Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
105d5d9c
Commit
105d5d9c
authored
Nov 26, 2016
by
Fabian Franz
Committed by
Franco Fichtner
Nov 30, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add validation message
(cherry picked from commit
fc1a15df
)
parent
cb0e11bc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
vouchers.volt
...nsense/mvc/app/views/OPNsense/CaptivePortal/vouchers.volt
+7
-0
No files found.
src/opnsense/mvc/app/views/OPNsense/CaptivePortal/vouchers.volt
View file @
105d5d9c
...
...
@@ -174,12 +174,18 @@ POSSIBILITY OF SUCH DAMAGE.
* link actual voucher generation in dialog
*/
$("#generateVoucherBtn").click(function(){
$('#generatevouchererror').html('');
$('#generatevouchererror').hide();
var voucher_provider = $('#voucher-providers').find("option:selected").val();
var voucher_validity = $("#voucher-validity").val();
var voucher_quantity = $("#voucher-quantity").val();
var voucher_groupname = $("#voucher-groupname").val();
if (!$.isNumeric(voucher_validity) || !$.isNumeric(voucher_quantity)) {
// don't try to generate vouchers then validity or quantity are invalid
var error = $('<p />');
error.text("{{ lang._('The validity and the quantity of vouchers must be integers.') }}");
$('#generatevouchererror').append(error);
$('#generatevouchererror').show();
return;
}
ajaxCall(url="/api/captiveportal/voucher/generateVouchers/" + voucher_provider + "/",
...
...
@@ -384,6 +390,7 @@ POSSIBILITY OF SUCH DAMAGE.
<h4 class="modal-title">{{ lang._('Generate vouchers') }}</h4>
</div>
<div class="modal-body">
<div id="generatevouchererror" class="alert alert-danger" role="alert" style="display: none"></div>
<table class="table table-striped table-condensed table-responsive">
<thead>
<tr>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment