Move: download button from dialog to file page

This commit is contained in:
2021-12-16 13:27:11 +08:00
parent 80802f95f8
commit 14f3c1c8da
2 changed files with 7 additions and 9 deletions

View File

@@ -9,20 +9,14 @@ function FileDialog(props) {
let navigate = useNavigate(); let navigate = useNavigate();
const downloadURL = "/api/v1/get_file_direct?id=" + props.file.id;
return ( return (
<dialog open={props.showStatus}> <dialog open={props.showStatus}>
<p>{props.file.filename}</p> <p>{props.file.filename}</p>
<p> <p>
Download 使用浏览器下载原文件 Play: play using browser player.
<br />
Play 调用网页播放器播放
<br /> <br />
Info for more actions.
</p> </p>
<a href={downloadURL} download>
<button>Download</button>
</a>
<button <button
onClick={() => { onClick={() => {
props.setPlayingFile(props.file); props.setPlayingFile(props.file);

View File

@@ -159,11 +159,15 @@ function FileInfo(props) {
getTagsOnFile(); getTagsOnFile();
}, []); }, []);
const downloadURL = "/api/v1/get_file_direct?id=" + file.id;
return ( return (
<div className="page"> <div className="page">
<h3>File Details</h3> <h3>File Details</h3>
<div> <div>
<button>Download</button> <a href={downloadURL} download>
<button>Download</button>
</a>
<button <button
onClick={() => { onClick={() => {
props.setPlayingFile(file); props.setPlayingFile(file);