1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-12 13:24:52 +00:00

improve tree loading for Wiki mode (#2842)

This commit is contained in:
杨顺强
2019-01-23 16:25:14 +08:00
committed by Daniel Pan
parent 4b4233ebb9
commit 123a442319
19 changed files with 1386 additions and 601 deletions

View File

@@ -4,23 +4,23 @@ import FileTag from './file-tag';
class Dirent {
constructor(json) {
this.id = json.id;
this.id = json.id || '0000000000000000';
this.name = json.name;
this.type = json.type;
this.mtime = json.mtime;
this.mtime_relative = moment.unix(json.mtime).fromNow();
this.permission = json.permission;
this.permission = json.permission || 'rw';
this.isSelected = false; // is check or not
if (json.type === 'file') {
this.size = Utils.bytesToSize(json.size);
this.starred = json.starred || false;
this.is_locked = json.is_locked || false;
this.lock_time = json.lock_time;
this.lock_owner= json.lock_owner;
this.locked_by_me = json.locked_by_me;
this.modifier_name = json.modifier_name;
this.modifier_email = json.modifier_email;
this.modifier_contact_email = json.modifier_contact_email;
this.lock_time = json.lock_time || '';
this.lock_owner= json.lock_owner || null;
this.locked_by_me = json.locked_by_me || false;
this.modifier_name = json.modifier_name || '';
this.modifier_email = json.modifier_email || '';
this.modifier_contact_email = json.modifier_contact_email || '';
let file_tags = [];
if (json.file_tags) {
file_tags = json.file_tags.map(item => {