@@ -74,7 +75,7 @@ const loading = computed(() => {
>
{{ license.formattedUpgradeProtectionExpiration }}
{{ licenseStatus.upgradeDaysLeft }}
-
diff --git a/src/ServicePulse.Host/vue/src/components/configuration/convertToWarningLevel.ts b/src/ServicePulse.Host/vue/src/components/configuration/convertToWarningLevel.ts
new file mode 100644
index 0000000000..b808e88193
--- /dev/null
+++ b/src/ServicePulse.Host/vue/src/components/configuration/convertToWarningLevel.ts
@@ -0,0 +1,13 @@
+import { LicenseWarningLevel } from "@/composables/LicenseStatus";
+import { WarningLevel } from "@/components/WarningLevel";
+
+export default function convertToWarningLevel(level: LicenseWarningLevel) {
+ switch (level) {
+ case LicenseWarningLevel.None:
+ return WarningLevel.None;
+ case LicenseWarningLevel.Warning:
+ return WarningLevel.Warning;
+ case LicenseWarningLevel.Danger:
+ return WarningLevel.Danger;
+ }
+}
diff --git a/src/ServicePulse.Host/vue/src/composables/LicenseStatus.ts b/src/ServicePulse.Host/vue/src/composables/LicenseStatus.ts
new file mode 100644
index 0000000000..47c2e74113
--- /dev/null
+++ b/src/ServicePulse.Host/vue/src/composables/LicenseStatus.ts
@@ -0,0 +1,5 @@
+export enum LicenseWarningLevel {
+ None = "none",
+ Warning = "warning",
+ Danger = "danger",
+}
diff --git a/src/ServicePulse.Host/vue/src/composables/serviceLicense.ts b/src/ServicePulse.Host/vue/src/composables/serviceLicense.ts
index 58f36dc95b..8f9f2131a3 100644
--- a/src/ServicePulse.Host/vue/src/composables/serviceLicense.ts
+++ b/src/ServicePulse.Host/vue/src/composables/serviceLicense.ts
@@ -5,6 +5,7 @@ import { useShowToast } from "./toast";
import { TYPE } from "vue-toastification";
import type LicenseInfo from "@/resources/LicenseInfo";
import { LicenseStatus } from "@/resources/LicenseInfo";
+import { LicenseWarningLevel } from "@/composables/LicenseStatus";
const subscriptionExpiring =
'
Platform license expires soonOnce the license expires you\'ll no longer be able to continue using the Particular Service Platform.
View license details ';
@@ -62,7 +63,7 @@ export const licenseStatus = reactive({
upgradeDaysLeft: "",
subscriptionDaysLeft: "",
trialDaysLeft: "",
- warningLevel: "",
+ warningLevel: LicenseWarningLevel.None,
});
export async function useLicense() {
@@ -101,9 +102,10 @@ export async function useLicense() {
}
function getLicenseWarningLevel(licenseStatus: LicenseStatus) {
- if (licenseStatus === "InvalidDueToExpiredTrial" || licenseStatus === "InvalidDueToExpiredSubscription" || licenseStatus === "InvalidDueToExpiredUpgradeProtection") return "danger";
- else if (licenseStatus === "ValidWithExpiringUpgradeProtection" || licenseStatus === "ValidWithExpiringTrial" || licenseStatus === "ValidWithExpiredUpgradeProtection" || licenseStatus === "ValidWithExpiringSubscription") return "warning";
- return "";
+ if (licenseStatus === "InvalidDueToExpiredTrial" || licenseStatus === "InvalidDueToExpiredSubscription" || licenseStatus === "InvalidDueToExpiredUpgradeProtection") return LicenseWarningLevel.Danger;
+ else if (licenseStatus === "ValidWithExpiringUpgradeProtection" || licenseStatus === "ValidWithExpiringTrial" || licenseStatus === "ValidWithExpiredUpgradeProtection" || licenseStatus === "ValidWithExpiringSubscription")
+ return LicenseWarningLevel.Warning;
+ return LicenseWarningLevel.None;
}
function isUpgradeProtectionLicense(license: UnwrapNestedRefs
) {
diff --git a/src/ServicePulse.Host/vue/src/composables/toast.ts b/src/ServicePulse.Host/vue/src/composables/toast.ts
index 82f8da6bfe..60df39947f 100644
--- a/src/ServicePulse.Host/vue/src/composables/toast.ts
+++ b/src/ServicePulse.Host/vue/src/composables/toast.ts
@@ -1,4 +1,4 @@
-import ToastPopup from "../components/ToastPopup.vue";
+import ToastPopup from "@/components/ToastPopup.vue";
import { TYPE, useToast } from "vue-toastification";
export function useShowToast(type: TYPE, title: string, message: string, doNotUseTimeout: boolean = false) {
diff --git a/src/ServicePulse.Host/vue/src/resources/EventLogItem.ts b/src/ServicePulse.Host/vue/src/resources/EventLogItem.ts
index 3279299a33..02722b12c5 100644
--- a/src/ServicePulse.Host/vue/src/resources/EventLogItem.ts
+++ b/src/ServicePulse.Host/vue/src/resources/EventLogItem.ts
@@ -1,9 +1,16 @@
export default interface EventLogItem {
id: string;
description: string;
- severity: string;
+ severity: Severity;
raised_at: string;
related_to: string[];
category: string;
event_type: string;
}
+
+export enum Severity {
+ Critical = "critical",
+ Error = "error",
+ Warning = "warning",
+ Info = "info",
+}
diff --git a/src/ServicePulse.Host/vue/src/views/ConfigurationView.vue b/src/ServicePulse.Host/vue/src/views/ConfigurationView.vue
index a9634bd1c5..28191323ef 100644
--- a/src/ServicePulse.Host/vue/src/views/ConfigurationView.vue
+++ b/src/ServicePulse.Host/vue/src/views/ConfigurationView.vue
@@ -5,6 +5,7 @@ import { connectionState, monitoringConnectionState } from "../composables/servi
import { useIsMonitoringEnabled } from "../composables/serviceServiceControlUrls";
import { useRedirects } from "../composables/serviceRedirects";
import ExclamationMark from "../components/ExclamationMark.vue";
+import convertToWarningLevel from "@/components/configuration/convertToWarningLevel";
const redirectCount = ref(0);
@@ -34,7 +35,7 @@ onMounted(async () => {
License
-
+
Health Check Notifications
diff --git a/src/ServicePulse.Host/vue/src/views/DashboardView.vue b/src/ServicePulse.Host/vue/src/views/DashboardView.vue
index 5506d2800e..0d51949588 100644
--- a/src/ServicePulse.Host/vue/src/views/DashboardView.vue
+++ b/src/ServicePulse.Host/vue/src/views/DashboardView.vue
@@ -1,10 +1,10 @@
-
diff --git a/src/ServicePulse.Host/vue/src/views/EventsView.vue b/src/ServicePulse.Host/vue/src/views/EventsView.vue
index cbf8e49e60..864f15476a 100644
--- a/src/ServicePulse.Host/vue/src/views/EventsView.vue
+++ b/src/ServicePulse.Host/vue/src/views/EventsView.vue
@@ -1,10 +1,15 @@
-
@@ -13,12 +18,12 @@ import ServiceControlNotAvailable from "../components/ServiceControlNotAvailable