add warning when server error

This commit is contained in:
hmm 2014-09-05 15:34:39 +08:00
parent 6759fd36d8
commit 7fd8fcc076
38 changed files with 136 additions and 38 deletions

View File

@ -151,11 +151,11 @@ body {
<script src="lib/chrisma/js/theme.js"></script>
<script src="lib/jqueryi18n/jquery.i18n.properties-1.0.9.js"></script>
<script src="http://malsup.github.com/jquery.form.js"></script>
<script src="script/Share/information.js"></script>
<script src="script/base.js"></script>
<script src="script/bench4q.table.js"></script>
<script src="script/admin/agentManage.js"></script>
<script src="lib/other/jquery.noty.packaged.min.js"></script>
<script src="script/scriptManager/uiFactory.js"></script>
</fmt:bundle>
</body>
</html>

View File

@ -231,6 +231,7 @@ body {
<script src="lib/other/jquery.msgbox.min.js"></script>
<script src="lib/other/jquery.noty.packaged.min.js"></script>
<script src="script/base.js"></script>
<script src="script/Share/information.js"></script>
<script src="script/scriptManager/scriptModels.js"></script>
<script src="script/scriptManager/editorFactory.js"></script>
<script src="script/scriptManager/containerFactory.js"></script>

View File

@ -226,6 +226,7 @@
<script src="lib/other/jquery.msgbox.min.js"></script>
<script src="lib/HashMap/HashMap.js"></script>
<script src="script/Share/getUrlVars.js"></script>
<script src="script/Share/information.js"></script>
<script src="script/scriptManager/editorFactory.js"></script>
<script src="script/scriptManager/dataFormat.js"></script>
<script src="script/scriptManager/containerFactory.js"></script>

View File

@ -138,10 +138,10 @@ body {
<script src="script/scriptTable.js"></script>
<script src="script/bench4q.table.js"></script>
<script src="script/Share/TestStatusMap.js"></script>
<script src="script/Share/information.js"></script>
<script src="script/testPlanListManage.js"></script>
<script src="script/home.js"></script>
<script src="lib/other/jquery.noty.packaged.min.js"></script>
<script src="script/scriptManager/uiFactory.js"></script>
</fmt:bundle>
</body>
</html>

View File

@ -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
stopRecordingMessage=Please click stop recording
failed-connect-server=failed to connect server

View File

@ -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
stopRecordingMessage=\u8bf7\u70b9\u51fb\u505c\u6b62\u5f55\u5236
failed-connect-server=\u8FDE\u63A5\u670D\u52A1\u5668\u5931\u8D25\uFF01

View File

@ -168,6 +168,7 @@ body {
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.0.min.js"></script>
<script src="lib/bootstrap/js/bootstrap-carousel.js"></script>
<script src="script/Share/information.js"></script>
<script src="script/index.js"></script>
</body>
</html>

View File

@ -145,6 +145,6 @@
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.0.min.js"></script>
<script src="script/login.js"></script>
<script src="lib/other/jquery.noty.packaged.min.js"></script>
<script src="script/scriptManager/uiFactory.js"></script>
<script src="script/Share/information.js"></script>
</body>
</html>

View File

@ -108,7 +108,7 @@
<script src="script/bench4q.table.js"></script>
<script src="script/admin/pluginManage.js"></script>
<script src="lib/other/jquery.noty.packaged.min.js"></script>
<script src="script/scriptManager/uiFactory.js"></script>
<script src="script/Share/information.js"></script>
</fmt:bundle>
</body>
</html>

View File

@ -108,7 +108,7 @@
<script src="script/base.js"></script>
<script src="script/admin/portManage.js"></script>
<script src="lib/other/jquery.noty.packaged.min.js"></script>
<script src="script/scriptManager/uiFactory.js"></script>
<script src="script/Share/information.js"></script>
</fmt:bundle>
</body>
</html>

View File

@ -103,7 +103,7 @@
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.0.3.min.js"></script>
<script src="script/register.js"></script>
<script src="lib/other/jquery.noty.packaged.min.js"></script>
<script src="script/scriptManager/uiFactory.js"></script>
<script src="script/Share/information.js"></script>
</fmt:bundle>
</body>
</html>

View File

@ -82,7 +82,7 @@ body {
<script src="lib/jqueryi18n/jquery.i18n.properties-1.0.9.js"></script>
<script src="script/login.js"></script>
<script src="lib/other/jquery.noty.packaged.min.js"></script>
<script src="script/scriptManager/uiFactory.js"></script>
<script src="script/Share/information.js"></script>
</fmt:bundle>
</body>
</html>

View File

@ -230,7 +230,7 @@ body {
<script src="script/testResult/behaviorResult.js"></script>
<script src="script/testResult/result.js"></script>
<script src="lib/other/jquery.noty.packaged.min.js"></script>
<script src="script/scriptManager/uiFactory.js"></script>
<script src="script/Share/information.js"></script>
</fmt:bundle>
</body>
</html>

View File

@ -239,7 +239,7 @@ body {
<script src="script/RecordScript/RecordScriptUI.js"></script>
<script src="script/RecordScript/RecordScriptServer.js"></script>
<script src="lib/other/jquery.noty.packaged.min.js"></script>
<script src="script/scriptManager/uiFactory.js"></script>
<script src="script/Share/information.js"></script>
</fmt:bundle>
</body>
</html>

View File

@ -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() {

View File

@ -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

View File

@ -0,0 +1,5 @@
function information(text){
noty({text: text,type:'information',layout:'center'});
setTimeout("document.body.removeChild(noty_center_layout_container)",2000);
}

View File

@ -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'));
}
});
}

View File

@ -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();

View File

@ -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'));
});
}

View File

@ -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) {

View File

@ -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");});

View File

@ -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) {

View File

@ -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

View File

@ -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'));
});
}

View File

@ -21,7 +21,9 @@ function getScriptObject(scriptId,usePlugin) {
usePlugin.initPluginAndPages(scriptObj);
}
}, "json");
}, "json").error(function(){
information($.i18n.prop('failed-connect-server'));
});
}
$(function() {

View File

@ -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'));
});
}

View File

@ -17,7 +17,9 @@ function loadScript(table, actionId) {
information(data.failedMessage);
}
}, "json");
}, "json").error(function(){
information($.i18n.prop('failed-connect-server'));
});
}
function addScriptAction() {

View File

@ -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'));
});
}

View File

@ -49,7 +49,9 @@ function Behavior() {
}
}
}, "json");
}, "json").error(function(){
information($.i18n.prop('failed-connect-server'));
});
}
this.insertDataToTable = function(table, map) {

View File

@ -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);
}

View File

@ -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");

View File

@ -44,7 +44,9 @@ function PageResult() {
}
}
}, "json");
}, "json").error(function(){
information($.i18n.prop('failed-connect-server'));
});
}

View File

@ -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);

View File

@ -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;

View File

@ -26,7 +26,9 @@ function showTestPlanStatusAsync(testPlanId) {
$('#status').html("<h4>" + testStatus + '</h4>');
}
}, "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("<h4>" + 0 + "</h4>");
}
}, "json");
}, "json").error(function(){
information($.i18n.prop('failed-connect-server'));
});
}

View File

@ -229,7 +229,7 @@ body {
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="lib/other/jquery.noty.packaged.min.js"></script>
<script src="script/base.js"></script>
<script src="script/scriptManager/uiFactory.js"></script>
<script src="script/Share/information.js"></script>
<script src="script/Share/loadProperties.js"></script>
<script src="script/TestPlan/TestPlanModels.js"></script>
<script src="script/TestPlan/TestPlanUI.js"></script>

View File

@ -135,7 +135,7 @@ body {
<script src="script/Share/TestStatusMap.js"></script>
<script src="script/testPlans.js"></script>
<script src="lib/other/jquery.noty.packaged.min.js"></script>
<script src="script/scriptManager/uiFactory.js"></script>
<script src="script/Share/information.js"></script>
</fmt:bundle>
</body>
</html>