Skip to content

dashboard improvements and redisign #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 26 commits into
base: gh-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2c6a9a0
Add "Build and publish a release - Manual" to dashboard
yeoldegrove Jun 3, 2025
aec2cab
Add Settings Panel to set Github Token
yeoldegrove Jun 3, 2025
762b84a
Show all workflow runs from today instead of only the last one.
yeoldegrove Jun 3, 2025
9991e02
open all links in new tab
yeoldegrove Jun 4, 2025
2989079
get historic data and color code
yeoldegrove Jun 4, 2025
c8849c2
complete visual redesign
yeoldegrove Jun 4, 2025
bc65ca6
use rollup to bundle JavaScript
yeoldegrove Jun 4, 2025
c76eb26
move hardcoded values to constants
yeoldegrove Jun 5, 2025
c9f94d7
Add Platform Test Cleanup Section
yeoldegrove Jun 5, 2025
c52aa5a
refactor to remove duplication
yeoldegrove Jun 5, 2025
6d73a55
fix package urls
yeoldegrove Jun 10, 2025
7030a42
restructure CSS styles again
yeoldegrove Jun 10, 2025
875f28c
update parent run detection
yeoldegrove Jun 16, 2025
2e1d7c7
cleanup of unused code
yeoldegrove Jun 16, 2025
4303653
split up main.js and dashboard.js
yeoldegrove Jun 16, 2025
aa70104
update README
yeoldegrove Jun 16, 2025
461cdfa
change stage 4 display behaviour
yeoldegrove Jun 16, 2025
93544d9
port package-aggregator from main
yeoldegrove Jun 17, 2025
161b0a5
build only on main
yeoldegrove Jun 17, 2025
e4ddfca
make gh-pages default branch
yeoldegrove Jun 17, 2025
36269e5
move packages to packages branch
yeoldegrove Jun 17, 2025
b134765
add color legend
yeoldegrove Jun 17, 2025
83f0dcc
rework color coding
yeoldegrove Jun 17, 2025
e57dd23
fix all_branches parameter to be false by default
yeoldegrove Jun 17, 2025
2b1bbf5
use the same logic for historic details as for historic list
yeoldegrove Jun 17, 2025
511608f
Package status for Gardenlinux Day 1905
Jun 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 13 additions & 13 deletions .github/workflows/aggregate_package_states.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: aggregate_package_states.yml
permissions:
contents: write
contents: write
on:
workflow_dispatch:
schedule:
- cron: '0 7 * * *'
workflow_dispatch:
schedule:
- cron: "0 3 * * *"
jobs:
aggregate_packages:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: run aggregator
run: sh cronjob.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
aggregate_packages:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: run aggregator
run: ./cronjob.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73 changes: 73 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Build and Deploy Dashboard

on:
push:
branches: [gh-pages]
pull_request:
branches: [gh-pages]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"

- name: Install dependencies
run: npm ci

- name: Build dashboard
run: npm run build
env:
NODE_ENV: production

- name: List build output
run: |
echo "Build completed. Output files:"
ls -la dist/

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dashboard-build
path: |
index.html
style.css
dist/
retention-days: 30

- name: Setup Pages (if deploying to GitHub Pages)
if: github.ref == 'refs/heads/gh-pages' && github.event_name == 'push'
uses: actions/configure-pages@v4

- name: Upload to GitHub Pages
if: github.ref == 'refs/heads/gh-pages' && github.event_name == 'push'
uses: actions/upload-pages-artifact@v3
with:
path: "."

deploy:
if: github.ref == 'refs/heads/gh-pages' && github.event_name == 'push'
needs: build
runs-on: ubuntu-latest

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
_site
.venv
shell.nix
vendor

# Dependencies
node_modules/

# Build output
dist/

# Environment variables
.env
.envrc

# packages are in packages branch
packages/
14 changes: 14 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Build artifacts
dist/
node_modules/
.venv/

# Package data
packages/

# Generated files
*.min.js
*.map

# Documentation that might have specific formatting
CHANGELOG.md
12 changes: 12 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"semi": true,
"trailingComma": "es5",
"singleQuote": false,
"printWidth": 80,
"tabWidth": 4,
"useTabs": false,
"bracketSpacing": true,
"arrowParens": "always",
"endOfLine": "lf",
"quoteProps": "as-needed"
}
74 changes: 74 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Garden Linux Daily Dashboard

A real-time monitoring dashboard for Garden Linux CI/CD pipeline status, package builds, and workflow runs.

https://gardenlinux.github.io/daily/

## 🌟 Features

- **Real-time Pipeline Status**: Monitor Production Garden Linux workflows
- **Package Monitoring**: Track package builds and identify issues (via daily cronjob)
- **Historical View**: Browse past Garden Linux versions
- **GitHub Authentication**: Support for both Classic and Fine-grained GitHub tokens

## 🚀 Quick Start

### Prerequisites

- **To build or develop locally:**
- Node.js 16 or higher
- npm
- **To use or serve the dashboard (e.g., via GitHub Pages or any static web server):**
- No dependencies required; just serve the static files in the repository (index.html, dist/dashboard.js, style.css, etc.)

## 🛠️ Development & Build Workflow

### Development Mode

- **Watch mode**: `npm run dev`
Rebuilds the dashboard automatically on file changes. Use this for local development.
- **Serve only**: `npm run serve`
Serves the static files in the current directory (default: http://localhost:8000).

### Production Build

- **Build for production**:

```sh
NODE_ENV=production npm run build
```

This creates a minified, optimized bundle in `dist/dashboard.js` with source maps for debugging. Console statements are removed in production builds.

- **Build only**: `npm run build`
(If you do not set `NODE_ENV=production`, the output will not be minified.)

### Output Details

- **Entry Point**: `src/main.js`
- **Output**: `dist/dashboard.js` (with source maps)
- **Format**: IIFE for direct browser inclusion
- **Minification**: Enabled automatically when `NODE_ENV=production`

## 🚀 GitHub Pages Integration

This dashboard is designed to be deployed on GitHub Pages:

- The `dist/` directory contains the production-ready JavaScript bundle.
- The `index.html` and `style.css` are also in the repository root for direct serving.
- GitHub Pages is configured to serve from the `/` (root).
- After building, simply push your changes to the `gh-pages` branch.
- The dashboard will be live at: https://gardenlinux.github.io/daily/

## 🔧 Configuration

### GitHub Token (Optional but Recommended)

To avoid GitHub API rate limits, configure a personal access token:

1. Go to [GitHub Settings > Tokens](https://github.com/settings/tokens)
2. Create a token with `public_repo` or `repo` scope
3. Click the ⚙️ settings button in the dashboard
4. Enter your token and save

The dashboard supports both Classic (`ghp_`) and Fine-grained (`github_pat_`) tokens.
28 changes: 28 additions & 0 deletions cronjob.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

set -Eexuo pipefail

GARDENLINUX_GENESIS="2020-03-31"
TODAY=$(date "+%Y-%m-%d")

START_SECONDS=$(date -d "$GARDENLINUX_GENESIS" +%s)
END_SECONDS=$(date -d "$TODAY" +%s)

GARDENLINUX_VERSION=$(((END_SECONDS - START_SECONDS) / 86400))

git config --global user.email "[email protected]"
git config --global user.name "package_aggregator"

OUTFILE=$(mktemp)
cd package-aggregator || exit 1
go run . -o $OUTFILE -exclude package-build,package-python3.11
cd .. || exit 2

git fetch origin
git checkout packages
# git reset --hard origin/packages

cp $OUTFILE packages/$GARDENLINUX_VERSION.json
git add packages/$GARDENLINUX_VERSION.json
git commit -m "Package status for Gardenlinux Day $GARDENLINUX_VERSION"
git push origin packages
62 changes: 62 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import js from "@eslint/js";

export default [
js.configs.recommended,
{
files: ["src/**/*.js"],
languageOptions: {
ecmaVersion: 2022,
sourceType: "module",
globals: {
window: "readonly",
document: "readonly",
console: "readonly",
fetch: "readonly",
URL: "readonly",
URLSearchParams: "readonly",
Date: "readonly",
localStorage: "readonly",
location: "readonly",
alert: "readonly",
confirm: "readonly",
setTimeout: "readonly",
setInterval: "readonly",
clearTimeout: "readonly",
clearInterval: "readonly",
goToGL: "writable",
},
},
rules: {
// Best practices
"no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
"no-console": "warn",
"prefer-const": "error",
"no-var": "error",

// Code style - let Prettier handle formatting
indent: "off",
quotes: "off",
semi: "off",
"comma-dangle": "off",
"eol-last": "off",

// Modern JavaScript
"prefer-arrow-callback": "error",
"prefer-template": "error",
"object-shorthand": "error",

// Error prevention
"no-undef": "error",
"no-unreachable": "error",
"no-duplicate-imports": "error",
},
},
{
files: ["rollup.config.js", "eslint.config.js"],
languageOptions: {
globals: {
process: "readonly",
},
},
},
];
Loading