From 1ef6489bb89e1e85236d4696d14878593ef82c27 Mon Sep 17 00:00:00 2001 From: ltaoo Date: Thu, 1 Feb 2024 13:39:19 +0800 Subject: [PATCH] feat: optimize sidebar icons of home page --- .gitignore | 2 + src/components/DriveFileCard/index.tsx | 16 ++--- src/pages/home/index.tsx | 82 +++++++++++++++++--------- src/pages/home/layout.tsx | 11 ++-- src/pages/movie/index.tsx | 6 +- src/pages/season/index.tsx | 4 +- src/services/common.ts | 3 +- 7 files changed, 81 insertions(+), 43 deletions(-) diff --git a/.gitignore b/.gitignore index f4439dd..9001171 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,8 @@ dist-ssr dist-admin *.local +mock + # Editor directories and files .vscode/* !.vscode/extensions.json diff --git a/src/components/DriveFileCard/index.tsx b/src/components/DriveFileCard/index.tsx index 51a1f8f..223962e 100644 --- a/src/components/DriveFileCard/index.tsx +++ b/src/components/DriveFileCard/index.tsx @@ -89,12 +89,12 @@ export const DriveFileCard = (props: { -
-
-
-
- + +
+
+
+
+
{profile()?.unknown_media?.name}
@@ -102,9 +102,9 @@ export const DriveFileCard = (props: {
{profile()?.unknown_media?.episode_text}
没有匹配到详情信息
- +
-
+
} >
diff --git a/src/pages/home/index.tsx b/src/pages/home/index.tsx index 98767ba..dcece23 100644 --- a/src/pages/home/index.tsx +++ b/src/pages/home/index.tsx @@ -2,7 +2,7 @@ * @file 管理后台首页(云盘列表) */ import { createSignal, For, Show } from "solid-js"; -import { Send, FileSearch, RefreshCcw, AlertTriangle } from "lucide-solid"; +import { Send, FileSearch, RefreshCcw, AlertTriangle, Loader, Bird } from "lucide-solid"; import { fetchDashboard, fetchMediaRecentlyCreated, refreshDashboard } from "@/services/common"; import { pushMessageToMembers } from "@/services"; @@ -42,6 +42,7 @@ export const HomeIndexPage: ViewComponent = (props) => { report_count: 0, media_request_count: 0, invalid_season_count: 0, + invalid_movie_count: 0, invalid_sync_task_count: 0, updated_at: null, }, @@ -208,6 +209,7 @@ export const HomeIndexPage: ViewComponent = (props) => {
{ refreshIcon.show(2); + mediaListRecentlyCreated.refresh(); const r = await refreshRequest.run(); if (r.error) { refreshIcon.show(3); @@ -297,15 +299,29 @@ export const HomeIndexPage: ViewComponent = (props) => {
待处理问题
-
{ - history.push("root.home_layout.invalid_media_list"); - // app.showView(homeInvalidMediaListPage); - }} - > -
{dashboard()?.invalid_season_count}
-
问题影视剧
+
+ { + history.push("root.home_layout.invalid_media_list"); + // app.showView(homeInvalidMediaListPage); + }} + > + {dashboard()?.invalid_season_count} + +
问题电视剧
+
+
+
{ + history.push("root.home_layout.invalid_media_list"); + // app.showView(homeInvalidMediaListPage); + }} + > + {dashboard()?.invalid_movie_count} +
+
问题电影
{

今日更新

-
-
- - {(media) => { - const { name, poster_path, text } = media; - return ( -
-
- -
-
-
{name}
-
{text}
+
+ +
+ +
+
+
+ + +
+ } + > + + {(media) => { + const { name, poster_path, text } = media; + return ( +
+ +
+
{name}
+
{text}
+
-
- ); - }} - + ); + }} + +
diff --git a/src/pages/home/layout.tsx b/src/pages/home/layout.tsx index 44d6d56..9a39aa7 100644 --- a/src/pages/home/layout.tsx +++ b/src/pages/home/layout.tsx @@ -20,6 +20,9 @@ import { MessageCircle, AlarmClock, Folder, + Cherry, + Sparkles, + HeartCrack, } from "lucide-solid"; import { fetchSettings, notify_test, pushMessageToMembers, updateSettings } from "@/services"; @@ -251,15 +254,15 @@ export const HomeLayout: ViewComponent = (props) => { // view: homeMovieListPage, }, { - text: "解析结果", - icon: , + text: "刮削结果", + icon: , // url: "/home/unknown_media/season", url: "root.home_layout.parse_result_layout.season" as PageKeys, // view: homeUnknownTVPage, }, { - text: "待处理影视剧问题", - icon: , + text: "问题影视剧", + icon: , badge: false, // url: "/home/invalid_media", url: "root.home_layout.invalid_media_list" as PageKeys, diff --git a/src/pages/movie/index.tsx b/src/pages/movie/index.tsx index 9636b0e..c2b5902 100644 --- a/src/pages/movie/index.tsx +++ b/src/pages/movie/index.tsx @@ -330,7 +330,7 @@ export const MovieListPage: ViewComponent = (props) => { {(movie) => { const { id, name, overview, poster_path, air_date, vote_average, origin_country, tips, persons } = movie; - const url = `/home/movie_profile?id=${id}`; + const url = history.buildURLWithPrefix("root.home_layout.movie_profile", { id }); return (
@@ -339,7 +339,9 @@ export const MovieListPage: ViewComponent = (props) => {

- {name} + + {name} +

diff --git a/src/pages/season/index.tsx b/src/pages/season/index.tsx index e55578c..4835534 100644 --- a/src/pages/season/index.tsx +++ b/src/pages/season/index.tsx @@ -513,7 +513,9 @@ export const HomeSeasonListPage: ViewComponent = (props) => {

diff --git a/src/services/common.ts b/src/services/common.ts index 2c4a9be..f4d4d25 100644 --- a/src/services/common.ts +++ b/src/services/common.ts @@ -95,6 +95,7 @@ export function fetchDashboard() { report_count: number; media_request_count: number; invalid_season_count: number; + invalid_movie_count: number; invalid_sync_task_count: number; updated_at: string; }>("/api/v2/admin/dashboard", {}); @@ -104,7 +105,7 @@ export function refreshDashboard() { return request.post("/api/v2/admin/dashboard/refresh", {}); } -export function fetchMediaRecentlyCreated(params: FetchParams) { +export async function fetchMediaRecentlyCreated(params: FetchParams) { return request.post< ListResponseWithCursor<{ id: string;