From 01948b9088f5f28123ea1ad183e9568afc659dda Mon Sep 17 00:00:00 2001 From: yougotwill Date: Wed, 21 Aug 2024 18:13:17 +1000 Subject: [PATCH] feat: remove the debug window since log files are too large to render effectively lets just save to the users computer so that they can view it themselves --- debug_log.html | 28 -------- debug_log_preload.js | 35 --------- package.json | 2 - ts/components/DebugLogView.tsx | 128 --------------------------------- ts/mains/debug_log_start.tsx | 6 -- ts/mains/main_node.ts | 65 ++--------------- ts/node/menu.ts | 14 +--- ts/themes/globals.tsx | 2 - 8 files changed, 5 insertions(+), 275 deletions(-) delete mode 100644 debug_log.html delete mode 100644 debug_log_preload.js delete mode 100644 ts/components/DebugLogView.tsx delete mode 100644 ts/mains/debug_log_start.tsx diff --git a/debug_log.html b/debug_log.html deleted file mode 100644 index 7e14ae956..000000000 --- a/debug_log.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - -
- - - diff --git a/debug_log_preload.js b/debug_log_preload.js deleted file mode 100644 index ff5e03054..000000000 --- a/debug_log_preload.js +++ /dev/null @@ -1,35 +0,0 @@ -/* global window */ -/* eslint-disable @typescript-eslint/no-var-requires */ - -const { ipcRenderer } = require('electron'); -const url = require('url'); - -const os = require('os'); - -const i18n = require('./ts/util/i18n'); - -const config = url.parse(window.location.toString(), true).query; -const { locale } = config; -const localeMessages = ipcRenderer.sendSync('locale-data'); - -window._ = require('lodash'); - -window.getVersion = () => config.version; -window.theme = config.theme; -window.i18n = i18n.setupi18n(locale, localeMessages); - -// got.js appears to need this to successfully submit debug logs to the cloud -window.nodeSetImmediate = setImmediate; - -window.getNodeVersion = () => config.node_version; -window.getEnvironment = () => config.environment; - -require('./ts/util/logging'); - -window.getOSRelease = () => - `${os.type()} ${os.release()}, Node.js ${config.node_version} ${os.platform()} ${os.arch()}`; -window.getCommitHash = () => config.commitHash; - -window.closeDebugLog = () => ipcRenderer.send('close-debug-log'); - -window.saveLog = logText => ipcRenderer.send('save-debug-log', logText); diff --git a/package.json b/package.json index 814dfc96f..d89e58e2a 100644 --- a/package.json +++ b/package.json @@ -295,7 +295,6 @@ "background.html", "about.html", "password.html", - "debug_log.html", "_locales/**", "mnemonic_languages/**", "protos/*", @@ -309,7 +308,6 @@ "preload.js", "about_preload.js", "settings_preload.js", - "debug_log_preload.js", "password_preload.js", "images/**", "fonts/*", diff --git a/ts/components/DebugLogView.tsx b/ts/components/DebugLogView.tsx deleted file mode 100644 index 930414d59..000000000 --- a/ts/components/DebugLogView.tsx +++ /dev/null @@ -1,128 +0,0 @@ -import { useEffect, useState } from 'react'; -import styled from 'styled-components'; -import { SessionTheme } from '../themes/SessionTheme'; -import { switchThemeTo } from '../themes/switchTheme'; -import { fetchNodeLog } from '../util/logging'; -import { SessionButton, SessionButtonType } from './basic/SessionButton'; -import { SessionIconButton } from './icon'; - -const StyledContent = styled.div` - background-color: var(--modal-background-content-color); - color: var(--modal-text-color); - font-family: var(--font-default); - - display: flex; - flex-direction: column; - padding: 20px; - height: 100%; - - .session-button { - margin: 1rem auto 1rem 0; - padding: 1rem; - width: fit-content; - } - - .session-icon-button { - float: right; - } - - h1 { - color: var(--modal-text-color); - } - - textarea { - flex-grow: 1; - width: 100%; - box-sizing: border-box; - padding: var(--margins-md); - background-color: var(--input-background-color); - color: var(--input-text-color); - border: 2px solid var(--border-color); - border-radius: 4px; - resize: none; - min-height: 100px; - - font-family: var(--font-debug); - font-size: 12px; - line-height: 18px; - } -`; - -const DebugLogTextArea = (props: { content: string }) => { - return