mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-11 16:05:47 +01:00
remove refreshInterval from dashdot options
This commit is contained in:
@@ -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',
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user