Updates for handling 404 response text.

This commit is contained in:
kunw 2016-11-24 17:37:00 +08:00
parent 7e0305e37c
commit 50a057994e
2 changed files with 11 additions and 2 deletions

View File

@ -325,7 +325,12 @@
} }
function pingDestinationFailed(data, status) { function pingDestinationFailed(data, status) {
vm.pingAvailable = true; vm.pingAvailable = true;
vm.pingMessage = $filter('tr')('failed_to_ping_target', []) + (data && data.length > 0 ? ':' + data : ''); if(status === 404) {
data = '';
}
vm.pingMessage = $filter('tr')('failed_to_ping_target', []) + data;
console.log("Failed to ping target:" + data);
vm.pingTIP = false; vm.pingTIP = false;
} }
} }

View File

@ -163,7 +163,11 @@
} }
function pingDestinationFailed(data, status) { function pingDestinationFailed(data, status) {
vm.pingTIP = false; vm.pingTIP = false;
vm.pingMessage = $filter('tr')('failed_to_ping_target', []) + (data && data.length > 0 ? ':' + data : ''); if(status === 404) {
data = '';
}
vm.pingMessage = $filter('tr')('failed_to_ping_target', []) + data;
console.log("Failed to ping target:" + data);
} }
} }