@oneuptime/common 10.0.93 → 10.0.94

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.
Files changed (136) hide show
  1. package/Models/DatabaseModels/DockerResource.ts +497 -0
  2. package/Models/DatabaseModels/Index.ts +2 -0
  3. package/Models/DatabaseModels/Monitor.ts +83 -0
  4. package/Server/API/MonitorTemplateAPI.ts +182 -0
  5. package/Server/Infrastructure/Postgres/SchemaMigrations/1777933061000-MigrationName.ts +41 -0
  6. package/Server/Infrastructure/Postgres/SchemaMigrations/1777972687018-MigrationName.ts +69 -0
  7. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +4 -0
  8. package/Server/Services/BillingInvoiceService.ts +18 -29
  9. package/Server/Services/DockerResourceService.ts +310 -0
  10. package/Server/Services/MonitorTemplateService.ts +359 -0
  11. package/Types/Dashboard/DashboardComponentType.ts +13 -0
  12. package/Types/Dashboard/DashboardComponents/ComponentArgument.ts +16 -0
  13. package/Types/Dashboard/DashboardComponents/DashboardAlertListComponent.ts +4 -0
  14. package/Types/Dashboard/DashboardComponents/DashboardDockerContainerListComponent.ts +15 -0
  15. package/Types/Dashboard/DashboardComponents/DashboardDockerHostListComponent.ts +14 -0
  16. package/Types/Dashboard/DashboardComponents/DashboardDockerImageListComponent.ts +15 -0
  17. package/Types/Dashboard/DashboardComponents/DashboardDockerNetworkListComponent.ts +14 -0
  18. package/Types/Dashboard/DashboardComponents/DashboardDockerVolumeListComponent.ts +14 -0
  19. package/Types/Dashboard/DashboardComponents/DashboardIncidentListComponent.ts +4 -0
  20. package/Types/Dashboard/DashboardComponents/DashboardKubernetesCronJobListComponent.ts +15 -0
  21. package/Types/Dashboard/DashboardComponents/DashboardKubernetesDaemonSetListComponent.ts +15 -0
  22. package/Types/Dashboard/DashboardComponents/DashboardKubernetesDeploymentListComponent.ts +15 -0
  23. package/Types/Dashboard/DashboardComponents/DashboardKubernetesJobListComponent.ts +15 -0
  24. package/Types/Dashboard/DashboardComponents/DashboardKubernetesNamespaceListComponent.ts +14 -0
  25. package/Types/Dashboard/DashboardComponents/DashboardKubernetesNodeListComponent.ts +15 -0
  26. package/Types/Dashboard/DashboardComponents/DashboardKubernetesPodListComponent.ts +16 -0
  27. package/Types/Dashboard/DashboardComponents/DashboardKubernetesStatefulSetListComponent.ts +15 -0
  28. package/Types/Dashboard/DashboardComponents/DashboardMonitorListComponent.ts +3 -0
  29. package/Types/Docker/DockerInventoryExtractor.ts +343 -0
  30. package/Utils/Dashboard/Components/DashboardAlertListComponent.ts +47 -2
  31. package/Utils/Dashboard/Components/DashboardDockerContainerListComponent.ts +93 -0
  32. package/Utils/Dashboard/Components/DashboardDockerHostListComponent.ts +83 -0
  33. package/Utils/Dashboard/Components/DashboardDockerImageListComponent.ts +92 -0
  34. package/Utils/Dashboard/Components/DashboardDockerNetworkListComponent.ts +82 -0
  35. package/Utils/Dashboard/Components/DashboardDockerVolumeListComponent.ts +82 -0
  36. package/Utils/Dashboard/Components/DashboardIncidentListComponent.ts +47 -2
  37. package/Utils/Dashboard/Components/DashboardKubernetesCronJobListComponent.ts +36 -0
  38. package/Utils/Dashboard/Components/DashboardKubernetesDaemonSetListComponent.ts +36 -0
  39. package/Utils/Dashboard/Components/DashboardKubernetesDeploymentListComponent.ts +36 -0
  40. package/Utils/Dashboard/Components/DashboardKubernetesJobListComponent.ts +34 -0
  41. package/Utils/Dashboard/Components/DashboardKubernetesNamespaceListComponent.ts +36 -0
  42. package/Utils/Dashboard/Components/DashboardKubernetesNodeListComponent.ts +57 -0
  43. package/Utils/Dashboard/Components/DashboardKubernetesPodListComponent.ts +60 -0
  44. package/Utils/Dashboard/Components/DashboardKubernetesResourceListShared.ts +75 -0
  45. package/Utils/Dashboard/Components/DashboardKubernetesStatefulSetListComponent.ts +36 -0
  46. package/Utils/Dashboard/Components/DashboardMonitorListComponent.ts +59 -2
  47. package/Utils/Dashboard/Components/Index.ts +102 -0
  48. package/build/dist/Models/DatabaseModels/DockerResource.js +525 -0
  49. package/build/dist/Models/DatabaseModels/DockerResource.js.map +1 -0
  50. package/build/dist/Models/DatabaseModels/Index.js +2 -0
  51. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  52. package/build/dist/Models/DatabaseModels/Monitor.js +82 -0
  53. package/build/dist/Models/DatabaseModels/Monitor.js.map +1 -1
  54. package/build/dist/Server/API/MonitorTemplateAPI.js +108 -0
  55. package/build/dist/Server/API/MonitorTemplateAPI.js.map +1 -0
  56. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1777933061000-MigrationName.js +20 -0
  57. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1777933061000-MigrationName.js.map +1 -0
  58. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1777972687018-MigrationName.js +30 -0
  59. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1777972687018-MigrationName.js.map +1 -0
  60. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +4 -0
  61. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  62. package/build/dist/Server/Services/BillingInvoiceService.js +22 -25
  63. package/build/dist/Server/Services/BillingInvoiceService.js.map +1 -1
  64. package/build/dist/Server/Services/DockerResourceService.js +196 -0
  65. package/build/dist/Server/Services/DockerResourceService.js.map +1 -0
  66. package/build/dist/Server/Services/MonitorTemplateService.js +290 -0
  67. package/build/dist/Server/Services/MonitorTemplateService.js.map +1 -1
  68. package/build/dist/Types/Dashboard/DashboardComponentType.js +13 -0
  69. package/build/dist/Types/Dashboard/DashboardComponentType.js.map +1 -1
  70. package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js +15 -0
  71. package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js.map +1 -1
  72. package/build/dist/Types/Dashboard/DashboardComponents/DashboardDockerContainerListComponent.js +2 -0
  73. package/build/dist/Types/Dashboard/DashboardComponents/DashboardDockerContainerListComponent.js.map +1 -0
  74. package/build/dist/Types/Dashboard/DashboardComponents/DashboardDockerHostListComponent.js +2 -0
  75. package/build/dist/Types/Dashboard/DashboardComponents/DashboardDockerHostListComponent.js.map +1 -0
  76. package/build/dist/Types/Dashboard/DashboardComponents/DashboardDockerImageListComponent.js +2 -0
  77. package/build/dist/Types/Dashboard/DashboardComponents/DashboardDockerImageListComponent.js.map +1 -0
  78. package/build/dist/Types/Dashboard/DashboardComponents/DashboardDockerNetworkListComponent.js +2 -0
  79. package/build/dist/Types/Dashboard/DashboardComponents/DashboardDockerNetworkListComponent.js.map +1 -0
  80. package/build/dist/Types/Dashboard/DashboardComponents/DashboardDockerVolumeListComponent.js +2 -0
  81. package/build/dist/Types/Dashboard/DashboardComponents/DashboardDockerVolumeListComponent.js.map +1 -0
  82. package/build/dist/Types/Dashboard/DashboardComponents/DashboardKubernetesCronJobListComponent.js +2 -0
  83. package/build/dist/Types/Dashboard/DashboardComponents/DashboardKubernetesCronJobListComponent.js.map +1 -0
  84. package/build/dist/Types/Dashboard/DashboardComponents/DashboardKubernetesDaemonSetListComponent.js +2 -0
  85. package/build/dist/Types/Dashboard/DashboardComponents/DashboardKubernetesDaemonSetListComponent.js.map +1 -0
  86. package/build/dist/Types/Dashboard/DashboardComponents/DashboardKubernetesDeploymentListComponent.js +2 -0
  87. package/build/dist/Types/Dashboard/DashboardComponents/DashboardKubernetesDeploymentListComponent.js.map +1 -0
  88. package/build/dist/Types/Dashboard/DashboardComponents/DashboardKubernetesJobListComponent.js +2 -0
  89. package/build/dist/Types/Dashboard/DashboardComponents/DashboardKubernetesJobListComponent.js.map +1 -0
  90. package/build/dist/Types/Dashboard/DashboardComponents/DashboardKubernetesNamespaceListComponent.js +2 -0
  91. package/build/dist/Types/Dashboard/DashboardComponents/DashboardKubernetesNamespaceListComponent.js.map +1 -0
  92. package/build/dist/Types/Dashboard/DashboardComponents/DashboardKubernetesNodeListComponent.js +2 -0
  93. package/build/dist/Types/Dashboard/DashboardComponents/DashboardKubernetesNodeListComponent.js.map +1 -0
  94. package/build/dist/Types/Dashboard/DashboardComponents/DashboardKubernetesPodListComponent.js +2 -0
  95. package/build/dist/Types/Dashboard/DashboardComponents/DashboardKubernetesPodListComponent.js.map +1 -0
  96. package/build/dist/Types/Dashboard/DashboardComponents/DashboardKubernetesStatefulSetListComponent.js +2 -0
  97. package/build/dist/Types/Dashboard/DashboardComponents/DashboardKubernetesStatefulSetListComponent.js.map +1 -0
  98. package/build/dist/Types/Docker/DockerInventoryExtractor.js +293 -0
  99. package/build/dist/Types/Docker/DockerInventoryExtractor.js.map +1 -0
  100. package/build/dist/Utils/Dashboard/Components/DashboardAlertListComponent.js +43 -3
  101. package/build/dist/Utils/Dashboard/Components/DashboardAlertListComponent.js.map +1 -1
  102. package/build/dist/Utils/Dashboard/Components/DashboardDockerContainerListComponent.js +75 -0
  103. package/build/dist/Utils/Dashboard/Components/DashboardDockerContainerListComponent.js.map +1 -0
  104. package/build/dist/Utils/Dashboard/Components/DashboardDockerHostListComponent.js +69 -0
  105. package/build/dist/Utils/Dashboard/Components/DashboardDockerHostListComponent.js.map +1 -0
  106. package/build/dist/Utils/Dashboard/Components/DashboardDockerImageListComponent.js +75 -0
  107. package/build/dist/Utils/Dashboard/Components/DashboardDockerImageListComponent.js.map +1 -0
  108. package/build/dist/Utils/Dashboard/Components/DashboardDockerNetworkListComponent.js +66 -0
  109. package/build/dist/Utils/Dashboard/Components/DashboardDockerNetworkListComponent.js.map +1 -0
  110. package/build/dist/Utils/Dashboard/Components/DashboardDockerVolumeListComponent.js +66 -0
  111. package/build/dist/Utils/Dashboard/Components/DashboardDockerVolumeListComponent.js.map +1 -0
  112. package/build/dist/Utils/Dashboard/Components/DashboardIncidentListComponent.js +43 -3
  113. package/build/dist/Utils/Dashboard/Components/DashboardIncidentListComponent.js.map +1 -1
  114. package/build/dist/Utils/Dashboard/Components/DashboardKubernetesCronJobListComponent.js +29 -0
  115. package/build/dist/Utils/Dashboard/Components/DashboardKubernetesCronJobListComponent.js.map +1 -0
  116. package/build/dist/Utils/Dashboard/Components/DashboardKubernetesDaemonSetListComponent.js +29 -0
  117. package/build/dist/Utils/Dashboard/Components/DashboardKubernetesDaemonSetListComponent.js.map +1 -0
  118. package/build/dist/Utils/Dashboard/Components/DashboardKubernetesDeploymentListComponent.js +29 -0
  119. package/build/dist/Utils/Dashboard/Components/DashboardKubernetesDeploymentListComponent.js.map +1 -0
  120. package/build/dist/Utils/Dashboard/Components/DashboardKubernetesJobListComponent.js +29 -0
  121. package/build/dist/Utils/Dashboard/Components/DashboardKubernetesJobListComponent.js.map +1 -0
  122. package/build/dist/Utils/Dashboard/Components/DashboardKubernetesNamespaceListComponent.js +29 -0
  123. package/build/dist/Utils/Dashboard/Components/DashboardKubernetesNamespaceListComponent.js.map +1 -0
  124. package/build/dist/Utils/Dashboard/Components/DashboardKubernetesNodeListComponent.js +44 -0
  125. package/build/dist/Utils/Dashboard/Components/DashboardKubernetesNodeListComponent.js.map +1 -0
  126. package/build/dist/Utils/Dashboard/Components/DashboardKubernetesPodListComponent.js +47 -0
  127. package/build/dist/Utils/Dashboard/Components/DashboardKubernetesPodListComponent.js.map +1 -0
  128. package/build/dist/Utils/Dashboard/Components/DashboardKubernetesResourceListShared.js +55 -0
  129. package/build/dist/Utils/Dashboard/Components/DashboardKubernetesResourceListShared.js.map +1 -0
  130. package/build/dist/Utils/Dashboard/Components/DashboardKubernetesStatefulSetListComponent.js +29 -0
  131. package/build/dist/Utils/Dashboard/Components/DashboardKubernetesStatefulSetListComponent.js.map +1 -0
  132. package/build/dist/Utils/Dashboard/Components/DashboardMonitorListComponent.js +46 -3
  133. package/build/dist/Utils/Dashboard/Components/DashboardMonitorListComponent.js.map +1 -1
  134. package/build/dist/Utils/Dashboard/Components/Index.js +53 -0
  135. package/build/dist/Utils/Dashboard/Components/Index.js.map +1 -1
  136. package/package.json +1 -1
@@ -0,0 +1,57 @@
1
+ import DashboardKubernetesNodeListComponent from "../../../Types/Dashboard/DashboardComponents/DashboardKubernetesNodeListComponent";
2
+ import { ObjectType } from "../../../Types/JSON";
3
+ import ObjectID from "../../../Types/ObjectID";
4
+ import DashboardBaseComponentUtil from "./DashboardBaseComponent";
5
+ import {
6
+ ComponentArgument,
7
+ ComponentInputType,
8
+ } from "../../../Types/Dashboard/DashboardComponents/ComponentArgument";
9
+ import DashboardComponentType from "../../../Types/Dashboard/DashboardComponentType";
10
+ import {
11
+ KubernetesFiltersSection,
12
+ getKubernetesCommonArguments,
13
+ } from "./DashboardKubernetesResourceListShared";
14
+
15
+ export default class DashboardKubernetesNodeListComponentUtil extends DashboardBaseComponentUtil {
16
+ public static override getDefaultComponent(): DashboardKubernetesNodeListComponent {
17
+ return {
18
+ _type: ObjectType.DashboardComponent,
19
+ componentType: DashboardComponentType.KubernetesNodeList,
20
+ widthInDashboardUnits: 6,
21
+ heightInDashboardUnits: 4,
22
+ topInDashboardUnits: 0,
23
+ leftInDashboardUnits: 0,
24
+ componentId: ObjectID.generate(),
25
+ minHeightInDashboardUnits: 3,
26
+ minWidthInDashboardUnits: 6,
27
+ arguments: {
28
+ maxRows: 25,
29
+ },
30
+ };
31
+ }
32
+
33
+ public static override getComponentConfigArguments(): Array<
34
+ ComponentArgument<DashboardKubernetesNodeListComponent>
35
+ > {
36
+ const args: Array<ComponentArgument<DashboardKubernetesNodeListComponent>> =
37
+ getKubernetesCommonArguments<DashboardKubernetesNodeListComponent>({
38
+ includeNamespaceFilter: false,
39
+ });
40
+
41
+ args.push({
42
+ name: "Readiness",
43
+ description: "Quick filter by node readiness",
44
+ required: false,
45
+ type: ComponentInputType.Dropdown,
46
+ id: "readinessFilter",
47
+ section: KubernetesFiltersSection,
48
+ dropdownOptions: [
49
+ { label: "All", value: "" },
50
+ { label: "Ready only", value: "ready" },
51
+ { label: "Not ready only", value: "not-ready" },
52
+ ],
53
+ });
54
+
55
+ return args;
56
+ }
57
+ }
@@ -0,0 +1,60 @@
1
+ import DashboardKubernetesPodListComponent from "../../../Types/Dashboard/DashboardComponents/DashboardKubernetesPodListComponent";
2
+ import { ObjectType } from "../../../Types/JSON";
3
+ import ObjectID from "../../../Types/ObjectID";
4
+ import DashboardBaseComponentUtil from "./DashboardBaseComponent";
5
+ import {
6
+ ComponentArgument,
7
+ ComponentInputType,
8
+ } from "../../../Types/Dashboard/DashboardComponents/ComponentArgument";
9
+ import DashboardComponentType from "../../../Types/Dashboard/DashboardComponentType";
10
+ import {
11
+ KubernetesFiltersSection,
12
+ getKubernetesCommonArguments,
13
+ } from "./DashboardKubernetesResourceListShared";
14
+
15
+ export default class DashboardKubernetesPodListComponentUtil extends DashboardBaseComponentUtil {
16
+ public static override getDefaultComponent(): DashboardKubernetesPodListComponent {
17
+ return {
18
+ _type: ObjectType.DashboardComponent,
19
+ componentType: DashboardComponentType.KubernetesPodList,
20
+ widthInDashboardUnits: 6,
21
+ heightInDashboardUnits: 4,
22
+ topInDashboardUnits: 0,
23
+ leftInDashboardUnits: 0,
24
+ componentId: ObjectID.generate(),
25
+ minHeightInDashboardUnits: 3,
26
+ minWidthInDashboardUnits: 6,
27
+ arguments: {
28
+ maxRows: 25,
29
+ },
30
+ };
31
+ }
32
+
33
+ public static override getComponentConfigArguments(): Array<
34
+ ComponentArgument<DashboardKubernetesPodListComponent>
35
+ > {
36
+ const args: Array<ComponentArgument<DashboardKubernetesPodListComponent>> =
37
+ getKubernetesCommonArguments<DashboardKubernetesPodListComponent>({
38
+ includeNamespaceFilter: true,
39
+ });
40
+
41
+ args.push({
42
+ name: "Pod Phases",
43
+ description: "Show only pods in the selected phases",
44
+ required: false,
45
+ type: ComponentInputType.MultiSelectDropdown,
46
+ id: "podPhases",
47
+ placeholder: "All phases",
48
+ section: KubernetesFiltersSection,
49
+ dropdownOptions: [
50
+ { label: "Running", value: "Running" },
51
+ { label: "Pending", value: "Pending" },
52
+ { label: "Succeeded", value: "Succeeded" },
53
+ { label: "Failed", value: "Failed" },
54
+ { label: "Unknown", value: "Unknown" },
55
+ ],
56
+ });
57
+
58
+ return args;
59
+ }
60
+ }
@@ -0,0 +1,75 @@
1
+ import {
2
+ ComponentArgument,
3
+ ComponentArgumentSection,
4
+ ComponentInputType,
5
+ EntityFilterModelType,
6
+ } from "../../../Types/Dashboard/DashboardComponents/ComponentArgument";
7
+ import DashboardBaseComponent from "../../../Types/Dashboard/DashboardComponents/DashboardBaseComponent";
8
+
9
+ export const KubernetesDisplaySection: ComponentArgumentSection = {
10
+ name: "Display Options",
11
+ description: "Configure the widget title and row limit",
12
+ order: 1,
13
+ };
14
+
15
+ export const KubernetesFiltersSection: ComponentArgumentSection = {
16
+ name: "Filters",
17
+ description: "Narrow down which resources are shown",
18
+ order: 2,
19
+ defaultCollapsed: true,
20
+ };
21
+
22
+ export interface KubernetesCommonArgumentsOptions {
23
+ includeNamespaceFilter: boolean;
24
+ }
25
+
26
+ export function getKubernetesCommonArguments<T extends DashboardBaseComponent>(
27
+ options: KubernetesCommonArgumentsOptions,
28
+ ): Array<ComponentArgument<T>> {
29
+ const args: Array<ComponentArgument<T>> = [];
30
+
31
+ args.push({
32
+ name: "Title",
33
+ description: "Header shown above the list",
34
+ required: false,
35
+ type: ComponentInputType.Text,
36
+ id: "title" as keyof T["arguments"],
37
+ section: KubernetesDisplaySection,
38
+ });
39
+
40
+ args.push({
41
+ name: "Max Rows",
42
+ description: "Maximum number of rows to show",
43
+ required: false,
44
+ type: ComponentInputType.Number,
45
+ id: "maxRows" as keyof T["arguments"],
46
+ placeholder: "25",
47
+ section: KubernetesDisplaySection,
48
+ });
49
+
50
+ args.push({
51
+ name: "Clusters",
52
+ description: "Show only resources from the selected clusters",
53
+ required: false,
54
+ type: ComponentInputType.EntityMultiSelectDropdown,
55
+ id: "kubernetesClusterIds" as keyof T["arguments"],
56
+ placeholder: "All clusters",
57
+ section: KubernetesFiltersSection,
58
+ entityFilterModelType: EntityFilterModelType.KubernetesCluster,
59
+ });
60
+
61
+ if (options.includeNamespaceFilter) {
62
+ args.push({
63
+ name: "Namespaces",
64
+ description:
65
+ "Comma-separated list of namespaces to include. Leave blank for all.",
66
+ required: false,
67
+ type: ComponentInputType.Text,
68
+ id: "namespaces" as keyof T["arguments"],
69
+ placeholder: "default, kube-system",
70
+ section: KubernetesFiltersSection,
71
+ });
72
+ }
73
+
74
+ return args;
75
+ }
@@ -0,0 +1,36 @@
1
+ import DashboardKubernetesStatefulSetListComponent from "../../../Types/Dashboard/DashboardComponents/DashboardKubernetesStatefulSetListComponent";
2
+ import { ObjectType } from "../../../Types/JSON";
3
+ import ObjectID from "../../../Types/ObjectID";
4
+ import DashboardBaseComponentUtil from "./DashboardBaseComponent";
5
+ import { ComponentArgument } from "../../../Types/Dashboard/DashboardComponents/ComponentArgument";
6
+ import DashboardComponentType from "../../../Types/Dashboard/DashboardComponentType";
7
+ import { getKubernetesCommonArguments } from "./DashboardKubernetesResourceListShared";
8
+
9
+ export default class DashboardKubernetesStatefulSetListComponentUtil extends DashboardBaseComponentUtil {
10
+ public static override getDefaultComponent(): DashboardKubernetesStatefulSetListComponent {
11
+ return {
12
+ _type: ObjectType.DashboardComponent,
13
+ componentType: DashboardComponentType.KubernetesStatefulSetList,
14
+ widthInDashboardUnits: 6,
15
+ heightInDashboardUnits: 4,
16
+ topInDashboardUnits: 0,
17
+ leftInDashboardUnits: 0,
18
+ componentId: ObjectID.generate(),
19
+ minHeightInDashboardUnits: 3,
20
+ minWidthInDashboardUnits: 6,
21
+ arguments: {
22
+ maxRows: 25,
23
+ },
24
+ };
25
+ }
26
+
27
+ public static override getComponentConfigArguments(): Array<
28
+ ComponentArgument<DashboardKubernetesStatefulSetListComponent>
29
+ > {
30
+ return getKubernetesCommonArguments<DashboardKubernetesStatefulSetListComponent>(
31
+ {
32
+ includeNamespaceFilter: true,
33
+ },
34
+ );
35
+ }
36
+ }
@@ -6,8 +6,14 @@ import {
6
6
  ComponentArgument,
7
7
  ComponentArgumentSection,
8
8
  ComponentInputType,
9
+ EntityFilterModelType,
9
10
  } from "../../../Types/Dashboard/DashboardComponents/ComponentArgument";
10
11
  import DashboardComponentType from "../../../Types/Dashboard/DashboardComponentType";
12
+ import {
13
+ MonitorTypeHelper,
14
+ MonitorTypeProps,
15
+ } from "../../../Types/Monitor/MonitorType";
16
+ import { DropdownOption } from "../../../UI/Components/Dropdown/Dropdown";
11
17
 
12
18
  const DisplaySection: ComponentArgumentSection = {
13
19
  name: "Display Options",
@@ -22,6 +28,24 @@ const FiltersSection: ComponentArgumentSection = {
22
28
  defaultCollapsed: true,
23
29
  };
24
30
 
31
+ function getMonitorTypeDropdownOptions(): Array<DropdownOption> {
32
+ const options: Array<DropdownOption> =
33
+ MonitorTypeHelper.getAllMonitorTypeProps().map(
34
+ (props: MonitorTypeProps) => {
35
+ return {
36
+ label: props.title,
37
+ value: props.monitorType,
38
+ };
39
+ },
40
+ );
41
+
42
+ options.sort((a: DropdownOption, b: DropdownOption) => {
43
+ return (a.label as string).localeCompare(b.label as string);
44
+ });
45
+
46
+ return options;
47
+ }
48
+
25
49
  export default class DashboardMonitorListComponentUtil extends DashboardBaseComponentUtil {
26
50
  public static override getDefaultComponent(): DashboardMonitorListComponent {
27
51
  return {
@@ -67,8 +91,8 @@ export default class DashboardMonitorListComponentUtil extends DashboardBaseComp
67
91
  });
68
92
 
69
93
  componentArguments.push({
70
- name: "Status",
71
- description: "Filter monitors by current status",
94
+ name: "Operational Status",
95
+ description: "Quick filter by operational state",
72
96
  required: false,
73
97
  type: ComponentInputType.Dropdown,
74
98
  id: "statusFilter",
@@ -80,6 +104,39 @@ export default class DashboardMonitorListComponentUtil extends DashboardBaseComp
80
104
  ],
81
105
  });
82
106
 
107
+ componentArguments.push({
108
+ name: "Status",
109
+ description: "Show only monitors with the selected statuses",
110
+ required: false,
111
+ type: ComponentInputType.EntityMultiSelectDropdown,
112
+ id: "monitorStatusIds",
113
+ placeholder: "All statuses",
114
+ section: FiltersSection,
115
+ entityFilterModelType: EntityFilterModelType.MonitorStatus,
116
+ });
117
+
118
+ componentArguments.push({
119
+ name: "Monitor Type",
120
+ description: "Show only monitors of the selected types",
121
+ required: false,
122
+ type: ComponentInputType.MultiSelectDropdown,
123
+ id: "monitorTypes",
124
+ placeholder: "All monitor types",
125
+ section: FiltersSection,
126
+ dropdownOptions: getMonitorTypeDropdownOptions(),
127
+ });
128
+
129
+ componentArguments.push({
130
+ name: "Labels",
131
+ description: "Show only monitors tagged with the selected labels",
132
+ required: false,
133
+ type: ComponentInputType.EntityMultiSelectDropdown,
134
+ id: "labelIds",
135
+ placeholder: "All labels",
136
+ section: FiltersSection,
137
+ entityFilterModelType: EntityFilterModelType.Label,
138
+ });
139
+
83
140
  return componentArguments;
84
141
  }
85
142
  }
@@ -4,8 +4,21 @@ import DashboardComponentType from "../../../Types/Dashboard/DashboardComponentT
4
4
  import BadDataException from "../../../Types/Exception/BadDataException";
5
5
  import DashboardAlertListComponentUtil from "./DashboardAlertListComponent";
6
6
  import DashboardChartComponentUtil from "./DashboardChartComponent";
7
+ import DashboardDockerContainerListComponentUtil from "./DashboardDockerContainerListComponent";
8
+ import DashboardDockerHostListComponentUtil from "./DashboardDockerHostListComponent";
9
+ import DashboardDockerImageListComponentUtil from "./DashboardDockerImageListComponent";
10
+ import DashboardDockerNetworkListComponentUtil from "./DashboardDockerNetworkListComponent";
11
+ import DashboardDockerVolumeListComponentUtil from "./DashboardDockerVolumeListComponent";
7
12
  import DashboardGaugeComponentUtil from "./DashboardGaugeComponent";
8
13
  import DashboardIncidentListComponentUtil from "./DashboardIncidentListComponent";
14
+ import DashboardKubernetesCronJobListComponentUtil from "./DashboardKubernetesCronJobListComponent";
15
+ import DashboardKubernetesDaemonSetListComponentUtil from "./DashboardKubernetesDaemonSetListComponent";
16
+ import DashboardKubernetesDeploymentListComponentUtil from "./DashboardKubernetesDeploymentListComponent";
17
+ import DashboardKubernetesJobListComponentUtil from "./DashboardKubernetesJobListComponent";
18
+ import DashboardKubernetesNamespaceListComponentUtil from "./DashboardKubernetesNamespaceListComponent";
19
+ import DashboardKubernetesNodeListComponentUtil from "./DashboardKubernetesNodeListComponent";
20
+ import DashboardKubernetesPodListComponentUtil from "./DashboardKubernetesPodListComponent";
21
+ import DashboardKubernetesStatefulSetListComponentUtil from "./DashboardKubernetesStatefulSetListComponent";
9
22
  import DashboardLogStreamComponentUtil from "./DashboardLogStreamComponent";
10
23
  import DashboardMonitorListComponentUtil from "./DashboardMonitorListComponent";
11
24
  import DashboardTableComponentUtil from "./DashboardTableComponent";
@@ -77,6 +90,95 @@ export default class DashboardComponentsUtil {
77
90
  >;
78
91
  }
79
92
 
93
+ if (dashboardComponentType === DashboardComponentType.KubernetesPodList) {
94
+ return DashboardKubernetesPodListComponentUtil.getComponentConfigArguments() as Array<
95
+ ComponentArgument<DashboardBaseComponent>
96
+ >;
97
+ }
98
+
99
+ if (dashboardComponentType === DashboardComponentType.KubernetesNodeList) {
100
+ return DashboardKubernetesNodeListComponentUtil.getComponentConfigArguments() as Array<
101
+ ComponentArgument<DashboardBaseComponent>
102
+ >;
103
+ }
104
+
105
+ if (
106
+ dashboardComponentType === DashboardComponentType.KubernetesNamespaceList
107
+ ) {
108
+ return DashboardKubernetesNamespaceListComponentUtil.getComponentConfigArguments() as Array<
109
+ ComponentArgument<DashboardBaseComponent>
110
+ >;
111
+ }
112
+
113
+ if (
114
+ dashboardComponentType === DashboardComponentType.KubernetesDeploymentList
115
+ ) {
116
+ return DashboardKubernetesDeploymentListComponentUtil.getComponentConfigArguments() as Array<
117
+ ComponentArgument<DashboardBaseComponent>
118
+ >;
119
+ }
120
+
121
+ if (
122
+ dashboardComponentType ===
123
+ DashboardComponentType.KubernetesStatefulSetList
124
+ ) {
125
+ return DashboardKubernetesStatefulSetListComponentUtil.getComponentConfigArguments() as Array<
126
+ ComponentArgument<DashboardBaseComponent>
127
+ >;
128
+ }
129
+
130
+ if (
131
+ dashboardComponentType === DashboardComponentType.KubernetesDaemonSetList
132
+ ) {
133
+ return DashboardKubernetesDaemonSetListComponentUtil.getComponentConfigArguments() as Array<
134
+ ComponentArgument<DashboardBaseComponent>
135
+ >;
136
+ }
137
+
138
+ if (dashboardComponentType === DashboardComponentType.KubernetesJobList) {
139
+ return DashboardKubernetesJobListComponentUtil.getComponentConfigArguments() as Array<
140
+ ComponentArgument<DashboardBaseComponent>
141
+ >;
142
+ }
143
+
144
+ if (
145
+ dashboardComponentType === DashboardComponentType.KubernetesCronJobList
146
+ ) {
147
+ return DashboardKubernetesCronJobListComponentUtil.getComponentConfigArguments() as Array<
148
+ ComponentArgument<DashboardBaseComponent>
149
+ >;
150
+ }
151
+
152
+ if (dashboardComponentType === DashboardComponentType.DockerHostList) {
153
+ return DashboardDockerHostListComponentUtil.getComponentConfigArguments() as Array<
154
+ ComponentArgument<DashboardBaseComponent>
155
+ >;
156
+ }
157
+
158
+ if (dashboardComponentType === DashboardComponentType.DockerContainerList) {
159
+ return DashboardDockerContainerListComponentUtil.getComponentConfigArguments() as Array<
160
+ ComponentArgument<DashboardBaseComponent>
161
+ >;
162
+ }
163
+
164
+ if (dashboardComponentType === DashboardComponentType.DockerImageList) {
165
+ return DashboardDockerImageListComponentUtil.getComponentConfigArguments() as Array<
166
+ ComponentArgument<DashboardBaseComponent>
167
+ >;
168
+ }
169
+
170
+ if (dashboardComponentType === DashboardComponentType.DockerNetworkList) {
171
+ return DashboardDockerNetworkListComponentUtil.getComponentConfigArguments() as Array<
172
+ ComponentArgument<DashboardBaseComponent>
173
+ >;
174
+ }
175
+
176
+ if (dashboardComponentType === DashboardComponentType.DockerVolumeList) {
177
+ return DashboardDockerVolumeListComponentUtil.getComponentConfigArguments() as Array<
178
+ ComponentArgument<DashboardBaseComponent>
179
+ >;
180
+ }
181
+
80
182
  throw new BadDataException(
81
183
  `Unknown dashboard component type: ${dashboardComponentType}`,
82
184
  );