fix(dashboard): display real config path on Config page

Replace the hardcoded i18n placeholder "~/.hermes/config.yaml" with the
real config_path returned from api.getStatus(), falling back to the i18n
string while loading or on API failure.

Co-authored-by: aqilaziz <gonzes7@gmail.com>
This commit is contained in:
aqilaziz 2026-05-12 16:39:11 -07:00 committed by Teknium
parent 782e3f5164
commit 80375cbe2c

View file

@ -118,6 +118,7 @@ export default function ConfigPage() {
const [yamlText, setYamlText] = useState("");
const [yamlLoading, setYamlLoading] = useState(false);
const [yamlSaving, setYamlSaving] = useState(false);
const [configPath, setConfigPath] = useState<string | null>(null);
const [activeCategory, setActiveCategory] = useState<string>("");
const [confirmReset, setConfirmReset] = useState(false);
const { toast, showToast } = useToast();
@ -177,6 +178,10 @@ export default function ConfigPage() {
.getDefaults()
.then(setDefaults)
.catch(() => {});
api
.getStatus()
.then((resp) => setConfigPath(resp.config_path))
.catch(() => {});
}, []);
// Set active category when categories load
@ -416,7 +421,7 @@ export default function ConfigPage() {
<div className="flex items-center gap-2">
<Settings2 className="h-4 w-4 text-muted-foreground" />
<code className="text-xs text-muted-foreground bg-muted/50 px-2 py-0.5">
{t.config.configPath}
{configPath ?? t.config.configPath}
</code>
</div>
<div className="flex items-center gap-1.5">