@oneuptime/common 12.0.31 → 12.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Models/DatabaseModels/AlertState.ts +0 -2
- package/Models/DatabaseModels/Domain.ts +1 -1
- package/Models/DatabaseModels/Incident.ts +1 -1
- package/Models/DatabaseModels/IncidentTemplate.ts +1 -1
- package/Models/DatabaseModels/Index.ts +2 -0
- package/Models/DatabaseModels/MetricType.ts +0 -2
- package/Models/DatabaseModels/MonitorStatusTimeline.ts +0 -2
- package/Models/DatabaseModels/MonitorTest.ts +0 -2
- package/Models/DatabaseModels/NetworkDevice.ts +121 -2
- package/Models/DatabaseModels/NetworkDeviceOidTemplate.ts +3 -1
- package/Models/DatabaseModels/NetworkDeviceRole.ts +648 -0
- package/Models/DatabaseModels/ScheduledMaintenance.ts +1 -1
- package/Models/DatabaseModels/ScheduledMaintenanceTemplate.ts +1 -1
- package/Models/DatabaseModels/StatusPageAnnouncement.ts +0 -2
- package/Models/DatabaseModels/StatusPageAnnouncementTemplate.ts +0 -2
- package/Models/DatabaseModels/StatusPagePrivateUser.ts +0 -2
- package/Models/DatabaseModels/StatusPageResource.ts +0 -2
- package/Models/DatabaseModels/StatusPageSubscriber.ts +0 -2
- package/Server/Infrastructure/Postgres/SchemaMigrations/1790800000000-AddNetworkDeviceRoleTable.ts +72 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +2 -0
- package/Server/Services/DatabaseService.ts +39 -9
- package/Server/Services/Index.ts +2 -0
- package/Server/Services/NetworkDeviceRoleService.ts +90 -0
- package/Server/Services/ProjectService.ts +85 -0
- package/Server/Services/UserNotificationSettingService.ts +0 -6
- package/Tests/App/Dashboard/AddNeighborToMonitoringModal.test.tsx +31 -1
- package/Tests/App/Dashboard/DashboardChartWidgetZoom.test.tsx +35 -8
- package/Tests/App/Dashboard/DashboardCommandPalette.test.tsx +107 -3
- package/Tests/App/Dashboard/DashboardWideChartZoom.test.tsx +401 -0
- package/Tests/App/Dashboard/MonitorTemplateColumnAndFacet.test.tsx +318 -0
- package/Tests/App/Dashboard/NetworkDeviceBulkDelete.test.tsx +357 -0
- package/Tests/App/Dashboard/NetworkSideMenu.test.tsx +590 -0
- package/Tests/App/Dashboard/SideMenuHarness.tsx +11 -3
- package/Tests/Models/DatabaseModels/ModelRegistryInvariants.test.ts +115 -41
- package/Tests/Server/Infrastructure/Postgres/NetworkDeviceRoleTableMigration.test.ts +476 -0
- package/Tests/Server/Services/DatabaseServiceGenerateSlug.test.ts +215 -0
- package/Tests/Server/Services/NetworkDeviceRoleModel.test.ts +672 -0
- package/Tests/Server/Services/NetworkDeviceRuleEngines.test.ts +1 -1
- package/Tests/Server/Services/ProjectServiceCreateSubscriptionStarted.test.ts +67 -4
- package/Tests/Server/Services/ScheduledMaintenanceSubscriberEndTime.test.ts +369 -0
- package/Tests/Server/Services/UserNotificationSettingMonitorDefaults.test.ts +248 -0
- package/Tests/Server/Services/UserNotificationSettingWorkspaceChannels.test.ts +43 -2
- package/Tests/Server/Utils/BasicCron.test.ts +283 -0
- package/Tests/Server/Utils/IncomingCallPhoneNumber.test.ts +174 -0
- package/Tests/Types/NetworkDevice/DefaultNetworkDeviceRole.test.ts +417 -0
- package/Tests/UI/Components/Charts/ChartClickDoubleClickDisambiguation.test.tsx +221 -0
- package/Tests/UI/Components/Charts/ChartDoubleClickReset.test.tsx +220 -0
- package/Tests/UI/Components/ModelTable/BaseModelTableBulkDelete.test.tsx +751 -0
- package/Tests/UI/Components/ModelTable/BaseModelTableColumnCustomization.test.tsx +475 -43
- package/Tests/UI/Components/ModelTable/ColumnPreference.test.ts +89 -0
- package/Tests/UI/Components/NavBarCommandKGating.test.tsx +103 -8
- package/Tests/UI/Components/SideMenuItem.test.tsx +30 -0
- package/Tests/UI/Utils/TableColumnsToCsv.test.ts +30 -0
- package/Tests/UI/Utils/UseDashboardTimeRangeZoom.test.tsx +187 -0
- package/Tests/Utils/Dashboard/DashboardResourceListSharedArgs.test.ts +302 -0
- package/Tests/Utils/Dashboard/DashboardTimeRangeZoom.test.ts +242 -0
- package/Tests/Utils/Monitor/NetworkDeviceRoleCatalog.test.ts +981 -0
- package/Tests/Utils/Monitor/NetworkTopologyRoleCatalog.test.ts +865 -0
- package/Tests/Utils/NetworkDevice/DeviceRoleKeyUtil.test.ts +538 -0
- package/Tests/Utils/Slo/SloEvaluation.test.ts +171 -0
- package/Tests/Utils/Slug.test.ts +61 -1
- package/Tests/jest.setup.ts +19 -0
- package/Types/Monitor/SnmpMonitor/NetworkTopology.ts +61 -0
- package/Types/NetworkDevice/DefaultNetworkDeviceRole.ts +145 -0
- package/Types/Permission.ts +45 -0
- package/UI/Components/Charts/Area/AreaChart.tsx +7 -0
- package/UI/Components/Charts/Bar/BarChart.tsx +6 -0
- package/UI/Components/Charts/ChartGroup/ChartGroup.tsx +9 -1
- package/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.tsx +97 -35
- package/UI/Components/Charts/ChartLibrary/BarChart/BarChart.tsx +14 -0
- package/UI/Components/Charts/ChartLibrary/LineChart/LineChart.tsx +97 -35
- package/UI/Components/Charts/ChartLibrary/Utils/DoubleClick.ts +13 -0
- package/UI/Components/Charts/Line/LineChart.tsx +7 -0
- package/UI/Components/ModelTable/BaseModelTable.tsx +50 -15
- package/UI/Components/Navbar/NavBar.tsx +62 -13
- package/UI/Components/Navbar/NavBarMenuModal.tsx +7 -2
- package/UI/Components/SideMenu/CountModelSideMenuItem.tsx +2 -0
- package/UI/Components/SideMenu/SideMenu.tsx +12 -2
- package/UI/Components/SideMenu/SideMenuItem.tsx +4 -1
- package/UI/Components/SideMenu/SideMenuSection.tsx +14 -2
- package/UI/Utils/UseDashboardTimeRangeZoom.ts +77 -0
- package/Utils/Dashboard/DashboardTimeRangeZoom.ts +118 -0
- package/Utils/Monitor/NetworkDeviceRoleCatalog.ts +232 -0
- package/Utils/Monitor/NetworkDeviceRoleUtil.ts +2 -1
- package/Utils/Monitor/NetworkTopologyUtil.ts +116 -33
- package/Utils/NetworkDevice/DeviceRoleKeyUtil.ts +137 -0
- package/Utils/Rules/RulePatternMatchUtil.ts +1 -1
- package/Utils/Slug.ts +34 -1
- package/build/dist/Models/DatabaseModels/AlertState.js +0 -2
- package/build/dist/Models/DatabaseModels/AlertState.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Domain.js +1 -1
- package/build/dist/Models/DatabaseModels/Domain.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Incident.js +1 -1
- package/build/dist/Models/DatabaseModels/Incident.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentTemplate.js +1 -1
- package/build/dist/Models/DatabaseModels/IncidentTemplate.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +2 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/MetricType.js +0 -2
- package/build/dist/Models/DatabaseModels/MetricType.js.map +1 -1
- package/build/dist/Models/DatabaseModels/MonitorStatusTimeline.js +0 -2
- package/build/dist/Models/DatabaseModels/MonitorStatusTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/MonitorTest.js +0 -2
- package/build/dist/Models/DatabaseModels/MonitorTest.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDevice.js +124 -3
- package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDeviceOidTemplate.js +3 -1
- package/build/dist/Models/DatabaseModels/NetworkDeviceOidTemplate.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDeviceRole.js +677 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceRole.js.map +1 -0
- package/build/dist/Models/DatabaseModels/ScheduledMaintenance.js +1 -1
- package/build/dist/Models/DatabaseModels/ScheduledMaintenance.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceTemplate.js +1 -1
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceTemplate.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageAnnouncement.js +0 -2
- package/build/dist/Models/DatabaseModels/StatusPageAnnouncement.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageAnnouncementTemplate.js +0 -2
- package/build/dist/Models/DatabaseModels/StatusPageAnnouncementTemplate.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPagePrivateUser.js +0 -2
- package/build/dist/Models/DatabaseModels/StatusPagePrivateUser.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageResource.js +0 -2
- package/build/dist/Models/DatabaseModels/StatusPageResource.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageSubscriber.js +0 -2
- package/build/dist/Models/DatabaseModels/StatusPageSubscriber.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790800000000-AddNetworkDeviceRoleTable.js +39 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790800000000-AddNetworkDeviceRoleTable.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +2 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/DatabaseService.js +31 -5
- package/build/dist/Server/Services/DatabaseService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +2 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceRoleService.js +70 -0
- package/build/dist/Server/Services/NetworkDeviceRoleService.js.map +1 -0
- package/build/dist/Server/Services/ProjectService.js +65 -0
- package/build/dist/Server/Services/ProjectService.js.map +1 -1
- package/build/dist/Server/Services/UserNotificationSettingService.js +0 -1
- package/build/dist/Server/Services/UserNotificationSettingService.js.map +1 -1
- package/build/dist/Types/NetworkDevice/DefaultNetworkDeviceRole.js +105 -0
- package/build/dist/Types/NetworkDevice/DefaultNetworkDeviceRole.js.map +1 -0
- package/build/dist/Types/Permission.js +40 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/UI/Components/Charts/Area/AreaChart.js +1 -1
- package/build/dist/UI/Components/Charts/Area/AreaChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/Bar/BarChart.js +1 -1
- package/build/dist/UI/Components/Charts/Bar/BarChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js +6 -1
- package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js +79 -31
- package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js +7 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js +79 -31
- package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/Utils/DoubleClick.js +14 -0
- package/build/dist/UI/Components/Charts/ChartLibrary/Utils/DoubleClick.js.map +1 -0
- package/build/dist/UI/Components/Charts/Line/LineChart.js +1 -1
- package/build/dist/UI/Components/Charts/Line/LineChart.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js +39 -13
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- package/build/dist/UI/Components/Navbar/NavBar.js +44 -9
- package/build/dist/UI/Components/Navbar/NavBar.js.map +1 -1
- package/build/dist/UI/Components/Navbar/NavBarMenuModal.js +2 -2
- package/build/dist/UI/Components/Navbar/NavBarMenuModal.js.map +1 -1
- package/build/dist/UI/Components/SideMenu/CountModelSideMenuItem.js +1 -1
- package/build/dist/UI/Components/SideMenu/CountModelSideMenuItem.js.map +1 -1
- package/build/dist/UI/Components/SideMenu/SideMenu.js +9 -6
- package/build/dist/UI/Components/SideMenu/SideMenu.js.map +1 -1
- package/build/dist/UI/Components/SideMenu/SideMenuItem.js +1 -1
- package/build/dist/UI/Components/SideMenu/SideMenuItem.js.map +1 -1
- package/build/dist/UI/Components/SideMenu/SideMenuSection.js +7 -2
- package/build/dist/UI/Components/SideMenu/SideMenuSection.js.map +1 -1
- package/build/dist/UI/Utils/UseDashboardTimeRangeZoom.js +42 -0
- package/build/dist/UI/Utils/UseDashboardTimeRangeZoom.js.map +1 -0
- package/build/dist/Utils/Dashboard/DashboardTimeRangeZoom.js +74 -0
- package/build/dist/Utils/Dashboard/DashboardTimeRangeZoom.js.map +1 -0
- package/build/dist/Utils/Monitor/NetworkDeviceRoleCatalog.js +126 -0
- package/build/dist/Utils/Monitor/NetworkDeviceRoleCatalog.js.map +1 -0
- package/build/dist/Utils/Monitor/NetworkDeviceRoleUtil.js +2 -1
- package/build/dist/Utils/Monitor/NetworkDeviceRoleUtil.js.map +1 -1
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js +67 -32
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js.map +1 -1
- package/build/dist/Utils/NetworkDevice/DeviceRoleKeyUtil.js +114 -0
- package/build/dist/Utils/NetworkDevice/DeviceRoleKeyUtil.js.map +1 -0
- package/build/dist/Utils/Rules/RulePatternMatchUtil.js +1 -1
- package/build/dist/Utils/Slug.js +31 -1
- package/build/dist/Utils/Slug.js.map +1 -1
- package/package.json +1 -1
|
@@ -14,7 +14,6 @@ import EnableDocumentation from "../../Types/Database/EnableDocumentation";
|
|
|
14
14
|
import EnableMCP from "../../Types/Database/EnableMCP";
|
|
15
15
|
import EnableWorkflow from "../../Types/Database/EnableWorkflow";
|
|
16
16
|
import ColorField from "../../Types/Database/ColorField";
|
|
17
|
-
import SlugifyColumn from "../../Types/Database/SlugifyColumn";
|
|
18
17
|
import TableColumn from "../../Types/Database/TableColumn";
|
|
19
18
|
import TableColumnType from "../../Types/Database/TableColumnType";
|
|
20
19
|
import TableMetadata from "../../Types/Database/TableMetadata";
|
|
@@ -71,7 +70,6 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
|
|
|
71
70
|
read: true,
|
|
72
71
|
})
|
|
73
72
|
@CrudApiEndpoint(new Route("/alert-state"))
|
|
74
|
-
@SlugifyColumn("name", "slug")
|
|
75
73
|
@TableMetadata({
|
|
76
74
|
tableName: "AlertState",
|
|
77
75
|
singularName: "Alert State",
|
|
@@ -50,7 +50,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
|
|
|
50
50
|
],
|
|
51
51
|
})
|
|
52
52
|
@CrudApiEndpoint(new Route("/domain"))
|
|
53
|
-
@SlugifyColumn("
|
|
53
|
+
@SlugifyColumn("domain", "slug")
|
|
54
54
|
@TableMetadata({
|
|
55
55
|
tableName: "Domain",
|
|
56
56
|
singularName: "Domain",
|
|
@@ -101,7 +101,7 @@ import NotificationRuleWorkspaceChannel from "../../Types/Workspace/Notification
|
|
|
101
101
|
],
|
|
102
102
|
})
|
|
103
103
|
@CrudApiEndpoint(new Route("/incident"))
|
|
104
|
-
@SlugifyColumn("
|
|
104
|
+
@SlugifyColumn("title", "slug")
|
|
105
105
|
@Entity({
|
|
106
106
|
name: "Incident",
|
|
107
107
|
})
|
|
@@ -13,6 +13,7 @@ import NetworkDeviceOwnerRule from "./NetworkDeviceOwnerRule";
|
|
|
13
13
|
import NetworkDeviceLabelRule from "./NetworkDeviceLabelRule";
|
|
14
14
|
import NetworkDeviceAutoImportRule from "./NetworkDeviceAutoImportRule";
|
|
15
15
|
import NetworkDeviceOidTemplate from "./NetworkDeviceOidTemplate";
|
|
16
|
+
import NetworkDeviceRole from "./NetworkDeviceRole";
|
|
16
17
|
import NetworkDeviceDiscoveryScan from "./NetworkDeviceDiscoveryScan";
|
|
17
18
|
import NetworkInterface from "./NetworkInterface";
|
|
18
19
|
import NetworkSite from "./NetworkSite";
|
|
@@ -880,6 +881,7 @@ const AllModelTypes: Array<{
|
|
|
880
881
|
NetworkDeviceLabelRule,
|
|
881
882
|
NetworkDeviceAutoImportRule,
|
|
882
883
|
NetworkDeviceOidTemplate,
|
|
884
|
+
NetworkDeviceRole,
|
|
883
885
|
NetworkDeviceDiscoveryScan,
|
|
884
886
|
NetworkInterface,
|
|
885
887
|
NetworkSite,
|
|
@@ -8,7 +8,6 @@ import ColumnType from "../../Types/Database/ColumnType";
|
|
|
8
8
|
import CrudApiEndpoint from "../../Types/Database/CrudApiEndpoint";
|
|
9
9
|
import EnableDocumentation from "../../Types/Database/EnableDocumentation";
|
|
10
10
|
import EnableWorkflow from "../../Types/Database/EnableWorkflow";
|
|
11
|
-
import SlugifyColumn from "../../Types/Database/SlugifyColumn";
|
|
12
11
|
import TableColumn from "../../Types/Database/TableColumn";
|
|
13
12
|
import TableColumnType from "../../Types/Database/TableColumnType";
|
|
14
13
|
import TableMetadata from "../../Types/Database/TableMetadata";
|
|
@@ -72,7 +71,6 @@ import { AggregationTemporality } from "../AnalyticsModels/Metric";
|
|
|
72
71
|
read: false,
|
|
73
72
|
})
|
|
74
73
|
@CrudApiEndpoint(new Route("/metric-type"))
|
|
75
|
-
@SlugifyColumn("name", "slug")
|
|
76
74
|
@TableMetadata({
|
|
77
75
|
tableName: "MetricType",
|
|
78
76
|
singularName: "Metric Type",
|
|
@@ -13,7 +13,6 @@ import CrudApiEndpoint from "../../Types/Database/CrudApiEndpoint";
|
|
|
13
13
|
import EnableDocumentation from "../../Types/Database/EnableDocumentation";
|
|
14
14
|
import EnableMCP from "../../Types/Database/EnableMCP";
|
|
15
15
|
import EnableWorkflow from "../../Types/Database/EnableWorkflow";
|
|
16
|
-
import SlugifyColumn from "../../Types/Database/SlugifyColumn";
|
|
17
16
|
import TableColumn from "../../Types/Database/TableColumn";
|
|
18
17
|
import TableColumnType from "../../Types/Database/TableColumnType";
|
|
19
18
|
import TableMetadata from "../../Types/Database/TableMetadata";
|
|
@@ -73,7 +72,6 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
|
|
|
73
72
|
read: true,
|
|
74
73
|
})
|
|
75
74
|
@CrudApiEndpoint(new Route("/monitor-status-timeline"))
|
|
76
|
-
@SlugifyColumn("name", "slug")
|
|
77
75
|
@OwnedThrough("monitorId", Monitor)
|
|
78
76
|
@Entity({
|
|
79
77
|
name: "MonitorStatusTimeline",
|
|
@@ -10,7 +10,6 @@ import ColumnLength from "../../Types/Database/ColumnLength";
|
|
|
10
10
|
import ColumnType from "../../Types/Database/ColumnType";
|
|
11
11
|
import CrudApiEndpoint from "../../Types/Database/CrudApiEndpoint";
|
|
12
12
|
import EnableWorkflow from "../../Types/Database/EnableWorkflow";
|
|
13
|
-
import SlugifyColumn from "../../Types/Database/SlugifyColumn";
|
|
14
13
|
import TableColumn from "../../Types/Database/TableColumn";
|
|
15
14
|
import TableColumnType from "../../Types/Database/TableColumnType";
|
|
16
15
|
import TableMetadata from "../../Types/Database/TableMetadata";
|
|
@@ -70,7 +69,6 @@ import Monitor from "./Monitor";
|
|
|
70
69
|
read: true,
|
|
71
70
|
})
|
|
72
71
|
@CrudApiEndpoint(new Route("/monitor-test"))
|
|
73
|
-
@SlugifyColumn("name", "slug")
|
|
74
72
|
@OwnedThrough("monitorId", Monitor)
|
|
75
73
|
@Entity({
|
|
76
74
|
name: "MonitorTest",
|
|
@@ -2,6 +2,7 @@ import Label from "./Label";
|
|
|
2
2
|
import Monitor from "./Monitor";
|
|
3
3
|
import MonitorStatus from "./MonitorStatus";
|
|
4
4
|
import NetworkDeviceOidTemplate from "./NetworkDeviceOidTemplate";
|
|
5
|
+
import NetworkDeviceRole from "./NetworkDeviceRole";
|
|
5
6
|
import NetworkSite from "./NetworkSite";
|
|
6
7
|
import Probe from "./Probe";
|
|
7
8
|
import Project from "./Project";
|
|
@@ -845,13 +846,22 @@ export default class NetworkDevice extends BaseModel {
|
|
|
845
846
|
Permission.EditNetworkDevice,
|
|
846
847
|
],
|
|
847
848
|
})
|
|
849
|
+
/*
|
|
850
|
+
* DEPRECATED. Device roles used to be a fixed union stored inline as a
|
|
851
|
+
* string; they are now the per-project NetworkDeviceRole lookup table
|
|
852
|
+
* below, so a project can rename them, change what each is drawn as, or add
|
|
853
|
+
* roles of its own. This column is retained ONLY so the
|
|
854
|
+
* BackfillNetworkDeviceRoles data migration can read the old value and
|
|
855
|
+
* point networkDeviceRoleId at the matching role row. It is dropped in a
|
|
856
|
+
* follow-up PR - do not read or write it from new code.
|
|
857
|
+
*/
|
|
848
858
|
@TableColumn({
|
|
849
859
|
required: false,
|
|
850
860
|
type: TableColumnType.ShortText,
|
|
851
861
|
canReadOnRelationQuery: true,
|
|
852
|
-
title: "Device Role",
|
|
862
|
+
title: "Device Role (Deprecated)",
|
|
853
863
|
description:
|
|
854
|
-
"
|
|
864
|
+
"Deprecated legacy device role key. Use the Network Device Role relation instead; this column exists only for the backfill migration and will be removed.",
|
|
855
865
|
example: "switch",
|
|
856
866
|
})
|
|
857
867
|
@Column({
|
|
@@ -861,6 +871,115 @@ export default class NetworkDevice extends BaseModel {
|
|
|
861
871
|
})
|
|
862
872
|
public deviceRole?: string = undefined;
|
|
863
873
|
|
|
874
|
+
@ColumnAccessControl({
|
|
875
|
+
create: [
|
|
876
|
+
Permission.ProjectOwner,
|
|
877
|
+
Permission.ProjectAdmin,
|
|
878
|
+
Permission.ProjectMember,
|
|
879
|
+
Permission.SettingsAdmin,
|
|
880
|
+
Permission.SettingsMember,
|
|
881
|
+
Permission.CreateNetworkDevice,
|
|
882
|
+
],
|
|
883
|
+
read: [
|
|
884
|
+
Permission.ProjectOwner,
|
|
885
|
+
Permission.ProjectAdmin,
|
|
886
|
+
Permission.ProjectMember,
|
|
887
|
+
Permission.Viewer,
|
|
888
|
+
Permission.SettingsAdmin,
|
|
889
|
+
Permission.SettingsMember,
|
|
890
|
+
Permission.SettingsViewer,
|
|
891
|
+
Permission.ReadNetworkDevice,
|
|
892
|
+
],
|
|
893
|
+
update: [
|
|
894
|
+
Permission.ProjectOwner,
|
|
895
|
+
Permission.ProjectAdmin,
|
|
896
|
+
Permission.ProjectMember,
|
|
897
|
+
Permission.SettingsAdmin,
|
|
898
|
+
Permission.SettingsMember,
|
|
899
|
+
Permission.EditNetworkDevice,
|
|
900
|
+
],
|
|
901
|
+
})
|
|
902
|
+
/*
|
|
903
|
+
* The operator's own answer to what this device is, when they gave one.
|
|
904
|
+
*
|
|
905
|
+
* Empty is not "unknown": it means "no answer given", and the SNMP
|
|
906
|
+
* classifier is left to work the role out from the device's own identity.
|
|
907
|
+
* That is the better source when there IS an identity to read, which is
|
|
908
|
+
* why this is left empty on SNMP devices by default. On a device nothing
|
|
909
|
+
* walks - a ping-only device, a monitor-backed one - the classifier has
|
|
910
|
+
* only a hostname to go on, so this is the only statement about the role
|
|
911
|
+
* available at all, and it decides both the shape the device is drawn with
|
|
912
|
+
* and where it sits in the topology hierarchy.
|
|
913
|
+
*
|
|
914
|
+
* SET NULL on delete, deliberately: removing a role from the project's
|
|
915
|
+
* settings must not remove the devices that were using it. They simply go
|
|
916
|
+
* back to being classified from their SNMP identity.
|
|
917
|
+
*/
|
|
918
|
+
@TableColumn({
|
|
919
|
+
manyToOneRelationColumn: "networkDeviceRoleId",
|
|
920
|
+
type: TableColumnType.Entity,
|
|
921
|
+
modelType: NetworkDeviceRole,
|
|
922
|
+
title: "Device Role",
|
|
923
|
+
description:
|
|
924
|
+
"What this device does on the network - Router, Switch, Wireless AP and so on. Configured per project in Network > Settings > Device Roles.",
|
|
925
|
+
})
|
|
926
|
+
@ManyToOne(
|
|
927
|
+
() => {
|
|
928
|
+
return NetworkDeviceRole;
|
|
929
|
+
},
|
|
930
|
+
{
|
|
931
|
+
eager: false,
|
|
932
|
+
nullable: true,
|
|
933
|
+
onDelete: "SET NULL",
|
|
934
|
+
orphanedRowAction: "nullify",
|
|
935
|
+
},
|
|
936
|
+
)
|
|
937
|
+
@JoinColumn({ name: "networkDeviceRoleId" })
|
|
938
|
+
public networkDeviceRole?: NetworkDeviceRole = undefined;
|
|
939
|
+
|
|
940
|
+
@ColumnAccessControl({
|
|
941
|
+
create: [
|
|
942
|
+
Permission.ProjectOwner,
|
|
943
|
+
Permission.ProjectAdmin,
|
|
944
|
+
Permission.ProjectMember,
|
|
945
|
+
Permission.SettingsAdmin,
|
|
946
|
+
Permission.SettingsMember,
|
|
947
|
+
Permission.CreateNetworkDevice,
|
|
948
|
+
],
|
|
949
|
+
read: [
|
|
950
|
+
Permission.ProjectOwner,
|
|
951
|
+
Permission.ProjectAdmin,
|
|
952
|
+
Permission.ProjectMember,
|
|
953
|
+
Permission.Viewer,
|
|
954
|
+
Permission.SettingsAdmin,
|
|
955
|
+
Permission.SettingsMember,
|
|
956
|
+
Permission.SettingsViewer,
|
|
957
|
+
Permission.ReadNetworkDevice,
|
|
958
|
+
],
|
|
959
|
+
update: [
|
|
960
|
+
Permission.ProjectOwner,
|
|
961
|
+
Permission.ProjectAdmin,
|
|
962
|
+
Permission.ProjectMember,
|
|
963
|
+
Permission.SettingsAdmin,
|
|
964
|
+
Permission.SettingsMember,
|
|
965
|
+
Permission.EditNetworkDevice,
|
|
966
|
+
],
|
|
967
|
+
})
|
|
968
|
+
@Index()
|
|
969
|
+
@TableColumn({
|
|
970
|
+
required: false,
|
|
971
|
+
type: TableColumnType.ObjectID,
|
|
972
|
+
canReadOnRelationQuery: true,
|
|
973
|
+
title: "Device Role ID",
|
|
974
|
+
description: "ID of the Network Device Role this device is assigned.",
|
|
975
|
+
})
|
|
976
|
+
@Column({
|
|
977
|
+
type: ColumnType.ObjectID,
|
|
978
|
+
nullable: true,
|
|
979
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
980
|
+
})
|
|
981
|
+
public networkDeviceRoleId?: ObjectID = undefined;
|
|
982
|
+
|
|
864
983
|
@ColumnAccessControl({
|
|
865
984
|
create: [
|
|
866
985
|
Permission.ProjectOwner,
|
|
@@ -37,7 +37,9 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
|
|
|
37
37
|
*
|
|
38
38
|
* The template's NAME is the device type. There is no NetworkDeviceType
|
|
39
39
|
* model and every candidate matching key was defective: labels double as the
|
|
40
|
-
* row-level ACL column, deviceRole
|
|
40
|
+
* row-level ACL column, deviceRole was unconstrained free text (it is
|
|
41
|
+
* the NetworkDeviceRole lookup now, but a role says what a device DOES, not
|
|
42
|
+
* which OIDs it answers), and
|
|
41
43
|
* vendor/sysObjectId are probe-managed and NULL until the first successful
|
|
42
44
|
* walk. Devices link by an explicit FK the operator sets, in bulk from the
|
|
43
45
|
* device list.
|