From 7b50aa39db5e153a2de1fccbd03ce3fc18028fe2 Mon Sep 17 00:00:00 2001 From: Megghy Date: Tue, 24 Oct 2023 19:17:56 +0800 Subject: [PATCH] add event module --- package.json | 1 + src/api/api-models.ts | 4 + src/components/RegisterAndLogin.vue | 8 +- src/data/constants.ts | 2 + src/views/IndexView.vue | 12 +- src/views/manage/DashboardView.vue | 41 ++-- src/views/manage/EventView.vue | 287 +++++++++++++++++++++++- src/views/manage/SettingsManageView.vue | 3 +- yarn.lock | 5 + 9 files changed, 335 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index 527553d..193f4d4 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "core-js": "^3.8.3", "date-fns": "^2.30.0", "echarts": "^5.4.3", + "file-saver": "^2.0.5", "grapheme-splitter": "^1.0.4", "linqts": "^1.15.0", "universal-cookie": "^4.0.4", diff --git a/src/api/api-models.ts b/src/api/api-models.ts index bd568b6..8808488 100644 --- a/src/api/api-models.ts +++ b/src/api/api-models.ts @@ -34,6 +34,10 @@ export interface AccountInfo extends UserInfo { biliVerifyCode?: string bindEmail?: string settings: UserSetting + token: string + + eventFetcherOnline: boolean + eventFetcherStatus: string nextSendEmailTime?: number } diff --git a/src/components/RegisterAndLogin.vue b/src/components/RegisterAndLogin.vue index 54e0f1c..94dc447 100644 --- a/src/components/RegisterAndLogin.vue +++ b/src/components/RegisterAndLogin.vue @@ -139,7 +139,6 @@ function onLoginButtonClick() { nameOrEmail: loginModel.value.account, password: loginModel.value.password, }, - [['Turnstile', token.value]] ) .then(async (data) => { if (data.code == 200) { @@ -183,7 +182,7 @@ function onLoginButtonClick() { - 登陆 + 登陆 @@ -198,15 +197,16 @@ function onLoginButtonClick() { - + 注册 + + - diff --git a/src/data/constants.ts b/src/data/constants.ts index b708f08..d0c7ba0 100644 --- a/src/data/constants.ts +++ b/src/data/constants.ts @@ -5,6 +5,8 @@ const releseAPI = `https://vtsuru.suki.club/api/` export const isBackendUsable = ref(true) +export const AVATAR_URL = 'https://workers.vrp.moe/api/bilibili/avatar/' + export const BASE_API = process.env.NODE_ENV === 'development' ? debugAPI : releseAPI export const FETCH_API = 'https://fetch.vtsuru.live/' diff --git a/src/views/IndexView.vue b/src/views/IndexView.vue index a0af331..1d105e9 100644 --- a/src/views/IndexView.vue +++ b/src/views/IndexView.vue @@ -1,14 +1,18 @@ + \ No newline at end of file + 实验性功能, 尚不稳定. + + + + {{ accountInfo?.eventFetcherOnline ? (accountInfo?.eventFetcherStatus == 'ok' ? '正常' : `异常: ${accountInfo.eventFetcherStatus}`) : '未连接' }} + + + + + + + + diff --git a/src/views/manage/SettingsManageView.vue b/src/views/manage/SettingsManageView.vue index 5e82121..a8c5d53 100644 --- a/src/views/manage/SettingsManageView.vue +++ b/src/views/manage/SettingsManageView.vue @@ -135,6 +135,7 @@ const fakeSchedule = [ }, ] as ScheduleWeekInfo[] const selectedOption = ref(templateOptions[0].value) +const selectedTab = ref('general') const scheduleTemplateOptions = [ { @@ -236,7 +237,7 @@ onMounted(() => {