feat: speedtest tracker integration (#5363)
Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
This commit is contained in:
1 parent
c861878058
commit
22d599c0cf
21 files changed
+1005
-1
No files matched your search
@@ -0,0 +1,38 @@
|
||||
import { IconServerOff, IconSpeedboat } from "@tabler/icons-react";
|
||||
|
||||
import { createWidgetDefinition } from "../definition";
|
||||
import { optionsBuilder } from "../options";
|
||||
|
||||
export const { definition, componentLoader } = createWidgetDefinition("speedtestTracker", {
|
||||
icon: IconSpeedboat,
|
||||
createOptions() {
|
||||
return optionsBuilder.from(
|
||||
(factory) => ({
|
||||
showLatestResult: factory.switch({
|
||||
defaultValue: true,
|
||||
}),
|
||||
showStats: factory.switch({
|
||||
defaultValue: true,
|
||||
}),
|
||||
showRecentResults: factory.switch({
|
||||
defaultValue: true,
|
||||
}),
|
||||
showPingGraph: factory.switch({
|
||||
defaultValue: true,
|
||||
}),
|
||||
}),
|
||||
{
|
||||
showPingGraph: {
|
||||
shouldHide: (options) => !options.showRecentResults,
|
||||
},
|
||||
},
|
||||
);
|
||||
},
|
||||
supportedIntegrations: ["speedtestTracker"],
|
||||
errors: {
|
||||
INTERNAL_SERVER_ERROR: {
|
||||
icon: IconServerOff,
|
||||
message: (t) => t("widget.speedtestTracker.error.internalServerError"),
|
||||
},
|
||||
},
|
||||
}).withDynamicImport(() => import("./component"));
|
||||
Reference in new issue
Block a user