You've already forked Tricky-Addon-Update-Target-List
mirror of
https://github.com/KOWX712/Tricky-Addon-Update-Target-List.git
synced 2025-09-06 06:37:09 +00:00
adjust update menu UI
This commit is contained in:
@@ -243,7 +243,7 @@
|
|||||||
<button class="close-update">✕</button>
|
<button class="close-update">✕</button>
|
||||||
<div class="update-content">
|
<div class="update-content">
|
||||||
<h1 data-i18n="update.changelog"></h1>
|
<h1 data-i18n="update.changelog"></h1>
|
||||||
<p class="changelog"></p>
|
<ul class="changelog"></ul>
|
||||||
<div class="update-button-container">
|
<div class="update-button-container">
|
||||||
<button class="install" data-i18n="update.install"></button>
|
<button class="install" data-i18n="update.install"></button>
|
||||||
<button class="reboot" data-i18n="update.reboot"></button>
|
<button class="reboot" data-i18n="update.reboot"></button>
|
||||||
|
|||||||
@@ -46,26 +46,29 @@ function setupUpdateMenu() {
|
|||||||
}, 200);
|
}, 200);
|
||||||
}
|
}
|
||||||
updateCard.addEventListener('click', async () => {
|
updateCard.addEventListener('click', async () => {
|
||||||
try {
|
try {
|
||||||
const module = await execCommand(`[ -f ${basePath}common/tmp/module.zip ] || echo "false"`);
|
const module = await execCommand(`[ -f ${basePath}common/tmp/module.zip ] || echo "false"`);
|
||||||
if (module.trim() === "false") {
|
if (module.trim() === "false") {
|
||||||
showPrompt("prompt.downloading");
|
showPrompt("prompt.downloading");
|
||||||
await new Promise(resolve => setTimeout(resolve, 200));
|
await new Promise(resolve => setTimeout(resolve, 200));
|
||||||
await execCommand(`sh ${basePath}common/get_extra.sh --get-update`);
|
await execCommand(`sh ${basePath}common/get_extra.sh --get-update`);
|
||||||
showPrompt("prompt.downloaded");
|
showPrompt("prompt.downloaded");
|
||||||
}
|
}
|
||||||
const changelog = await execCommand(`sh ${basePath}common/get_extra.sh --release-note`);
|
const changelog = await execCommand(`sh ${basePath}common/get_extra.sh --release-note`);
|
||||||
const lines = changelog.split('\n');
|
const lines = changelog
|
||||||
const formattedChangelog = `
|
.split('\n')
|
||||||
<span style="font-weight: bold; font-size: 18px;">${lines[0]}</span><br>
|
.filter(line => line.trim() !== '')
|
||||||
${lines.slice(1).join('<br>')}
|
.map(line => line.startsWith('- ') ? line.slice(2) : line);
|
||||||
`;
|
const formattedChangelog = `
|
||||||
releaseNotes.innerHTML = formattedChangelog;
|
<li class="changelog-title">${lines[0]}</li>
|
||||||
openUpdateMenu();
|
${lines.slice(1).map(line => `<li>${line}</li>`).join('')}
|
||||||
} catch (error) {
|
`;
|
||||||
showPrompt("prompt.download_fail", false);
|
releaseNotes.innerHTML = formattedChangelog;
|
||||||
console.error('Error download module update:', error);
|
openUpdateMenu();
|
||||||
}
|
} catch (error) {
|
||||||
|
showPrompt("prompt.download_fail", false);
|
||||||
|
console.error('Error download module update:', error);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
closeUpdate.addEventListener("click", closeUpdateMenu);
|
closeUpdate.addEventListener("click", closeUpdateMenu);
|
||||||
UpdateMenu.addEventListener("click", (event) => {
|
UpdateMenu.addEventListener("click", (event) => {
|
||||||
|
|||||||
@@ -83,11 +83,32 @@
|
|||||||
max-height: 85vh;
|
max-height: 85vh;
|
||||||
padding: 0 30px;
|
padding: 0 30px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
user-select: none;
|
}
|
||||||
|
|
||||||
|
.update-content ul {
|
||||||
|
padding-left: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.changelog-title {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 22px;
|
||||||
|
list-style-type: none;
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.update-content ul li {
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.update-content ul li:not(:first-child) {
|
||||||
|
list-style-type: disc;
|
||||||
|
margin-left: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.update-button-container {
|
.update-button-container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
padding: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
@@ -95,6 +116,7 @@
|
|||||||
.install,
|
.install,
|
||||||
.reboot {
|
.reboot {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
|
margin-top: 10px;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
color: #3B3B3B;
|
color: #3B3B3B;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
|||||||
Reference in New Issue
Block a user