Fix API URL
This commit is contained in:
parent
a127bcfbbd
commit
efc56aae40
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user