admin/plugins: removed 'started' column to leave more space to the rest. You'll find timestamp in the 'stop' button tooltip
Massimo Melina committed
May 13, 2022 at 00:23 UTC
a2afe4c4724ab528de996da1fb226752923bc724
2 files changed
+4
-8
admin/src/InstalledPlugins.ts
+2
-6
@@ -36,11 +36,6 @@ export default function InstalledPlugins({ updates }: { updates?: true }) {
36
)
37
}
38
},
39
- {
40
- field: 'started',
41
- width: 180,
42
- valueFormatter: ({ value }) => !value ? "off" : new Date(value as string).toLocaleString()
43
- },
39
{
40
field: 'version',
41
width: 70,
@@ -70,7 +65,8 @@ export default function InstalledPlugins({ updates }: { updates?: true }) {
65
return h('div', {},
66
h(IconBtn, row.started ? {
67
icon: StopCircle,
73
- title: `Stop ${id}`,
68
+ title: h(Box, {}, `Stop ${id}`, h('br'), `Started ` + new Date(row.started as string).toLocaleString()),
69
+ color: 'success',
70
onClick: () =>
71
apiCall('set_plugin', { id, enabled: false }).then(() =>
72
toast("Plugin is stopping", h(StopCircle, { color: 'warning' })))
admin/src/misc.ts
+2
-2
@@ -1,6 +1,6 @@
1
// This file is part of HFS - Copyright 2021-2022, Massimo Melina <a@rejetto.com> - License https://www.gnu.org/licenses/gpl-3.0.txt
2
3
-import { createElement as h, FC } from 'react'
3
+import { createElement as h, FC, ReactNode } from 'react'
4
import { Box, CircularProgress, IconButton, Link, Tooltip } from '@mui/material'
5
import { Link as RouterLink } from 'react-router-dom'
6
import { SxProps } from '@mui/system'
@@ -28,7 +28,7 @@ export function modifiedSx(is: boolean) {
28
return is ? { outline: '2px solid' } : undefined
29
}
30
31
-interface IconBtnProps { title?: string, icon: SvgIconComponent, disabled?: boolean | string, progress?: boolean | number, link?: string, [rest:string]:any }
31
+interface IconBtnProps { title?: ReactNode, icon: SvgIconComponent, disabled?: boolean | string, progress?: boolean | number, link?: string, [rest:string]:any }
32
export function IconBtn({ title, icon, onClick, disabled, progress=false, link, ...rest }: IconBtnProps) {
33
const [loading, setLoading] = useStateMounted(false)
34
if (typeof disabled === 'string')