OpenVPN export, hide p12 password when not applicable. closes https://github.com/opnsense/core/issues/3500

This commit is contained in:
Ad Schellevis 2019-05-27 11:41:15 +02:00
parent 8bb3f1f38c
commit 7a143c8557

View File

@ -34,6 +34,10 @@
white-space: nowrap;
overflow: auto;
}
.ui_hide {
display: none !important;
}
</style>
<script>
@ -81,6 +85,7 @@
$("#row_openvpn_export\\."+selected_options[i]).show();
}
$("#openvpn_export\\.template").selectpicker('refresh');
$("#openvpn_export\\.cryptoapi").change();
});
/**
@ -166,6 +171,15 @@
$(".password_field").closest('tr').removeClass('has-warning');
}
});
// hide pkcs12 password when not applicable
$("#openvpn_export\\.cryptoapi").change(function(){
if ($("#openvpn_export\\.cryptoapi").prop("checked") && $("#openvpn_export\\.cryptoapi").is(":visible")) {
$("#row_openvpn_export\\.p12_password").addClass("ui_hide");
} else {
$("#row_openvpn_export\\.p12_password").removeClass("ui_hide");
}
});
});