From 0ca9703425201279dc09a385a8dd6eddf0715bc9 Mon Sep 17 00:00:00 2001 From: Szymon Pobiega Date: Wed, 23 Nov 2022 09:56:45 +0100 Subject: [PATCH 01/23] Try remove ref for computed to see if that works --- .../vue/src/components/configuration/EndpointConnection.vue | 2 +- .../src/components/configuration/HealthCheckNotifications.vue | 2 +- .../vue/src/components/configuration/PlatformConnections.vue | 2 +- .../vue/src/components/configuration/RetryRedirects.vue | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ServicePulse.Host/vue/src/components/configuration/EndpointConnection.vue b/src/ServicePulse.Host/vue/src/components/configuration/EndpointConnection.vue index 140a232190..d057333cea 100644 --- a/src/ServicePulse.Host/vue/src/components/configuration/EndpointConnection.vue +++ b/src/ServicePulse.Host/vue/src/components/configuration/EndpointConnection.vue @@ -15,7 +15,7 @@ import BusyIndicator from "../BusyIndicator.vue"; import { HighCode } from "vue-highlight-code"; import "vue-highlight-code/dist/style.css"; -const isExpired = ref(useLicenseStatus.isExpired); +const isExpired = useLicenseStatus.isExpired; const configuredServiceControlUrl = inject(key_ServiceControlUrl); const configuredMonitoringUrl = inject(key_MonitoringUrl); diff --git a/src/ServicePulse.Host/vue/src/components/configuration/HealthCheckNotifications.vue b/src/ServicePulse.Host/vue/src/components/configuration/HealthCheckNotifications.vue index e7688a4e9a..6ae4d858f4 100644 --- a/src/ServicePulse.Host/vue/src/components/configuration/HealthCheckNotifications.vue +++ b/src/ServicePulse.Host/vue/src/components/configuration/HealthCheckNotifications.vue @@ -18,7 +18,7 @@ import { } from "../../composables/serviceNotifications.js"; import { useShowToast } from "../../composables/toast.js"; -const isExpired = ref(useLicenseStatus.isExpired); +const isExpired = useLicenseStatus.isExpired; const isSCConnected = inject(key_IsSCConnected); const scConnectedAtLeastOnce = inject(key_ScConnectedAtLeastOnce); diff --git a/src/ServicePulse.Host/vue/src/components/configuration/PlatformConnections.vue b/src/ServicePulse.Host/vue/src/components/configuration/PlatformConnections.vue index 917c512808..ff444da480 100644 --- a/src/ServicePulse.Host/vue/src/components/configuration/PlatformConnections.vue +++ b/src/ServicePulse.Host/vue/src/components/configuration/PlatformConnections.vue @@ -11,7 +11,7 @@ import { key_UnableToConnectToMonitoring, } from "../../composables/keys.js"; -const isExpired = ref(useLicenseStatus.isExpired); +const isExpired = useLicenseStatus.isExpired; const configuredServiceControlUrl = inject(key_ServiceControlUrl); const configuredMonitoringUrl = inject(key_MonitoringUrl); diff --git a/src/ServicePulse.Host/vue/src/components/configuration/RetryRedirects.vue b/src/ServicePulse.Host/vue/src/components/configuration/RetryRedirects.vue index 8f1304bf2d..bc74217c86 100644 --- a/src/ServicePulse.Host/vue/src/components/configuration/RetryRedirects.vue +++ b/src/ServicePulse.Host/vue/src/components/configuration/RetryRedirects.vue @@ -24,7 +24,7 @@ import { retryPendingMessagesForQueue, } from "../../composables/serviceRedirects.js"; -const isExpired = ref(useLicenseStatus.isExpired); +const isExpired = useLicenseStatus.isExpired; const emit = defineEmits(["redirectCountUpdated"]); From 21fca9806ef7aceb9bd28466199f545254f33dff Mon Sep 17 00:00:00 2001 From: Szymon Pobiega Date: Wed, 23 Nov 2022 10:59:14 +0100 Subject: [PATCH 02/23] Change the dependency handling of version info Move watching of compatibility info to the SC service --- src/ServicePulse.Host/vue/src/App.vue | 89 +------------------ .../vue/src/components/PageFooter.vue | 85 +++++++++--------- .../vue/src/composables/keys.js | 14 --- .../src/composables/serviceServiceControl.js | 26 +++++- 4 files changed, 71 insertions(+), 143 deletions(-) diff --git a/src/ServicePulse.Host/vue/src/App.vue b/src/ServicePulse.Host/vue/src/App.vue index de33fccb32..3e8c2fbe0b 100644 --- a/src/ServicePulse.Host/vue/src/App.vue +++ b/src/ServicePulse.Host/vue/src/App.vue @@ -15,19 +15,7 @@ import { key_IsMonitoringEnabled, key_IsSCMonitoringConnected, key_IsSCMonitoringConnecting, - key_MonitoringVersion, - key_NewMonitoringVersion, - key_NewMonitoringVersionLink, - key_NewMonitoringVersionNumber, key_License, - key_SPVersion, - key_NewSPVersion, - key_NewSPVersionLink, - key_NewSPVersionNumber, - key_SCVersion, - key_NewSCVersion, - key_NewSCVersionLink, - key_NewSCVersionNumber, } from "./composables/keys.js"; import { useServiceControlUrls, @@ -42,8 +30,6 @@ import { useServiceControlMonitoringStats, isServiceControlMonitoringConnecting, isServiceControlMonitoringConnected, - environment, - newVersions, } from "./composables/serviceServiceControl.js"; import { useLicense, @@ -54,15 +40,17 @@ import { useShowToast } from "./composables/toast.js"; onMounted(() => { getLicense(); - getServiceControlVersions(); getServiceControlStats(); getServiceControlMonitoringStats(); }); const { serviceControlUrl, monitoringUrl } = useServiceControlUrls(); + provide(key_ServiceControlUrl, serviceControlUrl); provide(key_MonitoringUrl, monitoringUrl); +useServiceControlVersion(serviceControlUrl.value, monitoringUrl.value); + let license = ref(null); function getLicense() { useLicense(serviceControlUrl.value).then((lic) => { @@ -195,77 +183,6 @@ watch(isSCMonitoringConnected, async (newValue, oldValue) => { } } }); - -let scVersion = ref(null); -let newSCVersion = ref(null); -let newSCVersionLink = ref(null); -let newSCVersionNumber = ref(null); -let spVersion = ref(null); -let newSPVersion = ref(null); -let newSPVersionLink = ref(null); -let newSPVersionNumber = ref(null); -let monitoringVersion = ref(null); -let newmonitoringVersion = ref(null); -let newmonitoringVersionLink = ref(null); -let newmonitoringVersionNumber = ref(null); -let isCompatibleWithSC = ref(true); -let minimumSupportedSCVersion = ref(null); - -watch(isCompatibleWithSC, async (newValue, oldValue) => { - if (newValue != oldValue) { - if (!newValue) { - useShowToast( - "error", - "Error", - "You are using Service Control version " + - scVersion.value + - ". Please, upgrade to version " + - minimumSupportedSCVersion.value + - " or higher to unlock new functionality in ServicePulse." - ); - } - } -}); - -setInterval(() => getServiceControlVersions(), 60000); //NOTE is this often enough or too often? - -function getServiceControlVersions() { - useServiceControlVersion(serviceControlUrl.value, monitoringUrl.value).then( - () => { - scVersion.value = environment.sc_version; - newSCVersion.value = newVersions.newSCVersion.newscversion; - newSCVersionLink.value = newVersions.newSCVersion.newscversionlink; - newSCVersionNumber.value = newVersions.newSCVersion.newscversionnumber; - - spVersion.value = environment.sp_version; - newSPVersion.value = newVersions.newSPVersion.newspversion; - newSPVersionLink.value = newVersions.newSPVersion.newspversionlink; - newSPVersionNumber.value = newVersions.newSPVersion.newspversionnumber; - - monitoringVersion.value = environment.monitoring_version; - newmonitoringVersion.value = newVersions.newMVersion.newmversion; - newmonitoringVersionLink.value = newVersions.newMVersion.newmversionlink; - newmonitoringVersionNumber.value = - newVersions.newMVersion.newmversionnumber; - - isCompatibleWithSC.value = environment.is_compatible_with_sc; - minimumSupportedSCVersion.value = - environment.minimum_supported_sc_version; - } - ); -} -provide(key_SCVersion, scVersion); -provide(key_NewSCVersion, newSCVersion); -provide(key_NewSCVersionLink, newSCVersionLink); -provide(key_NewSCVersionNumber, newSCVersionNumber); -provide(key_SPVersion, spVersion); -provide(key_NewSPVersion, newSPVersion); -provide(key_NewSPVersionLink, newSPVersionLink); -provide(key_NewSPVersionNumber, newSPVersionNumber); -provide(key_MonitoringVersion, monitoringVersion); -provide(key_NewMonitoringVersion, newmonitoringVersion); -provide(key_NewMonitoringVersionLink, newmonitoringVersionLink); -provide(key_NewMonitoringVersionNumber, newmonitoringVersionNumber);