mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-08 07:12:39 +02:00
feat: add internal backend URL configuration and enhance server URL handling in SurfSense settings
This commit is contained in:
parent
1f524660e1
commit
1abbc6021f
4 changed files with 20 additions and 3 deletions
|
|
@ -41,7 +41,13 @@ export class SurfSenseSettingTab extends PluginSettingTab {
|
|||
.setPlaceholder("https://surfsense.com")
|
||||
.setValue(settings.serverUrl)
|
||||
.onChange(async (value) => {
|
||||
this.plugin.settings.serverUrl = value.trim();
|
||||
const next = value.trim();
|
||||
const previous = this.plugin.settings.serverUrl;
|
||||
if (previous !== "" && next !== previous) {
|
||||
this.plugin.settings.searchSpaceId = null;
|
||||
this.plugin.settings.connectorId = null;
|
||||
}
|
||||
this.plugin.settings.serverUrl = next;
|
||||
await this.plugin.saveSettings();
|
||||
}),
|
||||
);
|
||||
|
|
@ -59,7 +65,13 @@ export class SurfSenseSettingTab extends PluginSettingTab {
|
|||
.setPlaceholder("Paste token")
|
||||
.setValue(settings.apiToken)
|
||||
.onChange(async (value) => {
|
||||
this.plugin.settings.apiToken = value.trim();
|
||||
const next = value.trim();
|
||||
const previous = this.plugin.settings.apiToken;
|
||||
if (previous !== "" && next !== previous) {
|
||||
this.plugin.settings.searchSpaceId = null;
|
||||
this.plugin.settings.connectorId = null;
|
||||
}
|
||||
this.plugin.settings.apiToken = next;
|
||||
await this.plugin.saveSettings();
|
||||
});
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue