reduce logs for non-debug runtime
This commit is contained in:
1 parent
5103d87211
commit
d66be97922
39 files changed
+182
-31
No files matched your search
@@ -89,6 +89,8 @@ function bindSettingsEvents(): void {
|
||||
tm.upstreamProxy.user = (document.getElementById('upstreamUser') as HTMLInputElement).value.trim();
|
||||
tm.upstreamProxy.pass = (document.getElementById('upstreamPass') as HTMLInputElement).value.trim();
|
||||
tm.saveUpstreamProxy();
|
||||
tm.debugLogging = (document.getElementById('debugLogging') as HTMLInputElement).checked;
|
||||
tm.saveDebugLogging();
|
||||
closeSettings();
|
||||
});
|
||||
document.querySelectorAll('.btn-clear-cookies').forEach((btn) => {
|
||||
@@ -174,6 +176,7 @@ function openSettings(): void {
|
||||
(document.getElementById('upstreamSocks') as HTMLInputElement).value = tm.upstreamProxy.socks;
|
||||
(document.getElementById('upstreamUser') as HTMLInputElement).value = tm.upstreamProxy.user;
|
||||
(document.getElementById('upstreamPass') as HTMLInputElement).value = tm.upstreamProxy.pass;
|
||||
(document.getElementById('debugLogging') as HTMLInputElement).checked = tm.debugLogging;
|
||||
document.getElementById('clearCookiesStatus')!.textContent = '';
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ export class RendererTabManager {
|
||||
botRunning = false;
|
||||
botSettings: BotSettings;
|
||||
upstreamProxy: UpstreamProxy;
|
||||
debugLogging: boolean;
|
||||
private onRender: () => void;
|
||||
|
||||
constructor(onRender: () => void) {
|
||||
@@ -32,6 +33,7 @@ export class RendererTabManager {
|
||||
this.upstreamProxy = savedProxy
|
||||
? JSON.parse(savedProxy)
|
||||
: { socks: '', user: '', pass: '' };
|
||||
this.debugLogging = localStorage.getItem('debugLogging') === 'true';
|
||||
}
|
||||
|
||||
createTab(): string {
|
||||
@@ -247,6 +249,11 @@ export class RendererTabManager {
|
||||
window.bridge.setUpstreamProxy(this.upstreamProxy);
|
||||
}
|
||||
|
||||
saveDebugLogging(): void {
|
||||
localStorage.setItem('debugLogging', String(this.debugLogging));
|
||||
window.bridge.setDebugLogging(this.debugLogging);
|
||||
}
|
||||
|
||||
toggleBot(): void {
|
||||
if (!this.botSettings.token || !this.botSettings.groupId) return;
|
||||
this.botRunning = !this.botRunning;
|
||||
|
||||
Reference in new issue
Block a user