diff --git a/.github/workflows/common-config.yml b/.github/workflows/common-config.yml index 8ffb56c..5f33489 100644 --- a/.github/workflows/common-config.yml +++ b/.github/workflows/common-config.yml @@ -69,7 +69,7 @@ jobs: - run: yarn install --no-frozen-lockfile - name: Build - run: yarn ${{ inputs.PACKAGE_BUILD_SCRIPT }} + run: ${{ inputs.PACKAGE_BUILD_SCRIPT }} - name: Check if version has been updated id: check diff --git a/.github/workflows/release-controlhub-demo.yml b/.github/workflows/release-controlhub-demo.yml new file mode 100644 index 0000000..e449743 --- /dev/null +++ b/.github/workflows/release-controlhub-demo.yml @@ -0,0 +1,36 @@ +name: Update AdminConsole Frontend + +on: + workflow_dispatch: + + pull_request: + types: + - opened + branches: + - 'main' + - 'bug/fix-0729_beta' + paths: + - 'apps/adminConsole/package.json' + push: + branches: + - 'main' + - 'chore/apps' + paths: + - 'apps/adminConsole/**' + - 'apps/common/**' + - .github/workflows/update-admin-console.yml + - .github/workflows/common-config.yml + - nginx.conf + +jobs: + call-nodes-ci: + uses: ./.github/workflows/common-config.yml + with: + NODE_VERSION: '16.14' + PACKAGE_NAME: controlhub-demo + PACKAGE_PATH: apps/adminConsole/package.json + DIR_PATH: apps/adminConsole + DOCKERFILE_PATH: Dockerfile-admin-console-client + PACKAGE_BUILD_SCRIPT: DEMO=true yarn build:console + DEFAULT_VERSION: latest + secrets: inherit diff --git a/.github/workflows/update-admin-console.yml b/.github/workflows/update-admin-console.yml index 7e7061e..2917f22 100644 --- a/.github/workflows/update-admin-console.yml +++ b/.github/workflows/update-admin-console.yml @@ -3,14 +3,6 @@ name: Update AdminConsole Frontend on: workflow_dispatch: - pull_request: - types: - - opened - branches: - - 'main' - - 'bug/fix-0729_beta' - paths: - - 'apps/adminConsole/package.json' push: branches: - 'main' @@ -31,6 +23,6 @@ jobs: PACKAGE_PATH: apps/adminConsole/package.json DIR_PATH: apps/adminConsole DOCKERFILE_PATH: Dockerfile-admin-console-client - PACKAGE_BUILD_SCRIPT: build:console + PACKAGE_BUILD_SCRIPT: yarn build:console DEFAULT_VERSION: latest secrets: inherit diff --git a/.github/workflows/update-monitoring.yml b/.github/workflows/update-monitoring.yml index 3560313..9f3953c 100644 --- a/.github/workflows/update-monitoring.yml +++ b/.github/workflows/update-monitoring.yml @@ -25,6 +25,6 @@ jobs: PACKAGE_PATH: apps/monitoring/package.json DIR_PATH: apps/monitoring DOCKERFILE_PATH: Dockerfile-monitoring-client - PACKAGE_BUILD_SCRIPT: build:monitoring + PACKAGE_BUILD_SCRIPT: yarn build:monitoring DEFAULT_VERSION: latest secrets: inherit diff --git a/.github/workflows/update-server.yml b/.github/workflows/update-server.yml index 6ecb38a..6555a00 100644 --- a/.github/workflows/update-server.yml +++ b/.github/workflows/update-server.yml @@ -3,13 +3,6 @@ name: Update Server on: workflow_dispatch: - pull_request: - types: - - opened - branches: - - 'main' - paths: - - 'apps/server/package.json' push: branches: - 'main' diff --git a/apps/adminConsole/quasar.config.js b/apps/adminConsole/quasar.config.js index 34d0cf6..045176f 100644 --- a/apps/adminConsole/quasar.config.js +++ b/apps/adminConsole/quasar.config.js @@ -58,7 +58,8 @@ module.exports = configure(function (ctx) { LOGIN_USERNAME: process.env.LOGIN_USERNAME, LOGIN_PASSWORD: process.env.LOGIN_PASSWORD, AUTH_TOKEN: process.env.AUTH_TOKEN, - ACCOUNT: process.env.ACCOUNT + ACCOUNT: process.env.ACCOUNT, + DEMO: process.env.DEMO }, // Add dependencies for transpiling with Babel (Array of string/regex) diff --git a/apps/adminConsole/src/layouts/MainLayout.vue b/apps/adminConsole/src/layouts/MainLayout.vue index 66db932..cfb71a3 100644 --- a/apps/adminConsole/src/layouts/MainLayout.vue +++ b/apps/adminConsole/src/layouts/MainLayout.vue @@ -25,6 +25,7 @@ import { onMounted, computed } from 'vue'; import { useRouter, useRoute } from 'vue-router'; import { useSplitMenu } from '@packages/ui/src/stores/menu'; import { useI18n } from 'vue-i18n'; +import { useAppDetailStore } from 'src/stores/AppDetail'; import { updateBreadcrumbs, options, @@ -34,26 +35,32 @@ import { options3 } from './breadcrumbs'; const { t } = useI18n(); - +const appDetailStore = useAppDetailStore(); const splitMenu = useSplitMenu(); -const items = computed(() => [ - { - key: 'terminus', - label: t('TERMINUS'), - children: options.value - }, - { - key: 'resource', - label: t('RESOURCE'), - children: options2.value - }, - { - key: 'middleware', - label: t('MIDDLEWARE'), - children: options3.value - } -]); +const items = computed(() => { + const item1 = [ + { + key: 'terminus', + label: t('TERMINUS'), + children: options.value + }, + { + key: 'resource', + label: t('RESOURCE'), + children: options2.value + } + ]; + const item2 = [ + { + key: 'middleware', + label: t('MIDDLEWARE'), + children: options3.value + } + ]; + + return appDetailStore.isDemo ? item1 : item1.concat(item2); +}); const optionsAll = [...options.value, ...options2.value, ...options3.value]; diff --git a/apps/adminConsole/src/layouts/breadcrumbs.ts b/apps/adminConsole/src/layouts/breadcrumbs.ts index 21c8819..285702d 100644 --- a/apps/adminConsole/src/layouts/breadcrumbs.ts +++ b/apps/adminConsole/src/layouts/breadcrumbs.ts @@ -1,5 +1,6 @@ import { ref, computed } from 'vue'; import { t } from 'src/boot/i18n'; +import { useAppDetailStore } from 'src/stores/AppDetail'; export interface Breadcrumb { title: string; icon?: string; @@ -83,11 +84,13 @@ export const options3 = computed(() => [ } ]); -const optionAll = computed(() => [ - ...options.value, - ...options2.value, - ...options3.value -]); +const optionAll = computed(() => { + const appDetailsStore = useAppDetailStore(); + + return appDetailsStore.isDemo + ? [...options.value, ...options2.value] + : [...options.value, ...options2.value, ...options3.value]; +}); export const active = ref(optionAll.value[0].key); export const currentItem = computed(() => optionAll.value.find((item) => item.key === active.value) diff --git a/apps/adminConsole/src/pages/ApplicationSpaces/Configurations/Configmaps.vue b/apps/adminConsole/src/pages/ApplicationSpaces/Configurations/Configmaps.vue index e24016f..a118e95 100644 --- a/apps/adminConsole/src/pages/ApplicationSpaces/Configurations/Configmaps.vue +++ b/apps/adminConsole/src/pages/ApplicationSpaces/Configurations/Configmaps.vue @@ -2,7 +2,7 @@