From 5d01af1758c604247506de76da9bfa6d62748cfc Mon Sep 17 00:00:00 2001 From: jokob-sk Date: Sat, 29 Mar 2025 17:21:29 +1100 Subject: [PATCH] wf work --- docs/DATABASE.md | 69 ++++++++++++++++++++--------------------- front/workflowsCore.php | 8 ++--- 2 files changed, 38 insertions(+), 39 deletions(-) diff --git a/docs/DATABASE.md b/docs/DATABASE.md index 08860990..e55f4303 100755 --- a/docs/DATABASE.md +++ b/docs/DATABASE.md @@ -1,44 +1,43 @@ # A high-level description of the database structure - ⚠ Disclaimer: As I'm not the original author, some of the information might be inaccurate. Feel free to submit a PR to correct anything within this page or documentation in general. - - The MAC address is used as a foreign key in most cases. + An overview of the most important database tables as well as an detailed overview of the Devices table. The MAC address is used as a foreign key in most cases. ## Devices database table -| Field Name | Description | -|-------------------------|-------------| -| `devMac` | MAC address of the device. | -| `devName` | Name of the device. | -| `devOwner` | Owner of the device. | -| `devType` | Type of the device (e.g., phone, laptop, etc.). If set to a network type (e.g.: switch), it will become selectable as a Network Parent Node | -| `devVendor` | Vendor/manufacturer of the device. | -| `devFavorite` | Whether the device is marked as a favorite. | -| `devGroup` | Group the device belongs to. | -| `devComments` | User comments or notes about the device. | -| `devFirstConnection` | Timestamp of the device's first connection. | -| `devLastConnection` | Timestamp of the device's last connection. | -| `devLastIP` | Last known IP address of the device. | -| `devStaticIP` | Whether the device has a static IP address. | -| `devScan` | Whether the device should be scanned. | -| `devLogEvents` | Whether events related to the device should be logged. | -| `devAlertEvents` | Whether alerts should be generated for events. | -| `devAlertDown` | Whether an alert should be sent when the device goes down. | -| `devSkipRepeated` | Whether to skip repeated alerts for this device. | -| `devLastNotification` | Timestamp of the last notification sent for this device. | -| `devPresentLastScan` | Whether the device was present during the last scan. | -| `devIsNew` | Whether the device is marked as new. | -| `devLocation` | Physical or logical location of the device. | -| `devIsArchived` | Whether the device is archived. | -| `devParentMAC` | MAC address of the parent device (if applicable). | -| `devParentPort` | Port of the parent device to which this device is connected. | -| `devIcon` | Icon representing the device. | -| `devGUID` | Unique identifier for the device. | -| `devSite` | Site or location where the device is registered. | -| `devSSID` | SSID of the Wi-Fi network the device is connected to. | -| `devSyncHubNode` | The NetAlertX node ID used for synchronization between NetAlertX instances. | -| `devSourcePlugin` | Source plugin that discovered the device. | +| Field Name | Description | Sample Value | +|-------------------------|-------------|--------------| +| `devMac` | MAC address of the device. | `00:1A:2B:3C:4D:5E` | +| `devName` | Name of the device. | `iPhone 12` | +| `devOwner` | Owner of the device. | `John Doe` | +| `devType` | Type of the device (e.g., phone, laptop, etc.). If set to a network type (e.g., switch), it will become selectable as a Network Parent Node. | `Laptop` | +| `devVendor` | Vendor/manufacturer of the device. | `Apple` | +| `devFavorite` | Whether the device is marked as a favorite. | `1` | +| `devGroup` | Group the device belongs to. | `Home Devices` | +| `devComments` | User comments or notes about the device. | `Used for work purposes` | +| `devFirstConnection` | Timestamp of the device's first connection. | `2025-03-22 12:07:26+11:00` | +| `devLastConnection` | Timestamp of the device's last connection. | `2025-03-22 12:07:26+11:00` | +| `devLastIP` | Last known IP address of the device. | `192.168.1.5` | +| `devStaticIP` | Whether the device has a static IP address. | `0` | +| `devScan` | Whether the device should be scanned. | `1` | +| `devLogEvents` | Whether events related to the device should be logged. | `0` | +| `devAlertEvents` | Whether alerts should be generated for events. | `1` | +| `devAlertDown` | Whether an alert should be sent when the device goes down. | `0` | +| `devSkipRepeated` | Whether to skip repeated alerts for this device. | `1` | +| `devLastNotification` | Timestamp of the last notification sent for this device. | `2025-03-22 12:07:26+11:00` | +| `devPresentLastScan` | Whether the device was present during the last scan. | `1` | +| `devIsNew` | Whether the device is marked as new. | `0` | +| `devLocation` | Physical or logical location of the device. | `Living Room` | +| `devIsArchived` | Whether the device is archived. | `0` | +| `devParentMAC` | MAC address of the parent device (if applicable) to build the [Network Tree](./NETWORK_TREE.md). | `00:1A:2B:3C:4D:5F` | +| `devParentPort` | Port of the parent device to which this device is connected. | `Port 3` | +| `devIcon` | [Icon](./ICONS.md) representing the device. The value is a base64-encoded SVG or Font Awesome HTML tag. | `PHN2ZyB...` | +| `devGUID` | Unique identifier for the device. | `a2f4b5d6-7a8c-9d10-11e1-f12345678901` | +| `devSite` | Site or location where the device is registered. | `Office` | +| `devSSID` | SSID of the Wi-Fi network the device is connected to. | `HomeNetwork` | +| `devSyncHubNode` | The NetAlertX node ID used for synchronization between NetAlertX instances. | `node_1` | +| `devSourcePlugin` | Source plugin that discovered the device. | `ARPSCAN` | +| `devCustomProps` | [Custom properties](./CUSTOM_PROPERTIES.md) related to the device. The value is a base64-encoded JSON object. | `PHN2ZyB...` | To understand how values of these fields influuence application behavior, such as Notifications or Network topology, see also: diff --git a/front/workflowsCore.php b/front/workflowsCore.php index 561bd6b6..c27c652d 100755 --- a/front/workflowsCore.php +++ b/front/workflowsCore.php @@ -331,7 +331,7 @@ function generateWorkflowUI(wf, wfIndex) { class : "pointer add-action green-hover-text", lastActionIndex : lastActionIndex, wfIndex: wfIndex - }).append($actionAddIcon).append("Add Action") + }).append($actionAddIcon).append(" Add Action") $actionAddButtonWrap.append($actionAddButton) $actionsContainer.append($actionAddButtonWrap) @@ -348,7 +348,7 @@ function generateWorkflowUI(wf, wfIndex) { wfIndex: wfIndex }) .append($wfRemoveIcon) // Add icon - .append("Remove Workflow"); // Add text + .append(" Remove Workflow"); // Add text $wfCollapsiblePanel.append($actionsContainer); @@ -492,7 +492,7 @@ function renderConditions(wfIndex, parentIndexPath, conditionGroupsIndex, condit class: "pointer add-condition green-hover-text col-sx-12", wfIndex: wfIndex, parentIndexPath: parentIndexPath - }).append($conditionAddIcon).append("Add Condition"); + }).append($conditionAddIcon).append(" Add Condition"); $conditionAddWrap.append($conditionAddButton); // Remove Condition Group button @@ -522,7 +522,7 @@ function renderConditions(wfIndex, parentIndexPath, conditionGroupsIndex, condit class: "pointer add-condition-group green-hover-text col-sx-12", wfIndex: wfIndex, parentIndexPath: parentIndexPath - }).append($conditionsGroupAddIcon).append("Add Group"); + }).append($conditionsGroupAddIcon).append(" Add Group"); $conditionsGroupAddWrap.append($conditionsGroupAddButton); $addButtonWrap.append($conditionsGroupAddWrap);