clear unused imports

This commit is contained in:
Megghy
2023-12-19 10:41:04 +08:00
parent 89911c7ad2
commit 283f3e11f4
46 changed files with 330 additions and 514 deletions

View File

@@ -2,8 +2,7 @@
import { GetSelfAccount, useAccount } from '@/api/account'
import { QueryGetAPI } from '@/api/query'
import { BILI_API_URL } from '@/data/constants'
import { NAlert, NButton, NCard, NCode, NInput, NInputNumber, NSpace, NSpin, NText, NCountdown, NInputGroup, useMessage } from 'naive-ui'
import { isTaggedTemplateExpression } from 'typescript'
import { NAlert, NButton, NCard, NCountdown, NInput, NInputGroup, NInputNumber, NSpace, NSpin, NText, useMessage } from 'naive-ui'
import { onMounted, ref } from 'vue'
const message = useMessage()

View File

@@ -30,6 +30,6 @@ onUnmounted(() => {
<NAlert v-if="accountInfo?.isBiliVerified != true" type="info"> 尚未进行Bilibili认证 </NAlert>
<NSpin v-else-if="isClientLoading" show />
<KeepAlive v-else>
<component :is="component" :client="client" :room-info="client.roomAuthInfo?.value" :code="accountInfo?.biliAuthCode"/>
<component :is="component" :client="client" :room-info="client.roomAuthInfo?.value" :code="accountInfo?.biliAuthCode" />
</KeepAlive>
</template>

View File

@@ -1,15 +1,15 @@
<script setup lang="ts">
import { useAccount } from '@/api/account'
import { NAlert, NButton, NCard, NCountdown, NDivider, NEllipsis, NIcon, NInput, NInputGroup, NModal, NPopconfirm, NSpace, NTag, NText, NThing, NTime, NTooltip, useMessage } from 'naive-ui'
import SettingsManageView from './SettingsManageView.vue'
import { useLocalStorage } from '@vueuse/core'
import { ref } from 'vue'
import { BiliAuthCodeStatusType } from '@/api/api-models'
import { QueryGetAPI } from '@/api/query'
import EventFetcherStatusCard from '@/components/EventFetcherStatusCard.vue'
import { ACCOUNT_API_URL, TURNSTILE_KEY } from '@/data/constants'
import { Question24Regular } from '@vicons/fluent'
import { useLocalStorage } from '@vueuse/core'
import { NAlert, NButton, NCard, NCountdown, NDivider, NEllipsis, NIcon, NInput, NInputGroup, NModal, NPopconfirm, NSpace, NTag, NText, NTime, NTooltip, useMessage } from 'naive-ui'
import { ref } from 'vue'
import VueTurnstile from 'vue-turnstile'
import { BiliAuthCodeStatusType } from '@/api/api-models'
import EventFetcherStatusCard from '@/components/EventFetcherStatusCard.vue'
import SettingsManageView from './SettingsManageView.vue'
const token = ref('')
const turnstile = ref()
@@ -175,9 +175,7 @@ async function ChangeBili() {
当前本站正在测试为粉丝数大于 1000 或至少拥有一位舰长的主播直接从服务端记录并储存弹幕数据, 不过并不清楚B站的风控策略, 此功能不一定会长期启用
<br />
在我们被限制连接之前满足以上条件的主播无需部署
<NButton tag="a" href="https://www.yuque.com/megghy/dez70g/vfvcyv3024xvaa1p" target="_blank" type="primary" text>
VtsuruEventFetcher
</NButton>
<NButton tag="a" href="https://www.yuque.com/megghy/dez70g/vfvcyv3024xvaa1p" target="_blank" type="primary" text> VtsuruEventFetcher </NButton>
即可使用相关功能 (如记录上舰和SC, 直播场记录等) 😊
</NAlert>
<NCard embedded style="width: 100%">

View File

@@ -1,9 +1,13 @@
<script setup lang="ts">
import { isDarkMode } from '@/Utils'
import { useAccount } from '@/api/account'
import { QueryGetAPI } from '@/api/query'
import EventFetcherStatusCard from '@/components/EventFetcherStatusCard.vue'
import { AVATAR_URL, BASE_API } from '@/data/constants'
import { Grid28Filled, List16Filled } from '@vicons/fluent'
import { format, getDaysInMonth } from 'date-fns'
import { format } from 'date-fns'
import { saveAs } from 'file-saver'
import { List } from 'linqts'
import {
NAlert,
NAvatar,
@@ -16,10 +20,7 @@ import {
NEllipsis,
NGrid,
NGridItem,
NH1,
NH2,
NH3,
NH5,
NIcon,
NLi,
NRadioButton,
@@ -34,10 +35,6 @@ import {
useMessage,
} from 'naive-ui'
import { computed, onMounted, ref } from 'vue'
import { saveAs } from 'file-saver'
import { List } from 'linqts'
import { isDarkMode } from '@/Utils'
import EventFetcherStatusCard from '@/components/EventFetcherStatusCard.vue'
enum EventType {
Guard,
@@ -175,9 +172,7 @@ onMounted(() => {
当前本站正在测试为粉丝数大于 1000 或至少拥有一位舰长的主播直接从服务端记录并储存弹幕数据, 不过并不清楚B站的风控策略, 此功能不一定会长期启用
<br />
在我们被限制连接之前满足以上条件的主播无需部署
<NButton tag="a" href="https://www.yuque.com/megghy/dez70g/vfvcyv3024xvaa1p" target="_blank" type="primary" text>
VtsuruEventFetcher
</NButton>
<NButton tag="a" href="https://www.yuque.com/megghy/dez70g/vfvcyv3024xvaa1p" target="_blank" type="primary" text> VtsuruEventFetcher </NButton>
即可使用相关功能 (如记录上舰和SC, 直播场记录等) 😊
</NAlert>
<EventFetcherStatusCard />

View File

@@ -2,14 +2,14 @@
import { useAccount } from '@/api/account'
import { QueryGetAPI } from '@/api/query'
import { HISTORY_API_URL } from '@/data/constants'
import { NAlert, NCard, NSpace, NSpin, useMessage } from 'naive-ui'
import { onMounted, ref } from 'vue'
import { addHours, format, isSameDay, isSameHour, startOfHour } from 'date-fns'
import { BarChart, LineChart } from 'echarts/charts'
import { DataZoomComponent, GridComponent, LegendComponent, TitleComponent, ToolboxComponent, TooltipComponent } from 'echarts/components'
import { use } from 'echarts/core'
import { CanvasRenderer } from 'echarts/renderers'
import { BarChart, LineChart } from 'echarts/charts'
import { TitleComponent, TooltipComponent, LegendComponent, GridComponent, DataZoomComponent, ToolboxComponent } from 'echarts/components'
import { NAlert, NCard, NSpace, NSpin, useMessage } from 'naive-ui'
import { onMounted, ref } from 'vue'
import VChart from 'vue-echarts'
import { addHours, format, getUnixTime, isSameDay, isSameHour, startOfHour } from 'date-fns'
use([CanvasRenderer, LineChart, TitleComponent, TooltipComponent, LegendComponent, GridComponent, DataZoomComponent, LineChart, ToolboxComponent, BarChart])

View File

@@ -1,8 +1,8 @@
<script setup lang="ts">
import { useAccount } from '@/api/account'
import DanmakuClient from '@/data/DanmakuClient'
import { onMounted, onUnmounted } from 'vue'
import { NAlert } from 'naive-ui'
import { onMounted, onUnmounted } from 'vue'
import OpenLottery from '../open_live/OpenLottery.vue'
const accountInfo = useAccount()

View File

@@ -2,11 +2,9 @@
import { useAccount } from '@/api/account'
import { ResponseLiveInfoModel } from '@/api/api-models'
import { QueryGetAPI } from '@/api/query'
import EventFetcherStatusCard from '@/components/EventFetcherStatusCard.vue'
import LiveInfoContainer from '@/components/LiveInfoContainer.vue'
import { LIVE_API_URL } from '@/data/constants'
import { List } from 'linqts'
import { NButton, NDivider, NList, NListItem, NAlert, NPagination, NPopover, NSpace, NStatistic, NTag, NTime, NTooltip, useMessage } from 'naive-ui'
import { NAlert, NDivider, NList, NListItem, NPagination, NSpace, useMessage } from 'naive-ui'
import { ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'

View File

@@ -4,9 +4,7 @@ import { LotteryUserInfo } from '@/api/api-models'
import { QueryGetAPI } from '@/api/query'
import { LOTTERY_API_URL, TURNSTILE_KEY } from '@/data/constants'
import { useLocalStorage, useStorage } from '@vueuse/core'
import { randomInt } from 'crypto'
import { format } from 'date-fns'
import { List } from 'linqts'
import {
NAvatar,
NButton,
@@ -29,15 +27,12 @@ import {
NRadioGroup,
NScrollbar,
NSpace,
NTabPane,
NTabs,
NTag,
NTime,
NTooltip,
useMessage,
useNotification,
} from 'naive-ui'
import { breadcrumbLight } from 'naive-ui/es/breadcrumb/styles'
import { computed, h, ref } from 'vue'
import VueTurnstile from 'vue-turnstile'
@@ -152,7 +147,7 @@ async function getCommentsUsers() {
{
id: inputDynamicId.value,
},
[['Turnstile', token.value]]
[['Turnstile', token.value]],
)
.then((data) => {
if (data.code == 200) {
@@ -178,7 +173,7 @@ async function getForwardUsers() {
{
id: inputDynamicId.value,
},
[['Turnstile', token.value]]
[['Turnstile', token.value]],
)
.then((data) => {
if (data.code == 200) {
@@ -263,7 +258,7 @@ function onFinishLottery() {
h(
NSpace,
{ vertical: true },
resultUsers.value?.map((user) => h(NSpace, null, [h(NAvatar, { src: user.avatar + '@32w_32h', imgProps: { referrerpolicy: 'no-referrer' } }), h('span', user.name)]))
resultUsers.value?.map((user) => h(NSpace, null, [h(NAvatar, { src: user.avatar + '@32w_32h', imgProps: { referrerpolicy: 'no-referrer' } }), h('span', user.name)])),
),
meta: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
onAfterLeave: () => {

View File

@@ -1,14 +1,19 @@
<script setup lang="ts">
import { copyToClipboard } from '@/Utils'
import { useAccount } from '@/api/account'
import { QAInfo } from '@/api/api-models'
import { QueryGetAPI, QueryPostAPI } from '@/api/query'
import { ACCOUNT_API_URL, QUESTION_API_URL } from '@/data/constants'
import router from '@/router'
import { Heart, HeartOutline } from '@vicons/ionicons5'
import { saveAs } from 'file-saver'
import html2canvas from 'html2canvas'
import { List } from 'linqts'
import {
NButton,
NCard,
NCheckbox,
NDivider,
NGradientText,
NIcon,
NImage,
NInput,
@@ -27,14 +32,8 @@ import {
NTooltip,
useMessage,
} from 'naive-ui'
import { computed, onMounted, ref } from 'vue'
import { List } from 'linqts'
import router from '@/router'
import html2canvas from 'html2canvas'
import QrcodeVue from 'qrcode.vue'
import { useAccount } from '@/api/account'
import { saveAs } from 'file-saver'
import { copyToClipboard } from '@/Utils'
import { computed, onMounted, ref } from 'vue'
import { useRoute } from 'vue-router'
const accountInfo = useAccount()
@@ -247,7 +246,7 @@ function saveShareImage() {
saveAs(data, `vtsuru-提问箱-${accountInfo.value?.name}.png`)
},
'image/png',
1
1,
)
})
}

View File

@@ -1,30 +1,9 @@
<script setup lang="ts">
import { DelBiliBlackList, SaveAccountSettings, SaveEnableFunctions, useAccount } from '@/api/account'
import {
NButton,
NCard,
NCheckbox,
NCheckboxGroup,
NDivider,
NEmpty,
NForm,
NList,
NListItem,
NModal,
NSelect,
NSpace,
NSpin,
NSwitch,
NTabPane,
NTabs,
NText,
SelectOption,
useMessage,
} from 'naive-ui'
import { Ref, computed, h, onMounted, ref, defineAsyncComponent, onActivated } from 'vue'
import { FunctionTypes, ScheduleWeekInfo, SongFrom, SongLanguage, SongRequestOption, SongsInfo } from '@/api/api-models'
import { QueryPostAPI } from '@/api/query'
import { ACCOUNT_API_URL, FETCH_API, IndexTemplateMap, ScheduleTemplateMap, SongListTemplateMap } from '@/data/constants'
import { FETCH_API, IndexTemplateMap, ScheduleTemplateMap, SongListTemplateMap } from '@/data/constants'
import { NButton, NCard, NCheckbox, NCheckboxGroup, NDivider, NEmpty, NList, NListItem, NModal, NSelect, NSpace, NSpin, NTabPane, NTabs, NText, SelectOption, useMessage } from 'naive-ui'
import { Ref, computed, h, onActivated, onMounted, ref } from 'vue'
import { useRoute } from 'vue-router'
interface TemplateDefineTypes {

View File

@@ -6,6 +6,9 @@ import { QueryGetAPI, QueryPostAPI } from '@/api/query'
import SongList from '@/components/SongList.vue'
import { FETCH_API, SONG_API_URL } from '@/data/constants'
import { Info24Filled } from '@vicons/fluent'
import { format } from 'date-fns'
import { saveAs } from 'file-saver'
import { List } from 'linqts'
import {
FormInst,
FormRules,
@@ -34,9 +37,6 @@ import {
} from 'naive-ui'
import { Option } from 'naive-ui/es/transfer/src/interface'
import { computed, onMounted, ref } from 'vue'
import { saveAs } from 'file-saver'
import { format } from 'date-fns'
import { List } from 'linqts'
const message = useMessage()
const accountInfo = useAccount()

View File

@@ -1,9 +1,9 @@
<script setup lang="ts">
import { useAccount } from '@/api/account'
import DanmakuClient from '@/data/DanmakuClient'
import { onActivated, onDeactivated, onMounted, onUnmounted } from 'vue'
import MusicRequest from '../open_live/MusicRequest.vue'
import { NAlert } from 'naive-ui'
import { onMounted, onUnmounted } from 'vue'
import MusicRequest from '../open_live/MusicRequest.vue'
const accountInfo = useAccount()
let client = new DanmakuClient(null)

View File

@@ -1,12 +1,11 @@
<script setup lang="ts">
import { VideoCollectCreateModel, VideoCollectDetail, VideoCollectTable, VideoCollectVideo, VideoFrom, VideoInfo, VideoStatus } from '@/api/api-models'
import { VideoCollectCreateModel, VideoCollectDetail, VideoCollectTable, VideoCollectVideo, VideoInfo, VideoStatus } from '@/api/api-models'
import { QueryGetAPI, QueryPostAPI } from '@/api/query'
import VideoCollectInfoCard from '@/components/VideoCollectInfoCard.vue'
import { VIDEO_COLLECT_API_URL } from '@/data/constants'
import router from '@/router'
import { Clock24Filled, Person24Filled } from '@vicons/fluent'
import { useWindowSize } from '@vueuse/core'
import { formatDuration } from 'date-fns'
import { List } from 'linqts'
import {
FormRules,
@@ -21,7 +20,6 @@ import {
NGrid,
NGridItem,
NIcon,
NImage,
NInput,
NInputNumber,
NModal,
@@ -30,9 +28,7 @@ import {
NSpace,
NTabPane,
NTabs,
NTag,
NText,
NThing,
useMessage,
} from 'naive-ui'
import Qrcode from 'qrcode.vue'
@@ -143,44 +139,47 @@ const gridRender = (type: 'padding' | 'reject' | 'accept') => {
}
return videos.length == 0
? h(NEmpty)
: h(NGrid, { cols: '1 500:2 700:3 900:4 1200:5 ', xGap: '12', yGap: '12', responsive: 'self' }, () =>
videos?.map((v) =>
h(NGridItem, () =>
h(
NCard,
{ style: 'height: 330px;', embedded: true, size: 'small' },
{
cover: () =>
h('div', { style: 'position: relative;height: 150px;' }, [
h('img', {
src: v.video.cover,
referrerpolicy: 'no-referrer',
style: 'max-height: 100%; object-fit: contain;cursor: pointer',
onClick: () => window.open('https://www.bilibili.com/video/' + v.info.bvid, '_blank'),
}),
h(NSpace, { style: { position: 'relative', bottom: '20px', background: '#00000073' }, justify: 'space-around' }, () => [
h('span', [h(NIcon, { component: Clock24Filled, color: 'lightgrey' }), h(NText, { style: 'color: lightgrey;size:small;' }, () => formatSeconds(v.video.length))]),
h('span', [h(NIcon, { component: Person24Filled, color: 'lightgrey' }), h(NText, { style: 'color: lightgrey;size:small;' }, () => v.video.ownerName)]),
: h(
NGrid,
{ cols: '1 500:2 700:3 900:4 1200:5 ', xGap: '12', yGap: '12', responsive: 'self' },
() =>
videos?.map((v) =>
h(NGridItem, () =>
h(
NCard,
{ style: 'height: 330px;', embedded: true, size: 'small' },
{
cover: () =>
h('div', { style: 'position: relative;height: 150px;' }, [
h('img', {
src: v.video.cover,
referrerpolicy: 'no-referrer',
style: 'max-height: 100%; object-fit: contain;cursor: pointer',
onClick: () => window.open('https://www.bilibili.com/video/' + v.info.bvid, '_blank'),
}),
h(NSpace, { style: { position: 'relative', bottom: '20px', background: '#00000073' }, justify: 'space-around' }, () => [
h('span', [h(NIcon, { component: Clock24Filled, color: 'lightgrey' }), h(NText, { style: 'color: lightgrey;size:small;' }, () => formatSeconds(v.video.length))]),
h('span', [h(NIcon, { component: Person24Filled, color: 'lightgrey' }), h(NText, { style: 'color: lightgrey;size:small;' }, () => v.video.ownerName)]),
]),
]),
]),
header: () =>
h(NButton, { style: 'width: 100%;', text: true, onClick: () => window.open('https://www.bilibili.com/video/' + v.info.bvid, '_blank') }, () =>
h(NEllipsis, { style: 'max-width: 100%;' }, { default: () => v.video.title, tooltip: () => h('div', { style: 'max-width: 300px' }, v.video.title) })
),
default: () =>
h(NScrollbar, { style: 'height: 65px;' }, () =>
h(NCard, { contentStyle: 'padding: 5px;' }, () =>
v.info.senders.map((s) => [
h('div', { style: 'font-size: 12px;' }, [h('div', `推荐人: ${s.sender ?? '未填写'} [${s.senderId ?? '未填写'}]`), h('div', `推荐理由: ${s.description ?? '未填写'}`)]),
h(NSpace, { style: 'margin: 0;' }),
])
)
),
footer: () => footer(v.info),
}
)
)
)
header: () =>
h(NButton, { style: 'width: 100%;', text: true, onClick: () => window.open('https://www.bilibili.com/video/' + v.info.bvid, '_blank') }, () =>
h(NEllipsis, { style: 'max-width: 100%;' }, { default: () => v.video.title, tooltip: () => h('div', { style: 'max-width: 300px' }, v.video.title) }),
),
default: () =>
h(NScrollbar, { style: 'height: 65px;' }, () =>
h(NCard, { contentStyle: 'padding: 5px;' }, () =>
v.info.senders.map((s) => [
h('div', { style: 'font-size: 12px;' }, [h('div', `推荐人: ${s.sender ?? '未填写'} [${s.senderId ?? '未填写'}]`), h('div', `推荐理由: ${s.description ?? '未填写'}`)]),
h(NSpace, { style: 'margin: 0;' }),
]),
),
),
footer: () => footer(v.info),
},
),
),
),
)
}
const paddingButtonGroup = (v: VideoInfo) =>

View File

@@ -4,33 +4,7 @@ import { VideoCollectTable } from '@/api/api-models'
import { QueryGetAPI, QueryPostAPI } from '@/api/query'
import VideoCollectInfoCard from '@/components/VideoCollectInfoCard.vue'
import { VIDEO_COLLECT_API_URL } from '@/data/constants'
import { Clock24Filled } from '@vicons/fluent'
import {
CountdownProps,
FormRules,
NButton,
NCard,
NCountdown,
NDatePicker,
NDivider,
NEllipsis,
NEmpty,
NForm,
NFormItem,
NIcon,
NInput,
NInputNumber,
NList,
NListItem,
NModal,
NSpace,
NSpin,
NTag,
NText,
NTime,
NTooltip,
useMessage,
} from 'naive-ui'
import { FormRules, NButton, NDatePicker, NDivider, NEmpty, NForm, NFormItem, NInput, NInputNumber, NList, NListItem, NModal, NSpace, NSpin, NText, useMessage } from 'naive-ui'
import { ref } from 'vue'
const accountInfo = useAccount()