From a3251eebc46a329fb47666fd271751ccf70d27b7 Mon Sep 17 00:00:00 2001 From: dsutanto Date: Wed, 5 Aug 2026 19:58:35 +0700 Subject: [PATCH] dashboard: kolom AKUN/STAKE/VOTE sama lebar di desktop --- AGENTS.md | 2 +- SPEC.md | 3 ++- static/style.css | 7 +++++-- templates/history.html | 2 +- templates/index.html | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 42e8a3b..8ce8bed 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -29,7 +29,7 @@ Two tools scan the Vexanium blockchain voters table for accounts whose only vote - The web list shows RANK / AKUN / STAKE (VEX) / VOTE TERAKHIR columns (3 stats cells). Vote weight stays in the DB and `/api/search` JSON but is not rendered as a column. - Token contract is `vex.token` (NOT `eosio.token` — that name doesn't exist on Vexanium), 4-decimal VEX, chain_id `f9f432b1851b5c179d2091a96f593aaed50ec7466b74f89301f957a83e56ce1f`. Distribution signs `vex.token::transfer` with the BP `active` key. - Distribution (spec §V19–V27): each run pays the whole liquid balance pro-rata by stored `staked`, shares floored at 4 decimals with dust left in the account, one transfer per voter. A txid that can't be confirmed (`GET {DATABISNIS_API}/v2/history/get_transaction?id=` returns no `executed`) is never re-sent the same run — that payment stays `failed` and rejoins the next day. No-op (exit 0, no writes) when the voters table is empty or balance < 0.0001. The dashboard's `/history` view renders `distribute_runs` + `distribute_payments` read-only. -- Dashboard layout (spec §V28): desktop/tablet balances the STAKE column near page center; `/history` uses six-column run/payment grids; mobile turns history rows into labeled cards, including MEMO and TXID. HTML responses use `Cache-Control: no-store`; stylesheet URL is versioned with `?v=` for deploy cache-busting. +- Dashboard layout (spec §V28): desktop gives AKUN/STAKE/VOTE equal width with AKUN left and STAKE/VOTE centered; tablet keeps the fixed STAKE column near page center; `/history` uses six-column run/payment grids; mobile turns history rows into labeled cards, including MEMO and TXID. HTML responses use `Cache-Control: no-store`; stylesheet URL is versioned with `?v=` for deploy cache-busting. - Liquid balance (spec §V16): a 4th stat cell "SALDO LIQUID" shows the BP account's liquid VEX (`account.core_liquid_balance`) fetched from `GET {DATABISNIS_API}/v2/state/get_account?account=`. The dashboard fetches it live but caches per-worker in memory for `DASH_LIQUID_TTL` (default 60s); a failed fetch keeps the last value (or renders `—` if none ever succeeded) and the failure is also cooled-down so the API isn't hammered. The dashboard still never writes to the DB. ## Layout diff --git a/SPEC.md b/SPEC.md index 03eab36..cff994a 100644 --- a/SPEC.md +++ b/SPEC.md @@ -84,7 +84,7 @@ V24: run harian `DISTRIBUTE_HOUR` (default 10) waktu lokal `TZ`; ⊥ beku/carryo V25: pemilih kosong | saldo < 1 unit shareable → no-op senyap, ⊥ tulis DB V26: `VEX_BP_PRIVATE_KEY` ⊥ pernah di-log/print; `--dry-run` utk uji lokal (⊥ sign) V27: dashboard read-only; `/history` baca `distribute_*` via `db.py`; ⊥ mutasi -V28: web list → kolom STAKE/JUMLAH text center; STAKE dekat pusat halaman via grid seimbang; history runs/payments 6 kolom desktop/tablet; mobile → kartu berlabel ∀ field termasuk MEMO/TXID; HTML `no-store` + stylesheet versioned +V28: web list desktop → kolom AKUN/STAKE/VOTE sama lebar (RANK tetap 72px); AKUN kiri; STAKE & VOTE TERAKHIR center; tablet grid lama; history runs/payments 6 kolom desktop/tablet; mobile → kartu berlabel ∀ field termasuk MEMO/TXID; HTML `no-store` + stylesheet versioned ## §T — Tasks id|status|task|cites @@ -117,6 +117,7 @@ T26|x|dashboard: route `/history` (runs + per-voter log) + template, gaya DESIGN T27|x|tests: test_distribute.py (mock chain+pyntelope, temp DB: math share, memo, no-op, status/retry, guard duplikat) + extend test_dashboard.py (`/history`)|V20,V21,V22,V25,V26,V27,I.db T28|x|hygiene: .gitignore += `.oc/`; stage penghapusan README.md (stub kosong)| T29|x|dashboard layout: grid STAKE seimbang desktop/tablet; `/history` 6-kolom + kartu mobile berlabel; CSS cache-bust + HTML no-store|V28,I.web +T30|x|dashboard desktop: kolom AKUN/STAKE/VOTE sama lebar, AKUN kiri, STAKE+VOTE center|V28,I.web ## §B — Bug log id|date|cause|fix diff --git a/static/style.css b/static/style.css index 054d7e7..117a992 100644 --- a/static/style.css +++ b/static/style.css @@ -181,7 +181,7 @@ button.pill { .list-header, .list-row { display: grid; - grid-template-columns: 72px 1fr 200px 1fr; + grid-template-columns: 72px repeat(3, 1fr); gap: var(--sp-lg); align-items: baseline; padding: var(--sp-lg) var(--sp-sm); @@ -226,7 +226,9 @@ button.pill { color: var(--on-dark); font-variant-numeric: tabular-nums; } -.list-header span:nth-child(3) { text-align: center; } +.list-row .vote-date { text-align: center; } +.list-header span:nth-child(3), +.list-header span:nth-child(4) { text-align: center; } .txid { font-size: 12px; letter-spacing: 1px; @@ -319,6 +321,7 @@ button.pill { .list-row .vote-date, .list-row .txid { grid-column: 2; } .list-row .stake { text-align: left; } + .list-row .vote-date { text-align: left; } .list-row .txid { font-size: 12px; } .list-row .stake { overflow-wrap: anywhere; } .list-row .stake::before, diff --git a/templates/history.html b/templates/history.html index 55d6a63..fe33d89 100644 --- a/templates/history.html +++ b/templates/history.html @@ -7,7 +7,7 @@ - +
diff --git a/templates/index.html b/templates/index.html index 3589031..9fbb7e8 100644 --- a/templates/index.html +++ b/templates/index.html @@ -7,7 +7,7 @@ - +