Fixed output_dir not liking the move to JSONResponse

This commit is contained in:
Marc-Andre Ferland 2022-10-15 04:47:12 -04:00
parent 8fdb1e7ec9
commit 7625e591fe
2 changed files with 2 additions and 2 deletions

View File

@ -1497,7 +1497,7 @@ async function getDiskPath() {
let res = await fetch('/get/output_dir') let res = await fetch('/get/output_dir')
if (res.status === 200) { if (res.status === 200) {
res = await res.json() res = await res.json()
res = res[0] res = res.output_dir
document.querySelector('#diskPath').value = res document.querySelector('#diskPath').value = res
} }

View File

@ -263,7 +263,7 @@ def read_web_data(key:str=None):
elif key == 'models': elif key == 'models':
return JSONResponse(getModels(), headers=NOCACHE_HEADERS) return JSONResponse(getModels(), headers=NOCACHE_HEADERS)
elif key == 'modifiers': return FileResponse(os.path.join(SD_UI_DIR, 'modifiers.json'), headers=NOCACHE_HEADERS) elif key == 'modifiers': return FileResponse(os.path.join(SD_UI_DIR, 'modifiers.json'), headers=NOCACHE_HEADERS)
elif key == 'output_dir': return JSONResponse({outpath}, headers=NOCACHE_HEADERS) elif key == 'output_dir': return JSONResponse({ 'output_dir': outpath }, headers=NOCACHE_HEADERS)
else: else:
return HTTPException(status_code=404, detail=f'Request for unknown {key}') # HTTP404 Not Found return HTTPException(status_code=404, detail=f'Request for unknown {key}') # HTTP404 Not Found