mirror of
https://github.com/jwetzell/showbridge-webui.git
synced 2026-08-23 23:18:58 +00:00
store baseurl in local storage
This commit is contained in:
+1
-1
@@ -16,7 +16,7 @@
|
|||||||
class="pl-1 border-2 border-gray-200 text-white border-solid rounded-sm"
|
class="pl-1 border-2 border-gray-200 text-white border-solid rounded-sm"
|
||||||
[placeholder]="'http://localhost:8000'"
|
[placeholder]="'http://localhost:8000'"
|
||||||
[value]="settingsService.baseUrl()"
|
[value]="settingsService.baseUrl()"
|
||||||
(change)="settingsService.baseUrl.set($event.target.value)"
|
(change)="settingsService.updateBaseUrl($event.target.value)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<span class="flex-auto"></span>
|
<span class="flex-auto"></span>
|
||||||
|
|||||||
@@ -40,9 +40,15 @@ export class SettingsService {
|
|||||||
return url;
|
return url;
|
||||||
});
|
});
|
||||||
|
|
||||||
constructor() {}
|
constructor() {
|
||||||
|
const storedBaseUrl = localStorage.getItem('baseUrl');
|
||||||
|
if (storedBaseUrl) {
|
||||||
|
this.baseUrl.set(storedBaseUrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
updateBaseUrl(baseUrl: string) {
|
updateBaseUrl(baseUrl: string) {
|
||||||
this.baseUrl.set(baseUrl);
|
this.baseUrl.set(baseUrl);
|
||||||
|
localStorage.setItem('baseUrl', baseUrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user