Browse Source
- Deleted `index.css`, `index.js`, and `index.html` from `app/web/dist/`. - Cleared unused build artifacts to maintain a lean repository structure.main
5 changed files with 97 additions and 256 deletions
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
body{max-width:800px;margin:0 auto;padding:20px;font-family:Arial,sans-serif}.container{background:#f9f9f9;border-radius:8px;margin-top:20px;padding:30px}.form-group{margin-bottom:20px}label{display:block;margin-bottom:5px;font-weight:700}input,textarea{border:1px solid #ddd;border-radius:4px;width:100%;padding:10px}button{color:#fff;cursor:pointer;background:#007cba;border:none;border-radius:4px;padding:12px 20px}button:hover{background:#005a87}.danger-button{background:#dc3545}.danger-button:hover{background:#c82333}.status{border-radius:4px;margin-top:20px;margin-bottom:20px;padding:10px}.success{color:#155724;background:#d4edda}.error{color:#721c24;background:#f8d7da}.info{color:#0c5460;background:#d1ecf1}.header-panel{position:sticky;z-index:1000;display:flex;overflow:hidden;background-color:#f8f9fa;background-position:50%;background-size:cover;align-items: center;width:100%;height:60px;top:0;left:0;box-shadow:0 2px 4px #0000001a}.header-content{display:flex;box-sizing:border-box;align-items: center;width:100%;height:100%;margin:0 auto;padding:0 0 0 12px}.header-left{display:flex;justify-content:flex-start;align-items: center;height:100%}.header-center{display:flex;position:relative;overflow:hidden;flex-grow:1;justify-content:flex-start;align-items: center}.header-right{display:flex;justify-content:flex-end;align-items: center;height:100%}.header-logo{aspect-ratio:1;object-fit:cover;border-radius:0;flex-shrink:0;width:auto;height:100%}.user-avatar{object-fit:cover;border:2px solid #fff;border-radius:50%;width:40px;height:40px;margin-right:10px;box-shadow:0 1px 3px #0003}.user-profile{display:flex;position:relative;z-index:1;align-items: center}.user-info{text-align:left;font-size:1.2em;font-weight:700}.user-name{display:block;font-size:1em;font-weight:700}.profile-banner{position:absolute;z-index:-1;opacity:.7;width:100%;height:100%;top:0;left:0}.logout-button{color:#6c757d;cursor:pointer;display:flex;background:0 0;border:none;flex-shrink:0;justify-content:center;align-items: center;width:48px;height:100%;margin-left:10px;margin-right:0;padding:0;font-size:20px}.logout-button:hover{color:#343a40;background:0 0} |
||||
@ -1,13 +0,0 @@
@@ -1,13 +0,0 @@
|
||||
<!DOCTYPE html> |
||||
<html lang="en"> |
||||
<head> |
||||
<meta charset="UTF-8" /> |
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
||||
<title>Nostr Relay</title> |
||||
<link rel="stylesheet" href="tailwind.min.css" /> |
||||
</head> |
||||
<body class="bg-white"> |
||||
<div id="root"></div> |
||||
<script type="module" src="index.js"></script> |
||||
</body> |
||||
</html> |
||||
File diff suppressed because one or more lines are too long
@ -1,82 +0,0 @@
@@ -1,82 +0,0 @@
|
||||
/* |
||||
Local Tailwind CSS (minimal subset for this UI) |
||||
Note: This file includes just the utilities used by the app to keep size small. |
||||
You can replace this with a full Tailwind build if desired. |
||||
*/ |
||||
|
||||
/* Preflight-like resets (very minimal) */ |
||||
*,::before,::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb} |
||||
html,body,#root{height:100%} |
||||
html{line-height:1.5;-webkit-text-size-adjust:100%;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,Noto Sans,\"Apple Color Emoji\",\"Segoe UI Emoji\"} |
||||
body{margin:0} |
||||
button,input{font:inherit;color:inherit} |
||||
img{display:block;max-width:100%;height:auto} |
||||
|
||||
/* Layout */ |
||||
.sticky{position:sticky}.relative{position:relative}.absolute{position:absolute} |
||||
.top-0{top:0}.left-0{left:0}.inset-0{top:0;right:0;bottom:0;left:0} |
||||
.z-50{z-index:50}.z-10{z-index:10} |
||||
.block{display:block}.flex{display:flex} |
||||
.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-end{justify-content:flex-end} |
||||
.flex-grow{flex-grow:1}.shrink-0{flex-shrink:0} |
||||
.overflow-hidden{overflow:hidden} |
||||
|
||||
/* Sizing */ |
||||
.w-full{width:100%}.w-auto{width:auto}.w-16{width:4rem} |
||||
.h-full{height:100%}.h-16{height:4rem} |
||||
.aspect-square{aspect-ratio:1/1} |
||||
.max-w-3xl{max-width:48rem} |
||||
|
||||
/* Spacing */ |
||||
.p-0{padding:0}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-6{padding:1.5rem} |
||||
.px-2{padding-left:.5rem;padding-right:.5rem} |
||||
.mr-0{margin-right:0}.mr-2{margin-right:.5rem} |
||||
.mt-2{margin-top:.5rem}.mt-5{margin-top:1.25rem} |
||||
.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem} |
||||
.mx-auto{margin-left:auto;margin-right:auto} |
||||
|
||||
/* Borders & Radius */ |
||||
.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px} |
||||
.border-0{border-width:0}.border-2{border-width:2px} |
||||
.border-white{border-color:#fff} |
||||
.border{border-width:1px}.border-gray-300{border-color:#d1d5db} |
||||
|
||||
/* Colors / Backgrounds */ |
||||
.bg-white{background-color:#fff} |
||||
.bg-gray-100{background-color:#f3f4f6} |
||||
.bg-blue-600{background-color:#2563eb}.hover\:bg-blue-700:hover{background-color:#1d4ed8} |
||||
.bg-red-600{background-color:#dc2626}.hover\:bg-red-700:hover{background-color:#b91c1c} |
||||
.bg-cyan-100{background-color:#cffafe} |
||||
.bg-green-100{background-color:#d1fae5} |
||||
.bg-red-100{background-color:#fee2e2} |
||||
.bg-cover{background-size:cover}.bg-center{background-position:center} |
||||
.bg-transparent{background-color:transparent} |
||||
|
||||
/* Text */ |
||||
.text-left{text-align:left} |
||||
.text-white{color:#fff} |
||||
.text-gray-500{color:#6b7280}.hover\:text-gray-800:hover{color:#1f2937} |
||||
.text-green-800{color:#065f46} |
||||
.text-red-800{color:#991b1b} |
||||
.text-cyan-800{color:#155e75} |
||||
.text-base{font-size:1rem;line-height:1.5rem} |
||||
.text-lg{font-size:1.125rem;line-height:1.75rem} |
||||
.text-2xl{font-size:1.5rem;line-height:2rem} |
||||
.font-bold{font-weight:700} |
||||
|
||||
/* Opacity */ |
||||
.opacity-70{opacity:.7} |
||||
|
||||
/* Effects */ |
||||
.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,0.1),0 1px 2px -1px rgba(0,0,0,0.1);box-shadow:var(--tw-shadow)} |
||||
|
||||
/* Cursor */ |
||||
.cursor-pointer{cursor:pointer} |
||||
|
||||
/* Box model */ |
||||
.box-border{box-sizing:border-box} |
||||
|
||||
/* Utilities */ |
||||
.hover\:bg-transparent:hover{background-color:transparent} |
||||
|
||||
/* Height for avatar images in header already inherit from container */ |
||||
@ -0,0 +1,97 @@
@@ -0,0 +1,97 @@
|
||||
#!/usr/bin/env bash |
||||
# scripts/update-embedded-web.sh |
||||
# Build the embedded web UI and then install the Go binary. |
||||
# |
||||
# This script will: |
||||
# - Build the React app in app/web to app/web/dist using Bun (preferred), |
||||
# or fall back to npm/yarn/pnpm if Bun isn't available. |
||||
# - Run `go install` from the repository root so the binary picks up the new |
||||
# embedded assets. |
||||
# |
||||
# Usage: |
||||
# ./scripts/update-embedded-web.sh |
||||
# |
||||
# Requirements: |
||||
# - Go 1.18+ installed (for `go install` and go:embed support) |
||||
# - Bun (https://bun.sh) recommended; alternatively Node.js with npm/yarn/pnpm |
||||
# |
||||
set -euo pipefail |
||||
|
||||
# Resolve repo root to allow running from anywhere |
||||
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" |
||||
REPO_ROOT="$(cd -- "${SCRIPT_DIR}/.." && pwd)" |
||||
WEB_DIR="${REPO_ROOT}/app/web" |
||||
|
||||
log() { printf "[update-embedded-web] %s\n" "$*"; } |
||||
err() { printf "[update-embedded-web][ERROR] %s\n" "$*" >&2; } |
||||
|
||||
if [[ ! -d "${WEB_DIR}" ]]; then |
||||
err "Expected web directory at ${WEB_DIR} not found." |
||||
exit 1 |
||||
fi |
||||
|
||||
# Choose a JS package runner |
||||
JS_RUNNER="" |
||||
if command -v bun >/dev/null 2>&1; then |
||||
JS_RUNNER="bun" |
||||
elif command -v npm >/dev/null 2>&1; then |
||||
JS_RUNNER="npm" |
||||
elif command -v yarn >/dev/null 2>&1; then |
||||
JS_RUNNER="yarn" |
||||
elif command -v pnpm >/dev/null 2>&1; then |
||||
JS_RUNNER="pnpm" |
||||
else |
||||
err "No JavaScript package manager found. Install Bun (recommended) or npm/yarn/pnpm." |
||||
exit 1 |
||||
fi |
||||
|
||||
log "Using JavaScript runner: ${JS_RUNNER}" |
||||
|
||||
# Install dependencies and build the web app |
||||
log "Installing frontend dependencies..." |
||||
pushd "${WEB_DIR}" >/dev/null |
||||
case "${JS_RUNNER}" in |
||||
bun) |
||||
bun install |
||||
log "Building web app with Bun..." |
||||
bun run build |
||||
;; |
||||
npm) |
||||
npm ci || npm install |
||||
log "Building web app with npm..." |
||||
npm run build |
||||
;; |
||||
yarn) |
||||
yarn install --frozen-lockfile || yarn install |
||||
log "Building web app with yarn..." |
||||
yarn build |
||||
;; |
||||
pnpm) |
||||
pnpm install --frozen-lockfile || pnpm install |
||||
log "Building web app with pnpm..." |
||||
pnpm build |
||||
;; |
||||
*) |
||||
err "Unsupported JS runner: ${JS_RUNNER}" |
||||
exit 1 |
||||
;; |
||||
|
||||
esac |
||||
popd >/dev/null |
||||
|
||||
# Verify the output directory expected by go:embed exists |
||||
DIST_DIR="${WEB_DIR}/dist" |
||||
if [[ ! -d "${DIST_DIR}" ]]; then |
||||
err "Build did not produce ${DIST_DIR}. Check your frontend build configuration." |
||||
exit 1 |
||||
fi |
||||
|
||||
log "Frontend build complete at ${DIST_DIR}." |
||||
|
||||
# Install the Go binary so it embeds the latest files |
||||
log "Running 'go install' from repo root..." |
||||
pushd "${REPO_ROOT}" >/dev/null |
||||
GO111MODULE=on go install ./... |
||||
popd >/dev/null |
||||
|
||||
log "Done. Your installed binary now includes the updated embedded web UI." |
||||
Loading…
Reference in new issue