mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
feature(rest) config: add read
This commit is contained in:
parent
134c89912d
commit
b9273f9166
2 changed files with 21 additions and 9 deletions
|
|
@ -113,6 +113,7 @@ var CloudCmd, Util, DOM;
|
|||
|
||||
function onChange(event) {
|
||||
var data,
|
||||
Config = DOM.RESTful.Config,
|
||||
obj = {},
|
||||
el = event.target,
|
||||
name = el.id,
|
||||
|
|
@ -140,7 +141,7 @@ var CloudCmd, Util, DOM;
|
|||
CONFIG[name] = data;
|
||||
CloudCmd.setConfig(CONFIG);
|
||||
|
||||
DOM.RESTful.config(obj);
|
||||
Config.write(obj);
|
||||
}
|
||||
|
||||
function key(event) {
|
||||
|
|
|
|||
|
|
@ -82,14 +82,25 @@ var Util, DOM, CloudFunc, CloudCmd;
|
|||
});
|
||||
};
|
||||
|
||||
this.config = function(data, callback) {
|
||||
sendRequest({
|
||||
method : 'PUT',
|
||||
url : '/config',
|
||||
data : data,
|
||||
callback : callback,
|
||||
imgPosition : { top: true }
|
||||
});
|
||||
this.Config = {
|
||||
read: function(callback) {
|
||||
sendRequest({
|
||||
method : 'GET',
|
||||
url : '/config',
|
||||
callback : callback,
|
||||
imgPosition : { top: true }
|
||||
});
|
||||
},
|
||||
|
||||
write: function(data, callback) {
|
||||
sendRequest({
|
||||
method : 'PUT',
|
||||
url : '/config',
|
||||
data : data,
|
||||
callback : callback,
|
||||
imgPosition : { top: true }
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
this.Markdown = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue