pbca26
8 years ago
1 changed files with 28 additions and 33 deletions
@ -1,42 +1,37 @@ |
|||||
|
function Generic_Iguana_Jumblr(ajax_data, resolve) { |
||||
|
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'); |
||||
|
|
||||
|
ajax_data.userpass = tmpIguanaRPCAuth; |
||||
|
$.ajax({ |
||||
|
data: JSON.stringify(ajax_data), |
||||
|
url: 'http://127.0.0.1:' + config.iguanaPort, |
||||
|
type: 'POST', |
||||
|
dataType: 'json' |
||||
|
}) |
||||
|
.done(function(data) { |
||||
|
resolve(data); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
function Iguana_Jumblr_SetPassphrase(data) { |
function Iguana_Jumblr_SetPassphrase(data) { |
||||
return new Promise((resolve) => { |
var ajax_data = { |
||||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
'agent': 'jumblr', |
||||
ajax_data = { |
'method': 'setpassphrase', |
||||
'userpass': tmpIguanaRPCAuth, |
'passphrase': data.passphrase |
||||
'agent': 'jumblr', |
}; |
||||
'method': 'setpassphrase', |
|
||||
'passphrase': data.passphrase |
|
||||
}; |
|
||||
|
|
||||
$.ajax({ |
return new Promise((resolve) => { |
||||
data: JSON.stringify(ajax_data), |
Generic_Iguana_Jumblr(ajax_data, resolve); |
||||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|
||||
type: 'POST', |
|
||||
dataType: 'json' |
|
||||
}) |
|
||||
.done(function(data) { |
|
||||
resolve(data); |
|
||||
}); |
|
||||
}); |
}); |
||||
} |
} |
||||
|
|
||||
function Iguana_Jumblr_Status() { |
function Iguana_Jumblr_Status() { |
||||
return new Promise((resolve) => { |
var ajax_data = { |
||||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
'agent': 'jumblr', |
||||
ajax_data = { |
'method': 'status' |
||||
'userpass': tmpIguanaRPCAuth, |
}; |
||||
'agent': 'jumblr', |
|
||||
'method': 'status' |
|
||||
}; |
|
||||
|
|
||||
$.ajax({ |
return new Promise((resolve) => { |
||||
data: JSON.stringify(ajax_data), |
Generic_Iguana_Jumblr(ajax_data, resolve); |
||||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|
||||
type: 'POST', |
|
||||
dataType: 'json' |
|
||||
}) |
|
||||
.done(function(data) { |
|
||||
resolve(data); |
|
||||
}); |
|
||||
}); |
}); |
||||
} |
} |
Loading…
Reference in new issue