chore(ci): improve webui build and lint

This commit is contained in:
Michel Loiseleur 2024-06-07 16:56:04 +02:00 committed by GitHub
parent c23c3e0ed3
commit 5c48e3c96c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 76 additions and 47 deletions

View file

@ -20,9 +20,21 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: webui/.nvmrc
cache: yarn
cache-dependency-path: webui/yarn.lock
- name: Build webui - name: Build webui
working-directory: ./webui
run: |
yarn install
yarn build
- name: Package webui
run: | run: |
make clean-webui generate-webui
tar czvf webui.tar.gz ./webui/static/ tar czvf webui.tar.gz ./webui/static/
- name: Artifact webui - name: Artifact webui

View file

@ -25,9 +25,18 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: webui/.nvmrc
cache: yarn
cache-dependency-path: webui/yarn.lock
- name: Build webui - name: Build webui
working-directory: ./webui
run: | run: |
make clean-webui generate-webui yarn install
yarn build
- name: Set up Go ${{ env.GO_VERSION }} - name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5 uses: actions/setup-go@v5

View file

@ -1,4 +1,4 @@
FROM node:20.11 FROM node:20.14
# Current Active LTS release according to (https://nodejs.org/en/about/releases/) # Current Active LTS release according to (https://nodejs.org/en/about/releases/)
ENV WEBUI_DIR /src/webui ENV WEBUI_DIR /src/webui

View file

@ -8,10 +8,10 @@
"scripts": { "scripts": {
"transfer": "node dev/scripts/transfer.js", "transfer": "node dev/scripts/transfer.js",
"lint": "eslint --ext .js,.vue src", "lint": "eslint --ext .js,.vue src",
"dev": "export APP_ENV='development' && quasar dev", "dev": "APP_ENV=development quasar dev",
"build-quasar": "quasar build", "build-quasar": "quasar build",
"build-staging": "export NODE_ENV='production' && export APP_ENV='development' && yarn build-quasar", "build-staging": "NODE_ENV=production APP_ENV=development yarn build-quasar",
"build": "export NODE_ENV='production' && export APP_ENV='production' && yarn build-quasar && yarn transfer spa", "build": "NODE_ENV=production APP_ENV=production yarn build-quasar && yarn transfer spa",
"build:nc": "yarn build", "build:nc": "yarn build",
"test": "echo \"See package.json => scripts for available tests.\" && exit 0", "test": "echo \"See package.json => scripts for available tests.\" && exit 0",
"test:unit": "vitest", "test:unit": "vitest",
@ -56,6 +56,7 @@
"engines": { "engines": {
"node": "^20 || ^18 || ^16", "node": "^20 || ^18 || ^16",
"npm": ">= 6.13.4", "npm": ">= 6.13.4",
"yarn": ">= 1.21.1" "yarn": ">= 1.22.22"
} },
"packageManager": "yarn@1.22.22"
} }

View file

@ -20,7 +20,7 @@ make clean-webui generate-webui # Generate static contents in `webui/static/` fo
## How to build (only for frontend developer) ## How to build (only for frontend developer)
- prerequisite: [Node 20.11+](https://nodejs.org) [Yarn 1.22.19](https://yarnpkg.com/) - prerequisite: [Node 20.14+](https://nodejs.org) [Yarn 1.22.22](https://yarnpkg.com/)
- Go to the `webui/` directory - Go to the `webui/` directory

View file

@ -24,7 +24,7 @@ import { defineComponent } from 'vue'
export default defineComponent({ export default defineComponent({
name: 'AvatarState', name: 'AvatarState',
props: { props: {
state: String state: { type: String, default: undefined, required: false }
} }
}) })
</script> </script>

View file

@ -104,12 +104,12 @@ export default defineComponent({
QPageScroller QPageScroller
}, },
props: { props: {
data: Object, data: { type: Object, default: undefined, required: false },
columns: Array[Object], columns: Array[Object],
loading: Boolean, loading: Boolean,
onLoadMore: Function, onLoadMore: { type: Function, default: undefined, required: false },
endReached: Boolean, endReached: Boolean,
onRowClick: Function onRowClick: { type: Function, default: undefined, required: false }
}, },
methods: { methods: {
getColumn (columnName) { getColumn (columnName) {

View file

@ -137,7 +137,7 @@ export default {
filters: { filters: {
}, },
props: { props: {
data: Object, data: { type: Object, default: undefined, required: false },
dense: Boolean dense: Boolean
}, },
computed: { computed: {

View file

@ -75,8 +75,8 @@
ERRORS ERRORS
</div> </div>
<q-chip <q-chip
v-for="(errorMsg, index) in middleware.error" v-for="(errorMsg, errorIndex) in middleware.error"
:key="index" :key="errorIndex"
class="app-chip app-chip-error" class="app-chip app-chip-error"
> >
{{ errorMsg }} {{ errorMsg }}

View file

@ -70,7 +70,7 @@
export default { export default {
name: 'PanelMirroringServices', name: 'PanelMirroringServices',
props: { props: {
data: Object, data: { type: Object, default: undefined, required: false },
dense: Boolean dense: Boolean
}, },
computed: { computed: {

View file

@ -131,8 +131,8 @@ export default defineComponent({
AvatarState AvatarState
}, },
props: { props: {
data: Object, data: { type: Object, default: undefined, required: false },
protocol: String protocol: { type: String, default: undefined, required: false }
}, },
computed: { computed: {
getProviderLogoPath () { getProviderLogoPath () {

View file

@ -102,7 +102,7 @@ export default defineComponent({
AvatarState AvatarState
}, },
props: { props: {
data: Object, data: { type: Object, default: undefined, required: false },
dense: Boolean, dense: Boolean,
hasStatus: Boolean hasStatus: Boolean
}, },

View file

@ -171,7 +171,7 @@ export default defineComponent({
StickyServiceDetails StickyServiceDetails
}, },
props: { props: {
data: Object, data: { type: Object, default: undefined, required: false },
dense: Boolean dense: Boolean
}, },
computed: { computed: {

View file

@ -77,12 +77,12 @@
{{ domain.main }} {{ domain.main }}
</q-chip> </q-chip>
<q-chip <q-chip
v-for="(domain, key) in domain.sans" v-for="(sanDomain, sanKey) in domain.sans"
:key="key" :key="sanKey"
dense dense
class="app-chip app-chip-entry-points" class="app-chip app-chip-entry-points"
> >
{{ domain }} {{ sanDomain }}
</q-chip> </q-chip>
</div> </div>
</div> </div>
@ -130,8 +130,8 @@ export default defineComponent({
BooleanState BooleanState
}, },
props: { props: {
data: Object, data: { type: Object, default: undefined, required: false },
protocol: String protocol: { type: String, default: undefined, required: false }
} }
}) })
</script> </script>

View file

@ -66,7 +66,7 @@ export default defineComponent({
name: 'PanelWeightedServices', name: 'PanelWeightedServices',
components: {}, components: {},
props: { props: {
data: Object, data: { type: Object, default: undefined, required: false },
dense: Boolean dense: Boolean
}, },
computed: { computed: {

View file

@ -9,7 +9,7 @@ import { defineComponent } from 'vue'
export default defineComponent({ export default defineComponent({
props: { props: {
name: String name: { type: String, default: undefined, required: false }
}, },
computed: { computed: {
getLogoPath () { getLogoPath () {

View file

@ -55,7 +55,7 @@ export default defineComponent({
BooleanState BooleanState
}, },
props: { props: {
sticky: Object, sticky: { type: Object, default: undefined, required: false },
dense: Boolean dense: Boolean
} }
}) })

View file

@ -42,9 +42,10 @@ import Helps from '../../_helpers/Helps'
export default defineComponent({ export default defineComponent({
name: 'ToolBarTable', name: 'ToolBarTable',
props: { props: {
status: String, status: { type: String, default: undefined, required: false },
filter: String filter: { type: String, default: undefined, required: false }
}, },
emits: ['update:status', 'update:filter'],
computed: { computed: {
getStatus: { getStatus: {
get () { get () {

View file

@ -118,9 +118,9 @@ export default defineComponent({
AvatarState AvatarState
}, },
props: { props: {
name: String, name: { type: String, default: undefined, required: false },
data: Object, data: { type: Object, default: undefined, required: false },
type: String type: { type: String, default: undefined, required: false }
}, },
data () { data () {
return { return {

View file

@ -28,11 +28,11 @@ import { defineComponent } from 'vue'
export default defineComponent({ export default defineComponent({
name: 'PanelEntry', name: 'PanelEntry',
props: { props: {
address: String, address: { type: String, default: undefined, required: false },
name: String, name: { type: String, default: undefined, required: false },
type: String, type: { type: String, default: undefined, required: false },
focus: Boolean, focus: Boolean,
exSize: Number exSize: { type: Number, default: undefined, required: false }
} }
}) })
</script> </script>

View file

@ -28,7 +28,10 @@
<script> <script>
export default { export default {
name: 'PanelFeature', name: 'PanelFeature',
props: ['featureKey', 'featureVal'], props: {
featureKey: { type: String, default: undefined, required: false },
featureVal: { type: [String, Boolean], default: undefined, required: false }
},
computed: { computed: {
isString () { isString () {
return typeof this.featureVal === 'string' return typeof this.featureVal === 'string'

View file

@ -6,7 +6,10 @@
<q-card-section> <q-card-section>
<div class="row items-center no-wrap"> <div class="row items-center no-wrap">
<div class="col text-center"> <div class="col text-center">
<q-avatar class="provider-logo" font-size="inherit"> <q-avatar
class="provider-logo"
font-size="inherit"
>
<q-icon :name="`img:${getLogoPath}`" /> <q-icon :name="`img:${getLogoPath}`" />
</q-avatar> </q-avatar>
</div> </div>
@ -26,7 +29,7 @@ import { defineComponent } from 'vue'
export default defineComponent({ export default defineComponent({
name: 'PanelProvider', name: 'PanelProvider',
props: { props: {
name: String name: { type: String, default: undefined, required: false }
}, },
computed: { computed: {
getName () { getName () {

View file

@ -113,8 +113,8 @@ export default defineComponent({
}, },
mixins: [GetTablePropsMixin], mixins: [GetTablePropsMixin],
props: { props: {
name: String, name: { type: String, default: undefined, required: false },
type: String type: { type: String, default: undefined, required: false }
}, },
data () { data () {
return { return {

View file

@ -281,8 +281,8 @@ export default defineComponent({
PanelMiddlewares PanelMiddlewares
}, },
props: { props: {
name: String, name: { type: String, default: undefined, required: false },
type: String type: { type: String, default: undefined, required: false }
}, },
data () { data () {
return { return {

View file

@ -224,8 +224,8 @@ export default defineComponent({
}, },
mixins: [GetTablePropsMixin], mixins: [GetTablePropsMixin],
props: { props: {
name: String, name: { type: String, default: undefined, required: false },
type: String type: { type: String, default: undefined, required: false }
}, },
data () { data () {
return { return {