-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.ts
64 lines (55 loc) · 1.93 KB
/
settings.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import AmpliFlowPublisher from "main";
import { PluginSettingTab, App, Setting } from "obsidian";
interface AmpliFlowSettings {
tenant: string;
email: string;
password: string;
}
const DEFAULT_SETTINGS: AmpliFlowSettings = {
tenant: '',
email: '',
password: ''
};
export default class AmpliFlowSettingTab extends PluginSettingTab {
plugin: AmpliFlowPublisher;
constructor(app: App, plugin: AmpliFlowPublisher) {
super(app, plugin);
this.plugin = plugin;
}
display(): void {
const { containerEl } = this;
containerEl.empty();
new Setting(containerEl)
.setName('Tenant')
.setDesc('Your AmpliFlow tenant name')
.addText(text => text
.setPlaceholder('Enter your tenant')
.setValue(this.plugin.settings.tenant)
.onChange(async (value) => {
this.plugin.settings.tenant = value;
await this.plugin.saveSettings();
}));
new Setting(containerEl)
.setName('Email')
.setDesc('Your AmpliFlow email address')
.addText(text => text
.setPlaceholder('Enter your email')
.setValue(this.plugin.settings.email)
.onChange(async (value) => {
this.plugin.settings.email = value;
await this.plugin.saveSettings();
}));
new Setting(containerEl)
.setName('Password')
.setDesc('Your AmpliFlow password')
.addText(text => text
.setPlaceholder('Enter your password')
.setValue(this.plugin.settings.password)
.onChange(async (value) => {
this.plugin.settings.password = value;
await this.plugin.saveSettings();
})
.inputEl.type = 'password')
;
}
}