diff --git a/app.js b/app.js index 07282ec65b236b56ec296dbdb8556c2cb2e083b3..5a761d1017c03cc46ea66df0d37a584d9a360cd9 100644 --- a/app.js +++ b/app.js @@ -839,23 +839,36 @@ var firmwarewizard = function() { scrollDown(); } - var deviceinfo = $('#deviceinfo'); + // find device info link + function findDeviceInfo(vendor, model, revision, links) { + if (links[vendor] !== undefined && links[vendor][model] !== undefined) { + revisions = links[vendor][model]; + } else { + return ''; + } + + if (typeof revisions == 'object' && revisions[revision] !== undefined) { + return revisions[revision]; + } else if (typeof revisions == 'string') { + return revisions; + } else { + return ''; + } + } + var url = ''; + var custom_url = ''; + var deviceinfo = $('#deviceinfo'); deviceinfo.innerHTML = ''; - if ( - devices_info[currentVendor] !== undefined && - devices_info[currentVendor][currentModel] !== undefined - ) { - url = devices_info[currentVendor][currentModel]; + url = findDeviceInfo(currentVendor, currentModel, currentRevision, devices_info); + + if ("devices_info" in config){ + custom_url = findDeviceInfo(currentVendor, currentModel, currentRevision, config.devices_info); } - if ( - config.devices_info !== undefined && - config.devices_info[currentVendor] !== undefined && - config.devices_info[currentVendor][currentModel] - ) { - url = config.devices_info[currentVendor][currentModel]; + if (custom_url !== '') { + url = custom_url; } if (url !== '') { diff --git a/config_template.js b/config_template.js index bbe02745d44a817c1587df898eeca331bb7c1f7d..a54d7789c3d2eab17dd82d4b839297711e0b2e53 100644 --- a/config_template.js +++ b/config_template.js @@ -54,10 +54,14 @@ var config = { // link to changelog changelog: 'CHANGELOG.html', // links for instructions like flashing of certain devices (optional) - // overwrites values from devices_info in devices.js - devices_info: { - 'AVM': { - "FRITZ!Box 4040": "https://fritz-tools.readthedocs.io" - } - } + // can be set for a whole model or individual revisions + // overwrites default values from devices_info in devices.js + // devices_info: { + // 'AVM': { + // "FRITZ!Box 4040": "https://fritz-tools.readthedocs.io" + // }, + // "TP-Link": { + // "TL-WR841N/ND": {"v13": "https://wiki.freifunk.net/TP-Link_WR841ND/Flash-Anleitung_v13"} + // } + // } }; diff --git a/devices.js b/devices.js index 1c85a4e540669d65fbe3ffbb935ec6d00267d19b..09a5816ba68aa517c53d29e2cdb9cbe1baa2f3fa 100644 --- a/devices.js +++ b/devices.js @@ -428,5 +428,10 @@ var devices_info = { "UniFi AC Mesh Pro": "https://forum.darmstadt.freifunk.net/t/unifi-ap-erstinstallation/790", "UniFi AC Mesh": "https://forum.darmstadt.freifunk.net/t/unifi-ap-erstinstallation/790", "UniFi AC Pro": "https://forum.darmstadt.freifunk.net/t/unifi-ap-erstinstallation/790", + }, + "TP-Link": { + "TL-WR841N/ND" : { + "v13": "https://openwrt.org/toh/tp-link/tl-wr841nd#tftp_recovery_via_bootloader_for_v8_v9_v10_v11_v12_v13" + } } }