Fix clarifying color about message in modals. (#1258)

LGTM
This commit is contained in:
kun wang 2016-12-23 15:05:39 +08:00 committed by yhua123
parent 111638ae8e
commit 6088d45686
4 changed files with 13 additions and 7 deletions

View File

@ -99,13 +99,14 @@
<div class="form-group col-md-12 form-group-custom">
<div class="col-md-3"></div>
<div class="col-md-9">
<button type="button" class="btn btn-default" ng-disabled="vm.notAvailable || !vm.pingAvailable" ng-click="vm.pingDestination()" loading-progress hide-target="false" toggle-in-progress="vm.pingTIP">// 'test_connection' | tr //</button>
<button type="button" class="btn btn-default" ng-disabled="vm.notAvailable" ng-click="vm.pingDestination()" loading-progress hide-target="false" toggle-in-progress="vm.pingTIP">// 'test_connection' | tr //</button>
</div>
</div>
<div class="form-group col-md-12 form-group-custom">
<div class="col-md-3"></div>
<div class="col-md-9">
<span class="error-message" >// vm.pingMessage //</span>
<span ng-if="vm.isError" class="error-message" >// vm.pingMessage //</span>
<span ng-if="!vm.isError">// vm.pingMessage //</span>
</div>
</div>
</div>

View File

@ -201,9 +201,9 @@
target.name = vm1.name;
}
vm.pingAvailable = false;
vm.pingMessage = $filter('tr')('pinging_target');
vm.pingTIP = true;
vm.isError = false;
PingDestinationService(target)
.success(pingDestinationSuccess)
@ -319,12 +319,12 @@
console.log('Failed to update destination:' + data);
}
function pingDestinationSuccess(data, status) {
vm.pingAvailable = true;
vm.isError = false;
vm.pingMessage = $filter('tr')('successful_ping_target', []);
vm.pingTIP = false;
}
function pingDestinationFailed(data, status) {
vm.pingAvailable = true;
vm.isError = true;
if(status === 404) {
data = '';
}

View File

@ -69,7 +69,8 @@
<div class="form-group col-md-12 form-group-custom">
<div class="col-md-3"></div>
<div class="col-md-9">
<span class="error-message">// vm.pingMessage //</span>
<span ng-if="vm.isError" class="error-message">// vm.pingMessage //</span>
<span ng-if="!vm.isError">// vm.pingMessage //</span>
</div>
</div>
</div>

View File

@ -39,7 +39,7 @@
vm.errorMessages = [];
vm.pingTIP = false;
$timeout(function(){
$scope.$watch('destination.endpoint', function(current) {
if(current) {
@ -140,6 +140,8 @@
function pingDestination() {
vm.pingTIP = true;
vm.pingMessage = $filter('tr')('pinging_target');
vm.isError = false;
var target = {
'name': vm0.name,
@ -158,10 +160,12 @@
}
function pingDestinationSuccess(data, status) {
vm.isError = false;
vm.pingTIP = false;
vm.pingMessage = $filter('tr')('successful_ping_target', []);
}
function pingDestinationFailed(data, status) {
vm.isError = true;
vm.pingTIP = false;
if(status === 404) {
data = '';