mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
Signed-off-by: Frederick Borges <fborges@opennebula.io>
This commit is contained in:
parent
e0fd7582b8
commit
2dec5dc777
@ -88,8 +88,21 @@ define(function (require) {
|
||||
}
|
||||
};
|
||||
|
||||
var error_function = function(error, request=null, notify=true){
|
||||
if (notify)
|
||||
Notifier.onError(request, {error:{ message: "FireEdge public endpoint is not working, please contact your cloud administrator"}});
|
||||
|
||||
sunstone_fireedge_active = false;
|
||||
|
||||
if (typeof error === "function")
|
||||
error();
|
||||
}
|
||||
|
||||
var _check_fireedge_public_url = function (success, aux, error) {
|
||||
if (fireedge_endpoint){
|
||||
var regex = /^(http(s)?:\/\/)(www\.)?[a-z,0-9]+([\-\.]{1}[a-z,0-9]+)*(:[0-9]{1,5})?(\/.*)?$/gm
|
||||
var valid_endpoint = Boolean(fireedge_endpoint.match(regex))
|
||||
|
||||
if (fireedge_endpoint && valid_endpoint){
|
||||
$.ajax({
|
||||
url: fireedge_endpoint,
|
||||
type: "GET",
|
||||
@ -100,19 +113,12 @@ define(function (require) {
|
||||
}
|
||||
},
|
||||
error: function(request, response, data) {
|
||||
Notifier.onError(request, {error:{ message: "FireEdge public endpoint is not working, please contact your cloud administrator"}});
|
||||
sunstone_fireedge_active = false;
|
||||
if (typeof error === "function"){
|
||||
error();
|
||||
}
|
||||
error_function(error, request);
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
sunstone_fireedge_active = false;
|
||||
if (typeof error === "function"){
|
||||
error();
|
||||
}
|
||||
else{
|
||||
error_function(error, null, is_fireedge_configured && !valid_endpoint);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -47,7 +47,7 @@ define(function (require) {
|
||||
var _start = function (fireedgeToken="") {
|
||||
connection = STATUS.PROCESSING;
|
||||
|
||||
if (fireedgeToken != "" ){
|
||||
if (sunstone_fireedge_active && fireedgeToken != "" ){
|
||||
const socket = io(Config.publicFireedgeEndpoint, {
|
||||
path: "/fireedge/websocket",
|
||||
query: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user