restart_D5

Adds a simple reboot button in the upper right corner of TP-Link's ARcher D5 modem/router homepage

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        restart_D5
// @namespace   https://greasyfork.org/en/users/98065-exaoss
// @description Adds a simple reboot button in the upper right corner of TP-Link's ARcher D5 modem/router homepage
// @include     http://192.168.1.1/*
// @version     1
// @author      exaoss
// @grant       none
// ==/UserScript==


function doRestart() // do the restart.. got no idea how this function works since it's imported form router's reboot page

{
	if(confirm(c_str.creboot))
	{
		$.guage(["<span class='T T_rebooting'>"+s_str.rebooting+"</span>", "<span class='T T_wait_reboot'>"+s_str.wait_reboot+"</span>",], 100, $.guageInterval, function(){$.refresh();});
		$.act(ACT_OP, ACT_OP_REBOOT);
		$.exe(true);
		//location.replace("#__restart.htm"); //redirect to Reboot page
	}
}

var buttonnode= document.createElement('input');
buttonnode.setAttribute('type','button');
buttonnode.setAttribute('name','restart');
buttonnode.setAttribute('value','Restart');
buttonnode.onclick = relay;

function relay()
{
doRestart();
}

// append at beside the model name
document.getElementById( 'mname' ).appendChild( buttonnode );