From 8e52618a50d1ee6f3aa64d12233e08ee82e17169 Mon Sep 17 00:00:00 2001 From: NW Date: Tue, 23 Jun 2026 13:23:59 +0100 Subject: [PATCH] fix: make commission settings and wallets read-only for shop admin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Commission Settings card: disabled inputs, Platform Owner badge - Commission Wallets card: disabled inputs, Platform Owner badge - Hidden fields carry original values so POST preserves them unchanged - Shop admin sees values but cannot modify — only platform owner can --- src/admin/public/style.css | 28 ++++++++++++++++++++++++++++ src/admin/views/settings.js | 31 ++++++++++++++++++++----------- 2 files changed, 48 insertions(+), 11 deletions(-) diff --git a/src/admin/public/style.css b/src/admin/public/style.css index 1cb511b..2232514 100644 --- a/src/admin/public/style.css +++ b/src/admin/public/style.css @@ -125,6 +125,34 @@ tr:hover td { background: #f9fafb; } .btn-secondary { background: var(--muted); } .btn-secondary:hover { background: #555; } +.settings-readonly { + border-color: #d1d5db; + background: #f9fafb; +} + +.settings-readonly input[disabled] { + background: #f3f4f6; + color: #6b7280; + cursor: not-allowed; + border-color: #d1d5db; +} + +.settings-readonly input[disabled]:hover { + background: #f3f4f6; +} + +.readonly-badge { + display: inline-block; + font-size: 0.7rem; + font-weight: 600; + padding: 0.15rem 0.4rem; + border-radius: 999px; + background: #fee2e2; + color: #b91c1c; + vertical-align: middle; + margin-left: 0.5rem; +} + .form, .inline-form { display: flex; flex-direction: column; diff --git a/src/admin/views/settings.js b/src/admin/views/settings.js index fde0729..b2680cd 100644 --- a/src/admin/views/settings.js +++ b/src/admin/views/settings.js @@ -27,31 +27,33 @@ export function renderSettings(data) { -
-

Commission Settings

+
+

Commission Settings Platform Owner

+

Set by the platform owner. Contact them to change commission rate.

- +
-
-

Commission Wallets

+
+

Commission Wallets Platform Owner

+

These wallets receive commission payments. Set by the platform owner.

- + - + - + - + - +
@@ -85,6 +87,13 @@ export function renderSettings(data) { + + + + + + +