Skip to content
Snippets Groups Projects
Commit 73c4003b authored by David Bauer's avatar David Bauer Committed by David Bauer
Browse files

app: load vendors from vendormodels

This loads the vendor list for the dropdown menu from the vendormodels
structure. This way, only vendors for enabled device categories are
displayed.
parent cfdd9e75
Branches
No related tags found
No related merge requests found
...@@ -725,6 +725,20 @@ var firmwarewizard = function() { ...@@ -725,6 +725,20 @@ var firmwarewizard = function() {
} }
} }
function getVendors() {
var vendorlist = [];
for (var device_category_idx in enabled_device_categories) {
var device_category = enabled_device_categories[device_category_idx];
var category_vendors = Object.keys(config.vendormodels[device_category]);
category_vendors.forEach(function (val, idx) {
if (!vendorlist.includes(val)) {
vendorlist.push(val);
}
});
}
return vendorlist;
}
// update all elements of the page according to the wizard object. // update all elements of the page according to the wizard object.
function updateHTML(wizard) { function updateHTML(wizard) {
// parse searchstring to retrieve current vendor and model // parse searchstring to retrieve current vendor and model
...@@ -747,7 +761,7 @@ var firmwarewizard = function() { ...@@ -747,7 +761,7 @@ var firmwarewizard = function() {
createOption('', '-- Bitte Hersteller wählen --') createOption('', '-- Bitte Hersteller wählen --')
); );
var vendors = Object.keys(images).sort(sortCaseInsensitive); var vendors = getVendors().sort(sortCaseInsensitive);
for (var i in vendors) { for (var i in vendors) {
select.appendChild( select.appendChild(
createOption(atomic(vendors[i]), vendors[i], atomic(currentVendor)) createOption(atomic(vendors[i]), vendors[i], atomic(currentVendor))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment