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:
@@ -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;
|
||||
});
|
||||
|
Reference in New Issue
Block a user