mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 07:01:12 +00:00
new admin devices page;
This commit is contained in:
11
static/scripts/sysadmin-app/models/device-error.js
Normal file
11
static/scripts/sysadmin-app/models/device-error.js
Normal file
@@ -0,0 +1,11 @@
|
||||
define([
|
||||
'underscore',
|
||||
'backbone',
|
||||
'common',
|
||||
], function(_, Backbone, Common) {
|
||||
'use strict';
|
||||
|
||||
var DeviceError = Backbone.Model.extend({});
|
||||
|
||||
return DeviceError;
|
||||
});
|
37
static/scripts/sysadmin-app/models/device.js
Normal file
37
static/scripts/sysadmin-app/models/device.js
Normal file
@@ -0,0 +1,37 @@
|
||||
define([
|
||||
'underscore',
|
||||
'backbone',
|
||||
'common',
|
||||
], function(_, Backbone, Common) {
|
||||
'use strict';
|
||||
|
||||
var Device = Backbone.Model.extend({
|
||||
unlink: function(options) {
|
||||
var data = {
|
||||
'platform': this.get('platform'),
|
||||
'device_id': this.get('device_id'),
|
||||
'user': this.get('user')
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: Common.getUrl({name: 'admin-devices'}),
|
||||
type: 'DELETE',
|
||||
dataType: 'json',
|
||||
beforeSend: Common.prepareCSRFToken,
|
||||
data: data,
|
||||
success: function() {
|
||||
if (options.success) {
|
||||
options.success();
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
if (options.error) {
|
||||
options.error(xhr);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
return Device;
|
||||
});
|
Reference in New Issue
Block a user