Skip to content
Snippets Groups Projects
Commit 05b4e04f authored by codedust's avatar codedust
Browse files

Add config.js

parent 227ad7cc
Branches
No related tags found
No related merge requests found
config.js
images/*
...@@ -3,12 +3,6 @@ OpenWrt/LEDE Firmware Wizard ...@@ -3,12 +3,6 @@ OpenWrt/LEDE Firmware Wizard
This Firmware Wizard lets a user select the correct firmware for his device. Directory listings are used to parse the list of available images. This Firmware Wizard lets a user select the correct firmware for his device. Directory listings are used to parse the list of available images.
This a fork of the [gluon-firmware-wizard](https://github.com/freifunk-darmstadt/gluon-firmware-wizard) containing these changes:
- jQuery and bootstrap.js were removed
- support for other images name formats
- simpler configuration
- no static branch names
Some [Screenshots](docs/screenshots.md). Some [Screenshots](docs/screenshots.md).
### Configuration ### Configuration
...@@ -47,11 +41,10 @@ If no hardware revision is given or is it is empty, the revision is extracted fr ...@@ -47,11 +41,10 @@ If no hardware revision is given or is it is empty, the revision is extracted fr
If two matches overlap, the longest match will be assigned the matching files. On the other hand, the same match can be used by multiple models without problems. If two matches overlap, the longest match will be assigned the matching files. On the other hand, the same match can be used by multiple models without problems.
### Configuration ### Configuration
Image paths and available branches can be set in file app.js. Image paths and available branches can be set in file `config_template.js` which has to be renamed to `config.js`
### TODO ### TODO
- support rootfs/kernel image combinations - support rootfs/kernel image combinations
- server side site generation (maybe using python?)
### License ### License
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
......
...@@ -13,20 +13,6 @@ ...@@ -13,20 +13,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
var config = {
typeNames: {
'factory': 'Erstinstallation',
'sysupgrade': 'Upgrade'
},
// relative image paths and branch
directories: {
// some demo sources
'./images/gluon-factory.html': 'stable',
'./images/gluon-sysupgrade.html': 'stable'
}
};
function $(s) { function $(s) {
return document.getElementById(s.substring(1)); return document.getElementById(s.substring(1));
} }
...@@ -388,7 +374,11 @@ var firmwarewizard = function() { ...@@ -388,7 +374,11 @@ var firmwarewizard = function() {
var types = getImageTypes(); var types = getImageTypes();
for (var i in types) { for (var i in types) {
var type = types[i]; var type = types[i];
var displayType = config.typeNames[type] || type; var typeNames = {
'factory': 'Erstinstallation',
'sysupgrade': 'Upgrade'
};
var displayType = typeNames[type] || type;
content += '<input type="radio" id="radiogroup-typeselect-' content += '<input type="radio" id="radiogroup-typeselect-'
+ type + '" ' + ((type == wizard.imageType) ? 'checked ' : '') + type + '" ' + ((type == wizard.imageType) ? 'checked ' : '')
+ 'name="firmwareType" onclick="firmwarewizard.setImageType(\'' + type + '\');">' + 'name="firmwareType" onclick="firmwarewizard.setImageType(\'' + type + '\');">'
......
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
var config = {
// relative image paths and branch
directories: {
// some demo sources
'./images/gluon-factory.html': 'stable',
'./images/gluon-sysupgrade.html': 'stable'
}
};
...@@ -82,6 +82,7 @@ ...@@ -82,6 +82,7 @@
</div> </div>
<script src="devices.js"></script> <script src="devices.js"></script>
<script src="config.js"></script>
<script src="app.js"></script> <script src="app.js"></script>
</body> </body>
</html> </html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment