lv 2 týždňov pred
rodič
commit
734d8babdb
6 zmenil súbory, kde vykonal 34 pridanie a 11 odobranie
  1. 10 0
      pnpm-lock.yaml
  2. 1 0
      src-tauri/.gitignore
  3. 1 0
      src/App.css
  4. 6 10
      src/App.tsx
  5. 9 0
      src/components/TaskItem.tsx
  6. 7 1
      src/main.tsx

+ 10 - 0
pnpm-lock.yaml

@@ -17,6 +17,9 @@ importers:
       '@tauri-apps/plugin-opener':
         specifier: ^2
         version: 2.5.4
+      '@tauri-apps/plugin-sql':
+        specifier: ^2
+        version: 2.4.0
       antd:
         specifier: ^6.4.0
         version: 6.4.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6)
@@ -948,6 +951,9 @@ packages:
   '@tauri-apps/plugin-opener@2.5.4':
     resolution: {integrity: sha512-1HnPkb+AmgO29HBazm4uPLKB+r7zzcTBW1d0fyYp1uP+jwtpoiNDGKMMzz58SFp49nOIrxdE3aUJtT57lfO9CQ==}
 
+  '@tauri-apps/plugin-sql@2.4.0':
+    resolution: {integrity: sha512-SIICc5JlnK6OrBZzOw7MmhXHPlmASpt5zLWIu10WW4kLr5cDYOXHdV2MoCgYQkgZLQfyBYgF3SQa5XCisUiQkw==}
+
   '@types/babel__core@7.20.5':
     resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==}
 
@@ -2095,6 +2101,10 @@ snapshots:
     dependencies:
       '@tauri-apps/api': 2.11.0
 
+  '@tauri-apps/plugin-sql@2.4.0':
+    dependencies:
+      '@tauri-apps/api': 2.11.0
+
   '@types/babel__core@7.20.5':
     dependencies:
       '@babel/parser': 7.29.3

+ 1 - 0
src-tauri/.gitignore

@@ -5,3 +5,4 @@
 # Generated by Tauri
 # will have schema files for capabilities auto-completion
 /gen/schemas
+/resources/ffmpeg

+ 1 - 0
src/App.css

@@ -113,6 +113,7 @@
 html,
 body,
 #root {
+  background: #1f1fff;
   height: 100%;
   margin: 0;
 }

+ 6 - 10
src/App.tsx

@@ -4,7 +4,7 @@ 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 { Button, ConfigProvider, Divider, InputNumber, Layout, Menu, notification, Space, theme, Tooltip } from "antd";
+import { Button, Divider, InputNumber, Layout, Menu, notification, Space, theme, Tooltip } from "antd";
 import {
   countPendingTasks,
   listPendingTasks,
@@ -46,6 +46,7 @@ import {
   MinusOutlined,
   PictureOutlined,
   PlayCircleFilled,
+  PlusOutlined,
   StopOutlined,
   VideoCameraOutlined,
 } from "@ant-design/icons";
@@ -206,7 +207,8 @@ function App() {
       const pending = await countPendingTasks().catch(() => 0);
       const list = await reloadTasks();
       if (pending === 0 && list.length === 0) {
-        await openImportWindow();
+        setTimeout(() =>
+          openImportWindow(), 500);
       }
     })();
     // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -789,6 +791,7 @@ 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 || '']}
@@ -819,11 +822,4 @@ function App() {
 
 
 
-export default function Main() {
-  return <ConfigProvider theme={{
-    // 1. Use dark algorithm alone
-    algorithm: [theme.darkAlgorithm, theme.compactAlgorithm]
-  }}>
-    <App />
-  </ ConfigProvider>
-};
+export default App;

+ 9 - 0
src/components/TaskItem.tsx

@@ -0,0 +1,9 @@
+import { DeleteOutlined } from '@ant-design/icons'
+import { type Task } from '../lib/tasks'
+export default function TaskItem({ task, onClick }: { task: Task, onClick: () => void }) {
+
+    return <div className="w-full flex flex-row items-center" onClick={onClick}>
+        <span className="flex-1">{task.id}</span>
+        <DeleteOutlined />
+    </div>
+}

+ 7 - 1
src/main.tsx

@@ -1,9 +1,15 @@
 import React from "react";
 import ReactDOM from "react-dom/client";
 import App from "./App";
+import { ConfigProvider, theme } from "antd";
 
 ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
   <React.StrictMode>
-    <App />
+    <ConfigProvider theme={{
+      // 1. Use dark algorithm alone
+      algorithm: [theme.darkAlgorithm, theme.compactAlgorithm]
+    }}>
+      <App />
+    </ConfigProvider>
   </React.StrictMode>,
 );