Skip to content

Commit

Permalink
fix: remove the fixed domain
Browse files Browse the repository at this point in the history
  • Loading branch information
ltaoo committed Jul 17, 2024
1 parent e46afc2 commit a1c09f2
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 42 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@family-flix/admin",
"private": true,
"version": "2.0.0",
"version": "2.4.1",
"scripts": {
"dev": "vite --port 3003 --host",
"build": "tsc && vite build",
Expand Down
2 changes: 1 addition & 1 deletion src/biz/requests/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const media_request = request_factory({
hostnames: {
dev: "https://media-t.funzm.com",
test: "https://media-t.funzm.com",
prod: "https://media.funzm.com",
prod: "",
},
process<T>(r: Result<{ code: number | string; msg: string; data: T }>) {
if (r.error) {
Expand Down
3 changes: 3 additions & 0 deletions src/constants/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// @ts-ignore
export const __VERSION__ = process.global.__VERSION__;

export const code = `const oo = document;
const jj = JSON;
const ll = localStorage;
Expand Down
40 changes: 15 additions & 25 deletions src/pages/home/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
Folder,
Sparkles,
HeartCrack,
HardDrive,
} from "lucide-solid";

import { ViewComponent, ViewComponentProps } from "@/store/types";
Expand All @@ -40,6 +41,7 @@ import {
} from "@/domains/ui";
import { RequestCore } from "@/domains/request";
import { cn, sleep } from "@/utils/index";
import { __VERSION__ } from "@/constants/index";

function Page(props: ViewComponentProps) {
const { app, history, client, storage, pages, view } = props;
Expand Down Expand Up @@ -313,73 +315,59 @@ export const HomeLayout: ViewComponent = (props) => {
{
text: "首页",
icon: <Home class="w-6 h-6" />,
// url: "/home/index",
url: "root.home_layout.index",
// view: homeIndexPage,
},
{
text: "云盘管理",
icon: <HardDrive class="w-6 h-6" />,
url: "root.home_layout.drive_list",
},
{
text: "电视剧",
icon: <Tv class="w-6 h-6" />,
// url: "/home/season",
url: "root.home_layout.season_list",
// view: homeSeasonListPage,
},
{
text: "电影",
icon: <Film class="w-6 h-6" />,
// url: "/home/movie",
url: "root.home_layout.movie_list",
// view: homeMovieListPage,
},
{
text: "刮削结果",
icon: <Sparkles class="w-6 h-6" />,
// url: "/home/unknown_media/season",
url: "root.home_layout.parse_result_layout.season",
// view: homeUnknownTVPage,
},
{
text: "问题影视剧",
icon: <HeartCrack class="w-6 h-6" />,
badge: false,
// url: "/home/invalid_media",
url: "root.home_layout.invalid_media_list",
// view: homeInvalidMediaListPage,
},
{
text: "集合管理",
icon: <Folder class="w-6 h-6" />,
// url: "/home/collection",
url: "root.home_layout.collection_list",
// view: collectionListPage,
},
{
text: "字幕管理",
icon: <Subtitles class="w-6 h-6" />,
// url: "/home/subtitle",
url: "root.home_layout.subtitles_list",
// view: homeSubtitleListPage,
},
{
text: "同步任务",
icon: <AlarmClock class="w-6 h-6" />,
// view: syncTaskListPage,
url: "root.home_layout.resource_sync",
},
{
text: "任务",
icon: <Bot class="w-6 h-6" />,
badge: false,
// url: "/home/log",
// view: homeTaskListPage,
url: "root.home_layout.job_list",
},
{
text: "问题反馈",
icon: <CircuitBoard class="w-6 h-6" />,
badge: false,
// url: "/home/report",
// view: homeReportListPage,
url: "root.home_layout.report_list",
},
{
Expand All @@ -399,13 +387,11 @@ export const HomeLayout: ViewComponent = (props) => {
{
text: "成员",
icon: <Users class="w-6 h-6" />,
// view: homeMemberListPage,
url: "root.home_layout.member_list",
},
{
text: "转存资源",
icon: <FolderInput class="w-6 h-6" />,
// view: homeTransferPage,
url: "root.home_layout.transfer",
},
]);
Expand Down Expand Up @@ -459,14 +445,14 @@ export const HomeLayout: ViewComponent = (props) => {
}}
</For>
</div>
{/* <div class="flex justify-center space-x-2 h-[68rpx] py-2">
<Button class="" store={logoutBtn} variant="subtle" icon={<LogOut class="w-4 h-4" />}>
<div class="flex justify-center">
{/* <Button class="" store={logoutBtn} variant="subtle" icon={<LogOut class="w-4 h-4" />}>
退出登录
</Button>
<Button class="" store={settingsBtn} variant="subtle" icon={<Settings class="w-4 h-4" />}>
设置
</Button>
</div> */}
</Button> */}
</div>
</div>
</div>
<div class="flex-1 bg-slate-100">
Expand Down Expand Up @@ -541,6 +527,10 @@ export const HomeLayout: ViewComponent = (props) => {
<Checkbox store={$noNeedCode} />
无需邀请码
</div>
<div class="mt-4">
<div>当前版本</div>
<div class="">v{__VERSION__}</div>
</div>
{/* <div class="mt-4">
<div>其他</div>
<Button store={expiredDeletingBtn}>清除失效视频源</Button>
Expand Down
16 changes: 8 additions & 8 deletions src/pages/member/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ function Page(props: ViewComponentProps) {
$addMemberDialog.hide();
$remarkInput.clear();
$memberList.refresh();
$memberAccountsDialog.show();
const text = `https://media.funzm.com/mobile/home/index
// $memberAccountsDialog.show();
// const text = `${history.$router.origin}/mobile/home/index

邮箱
${r.account.id}
// 邮箱
// ${r.account.id}

密码
${r.account.pwd}
`;
// 密码
// ${r.account.pwd}
// `;
// setText();
},
});
Expand Down Expand Up @@ -360,7 +360,7 @@ export const HomeMemberListPage: ViewComponent = (props) => {
<ScrollView store={$page.ui.$scroll} class="h-screen p-8">
<h1 class="text-2xl">成员列表({response().total})</h1>
<div class="mt-8">
<div class="space-x-2">
<div class="flex items-center space-x-2">
<Button icon={<RotateCcw class="w-4 h-4" />} store={$page.ui.$refreshBtn}>
刷新
</Button>
Expand Down
69 changes: 62 additions & 7 deletions src/pages/movie/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,23 @@
* @file 电影列表
*/
import { createSignal, For, Show } from "solid-js";
import { Award, BookOpen, Calendar, Clock, Info, LocateIcon, MapPin, RotateCw, Search, Star } from "lucide-solid";
import {
Award,
BookOpen,
Calendar,
Clock,
Info,
LocateIcon,
MapPin,
RotateCw,
Search,
Star,
Trash,
} from "lucide-solid";

import {
MovieMediaItem,
deleteMedia,
fetchMovieMediaList,
fetchMovieMediaListProcess,
transferMediaToAnotherDrive,
Expand Down Expand Up @@ -68,6 +81,7 @@ export const MovieListPage: ViewComponent = (props) => {
refreshBtn.setLoading(loading);
},
});
const mediaDeleteRequest = new RequestCore(deleteMedia);
const movieRef = new RefCore<MovieMediaItem>();
const driveRef = new RefCore<DriveCore>({
onChange(v) {
Expand Down Expand Up @@ -97,14 +111,43 @@ export const MovieListPage: ViewComponent = (props) => {
});
const profileBtn = new ButtonInListCore<MovieMediaItem>({
onClick(record) {
// homeMovieProfilePage.query = {
// id: record.id,
// };
// app.showView(homeMovieProfilePage);
// homeLayout.showSubView(homeMovieProfilePage);
history.push("root.home_layout.movie_profile", { id: record.id });
},
});
const mediaDeleteBtn = new ButtonInListCore<MovieMediaItem>({
onClick(record) {
movieRef.select(record);
deleteConfirmDialog.show();
},
});
const deleteConfirmDialog = new DialogCore({
title: "删除电影",
async onOk() {
const media = movieRef.value;
if (!media) {
app.tip({
text: ["请选择要删除的电影"],
});
return;
}
deleteConfirmDialog.okBtn.setLoading(true);
const r = await mediaDeleteRequest.run({ media_id: media.id });
deleteConfirmDialog.okBtn.setLoading(false);
if (r.error) {
app.tip({
text: ["删除失败", r.error.message],
});
return;
}
app.tip({
text: ["删除成功"],
});
deleteConfirmDialog.hide();
movieList.deleteItem((item) => {
return item.id === media.id;
});
},
});
const transferConfirmDialog = new DialogCore({
title: "移动到其他云盘",
onOk() {
Expand Down Expand Up @@ -328,12 +371,19 @@ export const MovieListPage: ViewComponent = (props) => {
>
详情
</Button>
<Button
{/* <Button
store={transferBtn.bind(movie)}
variant="subtle"
icon={<BookOpen class="w-4 h-4" />}
>
归档
</Button> */}
<Button
store={mediaDeleteBtn.bind(movie)}
variant="subtle"
icon={<Trash class="w-4 h-4" />}
>
删除
</Button>
</div>
</div>
Expand Down Expand Up @@ -380,6 +430,11 @@ export const MovieListPage: ViewComponent = (props) => {
</div>
</div>
</Dialog>
<Dialog store={deleteConfirmDialog}>
<div class="w-[520px]">
<div>确认删除吗?</div>
</div>
</Dialog>
</>
);
};
12 changes: 12 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
import path from "path";
import fs from 'fs';

import { UserConfigExport, defineConfig } from "vite";
import solidPlugin from "vite-plugin-solid";

const pkg = (() => {
try {
return JSON.parse(fs.readFileSync(path.resolve(__dirname, "./package.json"), "utf-8"));
} catch (err) {
return null;
}
})();

const config = defineConfig(({ mode }) => {
return {
base: "/admin",
Expand All @@ -19,6 +28,9 @@ const config = defineConfig(({ mode }) => {
esbuild: {
drop: mode === "production" ? ["console", "debugger"] : [],
},
define: {
"process.global.__VERSION__": JSON.stringify(pkg ? pkg.version : "unknown"),
},
build: {
target: "esnext",
rollupOptions: {
Expand Down

0 comments on commit a1c09f2

Please sign in to comment.