feat: add reveal log file

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei
2024-11-27 15:26:51 +08:00
parent 8445bd946c
commit adbdf7472b
4 changed files with 22 additions and 6 deletions
+5 -1
View File
@@ -13,7 +13,7 @@ import { registerMenuAndContextMenu } from "~/init"
import { clearAllData, getCacheSize } from "~/lib/cleaner"
import { store, StoreKey } from "~/lib/store"
import { registerAppTray } from "~/lib/tray"
import { logger } from "~/logger"
import { logger, revealLogFile } from "~/logger"
import {
cleanupOldRender,
getCurrentRenderManifest,
@@ -348,6 +348,10 @@ ${content}
store.set(StoreKey.CacheSizeLimit, input)
}
}),
revealLogFile: t.procedure.action(async () => {
return revealLogFile()
}),
}
interface Sender extends Electron.WebContents {
+1 -5
View File
@@ -164,11 +164,7 @@ export function createWindow(
// source-code-font: For code such as Elements panel
// monospace-font: For sidebar such as Event Listener Panel
const css = `
:root {
--source-code-font-family: consolas;
--source-code-font-size: 13px;
--monospace-font-family: consolas;
--monospace-font-size: 13px;
:root {--devtool-font-family: consolas, operator mono, Cascadia Code, monospace;--source-code-font-family: var(--devtool-font-family);--source-code-font-size: 13px;--monospace-font-family: var(--devtool-font-family);--monospace-font-size: 13px;
}`
window.webContents.devToolsWebContents?.executeJavaScript(`
const overriddenStyle = document.createElement('style');
@@ -112,6 +112,18 @@ export const SettingDataControl = () => {
},
isElectronBuild && AppCacheLimit,
isElectronBuild && CleanCache,
isElectronBuild && {
type: "title",
value: t("general.data_file.label"),
},
isElectronBuild && {
label: t("general.log_file.label"),
description: t("general.log_file.description"),
buttonText: t("general.log_file.button"),
action: () => {
tipcClient?.revealLogFile()
},
},
]}
/>
</div>
+4
View File
@@ -111,6 +111,7 @@
"general.auto_group.label": "Auto Group",
"general.cache": "Cache",
"general.data": "Data",
"general.data_file.label": "Data File",
"general.data_persist.description": "Persist data locally to enable offline access and local search.",
"general.data_persist.label": "Persist data for offline usage",
"general.export.button": "Export",
@@ -123,6 +124,9 @@
"general.group_by_date.label": "Group by date",
"general.language": "Language",
"general.launch_at_login": "Launch at login",
"general.log_file.button": "Reveal",
"general.log_file.description": "Reveal the log file in the system.",
"general.log_file.label": "Log File",
"general.mark_as_read.hover.description": "Automatically mark entries as read when hovered.",
"general.mark_as_read.hover.label": "Mark as read when hovering",
"general.mark_as_read.render.description": "Automatically mark single-level entries (e.g. social media posts, pictures, video views) as read when they enter the view.",