mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 01:04:32 +02:00
api refactor: force access control and handle subpaths
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
+3
-3
@@ -385,7 +385,7 @@ function monitorServerStatus() {
|
||||
<h1>Waiting for server...</h1>
|
||||
<script>
|
||||
function monitorServerStatus() {
|
||||
fetch('/sdapi/v1/progress?skip_current_image=true')
|
||||
fetch('${window.api}/progress?skip_current_image=true')
|
||||
.then((res) => { !res?.ok ? setTimeout(monitorServerStatus, 1000) : location.reload(); })
|
||||
.catch((e) => setTimeout(monitorServerStatus, 1000))
|
||||
}
|
||||
@@ -400,7 +400,7 @@ function monitorServerStatus() {
|
||||
function restartReload() {
|
||||
document.body.style = 'background: #222222; font-size: 1rem; font-family:monospace; margin-top:20%; color:lightgray; text-align:center';
|
||||
document.body.innerHTML = '<h1>Server shutdown in progress...</h1>';
|
||||
fetch('/sdapi/v1/progress?skip_current_image=true')
|
||||
fetch(`${window.api}/progress?skip_current_image=true`)
|
||||
.then((res) => setTimeout(restartReload, 1000))
|
||||
.catch((e) => setTimeout(monitorServerStatus, 500));
|
||||
return [];
|
||||
@@ -479,7 +479,7 @@ function toggleCompact(val, old) {
|
||||
|
||||
function previewTheme() {
|
||||
let name = gradioApp().getElementById('setting_gradio_theme').querySelectorAll('input')?.[0].value || '';
|
||||
fetch('/file=html/themes.json')
|
||||
fetch(`${window.subpath}/file=html/themes.json`)
|
||||
.then((res) => {
|
||||
res.json()
|
||||
.then((themes) => {
|
||||
|
||||
Reference in New Issue
Block a user