diff --git a/module/build.gradle.kts b/module/build.gradle.kts index 23a11df..8b24757 100644 --- a/module/build.gradle.kts +++ b/module/build.gradle.kts @@ -216,6 +216,7 @@ androidComponents.onVariants { variant -> set.add(Pair(root.file("webroot/assets/error.svg").asFile, null)) set.add(Pair(root.file("webroot/assets/action.svg").asFile, null)) set.add(Pair(root.file("webroot/assets/home.svg").asFile, null)) + set.add(Pair(root.file("webroot/assets/delete.svg").asFile, null)) sig.initSign(privKey) set.forEach { it.first.sha(it.second) } val signFile = root.file(name).asFile diff --git a/module/src/customize.sh b/module/src/customize.sh index 367818e..ef6b797 100644 --- a/module/src/customize.sh +++ b/module/src/customize.sh @@ -151,7 +151,7 @@ extract "$ZIPFILE" 'webroot/css/fonts.css' "$MODPATH/webroot/css" true extract "$ZIPFILE" 'webroot/fonts/ProductSans-Italic.ttf' "$MODPATH/webroot/fonts" true extract "$ZIPFILE" 'webroot/fonts/ProductSans-Regular.ttf' "$MODPATH/webroot/fonts" true -for svg in mark tick warn module expand settings close content error action home; do +for svg in mark tick warn module expand settings close content error action home delete; do extract "$ZIPFILE" "webroot/assets/${svg}.svg" "$MODPATH/webroot/assets" true done diff --git a/webroot/assets/delete.svg b/webroot/assets/delete.svg new file mode 100644 index 0000000..a963303 --- /dev/null +++ b/webroot/assets/delete.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/webroot/css/index.css b/webroot/css/index.css index 61650de..f018d89 100644 --- a/webroot/css/index.css +++ b/webroot/css/index.css @@ -252,6 +252,7 @@ a { } .errorh_textarea { + field-sizing: content; resize: none; height: 100%; width: 100%; diff --git a/webroot/index.html b/webroot/index.html index e5d1c75..eef4445 100644 --- a/webroot/index.html +++ b/webroot/index.html @@ -12,9 +12,9 @@ - + @@ -49,14 +49,19 @@ -
+

Error History

-
- -
+
+
+ +
+
+ +
+
-
- +
+
diff --git a/webroot/js/main.js b/webroot/js/main.js index 42fc046..821c6df 100644 --- a/webroot/js/main.js +++ b/webroot/js/main.js @@ -1,11 +1,18 @@ import { fullScreen, exec, toast } from './kernelsu.js' import { setNewLanguage, getTranslations } from './language.js' -function setError(place, issue) { - toast(`${place}: ${issue}`) +const loading_screen = document.getElementById('loading_screen') +loading_screen.style.display = 'none' +let sys_lang = localStorage.getItem('/system/language') + +if (!sys_lang) sys_lang = setLangData('en_US') +if (sys_lang !== 'en_US') await setNewLanguage(sys_lang, true) + +function setError(place, issue) { const fullErrorLog = setErrorData(`${place}: ${issue}`) document.getElementById('errorh_panel').innerHTML = fullErrorLog + toast(`${place}: ${issue}`) } function setLangData(mode) { @@ -17,7 +24,7 @@ function setLangData(mode) { function setErrorData(errorLog) { const getPrevious = localStorage.getItem('/system/error') const finalLog = getPrevious && getPrevious.length !== 0 ? getPrevious + `\n` + errorLog : errorLog - + localStorage.setItem('/system/error', finalLog) return finalLog } @@ -168,4 +175,6 @@ function setErrorData(errorLog) { } else { setError('find', `Error while finding zygisk modules (${findModulesCmd.errno}): ${findModulesCmd.stderr}`) } -})().catch((err) => setError('WebUI', err.stack ? err.stack : err.message)) \ No newline at end of file +})().catch((err) => setError('WebUI', err.stack ? err.stack : err.message)) + +if (window.onerror) window.onerror = (err) => setError('WebUI', err.stack ? err.stack : err.message) \ No newline at end of file diff --git a/webroot/js/modal/errorHistory.js b/webroot/js/modal/errorHistory.js index f7b68f9..6892296 100644 --- a/webroot/js/modal/errorHistory.js +++ b/webroot/js/modal/errorHistory.js @@ -2,6 +2,7 @@ const button = document.getElementById('rezygisk_errorh') const copy_button = document.getElementById('errorh_copy') const target = document.getElementById('errorh_modal') const close_button = document.getElementById('errorh_modal_close') +const clearall_button = document.getElementById('errorh_clear_all') const panel = document.getElementById('errorh_panel') let sys_module_mode = localStorage.getItem('/cache/modal/error_history/state') @@ -23,6 +24,11 @@ copy_button.addEventListener('click', () => { navigator.clipboard.writeText(panel.innerHTML) }) +clearall_button.addEventListener('click', () => { + panel.innerHTML = '' + localStorage.setItem('/system/error', '') +}) + function setData(mode) { localStorage.setItem('/cache/modal/error_history/state', mode) diff --git a/webroot/js/themes/dark.js b/webroot/js/themes/dark.js index fcbd4c3..31996c5 100644 --- a/webroot/js/themes/dark.js +++ b/webroot/js/themes/dark.js @@ -6,6 +6,7 @@ const rootCss = document.querySelector(':root') const close_icons = document.getElementsByClassName('close_icon') const expand_icons = document.getElementsByClassName('expander') const copy_button = document.getElementById('errorh_copy') +const clearall_button = document.getElementById('errorh_clear_all') export function setDark() { rootCss.style.setProperty('--background', '#181c20') @@ -28,6 +29,7 @@ export function setDark() { } copy_button.innerHTML = '' + clearall_button.innerHTML = '' setDarkNav() } diff --git a/webroot/js/themes/light.js b/webroot/js/themes/light.js index 4507c6d..e04d9ae 100644 --- a/webroot/js/themes/light.js +++ b/webroot/js/themes/light.js @@ -2,6 +2,7 @@ import { light_close_icon, light_expand_icon, light_copy_icon, + light_clear_icon, } from './lightIcon.js' import { setLightNav } from './lightNavbar.js' @@ -11,6 +12,7 @@ const rootCss = document.querySelector(':root') const close_icons = document.getElementsByClassName('close_icon') const expand_icons = document.getElementsByClassName('expander') const copy_button = document.getElementById('errorh_copy') +const clearall_button = document.getElementById('errorh_clear_all') export function setLight() { rootCss.style.setProperty('--background', '#eff1f6') @@ -33,6 +35,7 @@ export function setLight() { } copy_button.innerHTML = light_copy_icon + clearall_button.innerHTML = light_clear_icon setLightNav() } diff --git a/webroot/js/themes/lightIcon.js b/webroot/js/themes/lightIcon.js index 9b5bbbd..89a876d 100644 --- a/webroot/js/themes/lightIcon.js +++ b/webroot/js/themes/lightIcon.js @@ -18,6 +18,11 @@ export const light_copy_icon = ` ` +export const light_clear_icon = ` + + + +` export const light_module_icon = (inside) => `