mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-04 00:20:07 +00:00
Wiki mode optimized (#2442)
This commit is contained in:
26
frontend/src/models/dirent.js
Normal file
26
frontend/src/models/dirent.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import moment from 'moment';
|
||||
import { Utils } from '../utils/utils';
|
||||
|
||||
class Dirent {
|
||||
constructor(json) {
|
||||
this.id = json.id;
|
||||
this.name = json.name;
|
||||
this.type = json.type;
|
||||
this.mtime = moment.unix(json.mtime).fromNow();
|
||||
this.permission = json.permission;
|
||||
if (json.type === 'file') {
|
||||
this.size = Utils.bytesToSize(json.size);
|
||||
this.starred = json.starred;
|
||||
this.is_locked = json.is_locked;
|
||||
this.lock_time = moment.unix(json.lock_time).fromNow();
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default Dirent;
|
21
frontend/src/models/repo.js
Normal file
21
frontend/src/models/repo.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import { Utils } from '../utils/utils';
|
||||
|
||||
class Repo {
|
||||
constructor(object) {
|
||||
this.repo_id = object.repo_id;
|
||||
this.repo_name = object.name;
|
||||
this.permission = object.permission;
|
||||
this.size = Utils.bytesToSize(object.size);
|
||||
this.file_count = object.file_count;
|
||||
this.owner_name = object.owner_name;
|
||||
this.owner_email = object.owner_email;
|
||||
this.owner_contact_email = object.owner_contact_email;
|
||||
this.is_admin = object.is_admin;
|
||||
this.is_virtual = object.is_virtual;
|
||||
this.no_quota = object.no_quota;
|
||||
this.has_been_shared_out = object.has_been_shared_out;
|
||||
this.encrypted = object.encrypted;
|
||||
}
|
||||
}
|
||||
|
||||
export default Repo;
|
Reference in New Issue
Block a user