From e69f33bd55897a27206a035e652d2933932e5178 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Fri, 26 Jul 2024 10:48:43 -0400 Subject: [PATCH 1/2] Log Subscriptoins --- src/views/cipp/app-settings/CIPPSettings.jsx | 28 ++++--- .../SettingsWebhookSubscriptions.jsx | 78 +++++++++++++++++++ 2 files changed, 97 insertions(+), 9 deletions(-) create mode 100644 src/views/cipp/app-settings/SettingsWebhookSubscriptions.jsx diff --git a/src/views/cipp/app-settings/CIPPSettings.jsx b/src/views/cipp/app-settings/CIPPSettings.jsx index 5a610170e49b..b4dd85cba84f 100644 --- a/src/views/cipp/app-settings/CIPPSettings.jsx +++ b/src/views/cipp/app-settings/CIPPSettings.jsx @@ -10,6 +10,7 @@ import { SettingsNotifications } from 'src/views/cipp/app-settings/SettingsNotif import { SettingsLicenses } from 'src/views/cipp/app-settings/SettingsLicenses.jsx' import { SettingsMaintenance } from 'src/views/cipp/app-settings/SettingsMaintenance.jsx' import { SettingsPartner } from 'src/views/cipp/app-settings/SettingsPartner.jsx' +import { SettingsWebhookSubscriptions } from 'src/views/cipp/app-settings/SettingsWebhookSubscriptions.jsx' import useQuery from 'src/hooks/useQuery.jsx' import { SettingsSuperAdmin } from './SettingsSuperAdmin.jsx' import { useLoadClientPrincipalQuery } from 'src/store/api/auth.js' @@ -48,16 +49,19 @@ export default function CIPPSettings() { Notifications setActive(5)} href="#"> - Partner Webhooks + Log Subscriptions setActive(6)} href="#"> - Licenses + Partner Webhooks setActive(7)} href="#"> + Licenses + + setActive(8)} href="#"> Maintenance {superAdmin && ( - setActive(8)} href="#"> + setActive(9)} href="#"> SuperAdmin Settings )} @@ -84,23 +88,29 @@ export default function CIPPSettings() { - + - - - + + - + - + + {superAdmin && ( + + + + + + )} ) diff --git a/src/views/cipp/app-settings/SettingsWebhookSubscriptions.jsx b/src/views/cipp/app-settings/SettingsWebhookSubscriptions.jsx new file mode 100644 index 000000000000..e373644af40e --- /dev/null +++ b/src/views/cipp/app-settings/SettingsWebhookSubscriptions.jsx @@ -0,0 +1,78 @@ +import React from 'react' +import { CippPageList } from 'src/components/layout/index.js' +import { cellGenericFormatter } from 'src/components/tables/CellGenericFormat' +import { cellBadgeFormatter, cellDateFormatter } from 'src/components/tables' + +/** + * SettingsWebhookSubscriptions component is used to manage webhook subscriptions in a settings page. + * + * @returns {JSX.Element} The generated settings page component. + */ +export function SettingsWebhookSubscriptions() { + const columns = [ + { + name: 'Tenant', + selector: (row) => row['PartitionKey'], + exportSelector: 'PartitionKey', + sortable: true, + cell: cellGenericFormatter(), + }, + { + name: 'Resource', + selector: (row) => row['Resource'], + exportSelector: 'Resource', + sortable: true, + cell: cellGenericFormatter(), + }, + { + name: 'Status', + selector: (row) => row['Status'], + exportSelector: 'Status', + sortable: true, + cell: cellBadgeFormatter(), + }, + { + name: 'Last Update', + selector: (row) => row['Timestamp'], + sortable: true, + cell: cellDateFormatter({ format: 'short' }), + exportSelector: 'Timestamp', + }, + ] + return ( + <> + + + ) +} From c8aba868b3775bc3f8346dd634b227892b164222 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Fri, 26 Jul 2024 12:02:20 -0400 Subject: [PATCH 2/2] UI tweaks --- src/views/cipp/ExtensionSync.jsx | 14 +++++++------- .../app-settings/SettingsWebhookSubscriptions.jsx | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/views/cipp/ExtensionSync.jsx b/src/views/cipp/ExtensionSync.jsx index c9937921aa86..f121bf08e513 100644 --- a/src/views/cipp/ExtensionSync.jsx +++ b/src/views/cipp/ExtensionSync.jsx @@ -19,49 +19,49 @@ const ExtensionSync = () => { const columns = [ { name: 'Tenant', - selector: (row) => row['Tenant'], + selector: (row) => row?.Tenant, sortable: true, cell: cellGenericFormatter(), exportSelector: 'Tenants', }, { name: 'Sync Type', - selector: (row) => row['SyncType'], + selector: (row) => row?.SyncType, sortable: true, cell: cellBadgeFormatter({ color: 'info' }), exportSelector: 'SyncType', }, { name: 'Task', - selector: (row) => row['Name'], + selector: (row) => row?.Name, sortable: true, cell: cellGenericFormatter(), exportSelector: 'Name', }, { name: 'Scheduled Time', - selector: (row) => row['ScheduledTime'], + selector: (row) => row?.ScheduledTime, sortable: true, cell: cellDateFormatter({ format: 'short' }), exportSelector: 'ScheduledTime', }, { name: 'Last Run', - selector: (row) => row['ExecutedTime'], + selector: (row) => row?.ExecutedTime, sortable: true, cell: cellDateFormatter({ format: 'short' }), exportSelector: 'ExecutedTime', }, { name: 'Repeats every', - selector: (row) => row['RepeatsEvery'], + selector: (row) => row?.RepeatsEvery, sortable: true, cell: (row) => CellTip(row['RepeatsEvery']), exportSelector: 'RepeatsEvery', }, { name: 'Results', - selector: (row) => row['Results'], + selector: (row) => row?.Results, sortable: true, cell: cellGenericFormatter(), exportSelector: 'Results', diff --git a/src/views/cipp/app-settings/SettingsWebhookSubscriptions.jsx b/src/views/cipp/app-settings/SettingsWebhookSubscriptions.jsx index e373644af40e..965e13b57b90 100644 --- a/src/views/cipp/app-settings/SettingsWebhookSubscriptions.jsx +++ b/src/views/cipp/app-settings/SettingsWebhookSubscriptions.jsx @@ -29,7 +29,7 @@ export function SettingsWebhookSubscriptions() { selector: (row) => row['Status'], exportSelector: 'Status', sortable: true, - cell: cellBadgeFormatter(), + cell: cellBadgeFormatter({ color: 'info' }), }, { name: 'Last Update',