Skip to content

Commit 2f00828

Browse files
committed
add build step for demo dashboard
fix webui mode for website
1 parent aba1c5e commit 2f00828

8 files changed

Lines changed: 26 additions & 7 deletions

File tree

.github/actions/publish-website/action.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: "Publish website"
22
description: "Publish website to web hosting"
33
inputs:
4+
image-name:
5+
required: true
6+
description: Mokapi image name
47
username:
58
required: true
69
description: ftp username
@@ -26,6 +29,17 @@ runs:
2629
repository: marle3003/mokapi
2730
excludes: prerelease, draft
2831
token: ${{ inputs.token }}
32+
- name: Run mokapi image
33+
run: docker run --name mokapi --rm -d -p 80:80 -p 8080:8080 -p 9092:9092 -p 8389:8389 -p 8025:8025 --mount type=bind,source=$(pwd)/webui/scripts/dashboard-demo/demo-configs,target=/data --env MOKAPI_Providers_File_Directory=/data ${{ inputs.image-name }}
34+
shell: bash
35+
- name: Build Demo Dashboard
36+
working-directory: ./webui/scripts/dashboard-demo/demo-configs
37+
run: node ci.ts
38+
shell: bash
39+
- name: Stop Mokapi
40+
if: always()
41+
run: docker stop mokapi || true
42+
shell: bash
2943
- name: build website
3044
working-directory: ./webui
3145
run: |

.github/actions/run-frontend-tests/action.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,8 @@ runs:
5959
uses: actions/upload-artifact@v4
6060
with:
6161
name: mokapi-test-logs
62-
path: /var/tmp/mokapi.log
62+
path: /var/tmp/mokapi.log
63+
- name: Stop Mokapi
64+
if: always()
65+
run: docker stop mokapi || true
66+
shell: bash

.github/workflows/alpha.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
name: Publish website
7575
runs-on: ubuntu-latest
7676
if: "success()"
77-
needs: [ build-alpha ]
77+
needs: [ setup, build-alpha ]
7878
steps:
7979
- name: Check out code
8080
uses: actions/checkout@v4
@@ -84,6 +84,7 @@ jobs:
8484
uses: chetan/git-restore-mtime-action@v2
8585
- uses: ./.github/actions/publish-website
8686
with:
87+
image-name: ${{ needs.setup.outputs.image-name }}
8788
username: ${{ secrets.FTP_USERNAME }}
8889
password: ${{ secrets.FTP_PASSWORD }}
8990
server: ${{ secrets.FTP_SERVER }}

webui/.env.dashboard

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
VITE_WEBSITE=false
2-
VITE_USE_DEMO=false
2+
VITE_USE_DEMO=false
3+
VITE_DASHBOARD=true

webui/.env.website

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
VITE_WEBSITE=true
2-
VITE_USE_DEMO=true
2+
VITE_USE_DEMO=true
3+
VITE_DASHBOARD=false

webui/src/components/Header.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { Modal } from 'bootstrap';
1010
1111
const isDashboard = import.meta.env.VITE_DASHBOARD === 'true'
1212
const useDemo = import.meta.env.VITE_USE_DEMO === 'true'
13-
console.log(useDemo);
1413
let appInfo: AppInfoResponse | null = null
1514
const query = ref('')
1615
const tooltipDark = 'Switch to light mode';

webui/src/composables/dashboard.demo.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ watchEffect(async () => {
2323
export const dashboard: Dashboard = {
2424

2525
getServices(type) {
26-
console.log(data.value)
2726
let result = []
2827
if (demo.value) {
2928
const response = demo.value['services']

webui/src/router/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ if (import.meta.env.VITE_DASHBOARD === 'true') {
303303
router.addRoute(createDashboardRoute('live'));
304304
}
305305
if (import.meta.env.VITE_USE_DEMO === 'true') {
306-
createDashboardRoute('demo')
306+
router.addRoute(createDashboardRoute('demo'));
307307
}
308308

309309

0 commit comments

Comments
 (0)