diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 7cbacc1..6334cd5 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,10 +4,13 @@
-
+
-
-
+
+
+
+
+
@@ -54,9 +57,11 @@
"RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true",
"RunOnceActivity.git.unshallow": "true",
"RunOnceActivity.typescript.service.memoryLimit.init": "true",
+ "com.intellij.ml.llm.matterhorn.ej.ui.settings.DefaultModelSelectionForGA.v1": "true",
"git-widget-placeholder": "main",
"go.import.settings.migrated": "true",
"javascript.preferred.runtime.type.id": "node",
+ "junie.onboarding.icon.badge.shown": "true",
"last_opened_file_path": "//wsl.localhost/Ubuntu/home/ahilbig/git/vcr/zabbix-graphql-api/src/test",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
@@ -68,6 +73,7 @@
"npm.copy-schema.executor": "Run",
"npm.prod.executor": "Run",
"settings.editor.selected.configurable": "preferences.sourceCode.TypeScript",
+ "to.speed.mode.migration.done": "true",
"ts.external.directory.path": "\\\\wsl.localhost\\Ubuntu\\home\\ahilbig\\git\\vcr\\zabbix-graphql-api\\node_modules\\typescript\\lib",
"vue.rearranger.settings.migration": "true"
}
@@ -89,7 +95,7 @@
-
+
@@ -150,7 +156,8 @@
1768273021451
-
+
+
@@ -240,7 +247,15 @@
1768388782068
-
+
+
+ 1768396879810
+
+
+
+ 1768396879810
+
+
@@ -269,6 +284,7 @@
-
+
+
\ No newline at end of file
diff --git a/schema/devices.graphql b/schema/devices.graphql
index b644bac..2d38745 100644
--- a/schema/devices.graphql
+++ b/schema/devices.graphql
@@ -12,9 +12,31 @@ interface Device implements Host {
deviceType: String
hostgroups: [HostGroup!]
name: String
- tags: JSONObject
+ tags: DeviceConfig
state: DeviceState
}
+
+type DeviceConfig {
+ deviceWidgetPreview: WidgetPreview
+}
+
+type WidgetPreview {
+ TOP_LEFT: DisplayFieldSpec
+ TOP_RIGHT: DisplayFieldSpec
+ BOTTOM_LEFT: DisplayFieldSpec
+ BOTTOM_RIGHT: DisplayFieldSpec
+}
+
+type DisplayFieldSpec {
+ key: String,
+ emptyValue: String
+ unit: String,
+ value_font_size: String
+ g_value_transform: String
+ unit_font_size: String
+ g_unit_transform: String
+}
+
type OperationalDeviceData {
temperature: Float
voltage: Float
@@ -53,6 +75,6 @@ type GenericDevice implements Host & Device {
deviceType: String
hostgroups: [HostGroup!]
name: String
- tags: JSONObject
+ tags: DeviceConfig
state: GenericDeviceState
}
diff --git a/schema/extensions/display_devices.graphql b/schema/extensions/display_devices.graphql
index 1d527b5..0503b5e 100644
--- a/schema/extensions/display_devices.graphql
+++ b/schema/extensions/display_devices.graphql
@@ -12,7 +12,7 @@ type SinglePanelDevice implements Host & Device {
deviceType: String
hostgroups: [HostGroup!]
name: String
- tags: JSONObject
+ tags: DeviceConfig
state: PanelState
}
@@ -53,7 +53,7 @@ type FourPanelDevice implements Host & Device {
deviceType: String
hostgroups: [HostGroup!]
name: String
- tags: JSONObject
+ tags: DeviceConfig
state: FourPanelState
}
@@ -72,3 +72,4 @@ type FourPanelValues {
BOTTOM_LEFT: PanelValues
BOTTOM_RIGHT: PanelValues
}
+
diff --git a/schema/extensions/location_tracker_devices.graphql b/schema/extensions/location_tracker_devices.graphql
index 1865863..9c3d86f 100644
--- a/schema/extensions/location_tracker_devices.graphql
+++ b/schema/extensions/location_tracker_devices.graphql
@@ -1,7 +1,7 @@
"""
DistanceTracker represents a device which can detect other devices around itself and estimate
-the distances, e.g. by using Bluetooth scanning technology and estimating the distance by .
-Optionally the
+the distances, e.g. by using Bluetooth scanning technology and estimating the distance.
+
"""
type DistanceTrackerDevice implements Host & Device {
hostid: ID!
@@ -12,7 +12,7 @@ type DistanceTrackerDevice implements Host & Device {
deviceType: String
hostgroups: [HostGroup!]
name: String
- tags: JSONObject
+ tags: DeviceConfig
state: DistanceTrackerState
}
diff --git a/schema/zabbix.graphql b/schema/zabbix.graphql
index 6f85fca..69e9920 100644
--- a/schema/zabbix.graphql
+++ b/schema/zabbix.graphql
@@ -15,7 +15,6 @@ interface Host {
host: String!
hostgroups: [HostGroup!]
name: String
- tags: JSONObject
"""
Specifies the type or category of the device. Used to define the classification
of a device in the system (capabilities, functionalities, or purpose).
diff --git a/src/api/resolver_helpers.ts b/src/api/resolver_helpers.ts
index 4a4c37c..1352cdd 100644
--- a/src/api/resolver_helpers.ts
+++ b/src/api/resolver_helpers.ts
@@ -2,8 +2,7 @@ import {isObjectType} from "graphql";
import {logger} from "../logging/logger.js";
import {Device, Host} from "../schema/generated/graphql.js";
-export const isDevice = (value: Host): value is Device => !!(value as Device).deviceType;
-
+export const isDevice = (value: Host | undefined): value is Device => !!(value as Device)?.deviceType;
/*
As a default all . - seperators within a key shall be replaced by a Capital letter of the following word
*/