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
feat: add confirmation dialog for uninstallation
This commit is contained in:
@@ -338,6 +338,18 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Uninstall Confirmation Overlay -->
|
||||
<div class="uninstall-confirmation-overlay overlay" id="uninstall-confirmation-overlay">
|
||||
<div class="uninstall-confirmation">
|
||||
<div class="uninstall-confirmation-title" data-i18n="confirmation.uninstall_title"></div>
|
||||
<p data-i18n="confirmation.uninstall_message"></p>
|
||||
<div class="uninstall-confirmation-button-container">
|
||||
<button class="uninstall-confirmation-button ripple-element" id="cancel-uninstall" data-i18n="confirmation.uninstall_cancel"></button>
|
||||
<button class="uninstall-confirmation-button ripple-element" id="confirm-uninstall" data-i18n="confirmation.uninstall_confirm"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Footer -->
|
||||
<div class="footer">
|
||||
<div class="uninstall-container ripple-element hidden-uninstall">
|
||||
|
||||
@@ -121,5 +121,11 @@
|
||||
"title": "Add System App",
|
||||
"add": "Add",
|
||||
"current_list": "Current System App List"
|
||||
},
|
||||
"confirmation": {
|
||||
"uninstall_title": "Confirm Uninstall?",
|
||||
"uninstall_message": "Are you sure you want to uninstall Tricky Addon",
|
||||
"uninstall_cancel": "Cancel",
|
||||
"uninstall_confirm": "Confirm"
|
||||
}
|
||||
}
|
||||
@@ -121,5 +121,11 @@
|
||||
"title": "Add System App",
|
||||
"add": "Add",
|
||||
"current_list": "Current System App List"
|
||||
},
|
||||
"confirmation": {
|
||||
"uninstall_title": "Confirm Uninstall?",
|
||||
"uninstall_message": "Are you sure you want to uninstall Tricky Addon",
|
||||
"uninstall_cancel": "Cancel",
|
||||
"uninstall_confirm": "Confirm"
|
||||
}
|
||||
}
|
||||
@@ -118,8 +118,14 @@
|
||||
"invalid_vendor": "Formato de vendor inválido"
|
||||
},
|
||||
"add_system_app": {
|
||||
"title": "Agregar Aplicación del Sistema",
|
||||
"add": "Agregar",
|
||||
"current_list": "Lista de Aplicaciones del Sistema Actual"
|
||||
"title": "Añadir aplicación del sistema",
|
||||
"add": "Añadir",
|
||||
"current_list": "Lista actual de aplicaciones del sistema"
|
||||
},
|
||||
"confirmation": {
|
||||
"uninstall_title": "¿Confirmar desinstalación?",
|
||||
"uninstall_message": "¿Está seguro de que desea desinstalar Tricky Addon",
|
||||
"uninstall_cancel": "Cancelar",
|
||||
"uninstall_confirm": "Confirmar"
|
||||
}
|
||||
}
|
||||
@@ -118,8 +118,14 @@
|
||||
"invalid_vendor": "Format vendor tidak valid"
|
||||
},
|
||||
"add_system_app": {
|
||||
"title": "Tambahkan Aplikasi Sistem",
|
||||
"title": "Tambah Aplikasi Sistem",
|
||||
"add": "Tambah",
|
||||
"current_list": "Daftar Aplikasi Sistem Saat Ini"
|
||||
},
|
||||
"confirmation": {
|
||||
"uninstall_title": "Konfirmasi Hapus?",
|
||||
"uninstall_message": "Apakah Anda yakin ingin menghapus Tricky Addon",
|
||||
"uninstall_cancel": "Batal",
|
||||
"uninstall_confirm": "Konfirmasi"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,5 +121,11 @@
|
||||
"title": "システムアプリを追加",
|
||||
"add": "追加",
|
||||
"current_list": "現在のシステムアプリリスト"
|
||||
},
|
||||
"confirmation": {
|
||||
"uninstall_title": "アンインストールの確認",
|
||||
"uninstall_message": "Tricky Addonをアンインストールしてもよろしいですか",
|
||||
"uninstall_cancel": "キャンセル",
|
||||
"uninstall_confirm": "確認"
|
||||
}
|
||||
}
|
||||
@@ -121,5 +121,11 @@
|
||||
"title": "Dodaj aplikację systemową",
|
||||
"add": "Dodaj",
|
||||
"current_list": "Aktualna lista aplikacji systemowych"
|
||||
},
|
||||
"confirmation": {
|
||||
"uninstall_title": "Potwierdzić odinstalowanie?",
|
||||
"uninstall_message": "Czy na pewno chcesz odinstalować Tricky Addon",
|
||||
"uninstall_cancel": "Anuluj",
|
||||
"uninstall_confirm": "Potwierdź"
|
||||
}
|
||||
}
|
||||
@@ -121,5 +121,11 @@
|
||||
"title": "Добавить системное приложение",
|
||||
"add": "Добавить",
|
||||
"current_list": "Текущий список системных приложений"
|
||||
},
|
||||
"confirmation": {
|
||||
"uninstall_title": "Подтвердить удаление?",
|
||||
"uninstall_message": "Вы уверены, что хотите удалить Tricky Addon",
|
||||
"uninstall_cancel": "Отмена",
|
||||
"uninstall_confirm": "Подтвердить"
|
||||
}
|
||||
}
|
||||
@@ -119,7 +119,13 @@
|
||||
},
|
||||
"add_system_app": {
|
||||
"title": "Magdagdag ng System App",
|
||||
"add": "Magdagdag",
|
||||
"current_list": "Kasalukuyang Listahan ng System Apps"
|
||||
"add": "Idagdag",
|
||||
"current_list": "Kasalukuyang Listahan ng System App"
|
||||
},
|
||||
"confirmation": {
|
||||
"uninstall_title": "Kumpirmahin ang Pag-uninstall?",
|
||||
"uninstall_message": "Sigurado ka bang gusto mong i-uninstall ang Tricky Addon",
|
||||
"uninstall_cancel": "Kanselahin",
|
||||
"uninstall_confirm": "Kumpirmahin"
|
||||
}
|
||||
}
|
||||
@@ -121,5 +121,11 @@
|
||||
"title": "Sistem Uygulaması Ekle",
|
||||
"add": "Ekle",
|
||||
"current_list": "Mevcut Sistem Uygulamaları Listesi"
|
||||
},
|
||||
"confirmation": {
|
||||
"uninstall_title": "Kaldırma İşlemi Onaylansın mı?",
|
||||
"uninstall_message": "Tricky Addon'u kaldırmak istediğinizden emin misiniz",
|
||||
"uninstall_cancel": "İptal",
|
||||
"uninstall_confirm": "Onayla"
|
||||
}
|
||||
}
|
||||
@@ -121,5 +121,11 @@
|
||||
"title": "添加系统应用",
|
||||
"add": "添加",
|
||||
"current_list": "当前系统应用列表"
|
||||
},
|
||||
"confirmation": {
|
||||
"uninstall_title": "确认卸载?",
|
||||
"uninstall_message": "您确定要卸载 TS 插件吗",
|
||||
"uninstall_cancel": "取消",
|
||||
"uninstall_confirm": "确认"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,5 +121,11 @@
|
||||
"title": "添加系統應用",
|
||||
"add": "添加",
|
||||
"current_list": "當前系統應用列表"
|
||||
},
|
||||
"confirmation": {
|
||||
"uninstall_title": "確認卸載?",
|
||||
"uninstall_message": "您確定要卸載 TS 插件嗎",
|
||||
"uninstall_cancel": "取消",
|
||||
"uninstall_confirm": "確認"
|
||||
}
|
||||
}
|
||||
@@ -172,7 +172,32 @@ document.getElementById("save").addEventListener("click", async () => {
|
||||
});
|
||||
|
||||
// Uninstall WebUI
|
||||
document.querySelector(".uninstall-container").addEventListener("click", async () => {
|
||||
document.querySelector(".uninstall-container").addEventListener("click", () => {
|
||||
const uninstallConfirmation = document.getElementById("uninstall-confirmation-overlay");
|
||||
const cancelButton = document.getElementById("cancel-uninstall");
|
||||
const confirmButton = document.getElementById("confirm-uninstall")
|
||||
|
||||
uninstallConfirmation.style.display = 'flex';
|
||||
setTimeout(() => {
|
||||
uninstallConfirmation.style.opacity = 1;
|
||||
}, 10)
|
||||
|
||||
const closeUninstallConfirmation = () => {
|
||||
uninstallConfirmation.style.opacity = 0;
|
||||
setTimeout(() => {
|
||||
uninstallConfirmation.style.display = 'none';
|
||||
}, 200)
|
||||
}
|
||||
cancelButton.addEventListener('click', () => closeUninstallConfirmation());
|
||||
uninstallConfirmation.addEventListener('click', (e) => {
|
||||
if (e.target === uninstallConfirmation) closeUninstallConfirmation();
|
||||
})
|
||||
confirmButton.addEventListener('click', () => {
|
||||
closeUninstallConfirmation();
|
||||
uninstallWebUI();
|
||||
})
|
||||
});
|
||||
async function uninstallWebUI() {
|
||||
try {
|
||||
await execCommand(`sh ${basePath}common/get_extra.sh --uninstall`);
|
||||
console.log("uninstall script executed successfully.");
|
||||
@@ -181,7 +206,7 @@ document.querySelector(".uninstall-container").addEventListener("click", async (
|
||||
console.error("Failed to execute uninstall command:", error);
|
||||
showPrompt("prompt.uninstall_failed", false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Function to check if running in MMRL
|
||||
async function checkMMRL() {
|
||||
|
||||
@@ -130,6 +130,55 @@ body {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.uninstall-confirmation-overlay {
|
||||
align-items: center;
|
||||
z-index: 2000;
|
||||
}
|
||||
|
||||
.uninstall-confirmation {
|
||||
width: 90%;
|
||||
max-width: 600px;
|
||||
max-height: 80%;
|
||||
overflow-y: auto;
|
||||
background-color: white;
|
||||
border-radius: 15px;
|
||||
padding: 20px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.uninstall-confirmation p {
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.uninstall-confirmation-title {
|
||||
font-size: 26px;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.uninstall-confirmation-button-container {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
gap: 10px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.uninstall-confirmation-button {
|
||||
width: 100%;
|
||||
padding: 12px;
|
||||
border: none;
|
||||
border-radius: 12px;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
#confirm-uninstall {
|
||||
color: #fff;
|
||||
background-color: #007bff;
|
||||
}
|
||||
|
||||
.permission-popup {
|
||||
opacity: 1;
|
||||
align-items: center;
|
||||
@@ -198,6 +247,7 @@ body {
|
||||
background-color: #121212;
|
||||
}
|
||||
|
||||
.uninstall-confirmation,
|
||||
.permission-content {
|
||||
background-color: #343434;
|
||||
}
|
||||
@@ -206,4 +256,9 @@ body {
|
||||
.permission-steps p {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.uninstall-confirmation-button {
|
||||
background-color: #6E6E6E;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
@@ -137,18 +137,8 @@
|
||||
}
|
||||
|
||||
.help-overlay {
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
z-index: 2000;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
opacity: 0;
|
||||
transition: opacity 0.2s ease;
|
||||
}
|
||||
|
||||
.help-menu {
|
||||
|
||||
@@ -122,7 +122,6 @@
|
||||
border-radius: 12px;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
transition: background-color 0.2s ease;
|
||||
}
|
||||
|
||||
.get-button,
|
||||
|
||||
Reference in New Issue
Block a user