mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-06 18:36:55 +08:00
add batch del song
This commit is contained in:
@@ -4,7 +4,6 @@ import { APIRoot, PaginationResponse } from './api-models'
|
|||||||
import { apiFail } from '@/data/constants'
|
import { apiFail } from '@/data/constants'
|
||||||
|
|
||||||
const cookie = useLocalStorage('JWT_Token', '')
|
const cookie = useLocalStorage('JWT_Token', '')
|
||||||
let failCount = 0
|
|
||||||
|
|
||||||
export async function QueryPostAPI<T>(
|
export async function QueryPostAPI<T>(
|
||||||
urlString: string,
|
urlString: string,
|
||||||
@@ -34,11 +33,9 @@ export async function QueryPostAPIWithParams<T>(
|
|||||||
body: typeof body === 'string' ? body : JSON.stringify(body),
|
body: typeof body === 'string' ? body : JSON.stringify(body),
|
||||||
})
|
})
|
||||||
const result = (await data.json()) as APIRoot<T>
|
const result = (await data.json()) as APIRoot<T>
|
||||||
failCount = 0
|
|
||||||
return result
|
return result
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(`[POST] API调用失败: ${e}`)
|
console.error(`[POST] API调用失败: ${e}`)
|
||||||
failCount++
|
|
||||||
if (!apiFail.value) {
|
if (!apiFail.value) {
|
||||||
apiFail.value = true
|
apiFail.value = true
|
||||||
console.log('默认API异常, 切换至故障转移节点')
|
console.log('默认API异常, 切换至故障转移节点')
|
||||||
@@ -63,11 +60,9 @@ export async function QueryGetAPI<T>(
|
|||||||
headers: headers,
|
headers: headers,
|
||||||
})
|
})
|
||||||
const result = (await data.json()) as APIRoot<T>
|
const result = (await data.json()) as APIRoot<T>
|
||||||
failCount = 0
|
|
||||||
return result
|
return result
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(`[GET] API调用失败: ${e}`)
|
console.error(`[GET] API调用失败: ${e}`)
|
||||||
failCount++
|
|
||||||
if (!apiFail.value) {
|
if (!apiFail.value) {
|
||||||
apiFail.value = true
|
apiFail.value = true
|
||||||
console.log('默认API异常, 切换至故障转移节点')
|
console.log('默认API异常, 切换至故障转移节点')
|
||||||
|
|||||||
@@ -477,6 +477,19 @@ async function delSong(song: SongsInfo) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
async function delBatchSong() {
|
||||||
|
const ids = selectedColumn.value.map((s) => s.toString())
|
||||||
|
await QueryPostAPI<SongsInfo>(SONG_API_URL + 'del-batch', ids).then((data) => {
|
||||||
|
if (data.code == 200) {
|
||||||
|
songsInternal.value = songsInternal.value.filter((s) => !ids.includes(s.key))
|
||||||
|
message.success('已删除 ' + ids.length + ' 首歌曲')
|
||||||
|
showBatchModal.value = false
|
||||||
|
selectedColumn.value = []
|
||||||
|
} else {
|
||||||
|
message.error('未能删除歌曲: ' + data.message)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
function GetSCColor(price: number): string {
|
function GetSCColor(price: number): string {
|
||||||
if (price === 0) return `#2a60b2`
|
if (price === 0) return `#2a60b2`
|
||||||
if (price > 0 && price < 30) return `#2a60b2`
|
if (price > 0 && price < 30) return `#2a60b2`
|
||||||
@@ -797,6 +810,14 @@ onMounted(() => {
|
|||||||
style="max-width: 600px"
|
style="max-width: 600px"
|
||||||
>
|
>
|
||||||
<NTabs>
|
<NTabs>
|
||||||
|
<NTabPane name="delete" tab="删除">
|
||||||
|
<NPopconfirm @positive-click="delBatchSong">
|
||||||
|
<template #trigger>
|
||||||
|
<NButton type="error"> 批量删除 </NButton>
|
||||||
|
</template>
|
||||||
|
<span> 确定删除 {{ selectedColumn.length }} 首曲目吗? </span>
|
||||||
|
</NPopconfirm>
|
||||||
|
</NTabPane>
|
||||||
<NTabPane name="author" tab="作者">
|
<NTabPane name="author" tab="作者">
|
||||||
<NSelect
|
<NSelect
|
||||||
v-model:value="batchUpdate_Author"
|
v-model:value="batchUpdate_Author"
|
||||||
|
|||||||
33
src/main.ts
33
src/main.ts
@@ -9,12 +9,15 @@ import { GetSelfAccount, UpdateAccountLoop } from './api/account'
|
|||||||
import { GetNotifactions } from './data/notifactions'
|
import { GetNotifactions } from './data/notifactions'
|
||||||
import router from './router'
|
import router from './router'
|
||||||
import { useAuthStore } from './store/useAuthStore'
|
import { useAuthStore } from './store/useAuthStore'
|
||||||
|
import { useRoute } from 'vue-router'
|
||||||
|
|
||||||
const pinia = createPinia()
|
const pinia = createPinia()
|
||||||
|
|
||||||
const app = createApp(App)
|
const app = createApp(App)
|
||||||
app.use(router).use(pinia).mount('#app')
|
app.use(router).use(pinia).mount('#app')
|
||||||
|
|
||||||
|
const route = useRoute()
|
||||||
|
|
||||||
let currentVersion: string
|
let currentVersion: string
|
||||||
let isHaveNewVersion = false
|
let isHaveNewVersion = false
|
||||||
|
|
||||||
@@ -48,20 +51,22 @@ QueryGetAPI<string>(BASE_API + 'vtsuru/version')
|
|||||||
currentVersion = version.data
|
currentVersion = version.data
|
||||||
localStorage.setItem('Version', currentVersion)
|
localStorage.setItem('Version', currentVersion)
|
||||||
|
|
||||||
const n = notification.info({
|
if (!route.path.startsWith('/obs')) {
|
||||||
title: '发现新的版本更新',
|
const n = notification.info({
|
||||||
content: '是否现在刷新?',
|
title: '发现新的版本更新',
|
||||||
meta: () => h(NText, { depth: 3 }, () => currentVersion),
|
content: '是否现在刷新?',
|
||||||
action: () =>
|
meta: () => h(NText, { depth: 3 }, () => currentVersion),
|
||||||
h(NFlex, null, () => [
|
action: () =>
|
||||||
h(
|
h(NFlex, null, () => [
|
||||||
NButton,
|
h(
|
||||||
{ text: true, type: 'primary', onClick: () => location.reload(), size: 'small' },
|
NButton,
|
||||||
{ default: () => '刷新' },
|
{ text: true, type: 'primary', onClick: () => location.reload(), size: 'small' },
|
||||||
),
|
{ default: () => '刷新' },
|
||||||
h(NButton, { text: true, onClick: () => n.destroy(), size: 'small' }, { default: () => '稍后' }),
|
),
|
||||||
]),
|
h(NButton, { text: true, onClick: () => n.destroy(), size: 'small' }, { default: () => '稍后' }),
|
||||||
})
|
]),
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}, 60 * 1000)
|
}, 60 * 1000)
|
||||||
|
|||||||
@@ -172,15 +172,17 @@ function objectsToCSV(arr: any[]) {
|
|||||||
>认证Bilibili账号</NButton
|
>认证Bilibili账号</NButton
|
||||||
>
|
>
|
||||||
</NAlert>
|
</NAlert>
|
||||||
<NAlert type="info">
|
<NAlert type="error" title="2024.2.26">
|
||||||
当前本站正在测试为粉丝数大于 1000 或至少拥有一位舰长的主播直接从服务端记录并储存弹幕数据,
|
近期逸站对开放平台直播弹幕流进行了极为严格的限制, 目前本站服务器只能连接个位数的直播间, 这使得在不使用
|
||||||
不过并不清楚B站的风控策略, 此功能不一定会长期启用
|
<NButton tag="a" href="https://www.yuque.com/megghy/dez70g/vfvcyv3024xvaa1p" target="_blank" type="primary" text>
|
||||||
<br />
|
VtsuruEventFetcher
|
||||||
在我们被限制连接之前满足以上条件的主播无需部署
|
</NButton>
|
||||||
|
的情况下获取弹幕数据几乎不可能实现.
|
||||||
|
<br />
|
||||||
|
在这种情况下如果你还需要记录上舰, SC等事件请跟随链接里的教程部署
|
||||||
<NButton tag="a" href="https://www.yuque.com/megghy/dez70g/vfvcyv3024xvaa1p" target="_blank" type="primary" text>
|
<NButton tag="a" href="https://www.yuque.com/megghy/dez70g/vfvcyv3024xvaa1p" target="_blank" type="primary" text>
|
||||||
VtsuruEventFetcher
|
VtsuruEventFetcher
|
||||||
</NButton>
|
</NButton>
|
||||||
即可使用相关功能 (如记录上舰和SC, 直播场记录等) 😊
|
|
||||||
</NAlert>
|
</NAlert>
|
||||||
<EventFetcherStatusCard />
|
<EventFetcherStatusCard />
|
||||||
</NSpace>
|
</NSpace>
|
||||||
|
|||||||
Reference in New Issue
Block a user