1 Commits
Author SHA1 Message Date
alu 27e7e2771f add lint workflow
ProxmoxAAS-Dashboard Code Style Check / lint-check (push) Failing after 10s
2026-07-29 02:53:55 +00:00
17 changed files with 93 additions and 66 deletions
+32
View File
@@ -0,0 +1,32 @@
name: ProxmoxAAS-Dashboard Code Style Check
run-name: Code style check on ${{gitea.repository}} ${{gitea.ref}} ${{gitea.sha}}
on: [push]
jobs:
lint-check:
runs-on: ubuntu-latest
steps:
- name: Initialize ${{runner.os}} ${{runner.arch}}
uses: actions/setup-node@v4
- name: Install linters
run: |
npm install -g \
@eslint/eslintrc \
@eslint/js \
eslint \
globals \
html-validate \
stylelint \
stylelint-config-standard
- name: Verify linters
run: |
eslint --version
stylelint --version
html-validate --version
- name: Check out ${{gitea.repository}} ${{gitea.ref}} ${{gitea.sha}}
uses: actions/checkout@v4
- name: Run Linters
run: |
html-validate --config dev_config/.htmlvalidate.json web/html/*; \
stylelint --config dev_config/.stylelintrc.json --formatter verbose web/css/*.css; \
eslint --config dev_config/eslint.config.mjs web/scripts/
+2
View File
@@ -1,3 +1,5 @@
**/config.json
**/package-lock.json
**/node_modules
dist/*
go.sum
+5 -12
View File
@@ -1,14 +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
build: clean build-wfa-js
@echo "======================== Building Binary ======================="
mkdir -p dist
# resolve symbolic links in web by copying it into dist/web/
cp -rL web/ dist/web/
CGO_ENABLED=0 go build -tags release -ldflags="-s -w" -v -o dist/ .
build-web: ensure-dist
cp -rL web/ dist/web/
build-wfa-js: ensure-dist
build-wfa-js:
$(MAKE) -C WFA-JS
cp -f WFA-JS/dist/* web/modules
@@ -19,9 +18,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
Submodule WFA-JS updated: f53f344fb3...f8f8636cc3
+1 -1
View File
@@ -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"
-3
View File
@@ -1,3 +0,0 @@
web/modules/*
WFA-JS/*
dist/*
-3
View File
@@ -1,3 +0,0 @@
web/modules/*
WFA-JS/*
dist/*
+25 -29
View File
@@ -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"]
},
}]);
-2
View File
@@ -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
+18
View File
@@ -0,0 +1,18 @@
{
"name": "proxmoxaas-dashboard",
"version": "1.0.0",
"description": "Front-end for ProxmoxAAS",
"type": "module",
"scripts": {
"lint": "html-validate --config dev_config/.htmlvalidate.json web/html/*; stylelint --config dev_config/.stylelintrc.json --formatter verbose --fix web/css/*.css; DEBUG=eslint:cli-engine eslint --config dev_config/eslint.config.mjs --fix web/scripts/"
},
"devDependencies": {
"@eslint/eslintrc": "^3.3.5",
"@eslint/js": "^10.0.1",
"eslint": "^10.2.1",
"globals": "^17.5.0",
"html-validate": "^9.4.0",
"stylelint": "^15.9.0",
"stylelint-config-standard": "^33.0.0"
}
}
-3
View File
@@ -1,3 +0,0 @@
module web
go 1.26.0
+2 -2
View File
@@ -58,9 +58,9 @@
<div id="body">
<form method="dialog" class="input-grid" style="grid-template-columns: auto 1fr;" id="form">
<label for="new-password">New Password</label>
<input class="w3-input w3-border" id="new-password" name="new-password" type="password" autocomplete="new-password" required>
<input class="w3-input w3-border" id="new-password" name="new-password" type="password" required>
<label for="confirm-password">Confirm Password</label>
<input class="w3-input w3-border" id="confirm-password" name="confirm-password" type="password" autocomplete="new-password" required>
<input class="w3-input w3-border" id="confirm-password" name="confirm-password" type="password" required>
</form>
</div>
<div id="controls" class="w3-center w3-container">
+2 -2
View File
@@ -114,9 +114,9 @@
<label class="container-specific none" for="rootfs-size">ROOTFS Size (GiB)</label>
<input class="w3-input w3-border container-specific none" name="rootfs-size" id="rootfs-size" type="number" min="0" max="131072" required disabled>
<label class="container-specific none" for="password">Password</label>
<input class="w3-input w3-border container-specific none" name="password" id="password" type="password" autocomplete="new-password" required disabled>
<input class="w3-input w3-border container-specific none" name="password" id="password" type="password" required disabled>
<label class="container-specific none" for="confirm-password">Confirm Password</label>
<input class="w3-input w3-border container-specific none" name="confirm-password" id="confirm-password" type="password" autocomplete="new-password" required disabled>
<input class="w3-input w3-border container-specific none" name="confirm-password" id="confirm-password" type="password" required disabled>
</form>
</div>
<div id="controls" class="w3-center w3-container">
+1 -1
View File
@@ -560,7 +560,7 @@ export default function init (path) {
const wasm = obj.instance;
global.wfa = wasm
go.run(wasm);
res(wasm)
res()
}
if ('instantiateStreaming' in WebAssembly) {
WebAssembly.instantiateStreaming(fetch(path), go.importObject).then(function (obj) {
+1 -1
View File
@@ -96,7 +96,7 @@ class ErrorDialog extends HTMLElement {
}
navigator.clipboard.writeText(errors);
}
this.dialog.close();
this.parentElement.removeChild(this);
});
}
+3 -5
View File
@@ -5,12 +5,10 @@ import wfaInit from "../modules/wfa.js";
window.addEventListener("DOMContentLoaded", init);
var wfa;
async function init () {
setAppearance();
wfa = await wfaInit("modules/wfa.wasm");
wfaInit("modules/wfa.wasm");
initInstances();
document.querySelector("#instance-add").addEventListener("click", handleInstanceAddButton);
@@ -274,8 +272,8 @@ function sortInstances () {
};
criteria = (item, query) => {
// lower is better
const { score, CIGAR } = wfa.wfAlign(query, item, penalties, true);
const alignment = wfa.DecodeCIGAR(CIGAR);
const { score, CIGAR } = global.wfa.wfAlign(query, item, penalties, true);
const alignment = global.wfa.DecodeCIGAR(CIGAR);
return { score: score / item.length, alignment };
};
}
-1
View File
@@ -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();