mirror of
https://github.com/cloudreve/frontend.git
synced 2025-12-25 19:52:48 +00:00
Feat: 缩略图
This commit is contained in:
parent
f3b31afabd
commit
393cbfd0f0
|
|
@ -132,7 +132,7 @@ class ContextMenuCompoment extends Component {
|
|||
}
|
||||
this.props.changeContextMenu("file",false);
|
||||
let downloadPath = this.props.selected[0].path === "/" ? this.props.selected[0].path+this.props.selected[0].name:this.props.selected[0].path+"/"+this.props.selected[0].name;
|
||||
window.open(baseURL+"/file"+(downloadPath));
|
||||
window.open(baseURL+"/file/download"+(downloadPath));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import {FileWordBox,FilePowerpointBox,FileExcelBox,ScriptText,MagnetOn,ZipBox,Wi
|
|||
import { LazyLoadImage } from 'react-lazy-load-image-component';
|
||||
import ContentLoader from 'react-content-loader'
|
||||
import {mediaType} from "../../config"
|
||||
|
||||
import {baseURL} from "../../middleware/Api"
|
||||
import { withStyles, ButtonBase, Typography, Divider, Tooltip } from '@material-ui/core';
|
||||
|
||||
const styles = theme => ({
|
||||
|
|
@ -64,6 +64,7 @@ const styles = theme => ({
|
|||
height:"150px",
|
||||
width:"100%",
|
||||
borderRadius: "6px 6px 0 0",
|
||||
backgroundColor: theme.palette.background.default,
|
||||
},
|
||||
previewIcon:{
|
||||
overflow: "hidden",
|
||||
|
|
@ -74,8 +75,9 @@ const styles = theme => ({
|
|||
paddingTop:"50px",
|
||||
},
|
||||
picPreview:{
|
||||
"height": "auto",
|
||||
"width": "100%",
|
||||
"height": "100%",
|
||||
"width": "auto",
|
||||
flex: "none",
|
||||
},
|
||||
fileInfo:{
|
||||
height:"50px",
|
||||
|
|
@ -186,6 +188,8 @@ const styles = theme => ({
|
|||
},
|
||||
loadingAnimation:{
|
||||
borderRadius: "6px 6px 0 0",
|
||||
height: "100%",
|
||||
width: "100%",
|
||||
},
|
||||
shareFix:{
|
||||
marginLeft: "20px",
|
||||
|
|
@ -283,7 +287,7 @@ class FileIconCompoment extends Component {
|
|||
[classes.hide]:this.state.loading,
|
||||
[classes.picPreview]:!this.state.loading,
|
||||
})}
|
||||
src={window.apiURL.imgThumb+"?isImg=true&path="+encodeURIComponent(this.props.file.path==="/"?this.props.file.path+this.props.file.name:this.props.file.path+"/"+this.props.file.name)}
|
||||
src={baseURL+"/file/thumb/"+this.props.file.id}
|
||||
afterLoad = {()=>this.setState({loading:false})}
|
||||
beforeLoad = {()=>this.setState({loading:true})}
|
||||
onError={()=>this.setState({showPicIcon:true})}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class ImgPreviewCompoment extends Component {
|
|||
title: value.name,
|
||||
src:
|
||||
baseURL +
|
||||
"/file" +
|
||||
"/file/download" +
|
||||
(value.path === "/"
|
||||
? value.path + value.name
|
||||
: value.path + "/" + value.name)
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ import {
|
|||
Tooltip,
|
||||
} from '@material-ui/core';
|
||||
import Auth from "../middleware/Auth"
|
||||
import {baseURL} from "../middleware/Api"
|
||||
|
||||
const drawerWidth = 240;
|
||||
const drawerWidthMobile = 270;
|
||||
|
|
@ -353,7 +354,7 @@ class NavbarCompoment extends Component {
|
|||
return;
|
||||
}
|
||||
let downloadPath = this.props.selected[0].path === "/" ? this.props.selected[0].path+this.props.selected[0].name:this.props.selected[0].path+"/"+this.props.selected[0].name;
|
||||
window.open(window.apiURL.download+"?action=download&path="+encodeURIComponent(downloadPath));
|
||||
window.open(baseURL+"/file/download"+downloadPath);
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue