Removed widgets from tile definitions

This commit is contained in:
Meierschlumpf
2022-12-18 21:50:08 +01:00
parent 864371e3c2
commit b4cfa1ac05
12 changed files with 126 additions and 15 deletions

View File

@@ -0,0 +1,30 @@
import { IconClock } from '@tabler/icons';
import { HomarrCardWrapper } from '../../components/Dashboard/Tiles/HomarrCardWrapper';
import { BaseTileProps } from '../../components/Dashboard/Tiles/type';
import { defineWidget } from '../helper';
import { IWidget } from '../widgets';
const definition = defineWidget({
id: 'bitTorrent',
icon: IconClock,
options: {},
gridstack: {
minWidth: 2,
minHeight: 2,
maxWidth: 2,
maxHeight: 2,
},
component: BitTorrentTile,
});
export type IBitTorrent = IWidget<typeof definition['id'], typeof definition>;
interface BitTorrentTileProps extends BaseTileProps {
module: IBitTorrent; // TODO: change to new type defined through widgetDefinition
}
function BitTorrentTile({ className, module }: BitTorrentTileProps) {
return <HomarrCardWrapper>Bit Torrent</HomarrCardWrapper>;
}
export default definition;

View File

@@ -22,6 +22,12 @@ const definition = defineWidget({
defaultValue: false,
},
},
gridstack: {
minWidth: 4,
minHeight: 5,
maxWidth: 12,
maxHeight: 12,
},
component: CalendarTile,
});

View File

@@ -18,6 +18,13 @@ const definition = defineWidget({
defaultValue: false,
},
},
gridstack: {
minWidth: 4,
minHeight: 2,
maxWidth: 12,
maxHeight: 12,
},
component: ClockTile,
});

View File

@@ -38,6 +38,12 @@ const definition = defineWidget({
defaultValue: '',
},
},
gridstack: {
minWidth: 4,
minHeight: 5,
maxWidth: 12,
maxHeight: 14,
},
component: DashDotTile,
});

View File

@@ -1,4 +1,8 @@
import calendar from './calendar/CalendarTile';
export default { calendar };
// TODO: add exports of new IWidgetDefinitions to here
import dashDot from './dashDot/DashDotTile';
import useNet from './useNet/UseNetTile';
import clock from './clock/ClockTile';
import weather from './weather/WeatherTile';
import bitTorrent from './bitTorrent/BitTorrentTile';
import torrentNetworkTraffic from './torrentNetworkTraffic/TorrentNetworkTrafficTile';
export default { calendar, dashDot, useNet, clock, weather, bitTorrent, torrentNetworkTraffic };

View File

@@ -0,0 +1,31 @@
import { IconClock } from '@tabler/icons';
import { HomarrCardWrapper } from '../../components/Dashboard/Tiles/HomarrCardWrapper';
import { BaseTileProps } from '../../components/Dashboard/Tiles/type';
import { defineWidget } from '../helper';
import { IWidget } from '../widgets';
const definition = defineWidget({
id: 'torrentNetworkTraffic',
icon: IconClock,
options: {},
gridstack: {
minWidth: 2,
minHeight: 2,
maxWidth: 2,
maxHeight: 2,
},
component: TorrentNetworkTrafficTile,
});
export type ITorrentNetworkTraffic = IWidget<typeof definition['id'], typeof definition>;
interface TorrentNetworkTrafficTileProps extends BaseTileProps {
module: ITorrentNetworkTraffic; // TODO: change to new type defined through widgetDefinition
}
function TorrentNetworkTrafficTile({ className, module }: TorrentNetworkTrafficTileProps) {
return <HomarrCardWrapper>TorrentNetworkTraffic</HomarrCardWrapper>;
}
export default definition;

View File

@@ -36,6 +36,12 @@ const definition = defineWidget({
icon: IconFileDownload,
options: {},
component: UseNetTile,
gridstack: {
minWidth: 4,
minHeight: 5,
maxWidth: 12,
maxHeight: 12,
},
});
export type IWeatherWidget = IWidget<typeof definition['id'], typeof definition>;

View File

@@ -21,6 +21,12 @@ const definition = defineWidget({
defaultValue: 'Paris',
},
},
gridstack: {
minWidth: 4,
minHeight: 2,
maxWidth: 12,
maxHeight: 12,
},
component: WeatherTile,
});

View File

@@ -66,5 +66,11 @@ export type IWidgetDefinition<TKey extends string = string> = {
options: {
[key: string]: IWidgetOptionValue;
};
gridstack: {
minWidth: number;
minHeight: number;
maxWidth: number;
maxHeight: number;
};
component: React.ComponentType<any>;
};