You've already forked ReZygisk
mirror of
https://github.com/PerformanC/ReZygisk.git
synced 2025-09-06 06:37:01 +00:00
add: track webui error and log directly into error history (may not working)
This commit is contained in:
@@ -170,6 +170,7 @@ androidComponents.onVariants { variant ->
|
||||
set.add(Pair(root.file("webroot/js/language.js").asFile, null))
|
||||
set.add(Pair(root.file("webroot/js/light.icon.js").asFile, null))
|
||||
set.add(Pair(root.file("webroot/js/restoreError.js").asFile, null))
|
||||
set.add(Pair(root.file("webroot/js/webuiError.js").asFile, null))
|
||||
|
||||
set.add(Pair(root.file("webroot/js/list/module.js").asFile, null))
|
||||
set.add(Pair(root.file("webroot/js/list/settings.js").asFile, null))
|
||||
|
||||
@@ -121,6 +121,7 @@ extract "$ZIPFILE" 'webroot/js/theme.js' "$MODPATH/webroot/js" true
|
||||
extract "$ZIPFILE" 'webroot/js/language.js' "$MODPATH/webroot/js" true
|
||||
extract "$ZIPFILE" 'webroot/js/light.icon.js' "$MODPATH/webroot/js/list" true
|
||||
extract "$ZIPFILE" 'webroot/js/restoreError.js' "$MODPATH/webroot/js/list" true
|
||||
extract "$ZIPFILE" 'webroot/js/webuiError.js' "$MODPATH/webroot/js/list" true
|
||||
|
||||
extract "$ZIPFILE" 'webroot/js/list/module.js' "$MODPATH/webroot/js/list" true
|
||||
extract "$ZIPFILE" 'webroot/js/list/settings.js' "$MODPATH/webroot/js/list" true
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
<meta name="viewport" content="viewport-fit=cover" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<script src="js/theme.js" type="module"></script>
|
||||
<script src="js/restoreError.js" type="module"></script>
|
||||
<script src="js/webuiError.js" type="module"></script>
|
||||
<script src="js/list/module.js" type="module"></script>
|
||||
<script src="js/list/settings.js" type="module"></script>
|
||||
<script src="js/list/language.js" type="module"></script>
|
||||
@@ -13,7 +15,6 @@
|
||||
<script src="js/main.js" type="module"></script>
|
||||
<script src="js/modal/language.js" type="module"></script>
|
||||
<script src="js/modal/errorHistory.js" type="module"></script>
|
||||
<script src="js/restoreError.js" type="module"></script>
|
||||
<link rel="stylesheet" href="css/fonts.css">
|
||||
<link rel="stylesheet" href="css/index.css">
|
||||
</head>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { fullScreen, exec, toast } from './kernelsu.js'
|
||||
import { setNewLanguage, getTranslations } from './language.js'
|
||||
import { sendError } from './webuiError.js'
|
||||
|
||||
(async () => {
|
||||
const EXPECTED = 1
|
||||
@@ -156,7 +157,9 @@ import { setNewLanguage, getTranslations } from './language.js'
|
||||
} else {
|
||||
toast(`${translations.cmdErrors.find}: ${findModulesCmd.stderr}`)
|
||||
}
|
||||
})()
|
||||
})().catch(err => {
|
||||
sendError(err)
|
||||
})
|
||||
|
||||
function setLangData(mode) {
|
||||
localStorage.setItem('/system/language', mode)
|
||||
|
||||
13
webroot/js/webuiError.js
Normal file
13
webroot/js/webuiError.js
Normal file
@@ -0,0 +1,13 @@
|
||||
window.addEventListener('error', (e) => {
|
||||
console.log(e.stack)
|
||||
const previousError = localStorage.getItem('/system/error')
|
||||
localStorage.setItem('/system/error', previousError + `\n` + e.stack)
|
||||
document.getElementById('errorh_panel').innerHTML += e.stack
|
||||
})
|
||||
|
||||
export function sendError(e) {
|
||||
console.log(e.stack)
|
||||
const previousError = localStorage.getItem('/system/error')
|
||||
localStorage.setItem('/system/error', previousError + `\n` + e.stack)
|
||||
document.getElementById('errorh_panel').innerHTML += e.stack
|
||||
}
|
||||
Reference in New Issue
Block a user