Compare commits
1
Commits
v2.0.0
..
3d5c80620e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d5c80620e |
@@ -0,0 +1,33 @@
|
||||
name: ProxmoxAAS-Dashboard Go Server Static Analysis Check
|
||||
run-name: Static analysis check on go server in ${{ gitea.repository }} ${{ gitea.ref_name }} ${{ gitea.sha }}
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
lint-check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check Out Repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: 'true'
|
||||
|
||||
- name: Initialize Runner
|
||||
uses: actions/setup-go@v7
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
|
||||
- name: Initialize Go
|
||||
run: make build-web && go get .
|
||||
|
||||
- name: Run Go Vet
|
||||
id: static_govet
|
||||
if: always()
|
||||
run: go vet ./...
|
||||
|
||||
- name: Verify Static Analysis
|
||||
if: >
|
||||
steps.static_govet.outcome != 'success'
|
||||
run: exit 1
|
||||
@@ -0,0 +1,56 @@
|
||||
name: ProxmoxAAS-Dashboard Web Components Style Check
|
||||
run-name: Code style check on web components in ${{ gitea.repository }} ${{ gitea.ref_name }} ${{ gitea.sha }}
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
lint-check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check Out Repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Initialize Runner
|
||||
uses: actions/setup-node@v4
|
||||
|
||||
- name: Install Linters
|
||||
run: |
|
||||
npm install --no-save \
|
||||
@eslint/eslintrc \
|
||||
@eslint/js \
|
||||
eslint \
|
||||
globals \
|
||||
html-validate \
|
||||
stylelint \
|
||||
stylelint-config-standard
|
||||
|
||||
- name: Verify Linters
|
||||
run: |
|
||||
npx html-validate --version
|
||||
npx stylelint --version
|
||||
npx eslint --version
|
||||
|
||||
- name: Run HTMLValidate
|
||||
id: html_lint
|
||||
run: npx html-validate --config dev_config/.htmlvalidate.json 'web/html/**/*'
|
||||
|
||||
- name: Run Stylelint
|
||||
id: style_lint
|
||||
if: always()
|
||||
run: npx stylelint --config dev_config/.stylelintrc.json --formatter verbose --fix 'web/css/**/*.css'
|
||||
|
||||
- name: Run ESLint
|
||||
id: js_lint
|
||||
if: always()
|
||||
env:
|
||||
DEBUG: eslint:cli-engine
|
||||
run: npx eslint --config dev_config/eslint.config.mjs --fix web/scripts/
|
||||
|
||||
- name: Verify Linters
|
||||
if: >
|
||||
steps.html_lint.outcome != 'success' ||
|
||||
steps.style_lint.outcome != 'success' ||
|
||||
steps.js_lint.outcome != 'success'
|
||||
run: exit 1
|
||||
@@ -1,3 +1,5 @@
|
||||
**/config.json
|
||||
**/package-lock.json
|
||||
**/node_modules
|
||||
dist/*
|
||||
go.sum
|
||||
@@ -1,10 +1,13 @@
|
||||
.PHONY: build build-web build-wfa-js clean clean-wfa-js ensure-dist workflow-init
|
||||
.PHONY: build test clean wfa-js
|
||||
|
||||
build: clean ensure-dist build-web build-wfa-js
|
||||
@echo "======================== Building Binary ======================="
|
||||
# resolve symbolic links in web by copying it into dist/web/
|
||||
CGO_ENABLED=0 go build -tags release -ldflags="-s -w" -v -o dist/ .
|
||||
|
||||
ensure-dist:
|
||||
mkdir -p dist
|
||||
|
||||
build-web: ensure-dist
|
||||
cp -rL web/ dist/web/
|
||||
|
||||
@@ -19,9 +22,3 @@ clean: clean-wfa-js
|
||||
|
||||
clean-wfa-js:
|
||||
$(MAKE) clean -C WFA-JS
|
||||
|
||||
ensure-dist:
|
||||
mkdir -p dist
|
||||
|
||||
workflow-init: ensure-dist build-web
|
||||
cp -r dev_config/. .
|
||||
+1
-1
@@ -6,7 +6,7 @@ import (
|
||||
"log"
|
||||
"proxmoxaas-dashboard/app/common"
|
||||
"proxmoxaas-dashboard/app/routes"
|
||||
"web" // go will complain here until the first build
|
||||
"proxmoxaas-dashboard/dist/web" // go will complain here until the first build
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/tdewolff/minify/v2"
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
web/modules/*
|
||||
WFA-JS/*
|
||||
dist/*
|
||||
@@ -1,3 +0,0 @@
|
||||
web/modules/*
|
||||
WFA-JS/*
|
||||
dist/*
|
||||
@@ -1,33 +1,29 @@
|
||||
import { defineConfig, globalIgnores } from "eslint/config";
|
||||
import { defineConfig } from "eslint/config";
|
||||
import globals from "globals";
|
||||
import js from "@eslint/js";
|
||||
|
||||
export default defineConfig([
|
||||
js.configs.recommended,
|
||||
globalIgnores(["dist/", "web/modules", "WFA-JS"]),
|
||||
{
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.browser,
|
||||
},
|
||||
ecmaVersion: "latest",
|
||||
sourceType: "module",
|
||||
export default defineConfig([js.configs.recommended,{
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.browser,
|
||||
},
|
||||
rules: {
|
||||
"no-tabs": ["error", {
|
||||
allowIndentationTabs: true,
|
||||
}],
|
||||
indent: ["error", "tab"],
|
||||
"linebreak-style": ["error", "unix"],
|
||||
quotes: ["error", "double"],
|
||||
semi: ["error", "always"],
|
||||
"brace-style": ["error", "stroustrup", { allowSingleLine: false }],
|
||||
"no-unused-vars": ["warn", {
|
||||
"argsIgnorePattern": "^_",
|
||||
"varsIgnorePattern": "^_",
|
||||
"caughtErrorsIgnorePattern": "^_"
|
||||
}],
|
||||
"prefer-const": ["error"]
|
||||
},
|
||||
}
|
||||
]);
|
||||
ecmaVersion: "latest",
|
||||
sourceType: "module",
|
||||
},
|
||||
rules: {
|
||||
"no-tabs": ["error", {
|
||||
allowIndentationTabs: true,
|
||||
}],
|
||||
indent: ["error", "tab"],
|
||||
"linebreak-style": ["error", "unix"],
|
||||
quotes: ["error", "double"],
|
||||
semi: ["error", "always"],
|
||||
"brace-style": ["error", "stroustrup", { allowSingleLine: false }],
|
||||
"no-unused-vars": ["warn", {
|
||||
"argsIgnorePattern": "^_",
|
||||
"varsIgnorePattern": "^_",
|
||||
"caughtErrorsIgnorePattern": "^_"
|
||||
}],
|
||||
"prefer-const": ["error"]
|
||||
},
|
||||
}]);
|
||||
@@ -8,11 +8,9 @@ require (
|
||||
github.com/go-viper/mapstructure/v2 v2.5.0
|
||||
github.com/tdewolff/minify/v2 v2.24.13
|
||||
proxmoxaas-common-lib v0.0.0
|
||||
web v0.0.0
|
||||
)
|
||||
|
||||
replace proxmoxaas-common-lib => ./proxmoxaas-common-lib
|
||||
replace web => ./dist/web
|
||||
|
||||
require (
|
||||
github.com/bytedance/gopkg v0.1.4 // indirect
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
module web
|
||||
|
||||
go 1.26.0
|
||||
@@ -96,7 +96,7 @@ class ErrorDialog extends HTMLElement {
|
||||
}
|
||||
navigator.clipboard.writeText(errors);
|
||||
}
|
||||
this.dialog.close();
|
||||
this.parentElement.removeChild(this);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ window.addEventListener("DOMContentLoaded", init);
|
||||
async function init () {
|
||||
await deleteAllCookies();
|
||||
setAppearance();
|
||||
|
||||
const formSubmitButton = document.querySelector("#submit");
|
||||
formSubmitButton.addEventListener("click", async (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
Reference in New Issue
Block a user