Fix API URL

This commit is contained in:
Zakary Timson 2024-10-30 10:35:09 -04:00
parent a127bcfbbd
commit efc56aae40

View File

@ -180,10 +180,10 @@
</dialog> </dialog>
<script> <script>
const remote = localStorage.getItem('remote') || 'localhost:1969'; const remote = localStorage.getItem('remote') || '';
function run(cmd) { function run(cmd) {
return fetch(`${remote.startsWith('http') ? '' : 'http://'}${remote}/api/${cmd}`).then(async resp => { return fetch(`${remote}/api/${cmd}`).then(async resp => {
const value = await resp.text(); const value = await resp.text();
try { try {
return JSON.parse(value); return JSON.parse(value);