fix: admin/logs: download of "console" not working #568
Massimo Melina committed
Apr 23, 2024 at 19:16 UTC
4d604c61c25dc019f3ab1e2bab532f6c1c5c9786
1 file changed
+7
-1
admin/src/LogsPage.ts
+7
-1
@@ -23,6 +23,7 @@ export default function LogsPage() {
23
const files = typedKeys(logLabels)
24
const shorterLabels = !useBreakpoint('sm') && { error_log: "Errors" }
25
const file = files[tab]
26
+ const fileAvailable = file !== 'console'
27
return h(Fragment, {},
28
h(Flex, { gap: 0 },
29
h(Tabs, { value: tab, onChange(ev,i){ setTab(i) } },
@@ -32,7 +33,12 @@ export default function LogsPage() {
33
sx: { minWidth: 0, px: { xs: 1.5, sm: 2 } } // save space
34
}))),
35
h(Box, { flex: 1 }),
35
- h(IconBtn, { icon: Download, title: "Download as file", link: API_URL + `get_log_file?file=${file}` }),
36
+ h(IconBtn, {
37
+ icon: Download,
38
+ title: fileAvailable ? "Download as file" : "Not available",
39
+ link: API_URL + `get_log_file?file=${file}`,
40
+ disabled: !fileAvailable
41
+ }),
42
h(IconBtn, { icon: Settings, title: "Options", onClick: showLogOptions })
43
),
44
files.map(f =>