diff --git a/example/plugins/debugger/mod/zoraxy_plugin/zoraxy_plugin.go b/example/plugins/debugger/mod/zoraxy_plugin/zoraxy_plugin.go index 2cf494e..737e928 100644 --- a/example/plugins/debugger/mod/zoraxy_plugin/zoraxy_plugin.go +++ b/example/plugins/debugger/mod/zoraxy_plugin/zoraxy_plugin.go @@ -42,8 +42,9 @@ type SubscriptionEvent struct { } type RuntimeConstantValue struct { - ZoraxyVersion string `json:"zoraxy_version"` - ZoraxyUUID string `json:"zoraxy_uuid"` + ZoraxyVersion string `json:"zoraxy_version"` + ZoraxyUUID string `json:"zoraxy_uuid"` + DevelopmentBuild bool `json:"development_build"` //Whether the Zoraxy is a development build or not } /* diff --git a/example/plugins/helloworld/mod/zoraxy_plugin/zoraxy_plugin.go b/example/plugins/helloworld/mod/zoraxy_plugin/zoraxy_plugin.go index 2cf494e..737e928 100644 --- a/example/plugins/helloworld/mod/zoraxy_plugin/zoraxy_plugin.go +++ b/example/plugins/helloworld/mod/zoraxy_plugin/zoraxy_plugin.go @@ -42,8 +42,9 @@ type SubscriptionEvent struct { } type RuntimeConstantValue struct { - ZoraxyVersion string `json:"zoraxy_version"` - ZoraxyUUID string `json:"zoraxy_uuid"` + ZoraxyVersion string `json:"zoraxy_version"` + ZoraxyUUID string `json:"zoraxy_uuid"` + DevelopmentBuild bool `json:"development_build"` //Whether the Zoraxy is a development build or not } /* diff --git a/example/plugins/upnp/mod/zoraxy_plugin/zoraxy_plugin.go b/example/plugins/upnp/mod/zoraxy_plugin/zoraxy_plugin.go index 2cf494e..737e928 100644 --- a/example/plugins/upnp/mod/zoraxy_plugin/zoraxy_plugin.go +++ b/example/plugins/upnp/mod/zoraxy_plugin/zoraxy_plugin.go @@ -42,8 +42,9 @@ type SubscriptionEvent struct { } type RuntimeConstantValue struct { - ZoraxyVersion string `json:"zoraxy_version"` - ZoraxyUUID string `json:"zoraxy_uuid"` + ZoraxyVersion string `json:"zoraxy_version"` + ZoraxyUUID string `json:"zoraxy_uuid"` + DevelopmentBuild bool `json:"development_build"` //Whether the Zoraxy is a development build or not } /* diff --git a/example/plugins/upnp/upnp.json b/example/plugins/upnp/upnp.json index 627b5bb..2f45679 100644 --- a/example/plugins/upnp/upnp.json +++ b/example/plugins/upnp/upnp.json @@ -1 +1 @@ -{"ForwardRules":[{"RuleName":"EarlySpring","PortNumber":2016}],"Enabled":false} \ No newline at end of file +{"ForwardRules":[],"Enabled":false} \ No newline at end of file diff --git a/example/plugins/ztnc/mod/zoraxy_plugin/zoraxy_plugin.go b/example/plugins/ztnc/mod/zoraxy_plugin/zoraxy_plugin.go index 2cf494e..737e928 100644 --- a/example/plugins/ztnc/mod/zoraxy_plugin/zoraxy_plugin.go +++ b/example/plugins/ztnc/mod/zoraxy_plugin/zoraxy_plugin.go @@ -42,8 +42,9 @@ type SubscriptionEvent struct { } type RuntimeConstantValue struct { - ZoraxyVersion string `json:"zoraxy_version"` - ZoraxyUUID string `json:"zoraxy_uuid"` + ZoraxyVersion string `json:"zoraxy_version"` + ZoraxyUUID string `json:"zoraxy_uuid"` + DevelopmentBuild bool `json:"development_build"` //Whether the Zoraxy is a development build or not } /* diff --git a/example/plugins/ztnc/web/details.html b/example/plugins/ztnc/web/details.html index 37db9a0..766644c 100644 --- a/example/plugins/ztnc/web/details.html +++ b/example/plugins/ztnc/web/details.html @@ -226,9 +226,9 @@ }, success: function(data){ if (data.error != undefined){ - msgbox(data.error, false, 5000) + parent.msgbox(data.error, false, 5000) }else{ - msgbox("Network Range Updated") + parent.msgbox("Network Range Updated") } } }) @@ -253,7 +253,7 @@ initNetNameAndDesc(); if (object != undefined){ $(object).removeClass("loading"); - msgbox("Network Metadata Updated"); + parent.msgbox("Network Metadata Updated"); } $("#gannetDetailEdit").slideUp("fast"); } @@ -264,7 +264,7 @@ //Get the details of the net $.get("./api/gan/network/name?netid=" + currentGANetID, function(data){ if (data.error !== undefined){ - msgbox(data.error, false, 6000); + parent.msgbox(data.error, false, 6000); }else{ $("#gaNetNameInput").val(data[0]); $(".ganetName").html(data[0]); @@ -278,7 +278,7 @@ //Get the details of the net $.get("./api/gan/network/list?netid=" + currentGANetID, function(data){ if (data.error !== undefined){ - msgbox(data.error, false, 6000); + parent.msgbox(data.error, false, 6000); }else{ currentGaNetDetails = data; highlightCurrentGANetCIDR(); @@ -299,9 +299,9 @@ }, success: function(data){ if (data.error != undefined){ - msgbox(data.error, false, 5000); + parent.msgbox(data.error, false, 5000); }else{ - msgbox("IP removed from member " + memberid) + parent.msgbox("IP removed from member " + memberid) } renderMemeberTable(); } @@ -331,7 +331,7 @@ } if (!isValidIPv4Address(newip)){ - msgbox(newip + " is not a valid IPv4 address", false, 5000) + parent.msgbox(newip + " is not a valid IPv4 address", false, 5000) return } @@ -346,9 +346,9 @@ }, success: function(data){ if (data.error != undefined){ - msgbox(data.error, false, 5000); + parent.msgbox(data.error, false, 5000); }else{ - msgbox("IP added to member " + memberid) + parent.msgbox("IP added to member " + memberid) } renderMemeberTable(); } @@ -482,7 +482,7 @@ function renameMember(targetMemberAddr){ if (targetMemberAddr == ""){ - msgbox("Member address cannot be empty", false, 5000) + parent.msgbox("Member address cannot be empty", false, 5000) return } @@ -498,9 +498,9 @@ }, success: function(data){ if (data.error != undefined){ - msgbox(data.error, false, 6000); + parent.msgbox(data.error, false, 6000); }else{ - msgbox("Member Name Updated"); + parent.msgbox("Member Name Updated"); } renderMemeberTable(true); } @@ -564,12 +564,12 @@ }, success: function(data){ if (data.error != undefined){ - msgbox(data.error, false, 6000); + parent.msgbox(data.error, false, 6000); }else{ if (isAuthed){ - msgbox("Member Authorized"); + parent.msgbox("Member Authorized"); }else{ - msgbox("Member Deauthorized"); + parent.msgbox("Member Deauthorized"); } } @@ -580,25 +580,26 @@ } function handleMemberDelete(addr){ - if (confirm("Confirm delete member " + addr + " ?")){ - $.cjax({ - url: "./api/gan/members/delete", - method: "POST", - data: { - netid:currentGANetID, - memid: addr, - }, - success: function(data){ - if (data.error != undefined){ - msgbox(data.error, false, 6000); - }else{ - msgbox("Member Deleted"); + parent.confirmBox("Confirm delete member " + addr + " ?", function(choice){ + if (choice){ + $.cjax({ + url: "./api/gan/members/delete", + method: "POST", + data: { + netid:currentGANetID, + memid: addr, + }, + success: function(data){ + if (data.error != undefined){ + parent.msgbox(data.error, false, 6000); + }else{ + parent.msgbox("Member Deleted"); + } + renderMemeberTable(true); } - renderMemeberTable(true); - } - }); - } - + }); + } + }); } //Add and remove this controller node to network as member @@ -616,13 +617,18 @@ $(".addControllerToNetworkBtn").removeClass("disabled"); $(".addControllerToNetworkBtn").removeClass("loading"); if (data.error != undefined){ - msgbox(data.error, false, 6000); + parent.msgbox(data.error, false, 6000); }else{ - msgbox("Controller joint " + currentGANetID); + parent.msgbox("Controller joint " + currentGANetID); } setTimeout(function(){ renderMemeberTable(true); }, 3000) + }, + error: function(){ + $(".addControllerToNetworkBtn").removeClass("disabled"); + $(".addControllerToNetworkBtn").removeClass("loading"); + } }); } @@ -639,9 +645,9 @@ }, success: function(data){ if (data.error != undefined){ - msgbox(data.error, false, 6000); + parent.msgbox(data.error, false, 6000); }else{ - msgbox("Controller left " + currentGANetID); + parent.msgbox("Controller left " + currentGANetID); } renderMemeberTable(true); $(".removeControllerFromNetworkBtn").removeClass("disabled"); @@ -655,7 +661,7 @@ currentGANetID = ganetId; $(".ganetID").text(ganetId); initNetNameAndDesc(ganetId); - generateIPRangeTable(netRanges);msgbox + generateIPRangeTable(netRanges); initNetDetails(); renderMemeberTable(true); @@ -676,7 +682,6 @@ } //Debug functions - if (typeof(msgbox) == "undefined"){ msgbox = function(msg, error=false, timeout=3000){ console.log(msg); diff --git a/example/plugins/ztnc/web/index.html b/example/plugins/ztnc/web/index.html index c470a65..3753ed4 100644 --- a/example/plugins/ztnc/web/index.html +++ b/example/plugins/ztnc/web/index.html @@ -92,7 +92,7 @@ function handleAddNetwork(){ let networkName = $("#networkName").val().trim(); if (networkName == ""){ - msgbox("Network name cannot be empty", false, 5000); + parent.msgbox("Network name cannot be empty", false, 5000); return; } @@ -104,7 +104,7 @@ function initGANetID(){ $.get("./api/gan/network/info", function(data){ if (data.error !== undefined){ - msgbox(data.error, false, 5000) + parent.msgbox(data.error, false, 5000) }else{ if (data != ""){ $(".ganControllerID").text(data); @@ -121,9 +121,9 @@ data: {}, success: function(response) { if (response.error != undefined){ - msgbox(response.error, false, 5000); + parent.msgbox(response.error, false, 5000); }else{ - msgbox("Network added successfully"); + parent.msgbox("Network added successfully"); } console.log("Network added successfully:", response); listGANet(); @@ -141,7 +141,7 @@ $("#GANetList").empty(); if (data.error != undefined){ console.log(data.error); - msgbox("Unable to load auth token for GANet", false, 5000); + parent.msgbox("Unable to load auth token for GANet", false, 5000); //token error or no zerotier found $(".gansnetworks").addClass("disabled"); $("#GANetList").append(`