mirror of
https://github.com/myvesta/vesta
synced 2025-07-11 15:46:43 -07:00
export from svn
This commit is contained in:
commit
641ed97fdd
340 changed files with 32404 additions and 0 deletions
65
web/js/model.js
Normal file
65
web/js/model.js
Normal file
|
@ -0,0 +1,65 @@
|
|||
App.Model.DNS.loadList = function(){
|
||||
App.Ajax.request('DNS.getList', {}, App.View.listItems);
|
||||
}
|
||||
|
||||
App.Model.IP.loadList = function(){
|
||||
App.Ajax.request('IP.getList', {}, App.View.listItems);
|
||||
}
|
||||
|
||||
App.Model.add = function(values, source_json) {
|
||||
var method = App.Settings.getMethodName('add');
|
||||
App.Ajax.request(method, {
|
||||
spell: $.toJSON(values)
|
||||
}, function(reply){
|
||||
if(!reply.result) {
|
||||
alert('FALSE');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
App.Model.update = function(values, source_json) {
|
||||
var method = App.Settings.getMethodName('update');
|
||||
App.Ajax.request(method, {
|
||||
'old': source_json,
|
||||
'new': App.Helpers.toJSON(values)
|
||||
}, function(reply){
|
||||
if(!reply.result) {
|
||||
alert('FALSE');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
App.Model.IP.update = function(values, source_json) {
|
||||
App.Ajax.request('IP.update', {
|
||||
'source': source_json,
|
||||
'target': App.Helpers.toJSON(values)
|
||||
}, function(reply){
|
||||
if(!reply.result) {
|
||||
App.Pages.IP.ipNotSaved(reply);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
App.Model.IP.add = function(values) {
|
||||
App.Ajax.request('IP.add', {
|
||||
'target': App.Helpers.toJSON(values)
|
||||
}, function(reply){
|
||||
if(!reply.result) {
|
||||
App.Helpers.alert(reply.message)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
App.Model.IP.remove = function(values_json, elm) {
|
||||
App.Ajax.request('IP.remove', {
|
||||
'target': values_json
|
||||
}, function(reply){
|
||||
if(!reply.result) {
|
||||
App.Helpers.alert(reply.message);
|
||||
}
|
||||
else {
|
||||
elm.remove();
|
||||
}
|
||||
});
|
||||
}*/
|
Loading…
Add table
Add a link
Reference in a new issue