mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-06 18:36:55 +08:00
update vef alert
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
"date-fns": "^3.0.6",
|
"date-fns": "^3.0.6",
|
||||||
"easy-speech": "^2.2.0",
|
"easy-speech": "^2.2.0",
|
||||||
"echarts": "^5.4.3",
|
"echarts": "^5.4.3",
|
||||||
|
"eslint": "^8.56.0",
|
||||||
"eslint-plugin-import": "^2.29.1",
|
"eslint-plugin-import": "^2.29.1",
|
||||||
"eslint-plugin-oxlint": "^0.2.0",
|
"eslint-plugin-oxlint": "^0.2.0",
|
||||||
"eslint-plugin-prettier": "^5.1.2",
|
"eslint-plugin-prettier": "^5.1.2",
|
||||||
@@ -43,11 +44,11 @@
|
|||||||
"worker-timers": "^7.0.80"
|
"worker-timers": "^7.0.80"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@types/eslint": "^8",
|
||||||
"@typescript-eslint/parser": "^6.16.0",
|
"@typescript-eslint/parser": "^6.16.0",
|
||||||
"@vicons/ionicons5": "^0.12.0",
|
"@vicons/ionicons5": "^0.12.0",
|
||||||
"@vitejs/plugin-vue-jsx": "^3.1.0",
|
"@vitejs/plugin-vue-jsx": "^3.1.0",
|
||||||
"@vue/eslint-config-typescript": "^12.0.0",
|
"@vue/eslint-config-typescript": "^12.0.0",
|
||||||
"eslint": "^8.56.0",
|
|
||||||
"eslint-config-prettier": "^9.1.0",
|
"eslint-config-prettier": "^9.1.0",
|
||||||
"eslint-plugin-vue": "^9.19.2",
|
"eslint-plugin-vue": "^9.19.2",
|
||||||
"naive-ui": "^2.36.0",
|
"naive-ui": "^2.36.0",
|
||||||
|
|||||||
@@ -147,3 +147,50 @@ export async function UploadConfig(name: string, data: unknown) {
|
|||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
export async function EnableFunction(func: FunctionTypes) {
|
||||||
|
if (ACCOUNT.value) {
|
||||||
|
if (ACCOUNT.value.settings.enableFunctions.includes(func)) {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
ACCOUNT.value.settings.enableFunctions.push(func)
|
||||||
|
if (await updateFunctionEnable()) {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
ACCOUNT.value.settings.enableFunctions.splice(ACCOUNT.value.settings.enableFunctions.indexOf(func), 1)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
export async function DisableFunction(func: FunctionTypes) {
|
||||||
|
if (ACCOUNT.value) {
|
||||||
|
if (!ACCOUNT.value.settings.enableFunctions.includes(func)) {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
ACCOUNT.value.settings.enableFunctions.splice(ACCOUNT.value.settings.enableFunctions.indexOf(func), 1)
|
||||||
|
if (await updateFunctionEnable()) {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
ACCOUNT.value.settings.enableFunctions.push(func)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
async function updateFunctionEnable() {
|
||||||
|
if (ACCOUNT.value) {
|
||||||
|
try {
|
||||||
|
const data = await SaveEnableFunctions(ACCOUNT.value.settings.enableFunctions)
|
||||||
|
if (data.code == 200) {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -173,6 +173,7 @@ export enum FunctionTypes {
|
|||||||
Schedule,
|
Schedule,
|
||||||
SongRequest,
|
SongRequest,
|
||||||
Queue,
|
Queue,
|
||||||
|
Point
|
||||||
}
|
}
|
||||||
export interface SongAuthorInfo {
|
export interface SongAuthorInfo {
|
||||||
name: string
|
name: string
|
||||||
@@ -499,3 +500,29 @@ export enum FeedbackStatus {
|
|||||||
Reject,
|
Reject,
|
||||||
Developing,
|
Developing,
|
||||||
}
|
}
|
||||||
|
export interface TagInfo
|
||||||
|
{
|
||||||
|
name: string
|
||||||
|
color: string
|
||||||
|
}
|
||||||
|
export enum GoodsStatus
|
||||||
|
{
|
||||||
|
Normal, // 商品正常
|
||||||
|
//OutOfStock, // 商品无货
|
||||||
|
Discontinued // 商品下架
|
||||||
|
}
|
||||||
|
export enum GoodsTypes {
|
||||||
|
Physical,
|
||||||
|
Virtual,
|
||||||
|
}
|
||||||
|
export interface ResponsePointGoodModel {
|
||||||
|
id: number
|
||||||
|
name: string
|
||||||
|
count: number
|
||||||
|
price: number
|
||||||
|
tags: TagInfo[]
|
||||||
|
cover?: string
|
||||||
|
images: string[]
|
||||||
|
status: GoodsStatus
|
||||||
|
type: GoodsTypes
|
||||||
|
}
|
||||||
@@ -10,8 +10,7 @@ const status = computed(() => {
|
|||||||
if (!accountInfo.value) return 'error'
|
if (!accountInfo.value) return 'error'
|
||||||
if (accountInfo.value.eventFetcherOnline == true) {
|
if (accountInfo.value.eventFetcherOnline == true) {
|
||||||
if (accountInfo.value.eventFetcherStatus) {
|
if (accountInfo.value.eventFetcherStatus) {
|
||||||
if (accountInfo.value.eventFetcherStatus == 'ok') return 'success'
|
return 'warning'
|
||||||
else return 'warning'
|
|
||||||
} else if (Object.keys(accountInfo.value.eventFetcherStatusV3 ?? {}).length > 0) {
|
} else if (Object.keys(accountInfo.value.eventFetcherStatusV3 ?? {}).length > 0) {
|
||||||
return 'warning'
|
return 'warning'
|
||||||
} else {
|
} else {
|
||||||
@@ -31,7 +30,7 @@ const status = computed(() => {
|
|||||||
<template #trigger>
|
<template #trigger>
|
||||||
<NIcon :component="Info24Filled" />
|
<NIcon :component="Info24Filled" />
|
||||||
</template>
|
</template>
|
||||||
这是一个可以持续监听直播间内的 Superchat 和上舰事件并上传到本站进行记录的 Nodejs/.Net 程序
|
这是一个可以持续监听直播间内的 Superchat 和上舰事件并上传到本站进行记录的 .Net 程序
|
||||||
<br />
|
<br />
|
||||||
事件上传到本站后允许按照自定义范围进行查询, 并导出为 CSV 之类的表格
|
事件上传到本站后允许按照自定义范围进行查询, 并导出为 CSV 之类的表格
|
||||||
<br />
|
<br />
|
||||||
@@ -39,11 +38,22 @@ const status = computed(() => {
|
|||||||
</NTooltip>
|
</NTooltip>
|
||||||
</template>
|
</template>
|
||||||
<NTag :type="status">
|
<NTag :type="status">
|
||||||
<template v-if="status == 'success'"> 运行中 </template>
|
<template v-if="accountInfo?.eventFetcherStatus">
|
||||||
<template v-else-if="status == 'warning'">
|
此版本已过期, 请更新
|
||||||
<template v-if="accountInfo?.eventFetcherStatus"> 异常: {{ accountInfo.eventFetcherStatus }} </template>
|
<NTooltip trigger="click">
|
||||||
|
<template #trigger>
|
||||||
|
<NButton type="warning" size="tiny"> 关于 </NButton>
|
||||||
|
</template>
|
||||||
|
Node.js 版已不再更新, 如果是 Docker 的话请切换至 ghcr.io/megghy/vtsurueventfetcher.net, 其他环境请下载 https://github.com/Megghy/VtsuruEventFetcher.Net/releases/latest
|
||||||
|
</NTooltip>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<template v-if="status == 'success'"> 运行中 </template>
|
||||||
|
<template v-else-if="status == 'warning'">
|
||||||
|
<template v-if="accountInfo?.eventFetcherStatusV3"> 异常: {{ Object.values(accountInfo.eventFetcherStatusV3).join('; ') }} </template>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="status == 'info'"> 未连接 </template>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="status == 'info'"> 未连接 </template>
|
|
||||||
</NTag>
|
</NTag>
|
||||||
<template v-if="accountInfo?.eventFetcherOnline != true">
|
<template v-if="accountInfo?.eventFetcherOnline != true">
|
||||||
<NDivider vertical />
|
<NDivider vertical />
|
||||||
|
|||||||
0
src/components/PointGoodItem.vue
Normal file
0
src/components/PointGoodItem.vue
Normal file
@@ -33,6 +33,7 @@ export const LIVE_API_URL = { toString: () => `${BASE_API()}live/` }
|
|||||||
export const FEEDBACK_API_URL = { toString: () => `${BASE_API()}feedback/` }
|
export const FEEDBACK_API_URL = { toString: () => `${BASE_API()}feedback/` }
|
||||||
export const MUSIC_REQUEST_API_URL = { toString: () => `${BASE_API()}music-request/` }
|
export const MUSIC_REQUEST_API_URL = { toString: () => `${BASE_API()}music-request/` }
|
||||||
export const VTSURU_API_URL = { toString: () => `${BASE_API()}vtsuru/` }
|
export const VTSURU_API_URL = { toString: () => `${BASE_API()}vtsuru/` }
|
||||||
|
export const POINT_API_URL = { toString: () => `${BASE_API()}point/` }
|
||||||
|
|
||||||
export const ScheduleTemplateMap = {
|
export const ScheduleTemplateMap = {
|
||||||
'': { name: '默认', compoent: defineAsyncComponent(() => import('@/views/view/scheduleTemplate/DefaultScheduleTemplate.vue')) },
|
'': { name: '默认', compoent: defineAsyncComponent(() => import('@/views/view/scheduleTemplate/DefaultScheduleTemplate.vue')) },
|
||||||
|
|||||||
@@ -159,5 +159,13 @@ export default //管理页面
|
|||||||
title: '反馈',
|
title: '反馈',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'point',
|
||||||
|
name: 'manage-point',
|
||||||
|
component: () => import('@/views/manage/PointManage.vue'),
|
||||||
|
meta: {
|
||||||
|
title: '积分',
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -528,7 +528,7 @@ onMounted(() => {
|
|||||||
listFolded
|
listFolded
|
||||||
@ended="musicRquestStore.onMusicEnd"
|
@ended="musicRquestStore.onMusicEnd"
|
||||||
@play="musicRquestStore.onMusicPlay"
|
@play="musicRquestStore.onMusicPlay"
|
||||||
style="flex: 1;min-width: 400px;"
|
style="flex: 1; min-width: 400px"
|
||||||
/>
|
/>
|
||||||
<NSpace vertical>
|
<NSpace vertical>
|
||||||
<NTag :bordered="false" type="info" size="small"> 队列: {{ musicRquestStore.waitingMusics.length }} </NTag>
|
<NTag :bordered="false" type="info" size="small"> 队列: {{ musicRquestStore.waitingMusics.length }} </NTag>
|
||||||
|
|||||||
59
src/views/manage/PointManage.vue
Normal file
59
src/views/manage/PointManage.vue
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { DisableFunction, EnableFunction, useAccount } from '@/api/account'
|
||||||
|
import { ResponsePointGoodModel, FunctionTypes } from '@/api/api-models'
|
||||||
|
import { QueryGetAPI } from '@/api/query'
|
||||||
|
import { POINT_API_URL } from '@/data/constants'
|
||||||
|
import { NAlert, NButton, NDivider, NModal, NSwitch, NTabPane, NTabs, NText, useMessage } from 'naive-ui'
|
||||||
|
import { ref } from 'vue'
|
||||||
|
|
||||||
|
const message = useMessage()
|
||||||
|
const accountInfo = useAccount()
|
||||||
|
|
||||||
|
const goods = ref<ResponsePointGoodModel[]>(await getGoods())
|
||||||
|
|
||||||
|
async function getGoods() {
|
||||||
|
try {
|
||||||
|
var resp = await QueryGetAPI<ResponsePointGoodModel[]>(POINT_API_URL + 'get-goods')
|
||||||
|
if (resp.code == 200) {
|
||||||
|
return resp.data
|
||||||
|
} else {
|
||||||
|
message.error('无法获取数据: ' + resp.message)
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
message.error('无法获取数据: ' + err)
|
||||||
|
}
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
async function setFunctionEnable(enable: boolean) {
|
||||||
|
let success = false
|
||||||
|
if (enable) {
|
||||||
|
success = await EnableFunction(FunctionTypes.Point)
|
||||||
|
} else {
|
||||||
|
success = await DisableFunction(FunctionTypes.Point)
|
||||||
|
}
|
||||||
|
if (success) {
|
||||||
|
message.success('已' + (enable ? '启用' : '禁用') + '积分系统')
|
||||||
|
} else {
|
||||||
|
message.error('无法' + (enable ? '启用' : '禁用') + '积分系统')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<NAlert type="info">
|
||||||
|
启用积分系统
|
||||||
|
<NSwitch :value="accountInfo?.settings.enableFunctions.includes(FunctionTypes.Point)" @update:value="setFunctionEnable" />
|
||||||
|
<br />
|
||||||
|
<NText depth="3">
|
||||||
|
此功能需要部署
|
||||||
|
<NButton text type="primary" tag="a" href="https://www.yuque.com/megghy/dez70g/vfvcyv3024xvaa1p" target="_blank"> VtsuruEventFetcher </NButton>
|
||||||
|
</NText>
|
||||||
|
</NAlert>
|
||||||
|
<NTabs>
|
||||||
|
<NTabPane name="goods" tab="商品">
|
||||||
|
<NDivider />
|
||||||
|
</NTabPane>
|
||||||
|
</NTabs>
|
||||||
|
|
||||||
|
<NModal> </NModal>
|
||||||
|
</template>
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
const { defineConfig } = require('@vue/cli-service')
|
|
||||||
|
|
||||||
module.exports = defineConfig({
|
|
||||||
transpileDependencies: true,
|
|
||||||
})
|
|
||||||
|
|||||||
40
yarn.lock
40
yarn.lock
@@ -603,13 +603,13 @@ __metadata:
|
|||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@humanwhocodes/config-array@npm:^0.11.13":
|
"@humanwhocodes/config-array@npm:^0.11.13":
|
||||||
version: 0.11.13
|
version: 0.11.14
|
||||||
resolution: "@humanwhocodes/config-array@npm:0.11.13"
|
resolution: "@humanwhocodes/config-array@npm:0.11.14"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@humanwhocodes/object-schema": "npm:^2.0.1"
|
"@humanwhocodes/object-schema": "npm:^2.0.2"
|
||||||
debug: "npm:^4.1.1"
|
debug: "npm:^4.3.1"
|
||||||
minimatch: "npm:^3.0.5"
|
minimatch: "npm:^3.0.5"
|
||||||
checksum: d76ca802d853366094d0e98ff0d0994117fc8eff96649cd357b15e469e428228f597cd2e929d54ab089051684949955f16ee905bb19f7b2f0446fb377157be7a
|
checksum: 66f725b4ee5fdd8322c737cb5013e19fac72d4d69c8bf4b7feb192fcb83442b035b92186f8e9497c220e58b2d51a080f28a73f7899bc1ab288c3be172c467541
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@@ -620,10 +620,10 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@humanwhocodes/object-schema@npm:^2.0.1":
|
"@humanwhocodes/object-schema@npm:^2.0.2":
|
||||||
version: 2.0.1
|
version: 2.0.2
|
||||||
resolution: "@humanwhocodes/object-schema@npm:2.0.1"
|
resolution: "@humanwhocodes/object-schema@npm:2.0.2"
|
||||||
checksum: 9dba24e59fdb4041829d92b693aacb778add3b6f612aaa9c0774f3b650c11a378cc64f042a59da85c11dae33df456580a3c36837b953541aed6ff94294f97fac
|
checksum: 6fd83dc320231d71c4541d0244051df61f301817e9f9da9fd4cb7e44ec8aacbde5958c1665b0c419401ab935114fdf532a6ad5d4e7294b1af2f347dd91a6983f
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@@ -851,7 +851,24 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@types/json-schema@npm:^7.0.12":
|
"@types/eslint@npm:^8":
|
||||||
|
version: 8.56.2
|
||||||
|
resolution: "@types/eslint@npm:8.56.2"
|
||||||
|
dependencies:
|
||||||
|
"@types/estree": "npm:*"
|
||||||
|
"@types/json-schema": "npm:*"
|
||||||
|
checksum: e33ca87a30a9454ba9943e1270ac759996f5fe598a1c1afbaec1d1e7346a339e20bf2a9d81f177067116bbaa6cfa4f748993cb338f57978ae862ad38ffae56fe
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"@types/estree@npm:*":
|
||||||
|
version: 1.0.5
|
||||||
|
resolution: "@types/estree@npm:1.0.5"
|
||||||
|
checksum: b3b0e334288ddb407c7b3357ca67dbee75ee22db242ca7c56fe27db4e1a31989cb8af48a84dd401deb787fe10cc6b2ab1ee82dc4783be87ededbe3d53c79c70d
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"@types/json-schema@npm:*, @types/json-schema@npm:^7.0.12":
|
||||||
version: 7.0.15
|
version: 7.0.15
|
||||||
resolution: "@types/json-schema@npm:7.0.15"
|
resolution: "@types/json-schema@npm:7.0.15"
|
||||||
checksum: a996a745e6c5d60292f36731dd41341339d4eeed8180bb09226e5c8d23759067692b1d88e5d91d72ee83dfc00d3aca8e7bd43ea120516c17922cbcb7c3e252db
|
checksum: a996a745e6c5d60292f36731dd41341339d4eeed8180bb09226e5c8d23759067692b1d88e5d91d72ee83dfc00d3aca8e7bd43ea120516c17922cbcb7c3e252db
|
||||||
@@ -1926,7 +1943,7 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.4":
|
"debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.4":
|
||||||
version: 4.3.4
|
version: 4.3.4
|
||||||
resolution: "debug@npm:4.3.4"
|
resolution: "debug@npm:4.3.4"
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -4864,6 +4881,7 @@ __metadata:
|
|||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "vtsuru.live@workspace:."
|
resolution: "vtsuru.live@workspace:."
|
||||||
dependencies:
|
dependencies:
|
||||||
|
"@types/eslint": "npm:^8"
|
||||||
"@types/node": "npm:^20.10.6"
|
"@types/node": "npm:^20.10.6"
|
||||||
"@typescript-eslint/eslint-plugin": "npm:^6.16.0"
|
"@typescript-eslint/eslint-plugin": "npm:^6.16.0"
|
||||||
"@typescript-eslint/parser": "npm:^6.16.0"
|
"@typescript-eslint/parser": "npm:^6.16.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user