mirror of
https://github.com/cdloh/obsidian-cron.git
synced 2026-07-22 07:40:30 +00:00
parent
e548b24a72
commit
e505695003
1 changed files with 39 additions and 38 deletions
|
|
@ -12,10 +12,10 @@ export default class CronSettingTab extends PluginSettingTab {
|
|||
}
|
||||
|
||||
display(): void {
|
||||
const {containerEl} = this;
|
||||
const { containerEl } = this;
|
||||
|
||||
containerEl.empty();
|
||||
containerEl.createEl('h2', {text: 'Settings for Cron.'});
|
||||
containerEl.createEl('h2', { text: 'Settings for Cron.' });
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Cron Interval')
|
||||
|
|
@ -23,7 +23,7 @@ export default class CronSettingTab extends PluginSettingTab {
|
|||
.addText(text => text
|
||||
.setValue(this.plugin.settings.cronInterval.toString())
|
||||
.onChange(async (value) => {
|
||||
if(value == "") {return}
|
||||
if (value == "") { return }
|
||||
this.plugin.settings.cronInterval = parseInt(value);
|
||||
await this.plugin.saveSettings();
|
||||
this.plugin.loadInterval();
|
||||
|
|
@ -82,7 +82,7 @@ export default class CronSettingTab extends PluginSettingTab {
|
|||
this.addCommandSearch()
|
||||
}
|
||||
|
||||
addCommandSearch (): void {
|
||||
addCommandSearch(): void {
|
||||
|
||||
this.plugin.settings.crons.forEach((cronjob, index) => {
|
||||
const jobSetting = new Setting(this.containerEl)
|
||||
|
|
@ -101,7 +101,7 @@ export default class CronSettingTab extends PluginSettingTab {
|
|||
cb.setPlaceholder("Command")
|
||||
.setValue(cronjob.job)
|
||||
.onChange(async (command) => {
|
||||
if(!command) { return }
|
||||
if (!command) { return }
|
||||
|
||||
this.plugin.settings.crons[index].job = command;
|
||||
await this.plugin.saveSettings();
|
||||
|
|
@ -157,6 +157,7 @@ export default class CronSettingTab extends PluginSettingTab {
|
|||
.setTooltip("Delete Job")
|
||||
.onClick(() => {
|
||||
this.plugin.settings.crons.splice(index, 1)
|
||||
delete this.plugin.jobs[cronjob.id]
|
||||
delete this.plugin.settings.locks[cronjob.id]
|
||||
this.plugin.saveSettings();
|
||||
// Force refresh
|
||||
|
|
|
|||
Loading…
Reference in a new issue