b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | (function ($) { |
| 2 | $.fn.objRouterManage = function (InIt) { |
| 3 | var afterRebootID; |
| 4 | this.onLoad = function () { |
| 5 | LoadWebPage("//192.168.1.1/html/router/router_management.html"); |
| 6 | |
| 7 | |
| 8 | $("#lt_rm_btnPowerOff").click(function() { |
| 9 | PowerOffRouter(); |
| 10 | }); |
| 11 | |
| 12 | $("#lt_rm_btnResetFactory").click(function() { |
| 13 | ResetRouter(); |
| 14 | }); |
| 15 | |
| 16 | $("#lt_rm_btnReboot").click(function() { |
| 17 | RebootRouter(); |
| 18 | }); |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | } |
| 24 | |
| 25 | function PowerOffRouter(){ |
| 26 | ShowDlg('MBRouterManageDlg',400,100); |
| 27 | $("#lQueryRouterInfo").text(jQuery.i18n.prop("lt_rm_QeuryPoweroff")); |
| 28 | |
| 29 | $("#lt_btnSave").click(function() { |
| 30 | CloseDlg(); |
| 31 | PostXml("router","router_poweroff"); |
| 32 | //ShowDlg("PleaseWait", 120, 100); |
| 33 | }); |
| 34 | } |
| 35 | |
| 36 | function RebootRouter() { |
| 37 | ShowDlg('MBRouterManageDlg',400,100); |
| 38 | $("#lQueryRouterInfo").text(jQuery.i18n.prop("lt_rm_QueryRebootedRouter")); |
| 39 | |
| 40 | $("#lt_btnSave").click(function() { |
| 41 | PostXml("router","router_call_reboot"); |
| 42 | |
| 43 | //ShowDlg("divWaitRouterResponse",200,50); |
| 44 | ShowDlg("PleaseWait", 120, 100); |
| 45 | |
| 46 | afterRebootID = setInterval(function(){CloseDlg();clearInterval(afterRebootID);clearAuthheader();}, 45000); |
| 47 | }); |
| 48 | } |
| 49 | |
| 50 | |
| 51 | function ResetRouter() { |
| 52 | ShowDlg('MBRouterManageDlg',400,100); |
| 53 | $("#lQueryRouterInfo").text(jQuery.i18n.prop("lt_rm_QueryResetRouter")); |
| 54 | |
| 55 | $("#lt_btnSave").click(function() { |
| 56 | PostXml("router","router_call_rst_factory"); |
| 57 | |
| 58 | //ShowDlg("divWaitRouterResponse",200,50); |
| 59 | ShowDlg("PleaseWait", 120, 100); |
| 60 | |
| 61 | afterRebootID = setInterval(function(){CloseDlg();clearInterval(afterRebootID);clearAuthheader();}, 45000); |
| 62 | }); |
| 63 | } |
| 64 | |
| 65 | return this; |
| 66 | |
| 67 | } |
| 68 | })(jQuery); |
| 69 | |