mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-13 20:56:16 +00:00
Merge pull request #3474 from haiwen/file-view
[file view] removed 'open via client'
This commit is contained in:
commit
c2ff293ec4
@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { gettext } from '../../utils/constants';
|
import { gettext } from '../../utils/constants';
|
||||||
|
|
||||||
const { err, filePerm, fileType, repoID, filePath } = window.app.pageOptions;
|
const { err } = window.app.pageOptions;
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
errorMsg: PropTypes.string
|
errorMsg: PropTypes.string
|
||||||
@ -18,22 +18,11 @@ class FileViewTip extends React.Component {
|
|||||||
errorMsg = <p className="error">{err || this.props.errorMsg}</p>;
|
errorMsg = <p className="error">{err || this.props.errorMsg}</p>;
|
||||||
}
|
}
|
||||||
|
|
||||||
let canOpenViaClient = false;
|
|
||||||
if (filePerm == 'rw' && (fileType == 'Document' || fileType == 'SpreadSheet')) {
|
|
||||||
canOpenViaClient = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="file-view-content flex-1 o-auto">
|
<div className="file-view-content flex-1 o-auto">
|
||||||
<div className="file-view-tip">
|
<div className="file-view-tip">
|
||||||
{errorMsg}
|
{errorMsg}
|
||||||
<a href="?dl=1" className="btn btn-secondary">{gettext('Download')}</a>
|
<a href="?dl=1" className="btn btn-secondary">{gettext('Download')}</a>
|
||||||
{canOpenViaClient && (
|
|
||||||
<React.Fragment>
|
|
||||||
<a className="open-via-client" href={`seafile://openfile?repo_id=${repoID}&path=${encodeURIComponent(filePath)}`}>{gettext('Open via Client')}</a>
|
|
||||||
<p className="tip">{gettext('Please install the desktop client to open file via client.')}</p>
|
|
||||||
</React.Fragment>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -40,13 +40,6 @@ body {
|
|||||||
background: #f4f4f4;
|
background: #f4f4f4;
|
||||||
border-right: 4px solid transparent;
|
border-right: 4px solid transparent;
|
||||||
}
|
}
|
||||||
.open-via-client {
|
|
||||||
display: block;
|
|
||||||
margin-top: 25px;
|
|
||||||
color: #333;
|
|
||||||
font-weight: normal;
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
.tip {
|
.tip {
|
||||||
color: #808080;
|
color: #808080;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user