Skip to content

Commit 0088ad9

Browse files
committed
pnpm format
Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>
1 parent f35d752 commit 0088ad9

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

src/components/ModalInput.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export type ModalInputProps = {
2525
title: string
2626
isRenamingFile?: boolean
2727
onSubmit?: (text: string) => void
28-
onSubmitWithValue?: (text: string,setValue: (value: string) => void) => void
28+
onSubmitWithValue?: (text: string, setValue: (value: string) => void) => void
2929
type?: string
3030
defaultValue?: string
3131
loading?: boolean
@@ -93,7 +93,7 @@ export const ModalInput = (props: ModalInputProps) => {
9393
}
9494
}
9595
props.onSubmit?.(value())
96-
props.onSubmitWithValue?.(value(),setValue)
96+
props.onSubmitWithValue?.(value(), setValue)
9797
}
9898

9999
const handleInput = (newValue: string) => {

src/pages/home/offlinedownload/TaskProgress.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
Text,
66
Badge,
77
Progress,
8-
ProgressIndicator
8+
ProgressIndicator,
99
} from "@hope-ui/solid"
1010
import { TaskInfo } from "./task"
1111
import { getFileSize } from "~/utils"
@@ -17,7 +17,7 @@ import { me } from "~/store"
1717
const getPath = (
1818
device: string,
1919
path: string,
20-
asLink: boolean = true
20+
asLink: boolean = true,
2121
): JSX.Element => {
2222
const fullPath = (device === "/" ? "" : device) + path
2323
const prefix = me().base_path === "/" ? "" : me().base_path
@@ -45,12 +45,12 @@ const parseTaskName = (name: string) => {
4545
return {
4646
type: "download" as const,
4747
fileName: match[1],
48-
path: match[2]
48+
path: match[2],
4949
}
5050
}
5151
// transfer/upload 类型:transfer [设备](路径) to [目标设备](目标路径) 或 upload [文件名](URL) to [目标设备](目标路径)
5252
match = name.match(
53-
/^(transfer|upload) \[(.*?)\]\((.*?)\) to \[(.*?)\]\((.*?)\)$/
53+
/^(transfer|upload) \[(.*?)\]\((.*?)\) to \[(.*?)\]\((.*?)\)$/,
5454
)
5555
if (match) {
5656
const type = match[1] as "transfer" | "upload"
@@ -68,7 +68,7 @@ const parseTaskName = (name: string) => {
6868
srcDevice: bracketContent,
6969
srcPath: urlOrPath,
7070
dstDevice,
71-
dstPath
71+
dstPath,
7272
}
7373
} else {
7474
// upload 类型:文件名直接取自方括号
@@ -78,7 +78,7 @@ const parseTaskName = (name: string) => {
7878
srcDevice: "",
7979
srcPath: urlOrPath,
8080
dstDevice,
81-
dstPath
81+
dstPath,
8282
}
8383
}
8484
}
@@ -91,7 +91,7 @@ export const StatusColor = {
9191
2: "warning",
9292
3: "danger",
9393
4: "success",
94-
5: "info"
94+
5: "info",
9595
} as const
9696

9797
export const TaskItem = (props: TaskInfo) => {

src/pages/home/offlinedownload/task.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const fetchTasks = async (showLoading = true) => {
2727
r.get("/task/offline_download/undone").catch(() => ({ data: [] })),
2828
r
2929
.get("/task/offline_download_transfer/undone")
30-
.catch(() => ({ data: [] }))
30+
.catch(() => ({ data: [] })),
3131
])
3232

3333
const taskMap = new Map<string, TaskInfo>()

src/pages/home/toolbar/OfflineDownload.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
Heading,
66
Button,
77
VStack,
8-
Text
8+
Text,
99
} from "@hope-ui/solid"
1010
import { ModalInput, SelectWrapper } from "~/components"
1111
import { useFetch, useRouter, useT } from "~/hooks"
@@ -14,15 +14,15 @@ import {
1414
bus,
1515
handleRespWithNotifySuccess,
1616
r,
17-
handleResp
17+
handleResp,
1818
} from "~/utils"
1919
import {
2020
createSignal,
2121
onCleanup,
2222
onMount,
2323
createEffect,
2424
For,
25-
Show
25+
Show,
2626
} from "solid-js"
2727
import { PResp } from "~/types"
2828
import bencode from "bencode"
@@ -36,7 +36,7 @@ const deletePolicies = [
3636
"delete_on_upload_succeed",
3737
"delete_on_upload_failed",
3838
"delete_never",
39-
"delete_always"
39+
"delete_always",
4040
] as const
4141

4242
type DeletePolicy = (typeof deletePolicies)[number]
@@ -65,7 +65,7 @@ function toMagnetUrl(torrentBuffer: Uint8Array) {
6565
}
6666

6767
return `magnet:?xt=urn:btih:${infoHash}&${new URLSearchParams(
68-
params
68+
params,
6969
).toString()}`
7070
}
7171

@@ -77,7 +77,7 @@ export const OfflineDownload = () => {
7777
})
7878
const [tool, setTool] = createSignal("")
7979
const [deletePolicy, setDeletePolicy] = createSignal<DeletePolicy>(
80-
"upload_download_stream"
80+
"upload_download_stream",
8181
)
8282
onMount(async () => {
8383
const resp = await reqTool()
@@ -108,7 +108,7 @@ export const OfflineDownload = () => {
108108

109109
const handleSubmit = async (
110110
urls: string,
111-
setValue: (value: string) => void
111+
setValue: (value: string) => void,
112112
) => {
113113
const resp = await ok(pathname(), urls.split("\n"), tool(), deletePolicy())
114114
handleRespWithNotifySuccess(resp, () => {
@@ -137,7 +137,7 @@ export const OfflineDownload = () => {
137137
// 拖拽种子文件转换为磁力链接
138138
const handleTorrentFileDrop = async (
139139
e: DragEvent,
140-
setValue: (value: string) => void
140+
setValue: (value: string) => void,
141141
) => {
142142
e.preventDefault()
143143
if (e.dataTransfer?.files.length) {
@@ -199,11 +199,11 @@ export const OfflineDownload = () => {
199199
.filter((policy) =>
200200
policy === "upload_download_stream"
201201
? tool() === "SimpleHttp"
202-
: true
202+
: true,
203203
)
204204
.map((policy) => ({
205205
value: policy,
206-
label: t(`home.toolbar.delete_policy.${policy}`)
206+
label: t(`home.toolbar.delete_policy.${policy}`),
207207
}))}
208208
/>
209209
</Box>

0 commit comments

Comments
 (0)