From 7fd8fcc0766adaf25b5e21a92fe76e0f807edb3c Mon Sep 17 00:00:00 2001 From: hmm Date: Fri, 5 Sep 2014 15:34:39 +0800 Subject: [PATCH] add warning when server error --- Bench4Q-Web/src/main/webapp/agentManage.jsp | 2 +- Bench4Q-Web/src/main/webapp/createScript.jsp | 1 + Bench4Q-Web/src/main/webapp/editScript.jsp | 1 + Bench4Q-Web/src/main/webapp/homepage.jsp | 2 +- .../src/main/webapp/i18n/i18n.properties | 3 ++- .../main/webapp/i18n/i18n_zh-CN.properties | 3 ++- Bench4Q-Web/src/main/webapp/index.jsp | 1 + Bench4Q-Web/src/main/webapp/login.jsp | 2 +- Bench4Q-Web/src/main/webapp/pluginManage.jsp | 2 +- Bench4Q-Web/src/main/webapp/portManage.jsp | 2 +- Bench4Q-Web/src/main/webapp/register.jsp | 2 +- .../src/main/webapp/registerSuccess.jsp | 2 +- Bench4Q-Web/src/main/webapp/result.jsp | 2 +- Bench4Q-Web/src/main/webapp/script.jsp | 2 +- .../script/RecordScript/RecordScriptServer.js | 20 ++++++++++++++----- .../script/RecordScript/ScriptListManage.js | 8 ++++++-- .../main/webapp/script/Share/information.js | 5 +++++ .../webapp/script/TestPlan/TestPlanServer.js | 7 +++++++ .../main/webapp/script/admin/agentManage.js | 10 ++++++++-- .../main/webapp/script/admin/pluginManage.js | 4 ++++ .../main/webapp/script/admin/portManage.js | 6 ++++++ Bench4Q-Web/src/main/webapp/script/login.js | 10 ++++++++-- .../src/main/webapp/script/register.js | 4 +++- .../main/webapp/script/scriptListManage.js | 8 ++++++-- .../webapp/script/scriptManager/behavior.js | 4 ++++ .../script/scriptManager/scriptEditor.js | 4 +++- .../webapp/script/scriptManager/usePlugin.js | 4 ++++ .../src/main/webapp/script/scriptTable.js | 4 +++- .../main/webapp/script/testPlanListManage.js | 6 +++++- .../script/testResult/behaviorResult.js | 4 +++- .../main/webapp/script/testResult/charts.js | 8 ++++++-- .../script/testResult/graphSelectorTree.js | 4 ++++ .../webapp/script/testResult/pageResult.js | 4 +++- .../main/webapp/script/testResult/pieChart.js | 4 +++- .../main/webapp/script/testResult/result.js | 7 ++++++- .../script/testResult/testBriefResult.js | 8 ++++++-- Bench4Q-Web/src/main/webapp/test.jsp | 2 +- Bench4Q-Web/src/main/webapp/testPlans.jsp | 2 +- 38 files changed, 136 insertions(+), 38 deletions(-) create mode 100644 Bench4Q-Web/src/main/webapp/script/Share/information.js diff --git a/Bench4Q-Web/src/main/webapp/agentManage.jsp b/Bench4Q-Web/src/main/webapp/agentManage.jsp index 5dbe17d0..79231711 100644 --- a/Bench4Q-Web/src/main/webapp/agentManage.jsp +++ b/Bench4Q-Web/src/main/webapp/agentManage.jsp @@ -151,11 +151,11 @@ body { + - diff --git a/Bench4Q-Web/src/main/webapp/createScript.jsp b/Bench4Q-Web/src/main/webapp/createScript.jsp index 13d69a4f..36e1dcf7 100644 --- a/Bench4Q-Web/src/main/webapp/createScript.jsp +++ b/Bench4Q-Web/src/main/webapp/createScript.jsp @@ -231,6 +231,7 @@ body { + diff --git a/Bench4Q-Web/src/main/webapp/editScript.jsp b/Bench4Q-Web/src/main/webapp/editScript.jsp index afff9ccd..aa579eb2 100644 --- a/Bench4Q-Web/src/main/webapp/editScript.jsp +++ b/Bench4Q-Web/src/main/webapp/editScript.jsp @@ -226,6 +226,7 @@ + diff --git a/Bench4Q-Web/src/main/webapp/homepage.jsp b/Bench4Q-Web/src/main/webapp/homepage.jsp index 0cf699d8..9308c324 100644 --- a/Bench4Q-Web/src/main/webapp/homepage.jsp +++ b/Bench4Q-Web/src/main/webapp/homepage.jsp @@ -138,10 +138,10 @@ body { + - diff --git a/Bench4Q-Web/src/main/webapp/i18n/i18n.properties b/Bench4Q-Web/src/main/webapp/i18n/i18n.properties index 92cd2c75..92a40310 100644 --- a/Bench4Q-Web/src/main/webapp/i18n/i18n.properties +++ b/Bench4Q-Web/src/main/webapp/i18n/i18n.properties @@ -47,4 +47,5 @@ saveScriptFail=Fail to save script. plugin_jsp_addPage=Add Page stopTestPlan_fail=Stop running test plan fail startRecordingMessage=Please click start recording -stopRecordingMessage=Please click stop recording \ No newline at end of file +stopRecordingMessage=Please click stop recording +failed-connect-server=failed to connect server \ No newline at end of file diff --git a/Bench4Q-Web/src/main/webapp/i18n/i18n_zh-CN.properties b/Bench4Q-Web/src/main/webapp/i18n/i18n_zh-CN.properties index 74add6c3..5e387298 100644 --- a/Bench4Q-Web/src/main/webapp/i18n/i18n_zh-CN.properties +++ b/Bench4Q-Web/src/main/webapp/i18n/i18n_zh-CN.properties @@ -43,4 +43,5 @@ saveScriptFail=\u4FDD\u5B58\u811A\u672C\u5931\u8D25 plugin_jsp_addPage=\u52A0\u9875 stopTestPlan_fail=\u505C\u6B62\u8FD0\u884C\u6D4B\u8BD5\u8BA1\u5212\u5931\u8D25 startRecordingMessage=\u8bf7\u70b9\u51fb\u5f00\u59cb\u5f55\u5236 -stopRecordingMessage=\u8bf7\u70b9\u51fb\u505c\u6b62\u5f55\u5236 \ No newline at end of file +stopRecordingMessage=\u8bf7\u70b9\u51fb\u505c\u6b62\u5f55\u5236 +failed-connect-server=\u8FDE\u63A5\u670D\u52A1\u5668\u5931\u8D25\uFF01 \ No newline at end of file diff --git a/Bench4Q-Web/src/main/webapp/index.jsp b/Bench4Q-Web/src/main/webapp/index.jsp index 5750278e..e8ccd29b 100644 --- a/Bench4Q-Web/src/main/webapp/index.jsp +++ b/Bench4Q-Web/src/main/webapp/index.jsp @@ -168,6 +168,7 @@ body { + \ No newline at end of file diff --git a/Bench4Q-Web/src/main/webapp/login.jsp b/Bench4Q-Web/src/main/webapp/login.jsp index 372dcb00..1e35a432 100644 --- a/Bench4Q-Web/src/main/webapp/login.jsp +++ b/Bench4Q-Web/src/main/webapp/login.jsp @@ -145,6 +145,6 @@ - + diff --git a/Bench4Q-Web/src/main/webapp/pluginManage.jsp b/Bench4Q-Web/src/main/webapp/pluginManage.jsp index 5f690623..48beea71 100644 --- a/Bench4Q-Web/src/main/webapp/pluginManage.jsp +++ b/Bench4Q-Web/src/main/webapp/pluginManage.jsp @@ -108,7 +108,7 @@ - + \ No newline at end of file diff --git a/Bench4Q-Web/src/main/webapp/portManage.jsp b/Bench4Q-Web/src/main/webapp/portManage.jsp index 2f2c84ba..87b073e1 100644 --- a/Bench4Q-Web/src/main/webapp/portManage.jsp +++ b/Bench4Q-Web/src/main/webapp/portManage.jsp @@ -108,7 +108,7 @@ - + diff --git a/Bench4Q-Web/src/main/webapp/register.jsp b/Bench4Q-Web/src/main/webapp/register.jsp index a8b2bda4..0e5d1e41 100644 --- a/Bench4Q-Web/src/main/webapp/register.jsp +++ b/Bench4Q-Web/src/main/webapp/register.jsp @@ -103,7 +103,7 @@ - + \ No newline at end of file diff --git a/Bench4Q-Web/src/main/webapp/registerSuccess.jsp b/Bench4Q-Web/src/main/webapp/registerSuccess.jsp index ea276245..69fe369a 100644 --- a/Bench4Q-Web/src/main/webapp/registerSuccess.jsp +++ b/Bench4Q-Web/src/main/webapp/registerSuccess.jsp @@ -82,7 +82,7 @@ body { - + diff --git a/Bench4Q-Web/src/main/webapp/result.jsp b/Bench4Q-Web/src/main/webapp/result.jsp index 9e6fe655..e42b2af9 100644 --- a/Bench4Q-Web/src/main/webapp/result.jsp +++ b/Bench4Q-Web/src/main/webapp/result.jsp @@ -230,7 +230,7 @@ body { - + \ No newline at end of file diff --git a/Bench4Q-Web/src/main/webapp/script.jsp b/Bench4Q-Web/src/main/webapp/script.jsp index dae8fe94..8a5c25ac 100644 --- a/Bench4Q-Web/src/main/webapp/script.jsp +++ b/Bench4Q-Web/src/main/webapp/script.jsp @@ -239,7 +239,7 @@ body { - + diff --git a/Bench4Q-Web/src/main/webapp/script/RecordScript/RecordScriptServer.js b/Bench4Q-Web/src/main/webapp/script/RecordScript/RecordScriptServer.js index fd11022d..e5e44d07 100644 --- a/Bench4Q-Web/src/main/webapp/script/RecordScript/RecordScriptServer.js +++ b/Bench4Q-Web/src/main/webapp/script/RecordScript/RecordScriptServer.js @@ -24,7 +24,9 @@ function startServer() { $.i18n.prop("startServerFail") + data.failedMessage); information($.i18n.prop("startServerFail") + data.failedMessage); } - }, "json"); + }, "json").error(function(){ + information($.i18n.prop('failed-connect-server')); + }); } function startRecording() { @@ -47,7 +49,9 @@ function startRecording() { $('#startRecording').attr('disabled', true); startRecordingSuccess = true; } - }, "json"); + }, "json").error(function(){ + information($.i18n.prop('failed-connect-server')); + }); } else { $('#scriptInfo3').text("record script server has not started"); } @@ -71,7 +75,9 @@ function stopRecording() { startRecordingSuccess = false; } $('#stopRecording').attr('disabled', true); - }, "json"); + }, "json").error(function(){ + information($.i18n.prop('failed-connect-server')); + }); } else { $('#scriptInfo3').text("record script server has not started"); } @@ -91,7 +97,9 @@ function stopServer() { startServerSuccess = false; } $('#startRecording').attr('disabled', false); - }, "json"); + }, "json").error(function(){ + information($.i18n.prop('failed-connect-server')); + }); } else { $('#scriptInfo3').text("record script server has not started"); } @@ -107,7 +115,9 @@ function testRecordProxy() { } else { $("#ProxySettingMessage").attr("class","show"); } - }, "json"); + }, "json").error(function(){ + information($.i18n.prop('failed-connect-server')); + }); } function saveScript() { diff --git a/Bench4Q-Web/src/main/webapp/script/RecordScript/ScriptListManage.js b/Bench4Q-Web/src/main/webapp/script/RecordScript/ScriptListManage.js index f519ad45..d3786f19 100644 --- a/Bench4Q-Web/src/main/webapp/script/RecordScript/ScriptListManage.js +++ b/Bench4Q-Web/src/main/webapp/script/RecordScript/ScriptListManage.js @@ -21,7 +21,9 @@ function loadScript(table) { information(data.failedMessage); } - }, "json"); + }, "json").error(function(){ + information($.i18n.prop('failed-connect-server')); + }); } function addEvent(table) { @@ -55,7 +57,9 @@ function deleteScript(scriptId, row) { information(data.failedMessage); // error message } - }, "json"); + }, "json").error(function(){ + information($.i18n.prop('failed-connect-server')); + }); } function editScript(scriptId, scriptName) { window.open("editScript.jsp?name=" + scriptName + "&scriptId=" + scriptId);// need diff --git a/Bench4Q-Web/src/main/webapp/script/Share/information.js b/Bench4Q-Web/src/main/webapp/script/Share/information.js new file mode 100644 index 00000000..fa75efe3 --- /dev/null +++ b/Bench4Q-Web/src/main/webapp/script/Share/information.js @@ -0,0 +1,5 @@ + +function information(text){ + noty({text: text,type:'information',layout:'center'}); + setTimeout("document.body.removeChild(noty_center_layout_container)",2000); +} diff --git a/Bench4Q-Web/src/main/webapp/script/TestPlan/TestPlanServer.js b/Bench4Q-Web/src/main/webapp/script/TestPlan/TestPlanServer.js index a4aa884f..961bace0 100644 --- a/Bench4Q-Web/src/main/webapp/script/TestPlan/TestPlanServer.js +++ b/Bench4Q-Web/src/main/webapp/script/TestPlan/TestPlanServer.js @@ -16,6 +16,8 @@ function loadScripts(){ var selectNode = document.getElementsByName("select")[0]; selectNode.appendChild(optionNode); } + }).error(function(){ + information($.i18n.prop('failed-connect-server')); }); } @@ -42,6 +44,8 @@ function loadFilterTypeList(){ $('#filterList').append(table); } } + }).error(function(){ + information($.i18n.prop('failed-connect-server')); }); } @@ -61,6 +65,8 @@ function getScriptId(scriptName) { } } else information(data.failedMessage); + }).error(function(){ + information($.i18n.prop('failed-connect-server')); }); return scriptId; @@ -130,6 +136,7 @@ function start() { information(data.failedMessage); }, error : function(request, status, error) { + information($.i18n.prop('failed-connect-server')); } }); } diff --git a/Bench4Q-Web/src/main/webapp/script/admin/agentManage.js b/Bench4Q-Web/src/main/webapp/script/admin/agentManage.js index 52a9f3be..b2521dbb 100644 --- a/Bench4Q-Web/src/main/webapp/script/admin/agentManage.js +++ b/Bench4Q-Web/src/main/webapp/script/admin/agentManage.js @@ -49,6 +49,8 @@ function loadAgents(table) { } + }).error(function(){ + information($.i18n.prop('failed-connect-server')); }) function formatAgentStatus(status) { if (status == "InIdle") { @@ -79,7 +81,9 @@ function deleteAgent(id, hostName, row) { information(data.failedMessage); } - }, "json"); + }, "json").error(function(){ + information($.i18n.prop('failed-connect-server')); + }); } function addAgentToDB() { @@ -95,7 +99,9 @@ function addAgentToDB() { } else { information(data.failedMessage); } - }, "json"); + }, "json").error(function(){ + information($.i18n.prop('failed-connect-server')); + }); } $('#agentList').click(function(e) { e.preventDefault(); diff --git a/Bench4Q-Web/src/main/webapp/script/admin/pluginManage.js b/Bench4Q-Web/src/main/webapp/script/admin/pluginManage.js index c1cfb36f..d7e852e9 100644 --- a/Bench4Q-Web/src/main/webapp/script/admin/pluginManage.js +++ b/Bench4Q-Web/src/main/webapp/script/admin/pluginManage.js @@ -19,6 +19,8 @@ function loadPluginInfo() { table.dataTable().fnAddData( [ data[i].pluginInfoModel.name, time, deleteButton ]); } + }).error(function(){ + information($.i18n.prop('failed-connect-server')); }); } @@ -40,6 +42,8 @@ function deleteAPlugin(plugin){ } information("delete success!"); location.replace(location) ; + }).error(function(){ + information($.i18n.prop('failed-connect-server')); }); } diff --git a/Bench4Q-Web/src/main/webapp/script/admin/portManage.js b/Bench4Q-Web/src/main/webapp/script/admin/portManage.js index 4f23c0e1..afd9a077 100644 --- a/Bench4Q-Web/src/main/webapp/script/admin/portManage.js +++ b/Bench4Q-Web/src/main/webapp/script/admin/portManage.js @@ -20,6 +20,8 @@ function deletePort(row, portId) { row.remove().draw(); } else information(data.failedMessage); + }).error(function(){ + information($.i18n.prop('failed-connect-server')); }); } @@ -33,6 +35,8 @@ function addPort(params) { } else { information(data.failedMessage); } + }).error(function(){ + information($.i18n.prop('failed-connect-server')); }); } function loadPorts(table) { @@ -52,6 +56,8 @@ function loadPorts(table) { information(data.failedMessage); } + }).error(function(){ + information($.i18n.prop('failed-connect-server')); }); } $("#plus").click(function(e) { diff --git a/Bench4Q-Web/src/main/webapp/script/login.js b/Bench4Q-Web/src/main/webapp/script/login.js index abd7928e..474f2b02 100644 --- a/Bench4Q-Web/src/main/webapp/script/login.js +++ b/Bench4Q-Web/src/main/webapp/script/login.js @@ -49,7 +49,9 @@ function login() { else { information(data.failedMessage); } - },"json"); + },"json").error(function(){ + information($.i18n.prop('failed-connect-server')); + }); } function adminLogin() { @@ -68,6 +70,8 @@ function adminLogin() { else { information(data.failedMessage); } + }).error(function(){ + information($.i18n.prop('failed-connect-server')); }); } function register() { @@ -96,7 +100,9 @@ function register() { // $('#registerMsg').html($.i18n.prop('msgRegister')); $('#registerMsg').show(); } - }, "json"); + }, "json").error(function(){ + information($.i18n.prop('failed-connect-server')); + }); } $("#img").mouseover(function(){document.getElementById("img").setAttribute("src", "img/githubsignon1.jpg");}); diff --git a/Bench4Q-Web/src/main/webapp/script/register.js b/Bench4Q-Web/src/main/webapp/script/register.js index 458da63e..89a8e9f8 100644 --- a/Bench4Q-Web/src/main/webapp/script/register.js +++ b/Bench4Q-Web/src/main/webapp/script/register.js @@ -43,7 +43,9 @@ function register(scope) { information(data.failedMessage); // $('#registerMsg').html($.i18n.prop('msgRegister')); } - }, "json"); + }, "json").error(function(){ + information($.i18n.prop('failed-connect-server')); + }); } function password_validation(scope) { diff --git a/Bench4Q-Web/src/main/webapp/script/scriptListManage.js b/Bench4Q-Web/src/main/webapp/script/scriptListManage.js index 6374d441..013913ec 100644 --- a/Bench4Q-Web/src/main/webapp/script/scriptListManage.js +++ b/Bench4Q-Web/src/main/webapp/script/scriptListManage.js @@ -23,7 +23,9 @@ function loadScript(table) { information(data.failedMessage); } - }, "json"); + }, "json").error(function(){ + information($.i18n.prop('failed-connect-server')); + }); } function addEvent(table) { @@ -57,7 +59,9 @@ function deleteScript(scriptId, row) { information(data.failedMessage); // error message } - }, "json"); + }, "json").error(function(){ + information($.i18n.prop('failed-connect-server')); + }); } function editScript(scriptId, scriptName) { window.open("editScript.jsp?name=" + scriptName + "&scriptId=" + scriptId);// need diff --git a/Bench4Q-Web/src/main/webapp/script/scriptManager/behavior.js b/Bench4Q-Web/src/main/webapp/script/scriptManager/behavior.js index 27c3a80a..13b3950c 100644 --- a/Bench4Q-Web/src/main/webapp/script/scriptManager/behavior.js +++ b/Bench4Q-Web/src/main/webapp/script/scriptManager/behavior.js @@ -121,6 +121,8 @@ function Behavior(usePlugin, containerId) { }); createRadioGroupByAttribute(dataBehaviors, "name", "name", "name", "method", "pluginMethod") + }).error(function(){ + information($.i18n.prop('failed-connect-server')); }); }); @@ -285,6 +287,8 @@ function Behavior(usePlugin, containerId) { return; } + }).error(function(){ + information($.i18n.prop('failed-connect-server')); }); } diff --git a/Bench4Q-Web/src/main/webapp/script/scriptManager/scriptEditor.js b/Bench4Q-Web/src/main/webapp/script/scriptManager/scriptEditor.js index bbc1aae0..40e05caf 100644 --- a/Bench4Q-Web/src/main/webapp/script/scriptManager/scriptEditor.js +++ b/Bench4Q-Web/src/main/webapp/script/scriptManager/scriptEditor.js @@ -21,7 +21,9 @@ function getScriptObject(scriptId,usePlugin) { usePlugin.initPluginAndPages(scriptObj); } - }, "json"); + }, "json").error(function(){ + information($.i18n.prop('failed-connect-server')); + }); } $(function() { diff --git a/Bench4Q-Web/src/main/webapp/script/scriptManager/usePlugin.js b/Bench4Q-Web/src/main/webapp/script/scriptManager/usePlugin.js index df22c6c3..89d37f63 100644 --- a/Bench4Q-Web/src/main/webapp/script/scriptManager/usePlugin.js +++ b/Bench4Q-Web/src/main/webapp/script/scriptManager/usePlugin.js @@ -93,6 +93,8 @@ function UsePlugin(behaviorListContainerId) { } else { return; } + }).error(function(){ + information($.i18n.prop('failed-connect-server')); }); } @@ -115,6 +117,8 @@ function UsePlugin(behaviorListContainerId) { return; } + }).error(function(){ + information($.i18n.prop('failed-connect-server')); }); } diff --git a/Bench4Q-Web/src/main/webapp/script/scriptTable.js b/Bench4Q-Web/src/main/webapp/script/scriptTable.js index 3e63686b..6b325e34 100644 --- a/Bench4Q-Web/src/main/webapp/script/scriptTable.js +++ b/Bench4Q-Web/src/main/webapp/script/scriptTable.js @@ -17,7 +17,9 @@ function loadScript(table, actionId) { information(data.failedMessage); } - }, "json"); + }, "json").error(function(){ + information($.i18n.prop('failed-connect-server')); + }); } function addScriptAction() { diff --git a/Bench4Q-Web/src/main/webapp/script/testPlanListManage.js b/Bench4Q-Web/src/main/webapp/script/testPlanListManage.js index 5f90c1d3..0f6b5998 100644 --- a/Bench4Q-Web/src/main/webapp/script/testPlanListManage.js +++ b/Bench4Q-Web/src/main/webapp/script/testPlanListManage.js @@ -28,7 +28,9 @@ function loadTestPlans(table) { - }, "json"); + }, "json").error(function(){ + information($.i18n.prop('failed-connect-server')); + }); } function addEvent(table){ var tbody = table.table().body(); @@ -76,6 +78,8 @@ function deleteTest(testPlanId, row) { } else { information($.i18n.prop('fail')); } + }).error(function(){ + information($.i18n.prop('failed-connect-server')); }); } \ No newline at end of file diff --git a/Bench4Q-Web/src/main/webapp/script/testResult/behaviorResult.js b/Bench4Q-Web/src/main/webapp/script/testResult/behaviorResult.js index e764ea66..612ecf7e 100644 --- a/Bench4Q-Web/src/main/webapp/script/testResult/behaviorResult.js +++ b/Bench4Q-Web/src/main/webapp/script/testResult/behaviorResult.js @@ -49,7 +49,9 @@ function Behavior() { } } - }, "json"); + }, "json").error(function(){ + information($.i18n.prop('failed-connect-server')); + }); } this.insertDataToTable = function(table, map) { diff --git a/Bench4Q-Web/src/main/webapp/script/testResult/charts.js b/Bench4Q-Web/src/main/webapp/script/testResult/charts.js index dbaac1b7..b3970461 100644 --- a/Bench4Q-Web/src/main/webapp/script/testResult/charts.js +++ b/Bench4Q-Web/src/main/webapp/script/testResult/charts.js @@ -100,7 +100,9 @@ Chart.prototype.getGraphDataFirstly=function(model){ chart.addDataToGraph(chart, model, data); } - }, "json"); + }, "json").error(function(){ + information($.i18n.prop('failed-connect-server')); + }); } @@ -126,7 +128,9 @@ Chart.prototype.addGraph = function(model) { chart.addDataToGraph(chart, model, data); } - }, "json"); + }, "json").error(function(){ + information($.i18n.prop('failed-connect-server')); + }); if($("#status").attr("status")=="Complete"){ clearInterval(intervalId); } diff --git a/Bench4Q-Web/src/main/webapp/script/testResult/graphSelectorTree.js b/Bench4Q-Web/src/main/webapp/script/testResult/graphSelectorTree.js index ee361131..84af4335 100644 --- a/Bench4Q-Web/src/main/webapp/script/testResult/graphSelectorTree.js +++ b/Bench4Q-Web/src/main/webapp/script/testResult/graphSelectorTree.js @@ -28,11 +28,15 @@ function getResultTree(testPlanId) { } + }, + error: function(){ + information($.i18n.prop('failed-connect-server')); } }); return tree; } + //function createScriptResultInfoTree(testPlanId, tree) { // var scriptResultTree = new Tree(); // scriptResultTree.createRoot("Script", "script"); diff --git a/Bench4Q-Web/src/main/webapp/script/testResult/pageResult.js b/Bench4Q-Web/src/main/webapp/script/testResult/pageResult.js index 8511f137..2de46520 100644 --- a/Bench4Q-Web/src/main/webapp/script/testResult/pageResult.js +++ b/Bench4Q-Web/src/main/webapp/script/testResult/pageResult.js @@ -44,7 +44,9 @@ function PageResult() { } } - }, "json"); + }, "json").error(function(){ + information($.i18n.prop('failed-connect-server')); + }); } diff --git a/Bench4Q-Web/src/main/webapp/script/testResult/pieChart.js b/Bench4Q-Web/src/main/webapp/script/testResult/pieChart.js index 24eda9c1..53256e82 100644 --- a/Bench4Q-Web/src/main/webapp/script/testResult/pieChart.js +++ b/Bench4Q-Web/src/main/webapp/script/testResult/pieChart.js @@ -60,7 +60,9 @@ var UrlContentTypeDistribution = function(containerId, testPlanId) { loadItems.urlDistribution=true; - },"json"); + },"json").error(function(){ + information($.i18n.prop('failed-connect-server')); + }); if (testStatus == "Complete"&&i>=1) { clearInterval(intervalId); diff --git a/Bench4Q-Web/src/main/webapp/script/testResult/result.js b/Bench4Q-Web/src/main/webapp/script/testResult/result.js index 2606265d..165c002a 100644 --- a/Bench4Q-Web/src/main/webapp/script/testResult/result.js +++ b/Bench4Q-Web/src/main/webapp/script/testResult/result.js @@ -39,7 +39,9 @@ $(function() { information($.i18n("stopTestPlan_fail")); } - }) + }).error(function(){ + information($.i18n.prop('failed-connect-server')); + }); } else { return; @@ -61,6 +63,9 @@ function getTestInfo(testPlanId) { } else { testPlan = data.testPlan; } + }, + error: function(){ + information($.i18n.prop('failed-connect-server')); } }); return testPlan; diff --git a/Bench4Q-Web/src/main/webapp/script/testResult/testBriefResult.js b/Bench4Q-Web/src/main/webapp/script/testResult/testBriefResult.js index f145255c..4040b5ae 100644 --- a/Bench4Q-Web/src/main/webapp/script/testResult/testBriefResult.js +++ b/Bench4Q-Web/src/main/webapp/script/testResult/testBriefResult.js @@ -26,7 +26,9 @@ function showTestPlanStatusAsync(testPlanId) { $('#status').html("

" + testStatus + '

'); } - }, "json"); + }, "json").error(function(){ + information($.i18n.prop('failed-connect-server')); + }); } function showTestBriefStatus(testPlanId) { var urlAddress = testPlanId + "/testBriefStatus"; @@ -46,5 +48,7 @@ function showTestBriefStatus(testPlanId) { if ($('#status').attr("status") == "Complete") { $("#vu").html("

" + 0 + "

"); } - }, "json"); + }, "json").error(function(){ + information($.i18n.prop('failed-connect-server')); + }); } diff --git a/Bench4Q-Web/src/main/webapp/test.jsp b/Bench4Q-Web/src/main/webapp/test.jsp index b34b779d..d982a884 100644 --- a/Bench4Q-Web/src/main/webapp/test.jsp +++ b/Bench4Q-Web/src/main/webapp/test.jsp @@ -229,7 +229,7 @@ body { - + diff --git a/Bench4Q-Web/src/main/webapp/testPlans.jsp b/Bench4Q-Web/src/main/webapp/testPlans.jsp index 49f024fc..0a68fd17 100644 --- a/Bench4Q-Web/src/main/webapp/testPlans.jsp +++ b/Bench4Q-Web/src/main/webapp/testPlans.jsp @@ -135,7 +135,7 @@ body { - +