mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-03 07:55:36 +00:00
new admin devices page;
This commit is contained in:
32
static/scripts/sysadmin-app/views/device-error.js
Normal file
32
static/scripts/sysadmin-app/views/device-error.js
Normal file
@@ -0,0 +1,32 @@
|
||||
define([
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone',
|
||||
'common',
|
||||
'moment',
|
||||
'app/views/widgets/hl-item-view'
|
||||
], function($, _, Backbone, Common, Moment, HLItemView) {
|
||||
'use strict';
|
||||
|
||||
var DeviceErrorView = HLItemView.extend({
|
||||
tagName: 'tr',
|
||||
|
||||
template: _.template($('#admin-device-error-tmpl').html()),
|
||||
|
||||
initialize: function() {
|
||||
HLItemView.prototype.initialize.call(this);
|
||||
},
|
||||
|
||||
render: function() {
|
||||
var data = this.model.toJSON();
|
||||
var last_accessed = Moment(data['last_accessed']);
|
||||
data['time'] = last_accessed.format('LLLL');
|
||||
data['time_from_now'] = Common.getRelativeTimeStr(last_accessed);
|
||||
this.$el.html(this.template(data));
|
||||
return this;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return DeviceErrorView;
|
||||
});
|
Reference in New Issue
Block a user