mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-06 09:21:54 +00:00
[file view] removed 'open via client'
This commit is contained in:
@@ -2,7 +2,7 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { gettext } from '../../utils/constants';
|
||||
|
||||
const { err, filePerm, fileType, repoID, filePath } = window.app.pageOptions;
|
||||
const { err } = window.app.pageOptions;
|
||||
|
||||
const propTypes = {
|
||||
errorMsg: PropTypes.string
|
||||
@@ -18,22 +18,11 @@ class FileViewTip extends React.Component {
|
||||
errorMsg = <p className="error">{err || this.props.errorMsg}</p>;
|
||||
}
|
||||
|
||||
let canOpenViaClient = false;
|
||||
if (filePerm == 'rw' && (fileType == 'Document' || fileType == 'SpreadSheet')) {
|
||||
canOpenViaClient = true;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="file-view-content flex-1 o-auto">
|
||||
<div className="file-view-tip">
|
||||
{errorMsg}
|
||||
<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>
|
||||
);
|
||||
|
Reference in New Issue
Block a user