improve webui

This commit is contained in:
josc146
2023-11-07 22:21:41 +08:00
parent 893be5cf43
commit 46f52923c3
5 changed files with 21 additions and 20 deletions

View File

@@ -289,6 +289,14 @@ export function bytesToReadable(size: number) {
else return bytesToGb(size) + ' GB';
}
export function getServerRoot(defaultLocalPort: number) {
if (commonStore.settings.apiUrl)
return commonStore.settings.apiUrl;
if (commonStore.platform === 'web')
return '';
return `http://127.0.0.1:${defaultLocalPort}`;
}
export function absPathAsset(path: string) {
if (commonStore.platform === 'web')
return path;