remove browse, add image
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { useState, useEffect } from 'react'
|
||||
import DirectoryBrowser from './DirectoryBrowser'
|
||||
import { useConfig, useSaveConfig } from '../hooks/useConfig'
|
||||
import { apiFetch } from '../lib/api'
|
||||
|
||||
@@ -14,7 +13,6 @@ export default function ConfigModal({ onClose }) {
|
||||
const { mutate: save, isPending } = useSaveConfig()
|
||||
|
||||
const [form, setForm] = useState({})
|
||||
const [browser, setBrowser] = useState(null) // 'target_dir' | 'results_dir' | null
|
||||
const [scanResult, setScanResult] = useState(null) // { testCount, completedCount } | null
|
||||
const [saveError, setSaveError] = useState(null)
|
||||
const [isRescanning, setIsRescanning] = useState(false)
|
||||
@@ -158,21 +156,13 @@ export default function ConfigModal({ onClose }) {
|
||||
].map(({ key, label }) => (
|
||||
<div key={key}>
|
||||
<label className="text-slate-400 text-xs block mb-1">{label}</label>
|
||||
<div className="flex gap-2">
|
||||
<input
|
||||
type="text"
|
||||
value={form[key] ?? ''}
|
||||
onChange={e => setForm(f => ({ ...f, [key]: e.target.value }))}
|
||||
placeholder="C:\path\to\folder"
|
||||
className="flex-1 bg-slate-800 border border-slate-700 text-slate-200 text-sm rounded-lg px-3 py-2 focus:outline-none focus:border-blue-500"
|
||||
/>
|
||||
<button
|
||||
onClick={() => setBrowser(key)}
|
||||
className="px-3 py-2 text-sm rounded-lg border border-slate-700 text-slate-300 hover:bg-slate-800 transition-colors whitespace-nowrap"
|
||||
>
|
||||
Browse
|
||||
</button>
|
||||
</div>
|
||||
<input
|
||||
type="text"
|
||||
value={form[key] ?? ''}
|
||||
onChange={e => setForm(f => ({ ...f, [key]: e.target.value }))}
|
||||
placeholder="C:\path\to\folder"
|
||||
className="w-full bg-slate-800 border border-slate-700 text-slate-200 text-sm rounded-lg px-3 py-2 focus:outline-none focus:border-blue-500"
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
@@ -204,10 +194,7 @@ export default function ConfigModal({ onClose }) {
|
||||
|
||||
{/* SMB Credentials */}
|
||||
<section>
|
||||
<h3 className="text-slate-300 text-xs uppercase tracking-widest mb-1">SMB Credentials</h3>
|
||||
<p className="text-slate-500 text-xs mb-3">
|
||||
Optional credentials for network shares used by target/results directories.
|
||||
</p>
|
||||
<h3 className="text-slate-300 text-xs uppercase tracking-widest mb-1">Credentials for network shares</h3>
|
||||
<div className="grid grid-cols-1 sm:grid-cols-3 gap-3">
|
||||
<input
|
||||
type="text"
|
||||
@@ -270,13 +257,6 @@ export default function ConfigModal({ onClose }) {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{browser && (
|
||||
<DirectoryBrowser
|
||||
onSelect={path => setForm(f => ({ ...f, [browser]: path }))}
|
||||
onClose={() => setBrowser(null)}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user