mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-31 10:28:06 +00:00
cloud_discovery: add initial ubus status call
Fixes: WIFI-14694 Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
@@ -287,6 +287,25 @@ let ubus_methods = {
|
|||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
status: {
|
||||||
|
call: function(req) {
|
||||||
|
const names = [ 'discover', 'validate', 'online', 'offline', 'orphan' ];
|
||||||
|
let ret = { state: names[state] };
|
||||||
|
switch(state){
|
||||||
|
case OFFLINE:
|
||||||
|
ret.since = time() - offline_time;
|
||||||
|
break;
|
||||||
|
case ORPHAN:
|
||||||
|
ret.since = time() - orphan_time;
|
||||||
|
break;
|
||||||
|
case VALIDATING:
|
||||||
|
ret.since = time() - validate_time;;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
},
|
||||||
|
args: {},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (gateway_available()) {
|
if (gateway_available()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user