var rpcRequestRegistry = {},
rpcRequestBatch = null,
rpcRequestID = 1,
- rpcSessionID = L.env.sessionid || '00000000000000000000000000000000';
+ rpcSessionID = L.env.sessionid || '00000000000000000000000000000000',
+ rpcBaseURL = L.url('admin/ubus');
return L.Class.extend({
call: function(req, cbFn) {
q += '/%s.%s'.format(req.params[1], req.params[2]);
}
- return L.Request.post(L.url('admin/ubus') + q, req, {
+ return L.Request.post(rpcBaseURL + q, req, {
timeout: (L.env.rpctimeout || 5) * 1000,
credentials: true
}).then(cb);
}, this, this, options);
},
+ getSessionID: function() {
+ return rpcSessionID;
+ },
+
setSessionID: function(sid) {
rpcSessionID = sid;
+ },
+
+ getBaseURL: function() {
+ return rpcBaseURL;
+ },
+
+ setBaseURL: function(url) {
+ rpcBaseURL = url;
}
});