1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 23:20:51 +00:00

improve devices page

This commit is contained in:
lian
2016-03-16 15:47:33 +08:00
parent a43b3f969e
commit 50711071a6
5 changed files with 109 additions and 54 deletions

View File

@@ -1,10 +1,36 @@
define([
'underscore',
'backbone'
], function(_, Backbone) {
'backbone',
'common',
], function(_, Backbone, Common) {
'use strict';
var Device = Backbone.Model.extend({});
var Device = Backbone.Model.extend({
unlink: function(options) {
var data = {
'platform': this.get('platform'),
'device_id': this.get('device_id')
};
$.ajax({
url: Common.getUrl({name: '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;
});