mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
net/zerotier: fix boxing, status on enabled but stopped, label consistency
This commit is contained in:
+1
-8
@@ -195,14 +195,7 @@ class ZerotierController extends ApiMutableModelControllerBase
|
||||
public function statusAction()
|
||||
{
|
||||
$mdlZerotier = $this->getModel();
|
||||
$enabled = false;
|
||||
|
||||
foreach ($mdlZerotier->networks->network->__items as $network) {
|
||||
if ($this->isEnabled($network)) {
|
||||
$enabled = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$enabled = (string)$mdlZerotier->enabled == '1';
|
||||
|
||||
$backend = new Backend();
|
||||
$response = $backend->configdRun('zerotier status');
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<form>
|
||||
<field>
|
||||
<id>zerotier.enabled</id>
|
||||
<label>Enable the Zerotier Service</label>
|
||||
<label>Enabled</label>
|
||||
<type>checkbox</type>
|
||||
<help>This will activate the Zerotier service</help>
|
||||
</field>
|
||||
|
||||
@@ -54,14 +54,14 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
toggleNetworksTab(data['result']);
|
||||
});
|
||||
|
||||
$("#save").click(function() {
|
||||
$("#saveProgress").addClass("fa fa-spinner fa-pulse");
|
||||
$("#btn_save_global").click(function() {
|
||||
$("#global_progress").addClass("fa fa-spinner fa-pulse");
|
||||
saveFormToEndpoint(url="/api/zerotier/zerotier/set", formid="global", callback_ok=function(data, status) {
|
||||
ajaxCall(url="/api/zerotier/zerotier/status", sendData={}, callback=function(data, status) {
|
||||
updateServiceStatusUI(data['result']);
|
||||
toggleNetworksTab(data['result']);
|
||||
});
|
||||
$("#saveProgress").removeClass("fa fa-spinner fa-pulse");
|
||||
$("#global_progress").removeClass("fa fa-spinner fa-pulse");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -89,12 +89,8 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
<div class="tab-content content-box tab-content">
|
||||
<div id="global" class="tab-pane fade in active">
|
||||
<div class="content-box" style="padding-bottom: 1.5em;">
|
||||
{{ partial("layout_partials/base_form", ['fields': globalForm, 'id': 'global']) }}
|
||||
<hr/>
|
||||
<div class="col-md-12">
|
||||
<button class="btn btn-primary" id="save" type="button"><b>{{ lang._('Save') }}</b> <i id="saveProgress" class=""></i></button>
|
||||
</div>
|
||||
<div class="content-box">
|
||||
{{ partial("layout_partials/base_form", ['fields': globalForm, 'id': 'global', 'apply_btn_id': 'btn_save_global']) }}
|
||||
</div>
|
||||
</div>
|
||||
<div id="networks" class="tab-pane fade in">
|
||||
|
||||
Reference in New Issue
Block a user