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
951a2984
Commit
951a2984
authored
Jun 06, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set custom mirror and flavour,
https://github.com/opnsense/core/issues/834
parent
4dde2392
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
6 deletions
+59
-6
firmware.volt
src/opnsense/mvc/app/views/OPNsense/Core/firmware.volt
+59
-6
No files found.
src/opnsense/mvc/app/views/OPNsense/Core/firmware.volt
View file @
951a2984
...
...
@@ -305,39 +305,84 @@ POSSIBILITY OF SUCH DAMAGE.
updateStatus();
}
});
// fetch firmware options
// handle firmware config options
ajaxGet('/api/core/firmware/getFirmwareOptions',{},function(firmwareoptions, status) {
ajaxGet('/api/core/firmware/getFirmwareConfig',{},function(firmwareconfig, status) {
var other_selected = true;
$.each(firmwareoptions.mirrors, function(key, value) {
var selected = false;
if (
firmwareconfig['mirror'].indexOf(key) == 0
) {
if (
(key != "" && firmwareconfig['mirror'].indexOf(key) == 0) || key == firmwareconfig['mirror']
) {
selected = true;
other_selected = false;
}
$("#firmware_mirror").append($("<option/>").attr("value",key).text(value).prop('selected', selected));
$("#firmware_mirror").append($("<option/>")
.attr("value",key)
.text(value)
.prop('selected', selected)
);
});
$("#firmware_mirror").prepend($("<option/>")
.attr("value", firmwareconfig['mirror'])
.text("(other)")
.data("other", 1)
.prop('selected', other_selected)
);
$("#firmware_mirror").selectpicker('refresh');
$("#firmware_mirror").change();
other_selected = true;
$.each(firmwareoptions.flavours, function(key, value) {
var selected = false;
if (key == firmwareconfig['flavour']) {
selected = true;
other_selected = false;
}
$("#firmware_flavour").append($("<option/>").attr("value",key).text(value).prop('selected', selected));
$("#firmware_flavour").append($("<option/>")
.attr("value",key)
.text(value)
.prop('selected', selected)
);
});
$("#firmware_flavour").prepend($("<option/>")
.attr("value",firmwareconfig['flavour'])
.text("(other)")
.data("other", 1)
.prop('selected', other_selected)
);
$("#firmware_flavour").selectpicker('refresh');
$("#firmware_flavour").change();
});
});
$("#firmware_mirror").change(function(){
$("#firmware_mirror_value").val($(this).val());
if ($(this).find(':selected').data("other") == 1) {
$("#firmware_mirror_other").show();
} else {
$("#firmware_mirror_other").hide();
}
});
$("#firmware_flavour").change(function() {
$("#firmware_flavour_value").val($(this).val());
if ($(this).find(':selected').data("other") == 1) {
$("#firmware_flavour_other").show();
} else {
$("#firmware_flavour_other").hide();
}
});
$("#change_mirror").click(function(){
$("#change_mirror_progress").addClass("fa fa-spinner fa-pulse");
var confopt = {};
confopt.mirror = $("#firmware_mirror").val()
confopt.flavour = $("#firmware_flavour").val()
confopt.mirror = $("#firmware_mirror
_value
").val()
confopt.flavour = $("#firmware_flavour
_value
").val()
ajaxCall(url='/api/core/firmware/setFirmwareConfig',sendData=confopt, callback=function(data,status) {
$("#change_mirror_progress").removeClass("fa fa-spinner fa-pulse");
});
});
});
</script>
...
...
@@ -368,6 +413,10 @@ POSSIBILITY OF SUCH DAMAGE.
<td>
<select class="selectpicker" id="firmware_mirror">
</select>
<div style="display:none;" id="firmware_mirror_other">
<br/>
<input type="text" id="firmware_mirror_value">
</div>
<div class="hidden" for="help_for_mirror">
<strong>
{{ lang._("Select an alternate firmware mirror.") }}
...
...
@@ -381,6 +430,10 @@ POSSIBILITY OF SUCH DAMAGE.
<td>
<select class="selectpicker" id="firmware_flavour">
</select>
<div style="display:none;" id="firmware_flavour_other">
<br/>
<input type="text" id="firmware_flavour_value">
</div>
<div class="hidden" for="help_for_flavour">
<strong>
{{ lang._("Select the firmware cryptography flavour.") }}
...
...
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