From 760c36a89a705edd7f4399e8f96a8ec26f2ca77d Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Tue, 23 Sep 2025 14:01:58 +0100 Subject: [PATCH] Issue templates, deployment workflow, dynamic favicon, offline warning --- .github/ISSUE_TEMPLATE/bug_report.yml | 56 +++++++++ .github/ISSUE_TEMPLATE/config.yml | 11 ++ .github/ISSUE_TEMPLATE/deployment.yml | 25 ++++ .github/ISSUE_TEMPLATE/deployment_issue.yml | 57 +++++++++ .github/ISSUE_TEMPLATE/question_feedback.yml | 25 ++++ .github/README.md | 41 +++++-- .github/workflows/github-pages.yml | 75 ++++++++++++ .gitignore | 1 + biome.json | 34 ------ package.json | 2 + playwright.config.ts | 2 +- .../components/furniture/SettingsMenu.svelte | 11 +- src/lib/constants/icon-map.ts | 3 +- src/lib/stores/theme.ts | 52 ++++++-- src/lib/utils/favicon.ts | 28 +++-- src/routes/+layout.svelte | 7 +- src/routes/diagnostics/+layout.svelte | 102 ++++++++++++++++ src/styles/variables.scss | 113 +++++++++++++++++- static/404.html | 76 ++++++++++++ static/favicon.ico | Bin 0 -> 1150 bytes svelte.config.js | 10 +- 21 files changed, 661 insertions(+), 70 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/deployment.yml create mode 100644 .github/ISSUE_TEMPLATE/deployment_issue.yml create mode 100644 .github/ISSUE_TEMPLATE/question_feedback.yml create mode 100644 .github/workflows/github-pages.yml delete mode 100644 biome.json create mode 100644 src/routes/diagnostics/+layout.svelte create mode 100644 static/404.html create mode 100644 static/favicon.ico diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..b38ef7c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,56 @@ +name: 🐛 Bug Report +description: Something is not working as expected +title: "[Bug]: " +labels: ["bug", "needs-triage"] +assignees: [] + +body: + - type: dropdown + id: bug-type + attributes: + label: Bug Type + description: What kind of issue is this? + options: + - Tool gives incorrect output + - Error/crash + - UI bug + - Performance issue + - Other + validations: + required: true + + - type: textarea + id: details + attributes: + label: Expected output, actual output, steps to recreate + description: | + Please provide: + - What you expected to happen + - What actually happened + - Steps to recreate the issue + placeholder: | + Expected: The subnet calculator should show... + Actual: It shows/does... + Steps: 1. Go to... 2. Enter... 3. Click... + validations: + required: true + + - type: textarea + id: additional + attributes: + label: Additional Info + description: Logs, screenshots, browser info, input data, etc. + placeholder: | + Browser: Chrome 120 + Input: 192.168.1.0/24 + Screenshots/logs: (paste here) + + - type: checkboxes + id: checklist + attributes: + label: Checklist + options: + - label: I have searched existing issues to make sure this bug hasn't been reported before + required: true + - label: I agree to follow the [Code of Conduct](https://github.com/Lissy93/networking-toolbox/?tab=coc-ov-file#contributor-covenant-code-of-conduct) + required: true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..3e74f6e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,11 @@ +blank_issues_enabled: false +contact_links: + - name: ⚠️ Report a security vulnerability + url: https://github.com/lissy93/networking-toolbox/security/policy + about: Please do NOT open a public issue for unresolved security problems. + - name: 💬 Questions / Support / How-to + url: https://github.com/lissy93/networking-toolbox/discussions + about: Ask usage questions or get help in Discussions. + - name: 📚 Documentation and About + url: https://networking-toolbox.as93.net/about + about: View project info, roadmap, and documentation. diff --git a/.github/ISSUE_TEMPLATE/deployment.yml b/.github/ISSUE_TEMPLATE/deployment.yml new file mode 100644 index 0000000..2f60d63 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/deployment.yml @@ -0,0 +1,25 @@ +name: 🛠️ Deployment / self-hosting +description: Installation, configuration, upgrades, containers, or Kubernetes. +title: "[deploy] " +labels: ["type:deploy", "scope:self-hosted"] +body: + - type: dropdown + id: method + attributes: + label: Install method + options: [Docker, Source, GitHub Pages, Vercel, Other] + validations: { required: true } + - type: input + id: version + attributes: + label: App image/tag or chart version + - type: textarea + id: env + attributes: + label: Platform details + placeholder: OS/distro, CPU/RAM, storage, container runtime, ingress, proxy. + - type: textarea + id: logs + attributes: + label: Startup/runtime logs + render: shell diff --git a/.github/ISSUE_TEMPLATE/deployment_issue.yml b/.github/ISSUE_TEMPLATE/deployment_issue.yml new file mode 100644 index 0000000..3f0092a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/deployment_issue.yml @@ -0,0 +1,57 @@ +name: 🚀 Deployment Issue +description: Issues with hosting, building, or deployment +title: "[Deployment]: " +labels: ["deployment", "needs-triage"] +assignees: [] + +body: + - type: dropdown + id: deployment-type + attributes: + label: Deployment Type + description: How are you trying to deploy? + options: + - Vercel + - Netlify + - GitHub Pages + - Docker + - Static hosting (Apache/Nginx) + - Self-hosted server + - Other + validations: + required: true + + - type: textarea + id: steps-taken + attributes: + label: Steps Taken + description: What steps did you follow to deploy? + placeholder: | + 1. Cloned the repository + 2. Ran npm install + 3. Ran npm run build + 4. Deployed to platform... + validations: + required: true + + - type: textarea + id: environment-info + attributes: + label: Environment Info + description: Node.js version, npm version, OS, platform details + placeholder: | + Node.js: v18.17.0 + npm: 9.6.7 + OS: Ubuntu 22.04 + validations: + required: true + + - type: textarea + id: error-logs + attributes: + label: Error Logs + description: Paste error messages and build logs here + placeholder: Paste error messages and logs here... + render: shell + validations: + required: true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/question_feedback.yml b/.github/ISSUE_TEMPLATE/question_feedback.yml new file mode 100644 index 0000000..812e5b4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question_feedback.yml @@ -0,0 +1,25 @@ +name: 💬 Question / Feedback +description: Ask questions or provide general feedback +title: "[Question]: " +labels: ["question", "feedback"] +assignees: [] + +body: + - type: markdown + attributes: + value: | + Thanks for your question or feedback! We appreciate your input. + + - type: textarea + id: question-feedback + attributes: + label: Question or Feedback + description: | + Please provide your question or feedback in detail. + - For questions: Be specific about what you're trying to achieve + - For feedback: Let us know what you liked or what could be improved + - For feature requests: Describe what functionality you'd like to see + placeholder: | + Your question or feedback here... + validations: + required: true \ No newline at end of file diff --git a/.github/README.md b/.github/README.md index d2daece..a6d4503 100644 --- a/.github/README.md +++ b/.github/README.md @@ -4,10 +4,9 @@ The all-in-one offline-first networking toolbox for sysadmins
🌐 networking-toolbox.as93.net

- - +

- +

@@ -17,15 +16,35 @@ #### Option 1 - Docker Run `docker run -p 8080:80 lissy93/networking-toolbox`
-Or, use our example [`docker-compose.yml`](#) +Or, use our example [`docker-compose.yml`](https://github.com/Lissy93/networking-toolbox/blob/main/docker-compose.yml) #### Option 2 - Cloud Fork the repo, and import into Vercel, Netlify or any static hosting provider of your choice. -#### Option 3 - Source -Follow the developing instructions below. Then run `npm run build` to compile output
-You can then upload the contents of `./dist` to any web server, CDN or static host. +#### Option 3 - Source: Node +Follow the dev steps below. +Then run `npm run build:node` to compile output.
+You can then start the server with `node build`. +
+More Deployment Options + +#### Option 4 - Source: Static +Follow the dev steps below. +Then run `npm run build:static` to compile output.
+And upload the contents of `./build` to any web server, CDN or static host. + +#### Option 5 - Source: Docker +Follow the dev steps below. +Then run `docker build -t networking-toolbox .` to build the image.
+You can then start the container with `docker run -p 8080:80 networking-toolbox`. + +#### Option 6 - GitHub Pages +Fork the repo.
+Head to the Actions tab, find the "Deploy to GitHub Pages" workflow, and trigger it.
+Then go to Settings > Pages > Source and select the `gh-pages` branch.
+Visit `https://.github.io/networking-toolbox/` to see your deployed app. +
--- @@ -44,6 +63,14 @@ yarn yarn dev ``` +#### Testing + +Before merging, code must pass all unit and end-to-end tests, as well as linting, type checks, svelte check and build checks.
+ +``` +yarn test +``` + --- ### Contributing diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml new file mode 100644 index 0000000..d7b5832 --- /dev/null +++ b/.github/workflows/github-pages.yml @@ -0,0 +1,75 @@ +name: Deploy to GitHub Pages + +on: + workflow_dispatch: + inputs: + base_url: + description: 'Base URL path (e.g., /networking-toolbox)' + required: false + default: '/networking-toolbox' + type: string + target_branch: + description: 'Target branch for deployment' + required: false + default: 'gh-pages' + type: string + node_version: + description: 'Node.js version' + required: false + default: '18' + type: string + deploy_env: + description: 'Deployment environment' + required: false + default: 'static' + type: choice + options: + - static + - github-pages + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ inputs.node_version }} + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Build static site + env: + BASE_URL: ${{ inputs.base_url }} + DEPLOY_ENV: ${{ inputs.deploy_env }} + run: npm run build:static + + - name: Upload build artifacts + uses: actions/upload-pages-artifact@v3 + with: + path: ./build + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/.gitignore b/.gitignore index bca51a6..cd6616c 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ Thumbs.db /nyc_output /playwright-report /test-results +e2e-results.xml # AI Crap .claude/ diff --git a/biome.json b/biome.json deleted file mode 100644 index 101d9e6..0000000 --- a/biome.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "$schema": "https://biomejs.dev/schemas/2.2.4/schema.json", - "vcs": { - "enabled": false, - "clientKind": "git", - "useIgnoreFile": false - }, - "files": { - "ignoreUnknown": false - }, - "formatter": { - "enabled": true, - "indentStyle": "tab" - }, - "linter": { - "enabled": true, - "rules": { - "recommended": true - } - }, - "javascript": { - "formatter": { - "quoteStyle": "double" - } - }, - "assist": { - "enabled": true, - "actions": { - "source": { - "organizeImports": "on" - } - } - } -} diff --git a/package.json b/package.json index 5f266ff..4fc454c 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,8 @@ "format": "prettier --check src --write", "types": "tsc -p tsconfig.json --noEmit", "build-check": "vite build --minify=false --sourcemap=false --logLevel error", + "build:node": "DEPLOY_ENV='node' npm run build", + "build:static": "DEPLOY_ENV='static' npm run build", "test": "vitest", "test:ui": "vitest --ui", "test:coverage": "vitest --coverage", diff --git a/playwright.config.ts b/playwright.config.ts index e50d014..fd471dc 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -24,7 +24,7 @@ export default defineConfig({ name: 'firefox', use: { ...devices['Desktop Firefox'] }, }, - // Disabled webkit due to missing system dependencies + // i disabled webkit cos of missing system deps on CI // { // name: 'webkit', // use: { ...devices['Desktop Safari'] }, diff --git a/src/lib/components/furniture/SettingsMenu.svelte b/src/lib/components/furniture/SettingsMenu.svelte index f615eae..4020a71 100644 --- a/src/lib/components/furniture/SettingsMenu.svelte +++ b/src/lib/components/furniture/SettingsMenu.svelte @@ -117,7 +117,7 @@ {#snippet accessibilityOption(option: AccessibilityOption)} -