|
|
@@ -3,7 +3,7 @@ import { invoke } from "@tauri-apps/api/core";
|
|
|
import { listen, type UnlistenFn } from "@tauri-apps/api/event";
|
|
|
import { getCurrentWindow } from "@tauri-apps/api/window";
|
|
|
import { WebviewWindow } from "@tauri-apps/api/webviewWindow";
|
|
|
-import { openUrl, revealItemInDir } from "@tauri-apps/plugin-opener";
|
|
|
+import { revealItemInDir } from "@tauri-apps/plugin-opener";
|
|
|
import { Button, Divider, InputNumber, Layout, Menu, notification, Space, theme, Tooltip } from "antd";
|
|
|
import {
|
|
|
countPendingTasks,
|
|
|
@@ -44,6 +44,7 @@ import {
|
|
|
LinkOutlined,
|
|
|
LoadingOutlined,
|
|
|
MinusOutlined,
|
|
|
+ OrderedListOutlined,
|
|
|
PictureOutlined,
|
|
|
PlayCircleFilled,
|
|
|
PlusOutlined,
|
|
|
@@ -79,13 +80,13 @@ async function loadInWebview(taskId: string, url: string) {
|
|
|
}
|
|
|
|
|
|
/** 点条目右侧图标:调系统浏览器打开 */
|
|
|
-async function openInBrowser(url: string) {
|
|
|
- try {
|
|
|
- await openUrl(url);
|
|
|
- } catch (e) {
|
|
|
- console.error("打开系统浏览器失败:", e);
|
|
|
- }
|
|
|
-}
|
|
|
+// async function openInBrowser(url: string) {
|
|
|
+// try {
|
|
|
+// await openUrl(url);
|
|
|
+// } catch (e) {
|
|
|
+// console.error("打开系统浏览器失败:", e);
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
function App() {
|
|
|
// 当前激活的任务 id(仅用于左栏视觉高亮)
|
|
|
@@ -571,8 +572,8 @@ function App() {
|
|
|
token: { colorBgContainer },
|
|
|
} = theme.useToken();
|
|
|
|
|
|
- const [statusColor, setStatusColor] = useState("#888");
|
|
|
- const [statusText, setStatusText] = useState("请选择任务");
|
|
|
+ const [statusColor] = useState("#888");
|
|
|
+ const [statusText] = useState("请选择任务");
|
|
|
|
|
|
// 当前窗口句柄,用于自定义标题栏的最小化 / 关闭
|
|
|
const appWindow = useMemo(() => getCurrentWindow(), []);
|
|
|
@@ -791,20 +792,24 @@ function App() {
|
|
|
</Header>
|
|
|
<Layout>
|
|
|
<Sider className="select-none" collapsible collapsed={collapsed} onCollapse={(c) => handleCollaspsed(c)} width={180} style={{ background: colorBgContainer }}>
|
|
|
- <div className="flex justify-between">所有任务<Button icon={<PlusOutlined />} onClick={openImportWindow} /> </div>
|
|
|
- <Menu
|
|
|
- mode="inline"
|
|
|
- defaultSelectedKeys={[activeId || '']}
|
|
|
- selectedKeys={[activeId || '']}
|
|
|
- style={{ height: '100%', borderInlineEnd: 0 }}
|
|
|
- onClick={handleSelectTask}
|
|
|
+ <div className="h-full w-full flex-row">
|
|
|
+ <div className="flex justify-between items-center text-md pl-1 font-bold text-white"><OrderedListOutlined />{collapsed ? '' : '所有任务'}<Button icon={<PlusOutlined />} onClick={openImportWindow} /> </div>
|
|
|
+ <div className="flex-1 overflow-y-auto">
|
|
|
+ <Menu
|
|
|
+ mode="vertical"
|
|
|
+ defaultSelectedKeys={[activeId || '']}
|
|
|
+ selectedKeys={[activeId || '']}
|
|
|
+ style={{ borderInlineEnd: 0, height: '100%' }}
|
|
|
+ onClick={handleSelectTask}
|
|
|
|
|
|
- >
|
|
|
- {tasks.map((t) => <Menu.Item icon={<LinkOutlined />} key={t.id}>
|
|
|
- {t.id}
|
|
|
- </Menu.Item>
|
|
|
- )}
|
|
|
- </Menu>
|
|
|
+ >
|
|
|
+ {tasks.map((t) => <Menu.Item icon={<LinkOutlined />} key={t.id}>
|
|
|
+ {t.id}
|
|
|
+ </Menu.Item>
|
|
|
+ )}
|
|
|
+ </Menu>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</Sider>
|
|
|
<Layout className="flex flex-row">
|
|
|
<Content className="w-full m-0 p-1 flex-1" />
|