diff --git a/src/Frontend/package-lock.json b/src/Frontend/package-lock.json index 72df7c06f..6f75e2548 100644 --- a/src/Frontend/package-lock.json +++ b/src/Frontend/package-lock.json @@ -126,7 +126,6 @@ "integrity": "sha512-2BCOP7TN8M+gVDj7/ht3hsaO/B/n5oDbiAyyvnRlNOs+u1o+JWNYTQrmpuNp1/Wq2gcFrI01JAW+paEKDMx/CA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.28.3", @@ -616,7 +615,6 @@ "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.18.6.tgz", "integrity": "sha512-PHHBXFomUs5DF+9tCOM/UoW6XQ4R44lLNNhRaW9PKPTU0D7lIjRg3ElxaJnTwsl/oHiR93WSXDBrekhoUGCPtg==", "license": "MIT", - "peer": true, "dependencies": { "@codemirror/language": "^6.0.0", "@codemirror/state": "^6.0.0", @@ -629,7 +627,6 @@ "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.8.1.tgz", "integrity": "sha512-KlGVYufHMQzxbdQONiLyGQDUW0itrLZwq3CcY7xpv9ZLRHqzkBSoteocBHtMCoY7/Ci4xhzSrToIeLg7FxHuaw==", "license": "MIT", - "peer": true, "dependencies": { "@codemirror/language": "^6.0.0", "@codemirror/state": "^6.4.0", @@ -666,7 +663,6 @@ "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.11.3.tgz", "integrity": "sha512-9HBM2XnwDj7fnu0551HkGdrUrrqmYq/WC5iv6nbY2WdicXdGbhR/gfbZOH73Aqj4351alY1+aoG9rCNfiwS1RA==", "license": "MIT", - "peer": true, "dependencies": { "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.23.0", @@ -690,7 +686,6 @@ "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.8.5.tgz", "integrity": "sha512-s3n3KisH7dx3vsoeGMxsbRAgKe4O1vbrnKBClm99PU0fWxmxsx5rR2PfqQgIt+2MMJBHbiJ5rfIdLYfB9NNvsA==", "license": "MIT", - "peer": true, "dependencies": { "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.35.0", @@ -702,7 +697,6 @@ "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.5.11.tgz", "integrity": "sha512-KmWepDE6jUdL6n8cAAqIpRmLPBZ5ZKnicE8oGU/s3QrAVID+0VhLFrzUucVKHG5035/BSykhExDL/Xm7dHthiA==", "license": "MIT", - "peer": true, "dependencies": { "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.0.0", @@ -714,7 +708,6 @@ "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.5.2.tgz", "integrity": "sha512-FVqsPqtPWKVVL3dPSxy8wEF/ymIEuVzF1PK3VbUgrxXpJUSHQWWZz4JMToquRxnkw+36LTamCZG2iua2Ptq0fA==", "license": "MIT", - "peer": true, "dependencies": { "@marijn/find-cluster-break": "^1.0.0" } @@ -724,7 +717,6 @@ "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.38.1.tgz", "integrity": "sha512-RmTOkE7hRU3OVREqFVITWHz6ocgBjv08GoePscAakgVQfciA3SGCEk7mb9IzwW61cKKmlTpHXG6DUE5Ubx+MGQ==", "license": "MIT", - "peer": true, "dependencies": { "@codemirror/state": "^6.5.0", "crelt": "^1.0.6", @@ -820,7 +812,6 @@ } ], "license": "MIT", - "peer": true, "engines": { "node": ">=18" }, @@ -844,7 +835,6 @@ } ], "license": "MIT", - "peer": true, "engines": { "node": ">=18" } @@ -1529,7 +1519,6 @@ "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-7.1.0.tgz", "integrity": "sha512-fNxRUk1KhjSbnbuBxlWSnBLKLBNun52ZBTcs22H/xEEzM6Ap81ZFTQ4bZBxVQGQgVY0xugKGoRcCbaKjLQ3XZA==", "license": "MIT", - "peer": true, "dependencies": { "@fortawesome/fontawesome-common-types": "7.1.0" }, @@ -2005,7 +1994,6 @@ "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", "license": "MIT", - "peer": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/popperjs" @@ -2311,7 +2299,6 @@ "integrity": "sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/code-frame": "^7.10.4", "@babel/runtime": "^7.12.5", @@ -2578,7 +2565,6 @@ "integrity": "sha512-jCzKdm/QK0Kg4V4IK/oMlRZlY+QOcdjv89U2NgKHZk1CYTj82/RVSx1mV/0gqCVMJ/DA+Zf/S4NBWNF8GQ+eqQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.48.0", "@typescript-eslint/types": "8.48.0", @@ -2994,7 +2980,6 @@ "resolved": "https://registry.npmjs.org/@vue-flow/core/-/core-1.48.0.tgz", "integrity": "sha512-keW9HGaEZEe4SKYtrzp5E+qSGJ5/z+9i2yRDtCr3o72IUnS0Ns1qQNsIbGGz0ygpKzg6LdtbVLWeYAvl3dzLQA==", "license": "MIT", - "peer": true, "dependencies": { "@vueuse/core": "^10.5.0", "d3-drag": "^3.0.0", @@ -3147,7 +3132,6 @@ "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.25.tgz", "integrity": "sha512-PUgKp2rn8fFsI++lF2sO7gwO2d9Yj57Utr5yEsDf3GNaQcowCLKL7sf+LvVFvtJDXUp/03+dC6f2+LCv5aK1ag==", "license": "MIT", - "peer": true, "dependencies": { "@babel/parser": "^7.28.5", "@vue/compiler-core": "3.5.25", @@ -3468,7 +3452,6 @@ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -3718,7 +3701,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "baseline-browser-mapping": "^2.8.9", "caniuse-lite": "^1.0.30001746", @@ -3956,7 +3938,6 @@ "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-6.0.2.tgz", "integrity": "sha512-VhydHotNW5w1UGK0Qj96BwSk/Zqbp9WbnyK2W/eVMv4QyF41INRGpjUhFJY7/uDNuudSc33a/PKr4iDqRduvHw==", "license": "MIT", - "peer": true, "dependencies": { "@codemirror/autocomplete": "^6.0.0", "@codemirror/commands": "^6.0.0", @@ -4183,7 +4164,6 @@ "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz", "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==", "license": "ISC", - "peer": true, "engines": { "node": ">=12" } @@ -4668,7 +4648,6 @@ "integrity": "sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -4729,7 +4708,6 @@ "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", "dev": true, "license": "MIT", - "peer": true, "bin": { "eslint-config-prettier": "bin/cli.js" }, @@ -6687,7 +6665,6 @@ "resolved": "https://registry.npmjs.org/pinia/-/pinia-3.0.4.tgz", "integrity": "sha512-l7pqLUFTI/+ESXn6k3nu30ZIzW5E2WZF/LaHJEpoq6ElcLD+wduZoB2kBN19du6K/4FDpPMazY2wJr+IndBtQw==", "license": "MIT", - "peer": true, "dependencies": { "@vue/devtools-api": "^7.7.7" }, @@ -6772,7 +6749,6 @@ "integrity": "sha512-RWKXE4qB3u5Z6yz7omJkjWwmTfLdcbv44jUVHC5NpfXwFGzvpQM798FGv/6WNK879tc+Cn0AAyherCl1KjbyZQ==", "dev": true, "license": "MIT", - "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -7399,8 +7375,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.2.tgz", "integrity": "sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/superjson": { "version": "2.2.2", @@ -7525,7 +7500,6 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -7662,7 +7636,6 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "devOptional": true, "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -7809,7 +7782,6 @@ "integrity": "sha512-NL8jTlbo0Tn4dUEXEsUg8KeyG/Lkmc4Fnzb8JXN/Ykm9G4HNImjtABMJgkQoVjOBN/j2WAwDTRytdqJbZsah7w==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", @@ -8125,7 +8097,6 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -8139,7 +8110,6 @@ "integrity": "sha512-pmW4GCKQ8t5Ko1jYjC3SqOr7TUKN7uHOHB/XGsAIb69eYu6d1ionGSsb5H9chmPf+WeXt0VE7jTXsB1IvWoNbw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@vitest/expect": "4.0.12", "@vitest/mocker": "4.0.12", @@ -8241,7 +8211,6 @@ "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.25.tgz", "integrity": "sha512-YLVdgv2K13WJ6n+kD5owehKtEXwdwXuj2TTyJMsO7pSeKw2bfRNZGjhB7YzrpbMYj5b5QsUebHpOqR3R3ziy/g==", "license": "MIT", - "peer": true, "dependencies": { "@vue/compiler-dom": "3.5.25", "@vue/compiler-sfc": "3.5.25", @@ -8389,7 +8358,6 @@ "integrity": "sha512-L/G9IUjOWhBU0yun89rv8fKqmKC+T0HfhrFjlIml71WpfBv9eb4E9Bev8FMbyueBIU9vxQqbd+oOsVcDa5amGw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@volar/typescript": "2.4.23", "@vue/language-core": "3.1.5" diff --git a/src/Frontend/src/components/AutoRefreshDataView.vue b/src/Frontend/src/components/AutoRefreshDataView.vue index 2fb2757a1..477ee2bc0 100644 --- a/src/Frontend/src/components/AutoRefreshDataView.vue +++ b/src/Frontend/src/components/AutoRefreshDataView.vue @@ -3,7 +3,7 @@ import { onMounted, onUnmounted, ref, watch } from "vue"; import ItemsPerPage from "@/components/ItemsPerPage.vue"; import PaginationStrip from "@/components/PaginationStrip.vue"; import type DataViewPageModel from "./DataViewPageModel"; -import { useServiceControlStore } from "@/stores/ServiceControlStore"; +import serviceControlClient from "@/components/serviceControlClient"; const props = withDefaults( defineProps<{ @@ -20,8 +20,6 @@ const props = withDefaults( let refreshTimer: number | undefined; const viewModel = defineModel>({ required: true }); -const store = useServiceControlStore(); - const pageNumber = ref(1); const itemsPerPage = ref(props.itemsPerPage); @@ -37,7 +35,7 @@ watch(itemsPerPage, () => loadData()); watch(pageNumber, () => loadData()); async function loadData() { - const [response, data] = await store.fetchTypedFromServiceControl(`${props.apiUrl}?page=${pageNumber.value}&per_page=${itemsPerPage.value}`); + const [response, data] = await serviceControlClient.fetchTypedFromServiceControl(`${props.apiUrl}?page=${pageNumber.value}&per_page=${itemsPerPage.value}`); if (response.ok) { viewModel.value.totalCount = parseInt(response.headers.get("Total-Count") ?? "0"); viewModel.value.data = data; diff --git a/src/Frontend/src/components/BackendChecksNotifications.vue b/src/Frontend/src/components/BackendChecksNotifications.vue index 36ccab2c8..2273a3b91 100644 --- a/src/Frontend/src/components/BackendChecksNotifications.vue +++ b/src/Frontend/src/components/BackendChecksNotifications.vue @@ -7,19 +7,15 @@ import { useShowToast } from "@/composables/toast"; import { TYPE } from "vue-toastification"; import useConnectionsAndStatsAutoRefresh from "@/composables/useConnectionsAndStatsAutoRefresh"; import useEnvironmentAndVersionsAutoRefresh from "@/composables/useEnvironmentAndVersionsAutoRefresh"; -import { useServiceControlStore } from "@/stores/ServiceControlStore"; -import { storeToRefs } from "pinia"; +import serviceControlClient from "@/components/serviceControlClient"; +import monitoringClient from "./monitoring/monitoringClient"; const router = useRouter(); - const { store: connectionStore } = useConnectionsAndStatsAutoRefresh(); const connectionState = connectionStore.connectionState; const monitoringConnectionState = connectionStore.monitoringConnectionState; const { store: environmentStore } = useEnvironmentAndVersionsAutoRefresh(); const environment = environmentStore.environment; -const serviceControlStore = useServiceControlStore(); -const { monitoringUrl, serviceControlUrl, isMonitoringDisabled } = storeToRefs(serviceControlStore); - const primaryConnectionFailure = computed(() => connectionState.unableToConnect); const monitoringConnectionFailure = computed(() => monitoringConnectionState.unableToConnect); @@ -28,16 +24,16 @@ watch(primaryConnectionFailure, (newValue, oldValue) => { if (newValue !== oldValue && !(oldValue === null && newValue === false)) { const connectionUrl = router.resolve(routeLinks.configuration.connections.link).href; if (newValue) { - useShowToast(TYPE.ERROR, "Error", `Could not connect to ServiceControl at ${serviceControlUrl.value}. View connection settings`); + useShowToast(TYPE.ERROR, "Error", `Could not connect to ServiceControl at ${serviceControlClient.url}. View connection settings`); } else { - useShowToast(TYPE.SUCCESS, "Success", `Connection to ServiceControl was successful at ${serviceControlUrl.value}.`); + useShowToast(TYPE.SUCCESS, "Success", `Connection to ServiceControl was successful at ${serviceControlClient.url}.`); } } }); watch(monitoringConnectionFailure, (newValue, oldValue) => { // Only watch the state change if monitoring is enabled - if (isMonitoringDisabled.value) { + if (monitoringClient.isMonitoringDisabled) { return; } @@ -45,9 +41,9 @@ watch(monitoringConnectionFailure, (newValue, oldValue) => { if (newValue !== oldValue && !(oldValue === null && newValue === false)) { const connectionUrl = router.resolve(routeLinks.configuration.connections.link).href; if (newValue) { - useShowToast(TYPE.ERROR, "Error", `Could not connect to the ServiceControl Monitoring service at ${monitoringUrl.value}. View connection settings`); + useShowToast(TYPE.ERROR, "Error", `Could not connect to the ServiceControl Monitoring service at ${monitoringClient.url}. View connection settings`); } else { - useShowToast(TYPE.SUCCESS, "Success", `Connection to ServiceControl Monitoring service was successful at ${monitoringUrl.value}.`); + useShowToast(TYPE.SUCCESS, "Success", `Connection to ServiceControl Monitoring service was successful at ${monitoringClient.url}.`); } } }); diff --git a/src/Frontend/src/components/PageFooter.vue b/src/Frontend/src/components/PageFooter.vue index 69527a1cc..ecb826af4 100644 --- a/src/Frontend/src/components/PageFooter.vue +++ b/src/Frontend/src/components/PageFooter.vue @@ -6,10 +6,11 @@ import FAIcon from "@/components/FAIcon.vue"; import { faArrowTurnUp, faPlus } from "@fortawesome/free-solid-svg-icons"; import useConnectionsAndStatsAutoRefresh from "@/composables/useConnectionsAndStatsAutoRefresh"; import useEnvironmentAndVersionsAutoRefresh from "@/composables/useEnvironmentAndVersionsAutoRefresh"; -import { useServiceControlStore } from "@/stores/ServiceControlStore"; +import serviceControlClient from "@/components/serviceControlClient"; import { storeToRefs } from "pinia"; import { useConfigurationStore } from "@/stores/ConfigurationStore"; import { useLicenseStore } from "@/stores/LicenseStore"; +import monitoringClient from "./monitoring/monitoringClient"; const { store: connectionStore } = useConnectionsAndStatsAutoRefresh(); const connectionState = connectionStore.connectionState; @@ -17,21 +18,16 @@ const monitoringConnectionState = connectionStore.monitoringConnectionState; const { store: environmentAndVersionsStore } = useEnvironmentAndVersionsAutoRefresh(); const newVersions = environmentAndVersionsStore.newVersions; const environment = environmentAndVersionsStore.environment; -const serviceControlStore = useServiceControlStore(); -const { serviceControlUrl, monitoringUrl } = storeToRefs(serviceControlStore); const licenseStore = useLicenseStore(); const { licenseStatus, license } = licenseStore; - -const isMonitoringEnabled = computed(() => { - return monitoringUrl.value !== "!" && monitoringUrl.value !== "" && monitoringUrl.value !== null && monitoringUrl.value !== undefined; -}); +const isMonitoringEnabled = monitoringClient.isMonitoringEnabled; const scAddressTooltip = computed(() => { - return `ServiceControl URL ${serviceControlUrl.value}`; + return `ServiceControl URL ${serviceControlClient.url}`; }); const scMonitoringAddressTooltip = computed(() => { - return `Monitoring URL ${monitoringUrl.value}`; + return `Monitoring URL ${monitoringClient.url}`; }); const configurationStore = useConfigurationStore(); diff --git a/src/Frontend/src/components/PageHeader.vue b/src/Frontend/src/components/PageHeader.vue index 640f2dcdd..e059894b2 100644 --- a/src/Frontend/src/components/PageHeader.vue +++ b/src/Frontend/src/components/PageHeader.vue @@ -12,17 +12,15 @@ import DashboardMenuItem from "@/components/dashboard/DashboardMenuItem.vue"; import FeedbackButton from "@/components/FeedbackButton.vue"; import ThroughputMenuItem from "@/views/throughputreport/ThroughputMenuItem.vue"; import AuditMenuItem from "./audit/AuditMenuItem.vue"; -import { useServiceControlStore } from "@/stores/ServiceControlStore"; -import { storeToRefs } from "pinia"; +import monitoringClient from "@/components/monitoring/monitoringClient"; -const serviceControlStore = useServiceControlStore(); -const { isMonitoringEnabled } = storeToRefs(serviceControlStore); +const isMonitoringEnabled = monitoringClient.isMonitoringEnabled; // prettier-ignore const menuItems = computed( () => [ DashboardMenuItem, HeartbeatsMenuItem, - ...(isMonitoringEnabled.value ? [MonitoringMenuItem] : []), + ...(isMonitoringEnabled ? [MonitoringMenuItem] : []), AuditMenuItem, FailedMessagesMenuItem, CustomChecksMenuItem, diff --git a/src/Frontend/src/components/ServiceControlAvailable.vue b/src/Frontend/src/components/ServiceControlAvailable.vue index 04aef2ff2..b40c6dc31 100644 --- a/src/Frontend/src/components/ServiceControlAvailable.vue +++ b/src/Frontend/src/components/ServiceControlAvailable.vue @@ -2,13 +2,10 @@ import ConditionalRender from "@/components/ConditionalRender.vue"; import routeLinks from "@/router/routeLinks"; import useConnectionsAndStatsAutoRefresh from "@/composables/useConnectionsAndStatsAutoRefresh"; -import { useServiceControlStore } from "@/stores/ServiceControlStore"; -import { storeToRefs } from "pinia"; +import serviceControlClient from "@/components/serviceControlClient"; const { store: connectionStore } = useConnectionsAndStatsAutoRefresh(); const connectionState = connectionStore.connectionState; -const serviceControlStore = useServiceControlStore(); -const { serviceControlUrl } = storeToRefs(serviceControlStore);