You've already forked ReZygisk
mirror of
https://github.com/PerformanC/ReZygisk.git
synced 2025-09-06 06:37:01 +00:00
improve: immediatly set monitor status after set in WebUI
This commit improves the "Actions" tab by immediatly changing visually the monitor status in the WebUI once modified.
This commit is contained in:
@@ -1,19 +1,38 @@
|
||||
import { exec } from './kernelsu.js'
|
||||
import { exec, toast } from './kernelsu.js'
|
||||
|
||||
import { getTranslations } from './language.js'
|
||||
|
||||
const monitor_start = document.getElementById('monitor_start_button')
|
||||
const monitor_stop = document.getElementById('monitor_stop_button')
|
||||
const monitor_pause = document.getElementById('monitor_pause_button')
|
||||
|
||||
if (monitor_start) {
|
||||
monitor_start.addEventListener('click', () => {
|
||||
exec('/data/adb/modules/zygisksu/bin/zygisk-ptrace64 ctl start')
|
||||
})
|
||||
const monitor_status = document.getElementById('monitor_status');
|
||||
|
||||
monitor_stop.addEventListener('click', () => {
|
||||
exec('/data/adb/modules/zygisksu/bin/zygisk-ptrace64 ctl exit')
|
||||
})
|
||||
(async () => {
|
||||
const sys_lang = localStorage.getItem('/system/language')
|
||||
const translations = await getTranslations(sys_lang || 'en_US')
|
||||
|
||||
monitor_pause.addEventListener('click', () => {
|
||||
exec('/data/adb/modules/zygisksu/bin/zygisk-ptrace64 ctl stop')
|
||||
})
|
||||
}
|
||||
if (monitor_start) {
|
||||
monitor_start.addEventListener('click', () => {
|
||||
if (![ translations.page.actions.status.tracing, translations.page.actions.status.stopping, translations.page.actions.status.stopped ].includes(monitor_status.innerHTML)) return;
|
||||
|
||||
monitor_status.innerHTML = translations.page.actions.status.tracing
|
||||
|
||||
exec('/data/adb/modules/zygisksu/bin/zygisk-ptrace64 ctl start')
|
||||
})
|
||||
|
||||
monitor_stop.addEventListener('click', () => {
|
||||
monitor_status.innerHTML = translations.page.actions.status.exiting
|
||||
|
||||
exec('/data/adb/modules/zygisksu/bin/zygisk-ptrace64 ctl exit')
|
||||
})
|
||||
|
||||
monitor_pause.addEventListener('click', () => {
|
||||
if (![ translations.page.actions.status.tracing, translations.page.actions.status.stopping, translations.page.actions.status.stopped ].includes(monitor_status.innerHTML)) return;
|
||||
|
||||
monitor_status.innerHTML = translations.page.actions.status.stopped
|
||||
|
||||
exec('/data/adb/modules/zygisksu/bin/zygisk-ptrace64 ctl stop')
|
||||
})
|
||||
}
|
||||
})()
|
||||
Reference in New Issue
Block a user