1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-07 01:41:39 +00:00

repo-status-interface

This commit is contained in:
王健辉
2019-05-17 16:30:56 +08:00
parent 75954dbf93
commit ba2ac6ca49
4 changed files with 9 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ class RepoInfo {
this.encrypted = object.encrypted; this.encrypted = object.encrypted;
this.lib_need_decrypt = object.lib_need_decrypt; this.lib_need_decrypt = object.lib_need_decrypt;
this.last_modified= object.last_modified; this.last_modified= object.last_modified;
this.status = object.status;
} }
} }

View File

@@ -16,6 +16,7 @@ class Repo {
this.modifier_name = object.modifier_name; this.modifier_name = object.modifier_name;
this.type = object.type; this.type = object.type;
this.starred = object.starred; this.starred = object.starred;
this.status = object.status;
if (object.is_admin != undefined) { if (object.is_admin != undefined) {
this.is_admin = object.is_admin; this.is_admin = object.is_admin;
} }

View File

@@ -164,6 +164,11 @@ class LibContentContainer extends React.Component {
return ( return (
<Fragment> <Fragment>
<div className="cur-view-container"> <div className="cur-view-container">
{this.props.currentRepoInfo.status === 'read-only' &&
<div style={{background:'#FEFBDC', textAlign:'center'}}>
<p>{gettext('This library has been set to read-only by admin and cannot be updated.')}</p>
</div>
}
<div className="cur-view-path"> <div className="cur-view-path">
<CurDirPath <CurDirPath
repoID={repoID} repoID={repoID}

View File

@@ -239,12 +239,13 @@ export const Utils = {
getLibIconUrl: function(repo, isBig) { getLibIconUrl: function(repo, isBig) {
let permission = repo.permission || repo.share_permission; //Compatible with regular repo and repo shared let permission = repo.permission || repo.share_permission; //Compatible with regular repo and repo shared
let size = Utils.isHiDPI() ? 48 : 24; let size = Utils.isHiDPI() ? 48 : 24;
let status = repo.status;
size = isBig ? 256 : size; size = isBig ? 256 : size;
let icon_name = 'lib.png'; let icon_name = 'lib.png';
if (repo.encrypted) { if (repo.encrypted) {
icon_name = 'lib-encrypted.png'; icon_name = 'lib-encrypted.png';
} }
if (permission === 'r' || permission === 'perview') { if (permission === 'r' || permission === 'perview' || status === 'read-only') {
icon_name = 'lib-readonly.png'; icon_name = 'lib-readonly.png';
} }