diff --git a/command/msTodoCommand.ts b/command/msTodoCommand.ts index 61bd906..ca8ad10 100644 --- a/command/msTodoCommand.ts +++ b/command/msTodoCommand.ts @@ -38,7 +38,7 @@ export async function createTodayTasks(todoApi: TodoApi,editor:Editor,dateFormat const lines = taskList.tasks?.map(task => { const createDate = window.moment(task.createdDateTime).format(dateFormat); const done = task.status == "completed" ? "x" : " "; - const date = createDate == now.format(dateFormat) ? "" : "🔎" + createDate; + const date = createDate == now.format(dateFormat) ? "" : `🔎[[${createDate}]]`; const body = !task.body?.content ? "" : "💡" + task.body.content; return `- [${done}] ${task.title} ${date} ${body}`; diff --git a/gui/msTodoSyncSettingTab.ts b/gui/msTodoSyncSettingTab.ts index 9c21c7e..6415bb9 100644 --- a/gui/msTodoSyncSettingTab.ts +++ b/gui/msTodoSyncSettingTab.ts @@ -2,6 +2,37 @@ import MsTodoSync from "../main"; import { App, Notice, PluginSettingTab, Setting } from "obsidian"; import { getUptimerToken } from "api/uptimerApi"; + +export interface MsTodoSyncSettings { + todoListSync: { + listName: string | undefined, + listId: string | undefined, + }; + uptimer:{ + email: string | undefined, + password: string | undefined, + token: string | undefined + }; + bot: { + baseUrl: string, + verifyKey: string, + qq: number, + } | undefined +} + +export const DEFAULT_SETTINGS: MsTodoSyncSettings = { + todoListSync:{ + listName: undefined, + listId: undefined, + }, + uptimer: { + email: undefined, + password: undefined, + token: undefined + }, + bot: undefined +} + export class MsTodoSyncSettingTab extends PluginSettingTab { plugin: MsTodoSync; constructor(app: App, plugin: MsTodoSync) { diff --git a/main.ts b/main.ts index 06a93b9..91ca8e2 100644 --- a/main.ts +++ b/main.ts @@ -4,38 +4,9 @@ import { TodoApi, MicrosoftClientProvider } from './api/todoApi'; import { UptimerApi } from './api/uptimerApi'; import { Bot, Message } from 'mirai-js' import { getBiliInfo } from './bot/bilibili'; -import { MsTodoSyncSettingTab } from 'gui/msTodoSyncSettingTab'; +import { DEFAULT_SETTINGS, MsTodoSyncSettings, MsTodoSyncSettingTab } from 'gui/msTodoSyncSettingTab'; import { createTodayTasks, postTask } from 'command/msTodoCommand'; -interface MsTodoSyncSettings { - todoListSync: { - listName: string | undefined, - listId: string | undefined, - }; - uptimer:{ - email: string | undefined, - password: string | undefined, - token: string | undefined - }; - bot: { - baseUrl: string, - verifyKey: string, - qq: number, - } | undefined -} - -const DEFAULT_SETTINGS: MsTodoSyncSettings = { - todoListSync:{ - listName: undefined, - listId: undefined, - }, - uptimer: { - email: undefined, - password: undefined, - token: undefined - }, - bot: undefined -} export default class MsTodoSync extends Plugin { settings: MsTodoSyncSettings;