Skip to content
Permalink
Browse files

Merge branch 'node'

  • Loading branch information...
RMerl committed Jul 12, 2019
2 parents 27d5212 + a3fffd8 commit 85e2f6ffba8e9d4fda8ff38a04b12c288e1e9d8c
@@ -17,16 +17,16 @@ fi
new_firm=`echo $2 | sed s/'\.'/_/4 | sed s/'\.'//g;`
echo "---- $new_firm ----" >> /tmp/webs_note.log

if [ $new_firm == $(nvram get webs_state_info) ]; then
releasenote_file=$(nvram get webs_state_info_am)_note.txt
releasenote_US=$releasenote_file
fwsite=$(nvram get firmware_server)
fwsiteSQ=$fwsite"/test"
else
if echo $2 | grep -q "\."; then
releasenote_file=$1_"$new_firm"_"$LANG"_note.zip
releasenote_file_US=$1_"$new_firm"_US_note.zip
fwsite="https://dlcdnets.asus.com/pub/ASUS/wireless/ASUSWRT/"
fwsiteSQ="https://dlcdnets.asus.com/pub/ASUS/LiveUpdate/Release/Wireless_SQ/"
else
releasenote_file=$(nvram get webs_state_info_am)_note.txt
releasenote_US=$releasenote_file
fwsite=$(nvram get firmware_server)
fwsiteSQ=$fwsite"/test"
fi
releasenote_path="/tmp/release_note.txt"

@@ -112,7 +112,6 @@ var sig_update_t = '<% nvram_get("sig_update_t"); %>';
if(cfg_sync_support){
var cfg_check = '<% nvram_get("cfg_check"); %>';
var cfg_upgrade = '<% nvram_get("cfg_upgrade"); %>';
var local_id = '<% get_lan_hwaddr(); %>'.replace(/:/g, "");
}
var download_srv = '<% nvram_get("firmware_server"); %>';
if (download_srv == "") {
@@ -168,7 +167,7 @@ function initial(){
html += "</tr>";
$("#fw_version_tr").before(html);
var mac_id = local_id;
var mac_id = '<% get_lan_hwaddr(); %>'.replace(/:/g, "");
html = "";
html += "<tr style='height:15px;'></tr>";
html += "<tr>";
@@ -228,7 +227,10 @@ function initial(){
html += "<#AiMesh_NodeLocation#> : " + alias;
html += "</th>";
html += "<td id='amas_" + mac_id + "'>";
html += "<div id='current_version'><#ADSL_FW_item1#> : " + fwver + "</div>";
if (check_is_merlin_fw(fwver))
html += "<div id='current_version'><#ADSL_FW_item1#> : " + fwver.replace("3.0.0.4.", "") + "</div>";
else
html += "<div id='current_version'><#ADSL_FW_item1#> : " + fwver + "</div>";
html += "<div id='manual_firmware_update'>";
html += gen_AiMesh_fw_status(check_AiMesh_fw_version(fwver), ip, online);
html += "</div>";
@@ -942,19 +944,18 @@ function show_amas_fw_result() {
var mac_id = mac.replace(/:/g, "");
var ck_fw_result = "<#is_latest#>";
var online = get_cfg_clientlist[idx].online;
var fwver = get_cfg_clientlist[idx].fwver;
$("#amas_" + mac_id + "").children().find(".checkFWReuslt").html(ck_fw_result);
if(newfwver != "") {
if (mac_id != local_id) {
ck_fw_result = newfwver;
} else {
if (check_is_merlin_fw(fwver)) {
ck_fw_result = newfwver.replace("3.0.0.4.","");
} else {
ck_fw_result = newfwver;
$("#amas_update").css("display", "");
}
$("#amas_" + mac_id + "").children().find(".checkFWReuslt").addClass("aimesh_fw_release_note");
$("#amas_" + mac_id + "").children().find(".checkFWReuslt").html(ck_fw_result);
if (mac_id != local_id) { // Not Local AM router
$("#amas_update").css("display", "");
}
$("#amas_" + mac_id + "").children().find(".checkFWReuslt").click({"model_name": model_name, "newfwver": newfwver}, show_fw_relese_note);
$("#amas_" + mac_id + "").children().find(".checkFWReuslt").click({"isMerlin" : check_is_merlin_fw(fwver), "model_name": model_name, "newfwver": newfwver}, show_fw_relese_note);
}
if(online == "1")
$("#amas_" + mac_id + "").children("#checkNewFW").css("display", "");
@@ -968,7 +969,10 @@ function show_fw_relese_note(event) {
$(".confirm_block").remove();
document.amas_release_note.model.value = event.data.model_name;
document.amas_release_note.version.value = event.data.newfwver;
if (event.data.isMerlin)
document.amas_release_note.version.value = event.data.newfwver.replace("3.0.0.4.","");
else
document.amas_release_note.version.value = event.data.newfwver;
document.amas_release_note.submit();
confirm_asus({
title: "New Firmware Available",
@@ -1046,11 +1050,12 @@ function update_AiMesh_fw() {
var ip = get_cfg_clientlist[idx].ip;
var online = get_cfg_clientlist[idx].online;
var mac_id = mac.replace(/:/g, "");
if (mac_id != local_id) { // Not Local AM router
if (check_is_merlin_fw(fwver))
$("#amas_" + mac_id + "").children("#current_version").html("<#ADSL_FW_item1#> : " + fwver.replace("3.0.0.4.","") + "");
else
$("#amas_" + mac_id + "").children("#current_version").html("<#ADSL_FW_item1#> : " + fwver + "");
$("#amas_" + mac_id + "").children("#manual_firmware_update").empty();
$("#amas_" + mac_id + "").children("#manual_firmware_update").html(gen_AiMesh_fw_status(check_AiMesh_fw_version(fwver), ip, online));
}
$("#amas_" + mac_id + "").children("#manual_firmware_update").empty();
$("#amas_" + mac_id + "").children("#manual_firmware_update").html(gen_AiMesh_fw_status(check_AiMesh_fw_version(fwver), ip, online));
}
}
}
@@ -1077,23 +1082,25 @@ function check_AiMesh_fw_version(_fw) {
var support_manual_fw_id = 382;
var support_manual_fw_num = 18000;
var manual_status = false;
var fw_array = _fw.split(".");
for(var i = 0; i < fw_array.length; i += 1) {
if( fw_array[i] != "" && (fw_array[i].indexOf("_") != -1) && (fw_array[i].indexOf("-") != -1) ) {
var fw_id_num = fw_array[i].substring(0, fw_array[i].indexOf('-')).split("_");
var fw_id = fw_id_num[0];
var fw_num = fw_id_num[1];
if(parseInt(fw_id) > support_manual_fw_id) {
manual_status = true;
break;
}
else if( (parseInt(fw_id) == support_manual_fw_id) && (parseInt(fw_num) >= support_manual_fw_num) ) {
manual_status = true;
break;
}
var fw_array = _fw.match(/(\d+)\.(\d+)\.(\d+)\.(\d+)\.([^_]+)_(\w+)/);
if (fw_array) {
var fw_id = fw_array[5];
var fw_num = fw_array[6];
if( (parseInt(fw_id) > support_manual_fw_id) ||
(parseInt(fw_id) == support_manual_fw_id) && (parseInt(fw_num) >= support_manual_fw_num) ) {
manual_status = true;
}
}
return manual_status
return manual_status;
}
function check_is_merlin_fw(_fw) {
var fw_array = _fw.match(/(\d+)\.(\d+)\.(\d+)\.(\d+)\.([^_]+)_(\w+)/);
if (fw_array && (fw_array[5].indexOf('.') > 0) )
return true;
else
return false;
}
function toggle_fw_check(state) {

0 comments on commit 85e2f6f

Please sign in to comment.
You can’t perform that action at this time.