-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: linxiaodong <[email protected]>
- Loading branch information
Showing
15 changed files
with
1,001 additions
and
392 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"private": true, | ||
"name": "video-subtitle-master", | ||
"description": "视频转字幕,字幕翻译软件", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"author": "buxuku <[email protected]>", | ||
"main": "app/background.js", | ||
"scripts": { | ||
|
@@ -14,6 +14,7 @@ | |
"dependencies": { | ||
"@ffmpeg-installer/ffmpeg": "^1.1.0", | ||
"@hookform/resolvers": "^3.4.0", | ||
"@radix-ui/react-alert-dialog": "^1.0.5", | ||
"@radix-ui/react-dialog": "^1.0.5", | ||
"@radix-ui/react-dropdown-menu": "^2.0.6", | ||
"@radix-ui/react-hover-card": "^1.0.7", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React from 'react'; | ||
import { | ||
AlertDialog, | ||
AlertDialogAction, | ||
AlertDialogCancel, | ||
AlertDialogContent, | ||
AlertDialogDescription, | ||
AlertDialogFooter, | ||
AlertDialogHeader, | ||
AlertDialogTitle, | ||
AlertDialogTrigger, | ||
} from "@/components/ui/alert-dialog" | ||
|
||
const DeleteModel = ({children, modelName, callBack}) => { | ||
const [visibility, setVisibility] = React.useState(false); | ||
const handleDelete = async (e) => { | ||
e.preventDefault(); | ||
const res = await window?.ipc?.invoke('deleteModel', modelName); | ||
setVisibility(false); | ||
callBack && callBack(); | ||
} | ||
return ( | ||
<AlertDialog open={visibility}> | ||
<AlertDialogTrigger asChild onClick={() => setVisibility(true)}> | ||
{children} | ||
</AlertDialogTrigger> | ||
<AlertDialogContent> | ||
<AlertDialogHeader> | ||
<AlertDialogTitle>确认删除该模型?</AlertDialogTitle> | ||
<AlertDialogDescription> | ||
删除之后,如果你需要再次使用该模型,需要重新下载。 | ||
</AlertDialogDescription> | ||
</AlertDialogHeader> | ||
<AlertDialogFooter> | ||
<AlertDialogCancel onClick={() => setVisibility(false)}>取消</AlertDialogCancel> | ||
<AlertDialogAction onClick={handleDelete}>删除</AlertDialogAction> | ||
</AlertDialogFooter> | ||
</AlertDialogContent> | ||
</AlertDialog> | ||
|
||
); | ||
}; | ||
|
||
export default DeleteModel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from "react"; | ||
import { Button } from "@/components/ui/button"; | ||
import { Loader2 } from "lucide-react"; | ||
|
||
const DownModel = ({ modelName, callBack, downSource }) => { | ||
const [loading, setLoading] = React.useState(false); | ||
const handleDownModel = async () => { | ||
setLoading(true); | ||
await window?.ipc?.invoke("downloadModel", { | ||
model: modelName, | ||
source: downSource, | ||
}); | ||
setLoading(false); | ||
callBack && callBack(); | ||
}; | ||
return ( | ||
<Button onClick={handleDownModel} disabled={loading}> | ||
{loading && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}下载 | ||
</Button> | ||
); | ||
}; | ||
|
||
export default DownModel; |
Oops, something went wrong.