AMBARI-18806. Fix configs for services and alerts (onechiporenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/02e2c483 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/02e2c483 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/02e2c483 Branch: refs/heads/branch-feature-AMBARI-18634 Commit: 02e2c483ea196adfc235f66a27b8be0b355240ed Parents: 69c9690 Author: Oleg Nechiporenko <[email protected]> Authored: Mon Nov 7 11:52:45 2016 +0200 Committer: Oleg Nechiporenko <[email protected]> Committed: Mon Nov 7 14:10:04 2016 +0200 ---------------------------------------------------------------------- ambari-web/app/models/alerts/alert_config.js | 2 +- ambari-web/app/styles/config_history_flow.less | 14 +-- .../common/configs/config_history_flow.hbs | 54 +++++++---- .../common/configs/service_version_box.hbs | 12 ++- .../alerts/configs/alert_config_parameter.hbs | 2 +- .../alerts/configs/alert_config_threshold.hbs | 6 +- .../main/service/all_services_actions.hbs | 94 ++++++++++---------- .../configs/service_configs_by_category_view.js | 2 +- 8 files changed, 107 insertions(+), 79 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/02e2c483/ambari-web/app/models/alerts/alert_config.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/alerts/alert_config.js b/ambari-web/app/models/alerts/alert_config.js index 5a4a84e..980dfe5 100644 --- a/ambari-web/app/models/alerts/alert_config.js +++ b/ambari-web/app/models/alerts/alert_config.js @@ -230,7 +230,7 @@ App.AlertConfigProperties = { label: 'Check Interval', displayType: 'textField', unit: 'Minute', - colWidth: 'col-md-3', + colWidth: 'col-md-4', apiProperty: 'interval', isValid: function () { var value = this.get('value'); http://git-wip-us.apache.org/repos/asf/ambari/blob/02e2c483/ambari-web/app/styles/config_history_flow.less ---------------------------------------------------------------------- diff --git a/ambari-web/app/styles/config_history_flow.less b/ambari-web/app/styles/config_history_flow.less index 1a8d598..c42f4bb 100644 --- a/ambari-web/app/styles/config_history_flow.less +++ b/ambari-web/app/styles/config_history_flow.less @@ -74,7 +74,7 @@ } .author, .content { - padding: 0 2px; + padding: 2px; text-align: center; color: #555555; display: block; @@ -121,12 +121,13 @@ padding: 1px 5px 15px 5px; text-align: left; .notes{ + padding-top: 6px; overflow-wrap: break-word; word-wrap: break-word; white-space: pre-wrap; } - .date { - padding: 5px 0; + .date{ + padding-top: 5px; color: #808080; font-size: 11px; white-space: nowrap; @@ -210,6 +211,7 @@ -moz-border-radius: 4px; border-radius: 4px; padding: 5px; + clear:both; margin-bottom: 5px; .glyphicon-remove-circle { @@ -222,7 +224,6 @@ } .label-wrapper { line-height: 30px; - margin-left: 10px; color: #d3d3d3; .label { font-size: 14px; @@ -283,6 +284,9 @@ background-image: linear-gradient(to bottom, #666666, #555555); color: #ffffff; } + li#show_more:hover { + background: none; + } li.not-allowed { // the version which is displayed cursor: not-allowed; @@ -307,7 +311,7 @@ max-width: 300px; line-height: 20px; font-size: 13px; - margin: 0px; + margin: 0; padding: 8px; color: #333333; cursor: default; http://git-wip-us.apache.org/repos/asf/ambari/blob/02e2c483/ambari-web/app/templates/common/configs/config_history_flow.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/common/configs/config_history_flow.hbs b/ambari-web/app/templates/common/configs/config_history_flow.hbs index 84f319f..5cadf91 100644 --- a/ambari-web/app/templates/common/configs/config_history_flow.hbs +++ b/ambari-web/app/templates/common/configs/config_history_flow.hbs @@ -16,8 +16,8 @@ * limitations under the License. }} - <div id="config_history_flow" {{bindAttr class="view.parentView.supportsConfigLayout:with-enhanced-config"}}> + {{! Slider with config versions }} <div class="version-slider"> <div {{bindAttr class=":glyphicon :glyphicon-chevron-box :pull-left view.showLeftArrow::disabled"}} {{action shiftBack target="view"}} data-toggle="arrow-tooltip" {{bindAttr data-original-title="view.leftArrowTooltip"}}><i class="glyphicon-chevron-left glyphicon glyphicon-3x"></i></div> @@ -26,12 +26,14 @@ {{#each sV in view.visibleServiceVersion}} {{view App.ConfigsServiceVersionBoxView serviceVersionBinding="sV"}} {{/each}} - </div> - <div class="version-info-bar-wrapper row"> + {{! Slider with config versions end }} + + <div class="version-info-bar-wrapper"> + {{! Compare config versions bar }} {{#isAuthorized "SERVICE.COMPARE_CONFIGS"}} - <div {{bindAttr class="view.showCompareVersionBar::hidden :version-info-bar :col-md-12"}}> - <div> + <div {{bindAttr class="view.showCompareVersionBar::hidden :version-info-bar"}}> + <div class="row"> <div class="col-md-1 remove-compare-bar" {{action removeCompareVersionBar target="view"}} data-toggle="arrow-tooltip" {{translateAttr data-original-title="services.service.config.configHistory.dismissIcon.tooltip"}}> <i class="glyphicon-remove-circle glyphicon glyphicon-large"></i> </div> @@ -46,14 +48,17 @@ <strong>{{view.compareServiceVersion.authorFormatted}}</strong> {{t dashboard.configHistory.info-bar.authoredOn}} <strong>{{view.compareServiceVersion.createdDate}}</strong> </div> - {{#isAuthorized "SERVICE.MODIFY_CONFIGS"}} - <div class="pull-right operations-button"> - <button class="btn btn-success" {{action doAction view.serviceVersionsReferences.compare view.actionTypes.REVERT target="view"}} {{bindAttr disabled="view.versionActionsDisabled" class="view.compareServiceVersion.canBeMadeCurrent::hidden"}}>{{view.compareServiceVersion.makeCurrentButtonText}}</button> + {{#isAuthorized "SERVICE.MODIFY_CONFIGS"}} + <div class="operations-button col-md-3"> + <button class="pull-right btn btn-success" {{action doAction view.serviceVersionsReferences.compare view.actionTypes.REVERT target="view"}} {{bindAttr disabled="view.versionActionsDisabled" class="view.compareServiceVersion.canBeMadeCurrent::hidden"}}>{{view.compareServiceVersion.makeCurrentButtonText}}</button> </div> {{/isAuthorized}} </div> </div> {{/isAuthorized}} + {{! Compare config versions bar end }} + + {{! Popup for config version }} {{#view App.ConfigHistoryDropdownSubMenuView id="config_version_popup"}} {{#if view.parentView.hoveredServiceVersion}} <div class="content"> @@ -74,9 +79,12 @@ </div> {{/if}} {{/view}} - <div class="version-info-bar col-md-12"> - <div> - <div class="btn-group pull-left"> + {{! Popup for config version }} + + {{! Config Version Bar }} + <div class="version-info-bar"> + <div class="row"> + <div class="btn-group col-md-2"> <button id="toggle-dropdown-button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" href="#" {{action hideFullList target="view"}} {{bindAttr disabled="view.versionActionsDisabled"}}> <i class="glyphicon glyphicon-random"></i> <span class="caret"></span> @@ -89,11 +97,10 @@ {{#each serviceVersion in view.dropDownList}} {{view App.ConfigHistoryDropdownRowView serviceVersionBinding="serviceVersion"}} {{/each}} - {{#unless view.showFullList}} <li class="align-center pointer" id="show_more"> <a {{action openFullList target="view"}}> - {{t dashboard.configHistory.info-bar.showMore}} {{view.displayName}} + {{t dashboard.configHistory.info-bar.showMore}} {{controller.selectedService.displayName}} <span class="lowercase ellipsis">{{t dashboard.configHistory.title}}</span> </a> </li> @@ -104,7 +111,7 @@ </div> </div> </div> - <div class="label-wrapper col-md-8" data-toggle="tooltip" {{bindAttr data-original-title="view.displayedServiceVersion.fullNotes"}}> + <div class="label-wrapper col-md-6" data-toggle="tooltip" {{bindAttr data-original-title="view.displayedServiceVersion.fullNotes"}}> {{#if view.displayedServiceVersion.versionText}} <span class="label label-info current-version-label">{{view.displayedServiceVersion.versionText}}</span> {{/if}} @@ -118,15 +125,24 @@ {{/if}} </div> {{#isAuthorized "SERVICE.MODIFY_CONFIGS"}} - <div class="pull-right operations-button"> - <div {{bindAttr class="view.displayedServiceVersion.isCurrent::hidden"}}> - <button class="btn btn-default" {{action doCancel target="controller"}} {{bindAttr disabled="view.isDiscardDisabled"}}>{{t common.discard}}</button> - <button class="btn btn-success" {{action save target="view"}} {{bindAttr disabled="view.isSaveDisabled"}}>{{t common.save}}</button> + <div class="operations-button col-md-4"> + <div {{bindAttr class="view.displayedServiceVersion.isCurrent::hidden :pull-right"}}> + <button class="btn btn-default" {{action doCancel target="controller"}} {{bindAttr disabled="view.isDiscardDisabled"}}> + {{t common.discard}} + </button> + <button class="btn btn-success" {{action save target="view"}} {{bindAttr disabled="view.isSaveDisabled"}}> + {{t common.save}} + </button> + </div> + <div class="pull-right"> + <button class="btn btn-success" {{action doAction view.serviceVersionsReferences.displayed view.actionTypes.REVERT target="view"}} {{bindAttr disabled="view.versionActionsDisabled" class="view.displayedServiceVersion.canBeMadeCurrent::hidden"}}> + {{view.displayedServiceVersion.makeCurrentButtonText}} + </button> </div> - <button class="btn btn-success" {{action doAction view.serviceVersionsReferences.displayed view.actionTypes.REVERT target="view"}} {{bindAttr disabled="view.versionActionsDisabled" class="view.displayedServiceVersion.canBeMadeCurrent::hidden"}}>{{view.displayedServiceVersion.makeCurrentButtonText}}</button> </div> {{/isAuthorized}} </div> </div> + {{! Config Version Bar end }} </div> </div> http://git-wip-us.apache.org/repos/asf/ambari/blob/02e2c483/ambari-web/app/templates/common/configs/service_version_box.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/common/configs/service_version_box.hbs b/ambari-web/app/templates/common/configs/service_version_box.hbs index 6e05369..134fe44 100644 --- a/ambari-web/app/templates/common/configs/service_version_box.hbs +++ b/ambari-web/app/templates/common/configs/service_version_box.hbs @@ -43,12 +43,18 @@ <div class="notes">{{view.serviceVersion.fullNotes}}</div> </div> <div class="version-operations-buttons"> - <button {{bindAttr disabled="view.disabledActionAttr.view" class=":btn :btn-default view.serviceVersion.isDisplayed:not-allowed-cursor" title="view.disabledActionMessages.view"}} {{action doAction view.serviceVersion view.actionTypes.SWITCH target="view.parentView"}}><i class="glyphicon glyphicon-search"></i> {{t common.view}}</button> + <button {{bindAttr disabled="view.disabledActionAttr.view" class=":btn :btn-default view.serviceVersion.isDisplayed:not-allowed-cursor" title="view.disabledActionMessages.view"}} {{action doAction view.serviceVersion view.actionTypes.SWITCH target="view.parentView"}}> + <i class="glyphicon glyphicon-search"></i> {{t common.view}} + </button> {{#isAuthorized "SERVICE.COMPARE_CONFIGS"}} - <button {{bindAttr disabled="view.disabledActionAttr.compare" class=":btn :btn-default view.serviceVersion.isDisplayed:not-allowed-cursor" title="view.disabledActionMessages.compare"}} {{action doAction view.serviceVersion view.actionTypes.COMPARE target="view.parentView"}}><i class="glyphicon glyphicon-copy"></i> {{t common.compare}}</button> + <button {{bindAttr disabled="view.disabledActionAttr.compare" class=":btn :btn-default view.serviceVersion.isDisplayed:not-allowed-cursor" title="view.disabledActionMessages.compare"}} {{action doAction view.serviceVersion view.actionTypes.COMPARE target="view.parentView"}}> + <i class="glyphicon glyphicon-copy"></i> {{t common.compare}} + </button> {{/isAuthorized}} {{#isAuthorized "SERVICE.MODIFY_CONFIGS"}} - <button {{bindAttr disabled="view.disabledActionAttr.revert" class=":btn :btn-default view.serviceVersion.isCurrent:not-allowed-cursor view.serviceVersion.isCompatible::hidden" title="view.disabledActionMessages.revert"}} {{action doAction view.serviceVersion view.actionTypes.REVERT target="view.parentView"}}>{{t dashboard.configHistory.info-bar.revert.button}}</button> + <button {{bindAttr disabled="view.disabledActionAttr.revert" class=":btn :btn-default view.serviceVersion.isCurrent:not-allowed-cursor view.serviceVersion.isCompatible::hidden" title="view.disabledActionMessages.revert"}} {{action doAction view.serviceVersion view.actionTypes.REVERT target="view.parentView"}}> + {{t dashboard.configHistory.info-bar.revert.button}} + </button> {{/isAuthorized}} </div> </div> http://git-wip-us.apache.org/repos/asf/ambari/blob/02e2c483/ambari-web/app/templates/main/alerts/configs/alert_config_parameter.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/alerts/configs/alert_config_parameter.hbs b/ambari-web/app/templates/main/alerts/configs/alert_config_parameter.hbs index 0e1232e..af8ae78 100644 --- a/ambari-web/app/templates/main/alerts/configs/alert_config_parameter.hbs +++ b/ambari-web/app/templates/main/alerts/configs/alert_config_parameter.hbs @@ -18,7 +18,7 @@ <div> {{#if view.property.thresholdExists}} - <div class="col-md-3"> + <div class="col-md-4"> <span {{bindAttr class="view.property.badgeCssClass :label :alert-label :alert-state-single-host"}}> {{view.property.badge}} </span> http://git-wip-us.apache.org/repos/asf/ambari/blob/02e2c483/ambari-web/app/templates/main/alerts/configs/alert_config_threshold.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/alerts/configs/alert_config_threshold.hbs b/ambari-web/app/templates/main/alerts/configs/alert_config_threshold.hbs index 7c7c211..8d67693 100644 --- a/ambari-web/app/templates/main/alerts/configs/alert_config_threshold.hbs +++ b/ambari-web/app/templates/main/alerts/configs/alert_config_threshold.hbs @@ -16,11 +16,11 @@ * limitations under the License. }} -<div class="col-md-3"> +<div class="col-md-4"> <span {{bindAttr class="view.property.badgeCssClass :alert-label :label :alert-state-single-host"}}>{{view.property.badge}}</span> </div> {{#if view.property.showInputForValue}} - <div class="col-md-3"> + <div class="col-md-4"> <div {{bindAttr class="view.property.valueMetric:input-group"}}> {{view Em.TextField valueBinding="view.property.displayValue" disabledBinding="view.property.isDisabled" class="form-control"}} {{#if view.property.valueMetric}} @@ -30,7 +30,7 @@ </div> {{/if}} {{#if view.property.showInputForText}} - <div {{bindAttr class="view.property.showInputForValue:col-md-6:col-md-9"}}> + <div {{bindAttr class="view.property.showInputForValue:col-md-4:col-md-8"}}> {{view Em.TextField valueBinding="view.property.text" disabledBinding="view.property.isDisabled" class="form-control"}} </div> {{/if}} http://git-wip-us.apache.org/repos/asf/ambari/blob/02e2c483/ambari-web/app/templates/main/service/all_services_actions.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/service/all_services_actions.hbs b/ambari-web/app/templates/main/service/all_services_actions.hbs index b68c575..dc67df8 100644 --- a/ambari-web/app/templates/main/service/all_services_actions.hbs +++ b/ambari-web/app/templates/main/service/all_services_actions.hbs @@ -16,49 +16,51 @@ * limitations under the License. }} -{{#isAuthorized "SERVICE.START_STOP, SERVICE.ADD_DELETE_SERVICES"}} - <div class="service-button" style="margin-top: 10px;"> - <div class="btn-group display-inline-block col-md-11 col-md-offset-1"> - <button class="btn btn-default dropdown-toggle col-md-10" data-toggle="dropdown" href="#">{{t common.actions}} - <span class="caret"></span> - </button> - <ul class="pull-left dropdown-menu"> - {{#isAuthorized "SERVICE.ADD_DELETE_SERVICES"}} - <li {{bindAttr class="view.serviceController.isAllServicesInstalled:disabled :add-service-button"}}> - <a href="#" - {{bindAttr class="view.serviceController.isAllServicesInstalled:disabled"}} - {{action gotoAddService target="view.serviceController"}}> - <i class="glyphicon glyphicon-plus glyphicon-white"></i> {{t services.service.add}}</a> - </li> - {{/isAuthorized}} - {{#isAuthorized "SERVICE.START_STOP"}} - <li class="divider"></li> - <li {{bindAttr class="view.serviceController.isStartAllDisabled:disabled" }}> - <a href="#" data-toggle="modal" - {{bindAttr class="view.serviceController.isStartAllDisabled:disabled" }} - {{action "startAllService" target="view.serviceController"}}> - <i {{bindAttr class=":glyphicon glyphicon-play view.serviceController.isStartAllDisabled:disabled:enabled " }}></i> - {{t services.service.startAll}} - </a> - </li> - <li {{bindAttr class="view.serviceController.isStopAllDisabled:disabled" }}> - <a href="#" data-toggle="modal" - {{bindAttr class="view.serviceController.isStopAllDisabled:disabled" }} - {{action "stopAllService" target="view.serviceController"}}> - <i {{bindAttr class=":glyphicon glyphicon-stop view.serviceController.isStopAllDisabled:disabled:enabled" }}></i> - {{t services.service.stopAll}} - </a> - </li> - <li {{bindAttr class="view.serviceController.isRestartAllRequiredDisabled:disabled" }}> - <a href="#" data-toggle="modal" - {{bindAttr class="view.serviceController.isRestartAllRequiredDisabled:disabled" }} - {{action "restartAllRequired" target="view.serviceController"}}> - <i {{bindAttr class=":glyphicon glyphicon-repeat view.serviceController.isRestartAllRequiredDisabled:disabled:enabled" }}></i> - {{t services.service.restartAllRequired}} - </a> - </li> - {{/isAuthorized}} - </ul> - </div> - </div> -{{/isAuthorized}} +<div class="row"> + <div class="col-md-10 col-md-offset-1"> + {{#isAuthorized "SERVICE.START_STOP, SERVICE.ADD_DELETE_SERVICES"}} + <div class="dropdown"> + <button class="btn btn-default dropdown-toggle center-block" data-toggle="dropdown" href="#">{{t common.actions}} + <span class="caret"></span> + </button> + <ul class="dropdown-menu"> + {{#isAuthorized "SERVICE.ADD_DELETE_SERVICES"}} + <li {{bindAttr class="view.serviceController.isAllServicesInstalled:disabled :add-service-button"}}> + <a href="#" + {{bindAttr class="view.serviceController.isAllServicesInstalled:disabled"}} + {{action gotoAddService target="view.serviceController"}}> + <i class="glyphicon glyphicon-plus glyphicon-white"></i> {{t services.service.add}}</a> + </li> + {{/isAuthorized}} + {{#isAuthorized "SERVICE.START_STOP"}} + <li class="divider"></li> + <li {{bindAttr class="view.serviceController.isStartAllDisabled:disabled" }}> + <a href="#" data-toggle="modal" + {{bindAttr class="view.serviceController.isStartAllDisabled:disabled" }} + {{action "startAllService" target="view.serviceController"}}> + <i {{bindAttr class=":glyphicon glyphicon-play view.serviceController.isStartAllDisabled:disabled:enabled " }}></i> + {{t services.service.startAll}} + </a> + </li> + <li {{bindAttr class="view.serviceController.isStopAllDisabled:disabled" }}> + <a href="#" data-toggle="modal" + {{bindAttr class="view.serviceController.isStopAllDisabled:disabled" }} + {{action "stopAllService" target="view.serviceController"}}> + <i {{bindAttr class=":glyphicon glyphicon-stop view.serviceController.isStopAllDisabled:disabled:enabled" }}></i> + {{t services.service.stopAll}} + </a> + </li> + <li {{bindAttr class="view.serviceController.isRestartAllRequiredDisabled:disabled" }}> + <a href="#" data-toggle="modal" + {{bindAttr class="view.serviceController.isRestartAllRequiredDisabled:disabled" }} + {{action "restartAllRequired" target="view.serviceController"}}> + <i {{bindAttr class=":glyphicon glyphicon-repeat view.serviceController.isRestartAllRequiredDisabled:disabled:enabled" }}></i> + {{t services.service.restartAllRequired}} + </a> + </li> + {{/isAuthorized}} + </ul> + </div> + {{/isAuthorized}} + </div> +</div> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/02e2c483/ambari-web/app/views/common/configs/service_configs_by_category_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/configs/service_configs_by_category_view.js b/ambari-web/app/views/common/configs/service_configs_by_category_view.js index 8ebe68c..4b2739b 100644 --- a/ambari-web/app/views/common/configs/service_configs_by_category_view.js +++ b/ambari-web/app/views/common/configs/service_configs_by_category_view.js @@ -70,7 +70,7 @@ App.ServiceConfigsByCategoryView = Em.View.extend(App.UserPref, App.ConfigOverri */ mainView: function () { //todo: Get rid of this logic. Get data from controller instead. - return this.get('controller.name') === 'mainServiceInfoConfigsController' ? this.get('parentView.parentView') : this.get('parentView'); + return ['mainHostServiceConfigsController', 'mainServiceInfoConfigsController'].contains(this.get('controller.name')) ? this.get('parentView.parentView') : this.get('parentView'); }.property('controller.name'), didInsertElement: function () {
