diff --git a/src/main.ts b/src/main.ts index 0f96736..e6f27b8 100644 --- a/src/main.ts +++ b/src/main.ts @@ -122,7 +122,7 @@ export default class AwesomeBrainManagerPlugin extends Plugin { createTime, spend: '0', breaknum: '0', - expectedTime: (SETTINGS.expectedTime.value * 60 * 1000).toString(), + expectedTime: (parseFloat(SETTINGS.expectedTime.value) * 60 * 1000).toString(), status: 'todo', tags: tagsStr, }; diff --git a/src/settings.ts b/src/settings.ts index b150af2..c603b43 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -18,7 +18,7 @@ class Settings { powerMode: SettingModel; shakeMode: SettingModel; toolbar: SettingModel; - expectedTime: SettingModel; + expectedTime: SettingModel; clickString: SettingModel; customTag: SettingModel; debugEnable: SettingModel; @@ -72,7 +72,7 @@ class Settings { .key('expectedTime') .name(t.setting.expectedTime.name) .desc(t.setting.expectedTime.desc) - .number(25) + .text('25') .build(new RawSerde()); this.clickString = this.settings @@ -161,7 +161,7 @@ class Settings { .desc( 'Change value to your ntfy server address, or use the ntfy official address https://ntfy.sh/change_to_your_topic_name, or disable if empty. Notice: Please learn how to use it from official documents to ensure information security!!!', ) - .text('https://ntfy.sh/change_to_your_topic_name') + .text('') .build(new RawSerde()); this.ntfyToken = this.settings diff --git a/src/ui/App.vue b/src/ui/App.vue index 58585be..13c886e 100644 --- a/src/ui/App.vue +++ b/src/ui/App.vue @@ -12,6 +12,18 @@ + + + @@ -26,6 +38,7 @@ import { type GlobalThemeOverrides, NConfigProvider, NMessageProvider, + NModal, NNotificationProvider, NSpace, darkTheme, @@ -35,7 +48,7 @@ import { lightTheme, zhCN, } from 'naive-ui'; -import { onMounted, onUnmounted, onUpdated, ref, watchEffect } from 'vue'; +import { onUpdated, ref, watchEffect } from 'vue'; import { storeToRefs } from 'pinia'; import LoggerUtil from '../utils/logger'; import { useSystemStore } from '../stores'; @@ -44,6 +57,7 @@ import Toolbar from './Toolbar.vue'; let theme = ref(darkTheme); let locale = ref(zhCN); let dateLocale = ref(dateZhCN); +const showModal = ref(false); const { systemState } = storeToRefs(useSystemStore()); @@ -66,6 +80,14 @@ const lightThemeOverrides: GlobalThemeOverrides = {}; const darkThemeOverrides: GlobalThemeOverrides = {}; +const submitCallback = () => { + console.log('submitCallback'); +}; + +const cancelCallback = () => { + console.log('cancelCallback'); +}; + onUpdated(() => { LoggerUtil.log('app updated'); }); diff --git a/src/ui/ClockView.vue b/src/ui/ClockView.vue index a505a3b..9256d50 100644 --- a/src/ui/ClockView.vue +++ b/src/ui/ClockView.vue @@ -38,12 +38,12 @@ const { currentPomodoro } = storeToRefs(usePomodoroStore()); function updateTime() { const pomodoro = currentPomodoro.value; - if (!pomodoro) { + if (!pomodoro || pomodoro.status !== 'ing') { return; } currentSpend.value = moment().valueOf() - parseInt(pomodoro.lastactive) + parseInt(pomodoro.spend); // 转换成毫秒 - expectedTime.value = parseInt(pomodoro.expectedTime); + expectedTime.value = parseFloat(pomodoro.expectedTime); const leftTime = moment.duration(expectedTime.value - currentSpend.value, 'milliseconds'); time.value = moment.utc(leftTime.asMilliseconds()).format('HH:mm:ss'); } diff --git a/src/ui/modal/index.ts b/src/ui/modal/index.ts index 228e0f0..bb267e1 100644 --- a/src/ui/modal/index.ts +++ b/src/ui/modal/index.ts @@ -92,8 +92,10 @@ export class PomodoroReminderModal extends Modal { onOpen() { const { contentEl } = this; - - contentEl.createEl('h2', { text: t.info.done + this.pomodoro.task }); + contentEl.createEl('h2', { text: t.info.done }); + contentEl.createEl('div', { + text: `✅ ${this.pomodoro.task}`, + }); } onClose() {