admin/plugins: name as link to save space and warning on the left to be sure that is not hidden
Massimo Melina committed
Apr 13, 2023 at 11:24 UTC
9f7b2610323b44caaacd799f1cd026a524d75510
1 file changed
+10
-6
admin/src/InstalledPlugins.ts
+10
-6
@@ -2,10 +2,10 @@
2
3
import { apiCall, useApiList } from './api'
4
import { createElement as h, Fragment } from 'react'
5
-import { Alert, Box, Tooltip } from '@mui/material'
5
+import { Alert, Box, Link, Tooltip } from '@mui/material'
6
import { DataGrid } from '@mui/x-data-grid'
7
import { Delete, Error, GitHub, PlayCircle, Settings, StopCircle, Upgrade } from '@mui/icons-material'
8
-import { IconBtn, xlate } from './misc'
8
+import { IconBtn, prefix, xlate } from './misc'
9
import { formDialog, toast } from './dialog'
10
import _ from 'lodash'
11
import { BoolField, Field, MultiSelectField, NumberField, SelectField, StringField } from '@hfs/mui-grid-form'
@@ -32,11 +32,15 @@ export default function InstalledPlugins({ updates }: { updates?: true }) {
32
flex: .3,
33
minWidth: 150,
34
renderCell({ row, value }) {
35
- return h(Fragment, {},
35
+ const href = prefix('https://github.com/', row.repo)
36
+ const children = [
37
+ typeof row.badApi === 'string' && h(Tooltip, {
38
+ title: row.badApi,
39
+ children: h(Error, { fontSize: 'small', color: 'warning', sx: { ml: -.5, mr: .5 } })
40
+ }),
41
value,
37
- typeof row.badApi === 'string' && h(Tooltip, { title: row.badApi, children: h(Error, { color: 'warning', sx: { ml: 1 } }) }),
38
- repoLink(row.repo),
39
- )
42
+ ]
43
+ return !href ? children : h(Link, { href, target: 'plugin' }, ...children)
44
}
45
},
46
{