diff --git a/.env b/.env index 0582fd1e34..04cd8521ff 100644 --- a/.env +++ b/.env @@ -1,2 +1 @@ VUE_APP_DATA_TIMEOUT=500 -VUE_APP_GENERAL_CONFIG=http://localhost:5681/config diff --git a/.env.development b/.env.development index d641ef60f3..743453e720 100644 --- a/.env.development +++ b/.env.development @@ -1,3 +1,3 @@ NODE_ENV=development -VUE_APP_MOCK_API_ENABLED=true +VUE_APP_MOCK_API_ENABLED=false VUE_APP_KUMA_CONFIG=/dev-api-config.json diff --git a/src/App.vue b/src/App.vue index 682c5e9341..0c318a8c39 100644 --- a/src/App.vue +++ b/src/App.vue @@ -113,6 +113,15 @@ export default { // fetch the config this.$store.dispatch('getConfig') + .then(() => { + const config = this.$store.getters.getConfig + const mode = config.mode + + // set Kuma's current mode in localStorage. + // if the mode is `global`, this denotes that it's + // running in Multicluster mode. + localStorage.setItem('kumaMode', mode) + }) // set the selected mesh in localStorage const mesh = () => { diff --git a/src/components/Global/Header.vue b/src/components/Global/Header.vue index 4eb8c471bb..cbc034286b 100644 --- a/src/components/Global/Header.vue +++ b/src/components/Global/Header.vue @@ -21,10 +21,18 @@ v-if="showStatus" class="py-1 md:py-0 md:px-4" > - + + + @@ -52,7 +60,9 @@ export default { // this checks the status of the API itself status: 'getStatus', // the currently selected mesh - currentMesh: 'getSelectedMesh' + currentMesh: 'getSelectedMesh', + // the status of multicluster + multicluster: 'getMulticlusterStatus' }), showStatus () { return !this.$route.meta.hideStatus && this.status === 'OK' @@ -63,8 +73,11 @@ export default { }, methods: { getGuiStatus () { + // these localStorage items are set on app launch const env = localStorage.getItem('kumaEnv') const apiUrl = localStorage.getItem('kumaApiUrl') + + // get the other values from our state const tagline = this.$store.getters.getTagline const version = this.$store.getters.getVersion @@ -116,6 +129,23 @@ export default { margin-left: auto; } +.status-badge { + --KBadgeWidth: auto; + --KBadgePaddingX: var(--spacing-sm); +} + +@media screen and (min-width: 990px) { + .status-badge { + margin-left: var(--spacing-sm); + } +} + +@media screen and (max-width: 989px) { + .status-badge { + margin-top: var(--spacing-sm); + } +} + @media screen and (max-width: 599px) { .upgrade-check-wrapper { display: none; diff --git a/src/components/Sidebar/MenuList.vue b/src/components/Sidebar/MenuList.vue index ad9ff1a8b2..32ec13513b 100644 --- a/src/components/Sidebar/MenuList.vue +++ b/src/components/Sidebar/MenuList.vue @@ -1,6 +1,6 @@