Skip to content

Commit d1dfaae

Browse files
Seven66677731xrgzsj2rong4cn
authored
feat(task): add move task page (#105)
* feat(task): add move task page * feat: use IoMove icon for move * 补缺 --------- Co-authored-by: MadDogOwner <[email protected]> Co-authored-by: j2rong4cn <[email protected]>
1 parent 42ff29e commit d1dfaae

File tree

4 files changed

+39
-1
lines changed

4 files changed

+39
-1
lines changed

src/lang/en/manage.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"tasks": "Tasks",
1616
"upload": "Upload",
1717
"copy": "Copy",
18+
"move": "Move",
1819
"decompress": "Decompress",
1920
"backup-restore": "Backup & Restore",
2021
"home": "Home",

src/lang/en/tasks.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"offline_download_transfer": "Transfer downloaded file to corresponding storage",
44
"upload": "Upload file to corresponding storage",
55
"copy": "Copy file from a storage to another storage",
6+
"move": "Move file from a storage to another storage",
67
"decompress": "Download and decompress an archive file",
78
"decompress_upload": "Upload extracted file into target storage",
89
"done": "Completed",

src/pages/manage/sidemenu_items.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { FiLogIn } from "solid-icons/fi"
1919
import { SiMetabase } from "solid-icons/si"
2020
import { CgDatabase } from "solid-icons/cg"
2121
import { OcWorkflow2 } from "solid-icons/oc"
22-
import { IoCopy, IoHome, IoMagnetOutline } from "solid-icons/io"
22+
import { IoCopy, IoMove, IoHome, IoMagnetOutline } from "solid-icons/io"
2323
import { Component, lazy } from "solid-js"
2424
import { Group, UserRole } from "~/types"
2525
import { FaSolidBook, FaSolidDatabase } from "solid-icons/fa"
@@ -146,6 +146,13 @@ export const side_menu_items: SideMenuItem[] = [
146146
role: UserRole.GENERAL,
147147
component: lazy(() => import("./tasks/Copy")),
148148
},
149+
{
150+
title: "manage.sidemenu.move",
151+
icon: IoMove,
152+
to: "/@manage/tasks/move",
153+
role: UserRole.GENERAL,
154+
component: lazy(() => import("./tasks/Move")),
155+
},
149156
{
150157
title: "manage.sidemenu.decompress",
151158
icon: TbArchive,

src/pages/manage/tasks/Move.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { useManageTitle, useT } from "~/hooks"
2+
import { TypeTasks } from "./Tasks"
3+
import { getPath } from "./helper"
4+
5+
const Move = () => {
6+
const t = useT()
7+
useManageTitle("manage.sidemenu.move")
8+
return (
9+
<TypeTasks
10+
type="move"
11+
canRetry
12+
nameAnalyzer={{
13+
regex: /^move \[(.*\/([^\/]*))]\((.*\/([^\/]*))\) to \[(.+)]\((.+)\)$/,
14+
title: (matches) => {
15+
if (matches[4] !== "") return matches[4]
16+
return matches[2] === "" ? "/" : matches[2]
17+
},
18+
attrs: {
19+
[t(`tasks.attr.copy.src`)]: (matches) =>
20+
getPath(matches[1], matches[3]),
21+
[t(`tasks.attr.copy.dst`)]: (matches) =>
22+
getPath(matches[5], matches[6]),
23+
},
24+
}}
25+
/>
26+
)
27+
}
28+
29+
export default Move

0 commit comments

Comments
 (0)