✨ Add migrator for modules to widgets
This commit is contained in:
@@ -44,7 +44,7 @@ const definition = defineWidget({
|
||||
},
|
||||
refreshInterval: {
|
||||
type: 'slider',
|
||||
defaultValue: 1,
|
||||
defaultValue: 10,
|
||||
min: 1,
|
||||
max: 60,
|
||||
step: 1,
|
||||
|
||||
@@ -60,13 +60,13 @@ function DashDotTile({ widget }: DashDotTileProps) {
|
||||
dashDotUrl,
|
||||
});
|
||||
|
||||
const graphs = widget?.properties.graphs.map((g) => ({
|
||||
id: g,
|
||||
name: t(`card.graphs.${g}.title`),
|
||||
twoSpan: ['network', 'gpu'].includes(g),
|
||||
const graphs = widget?.properties.graphs.map((graph) => ({
|
||||
id: graph,
|
||||
name: t(`card.graphs.${graph}.title`),
|
||||
twoSpan: ['network', 'gpu'].includes(graph),
|
||||
isMultiView:
|
||||
(g === 'cpu' && widget.properties.cpuMultiView) ||
|
||||
(g === 'storage' && widget.properties.storageMultiView),
|
||||
(graph === 'cpu' && widget.properties.cpuMultiView) ||
|
||||
(graph === 'storage' && widget.properties.storageMultiView),
|
||||
}));
|
||||
|
||||
const heading = (
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { TablerIcon } from '@tabler/icons';
|
||||
import React from 'react';
|
||||
import { AreaType } from '../types/area';
|
||||
import { ShapeType } from '../types/shape';
|
||||
|
||||
// Type of widgets which are safed to config
|
||||
export type IWidget<TKey extends string, TDefinition extends IWidgetDefinition> = {
|
||||
Reference in New Issue
Block a user