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