Compare commits

...

2 Commits

Author SHA1 Message Date
Zhi
7e06f9b28b Remove project step, keep only backend URL 2026-03-14 07:33:43 +00:00
Zhi
f7a19c71d6 Add VITE_WIZARD_HOST env variable 2026-03-13 19:43:04 +00:00
3 changed files with 10 additions and 12 deletions

View File

@@ -5,7 +5,9 @@ COPY package.json package-lock.json* ./
RUN npm install
COPY . .
ARG VITE_WIZARD_PORT=18080
ARG VITE_WIZARD_HOST=wizard
ENV VITE_WIZARD_PORT=$VITE_WIZARD_PORT
ENV VITE_WIZARD_HOST=$VITE_WIZARD_HOST
RUN npm run build
# Production stage — lightweight static server, no nginx

View File

@@ -18,7 +18,8 @@ import MonitorPage from '@/pages/MonitorPage'
import axios from 'axios'
const WIZARD_PORT = Number(import.meta.env.VITE_WIZARD_PORT) || 18080
const WIZARD_BASE = `http://127.0.0.1:${WIZARD_PORT}`
const WIZARD_HOST = import.meta.env.VITE_WIZARD_HOST || "wizard"
const WIZARD_BASE = `http://${WIZARD_HOST}:${WIZARD_PORT}`
type AppState = 'checking' | 'setup' | 'ready'

View File

@@ -21,7 +21,7 @@ interface SetupForm {
project_description: string
}
const STEPS = ['Welcome', 'Database', 'Admin', 'Projects', 'Finish']
const STEPS = ['Welcome', 'Database', 'Admin', 'Backend', 'Finish']
export default function SetupWizardPage({ wizardBase, onComplete }: Props) {
const [step, setStep] = useState(0)
@@ -39,8 +39,8 @@ export default function SetupWizardPage({ wizardBase, onComplete }: Props) {
db_password: 'harborforge_pass',
db_database: 'harborforge',
backend_base_url: 'http://127.0.0.1:8000',
project_name: 'Default',
project_description: 'Default project',
project_name: '',
project_description: '',
})
const wizardApi = axios.create({
@@ -83,9 +83,6 @@ export default function SetupWizardPage({ wizardBase, onComplete }: Props) {
database: form.db_database,
},
backend_url: form.backend_base_url || undefined,
default_project: form.project_name
? { name: form.project_name, description: form.project_description }
: undefined,
}
await wizardApi.put('/api/v1/config/harborforge.json', config, {
@@ -179,15 +176,13 @@ export default function SetupWizardPage({ wizardBase, onComplete }: Props) {
</div>
)}
{/* Step 3: Project */}
{/* Step 3: Backend */}
{step === 3 && (
<div className="setup-step-content">
<h2>Default project (optional)</h2>
<p className="text-dim">Create an initial project or skip</p>
<h2>Backend URL</h2>
<p className="text-dim">Configure the HarborForge backend API URL</p>
<div className="setup-form">
<label>Backend Base URL <input value={form.backend_base_url} onChange={(e) => set('backend_base_url', e.target.value)} placeholder="http://127.0.0.1:8000" /></label>
<label>Project name <input value={form.project_name} onChange={(e) => set('project_name', e.target.value)} placeholder="Leave blank to skip" /></label>
<label>ProjectsDescription <input value={form.project_description} onChange={(e) => set('project_description', e.target.value)} /></label>
</div>
<div className="setup-nav">
<button className="btn-back" onClick={() => setStep(2)}>Back</button>