chore: 前端跑一遍 format、lint,尝试在 ci 中加入前端 lint 检查 (#353)
This commit is contained in:
@@ -62,7 +62,7 @@
|
||||
<div class="flex-1">
|
||||
<Sidebar.Group>
|
||||
<Sidebar.GroupLabel
|
||||
class="text-muted-foreground mb-2 px-2 text-xs font-medium uppercase tracking-wider"
|
||||
class="text-muted-foreground mb-2 px-2 text-xs font-medium tracking-wider uppercase"
|
||||
>
|
||||
视频来源
|
||||
</Sidebar.GroupLabel>
|
||||
|
||||
@@ -3,14 +3,12 @@
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '$lib/components/ui/card/index.js';
|
||||
import { Button } from '$lib/components/ui/button/index.js';
|
||||
import * as AlertDialog from '$lib/components/ui/alert-dialog/index.js';
|
||||
import type { ApiError, VideoInfo } from '$lib/types';
|
||||
import type { VideoInfo } from '$lib/types';
|
||||
import RotateCcwIcon from '@lucide/svelte/icons/rotate-ccw';
|
||||
import InfoIcon from '@lucide/svelte/icons/info';
|
||||
import UserIcon from '@lucide/svelte/icons/user';
|
||||
import { goto } from '$app/navigation';
|
||||
import api from '$lib/api';
|
||||
import * as Tooltip from '$lib/components/ui/tooltip/index.js';
|
||||
import { toast } from 'svelte-sonner';
|
||||
|
||||
export let video: VideoInfo;
|
||||
export let showActions: boolean = true; // 控制是否显示操作按钮
|
||||
|
||||
@@ -12,7 +12,7 @@ export interface AppState {
|
||||
export const appStateStore = writable<AppState>({
|
||||
query: '',
|
||||
currentPage: 0,
|
||||
videoSource: null,
|
||||
videoSource: null
|
||||
});
|
||||
|
||||
export const ToQuery = (state: AppState): string => {
|
||||
@@ -41,36 +41,40 @@ export const setQuery = (query: string) => {
|
||||
export const setVideoSourceFilter = (filter: { type: string; id: string }) => {
|
||||
appStateStore.update((state) => ({
|
||||
...state,
|
||||
videoSource: filter,
|
||||
videoSource: filter
|
||||
}));
|
||||
};
|
||||
|
||||
export const clearVideoSourceFilter = () => {
|
||||
appStateStore.update((state) => ({
|
||||
...state,
|
||||
videoSource: null,
|
||||
videoSource: null
|
||||
}));
|
||||
};
|
||||
|
||||
export const setCurrentPage = (page: number) => {
|
||||
appStateStore.update((state) => ({
|
||||
...state,
|
||||
currentPage: page,
|
||||
currentPage: page
|
||||
}));
|
||||
};
|
||||
|
||||
export const resetCurrentPage = () => {
|
||||
appStateStore.update((state) => ({
|
||||
...state,
|
||||
currentPage: 0,
|
||||
currentPage: 0
|
||||
}));
|
||||
};
|
||||
|
||||
export const setAll = (query: string, currentPage: number, videoSource: { type: string; id: string } | null) => {
|
||||
export const setAll = (
|
||||
query: string,
|
||||
currentPage: number,
|
||||
videoSource: { type: string; id: string } | null
|
||||
) => {
|
||||
appStateStore.set({
|
||||
query,
|
||||
currentPage,
|
||||
videoSource,
|
||||
videoSource
|
||||
});
|
||||
};
|
||||
|
||||
@@ -78,6 +82,6 @@ export const clearAll = () => {
|
||||
appStateStore.set({
|
||||
query: '',
|
||||
currentPage: 0,
|
||||
videoSource: null,
|
||||
videoSource: null
|
||||
});
|
||||
};
|
||||
|
||||
@@ -61,7 +61,7 @@ export interface VideoResponse {
|
||||
// 重置视频响应类型
|
||||
export interface ResetVideoResponse {
|
||||
resetted: boolean;
|
||||
video: VideoInfo,
|
||||
video: VideoInfo;
|
||||
pages: PageInfo[];
|
||||
}
|
||||
|
||||
|
||||
@@ -6,16 +6,11 @@
|
||||
import * as AlertDialog from '$lib/components/ui/alert-dialog/index.js';
|
||||
import RotateCcwIcon from '@lucide/svelte/icons/rotate-ccw';
|
||||
import api from '$lib/api';
|
||||
import type {
|
||||
VideosResponse,
|
||||
VideoSourcesResponse,
|
||||
ApiError,
|
||||
ResetAllVideosResponse
|
||||
} from '$lib/types';
|
||||
import type { VideosResponse, VideoSourcesResponse, ApiError } from '$lib/types';
|
||||
import { onMount } from 'svelte';
|
||||
import { page } from '$app/stores';
|
||||
import { goto } from '$app/navigation';
|
||||
import { setVideoSources, videoSourceStore } from '$lib/stores/video-source';
|
||||
import { videoSourceStore } from '$lib/stores/video-source';
|
||||
import { VIDEO_SOURCES } from '$lib/consts';
|
||||
import { setBreadcrumb } from '$lib/stores/breadcrumb';
|
||||
import {
|
||||
@@ -24,12 +19,9 @@
|
||||
resetCurrentPage,
|
||||
setAll,
|
||||
setCurrentPage,
|
||||
setQuery,
|
||||
setVideoSourceFilter,
|
||||
ToQuery
|
||||
} from '$lib/stores/filter';
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { Title } from '$lib/components/ui/card';
|
||||
|
||||
const pageSize = 20;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user