remove refreshInterval from dashdot options

This commit is contained in:
ajnart
2023-01-06 11:19:07 +09:00
parent 7df1717d14
commit b3364c53ef

View File

@@ -13,13 +13,6 @@ const definition = defineWidget({
id: 'dashdot', id: 'dashdot',
icon: 'https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/png/dashdot.png', icon: 'https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/png/dashdot.png',
options: { options: {
refreshInterval: {
type: 'slider',
defaultValue: 5,
min: 1,
max: 60,
step: 1,
},
cpuMultiView: { cpuMultiView: {
type: 'switch', type: 'switch',
defaultValue: false, defaultValue: false,
@@ -65,7 +58,6 @@ function DashDotTile({ widget }: DashDotTileProps) {
const { data: info } = useDashDotInfo({ const { data: info } = useDashDotInfo({
dashDotUrl, dashDotUrl,
refreshInterval: widget.properties.refreshInterval,
}); });
const graphs = widget?.properties.graphs.map((g) => ({ const graphs = widget?.properties.graphs.map((g) => ({
@@ -119,16 +111,10 @@ function DashDotTile({ widget }: DashDotTileProps) {
); );
} }
const useDashDotInfo = ({ const useDashDotInfo = ({ dashDotUrl }: { dashDotUrl: string }) => {
dashDotUrl,
refreshInterval,
}: {
dashDotUrl: string;
refreshInterval: number;
}) => {
const { name: configName } = useConfigContext(); const { name: configName } = useConfigContext();
return useQuery({ return useQuery({
refetchInterval: refreshInterval * 1000 ?? 50000, refetchInterval: 50000,
queryKey: [ queryKey: [
'dashdot/info', 'dashdot/info',
{ {