AMBARI-15056. Long hostnames are not truncated in Alerts dialog (alexantonenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ea699bb9 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ea699bb9 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ea699bb9 Branch: refs/heads/branch-dev-patch-upgrade Commit: ea699bb9b1be059949fa6f1ddf6f563e52ed4f5f Parents: 5fcb716 Author: Alex Antonenko <[email protected]> Authored: Tue Feb 16 14:56:21 2016 +0200 Committer: Alex Antonenko <[email protected]> Committed: Tue Feb 16 15:32:16 2016 +0200 ---------------------------------------------------------------------- ambari-web/app/styles/alerts.less | 25 +++++++++------- .../main/alerts/instance_service_host.hbs | 30 +++++++++++--------- .../main/alerts/definition_details_view.js | 8 ++++++ 3 files changed, 39 insertions(+), 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/ea699bb9/ambari-web/app/styles/alerts.less ---------------------------------------------------------------------- diff --git a/ambari-web/app/styles/alerts.less b/ambari-web/app/styles/alerts.less index c4f163d..1b8d5f4 100644 --- a/ambari-web/app/styles/alerts.less +++ b/ambari-web/app/styles/alerts.less @@ -70,7 +70,7 @@ .filter-row { th { - padding: 0px; + padding: 0; padding-left: 4px; } } @@ -253,16 +253,16 @@ .definition-name { .name-text-field{ margin-left: 2px; - margin-bottom: 0px; + margin-bottom: 0; input { width: 99%; - margin-bottom: 0px; + margin-bottom: 0; margin-top: -4px; margin-left: -5px; } } .edit-buttons { - margin-bottom: 0px; + margin-bottom: 0; margin-top: -4px; float: left; margin-left: 7px; @@ -407,7 +407,7 @@ #manage-alert-notification-content { .notification-info .global-info .global-checkbox { - margin: 0px; + margin: 0; } .input-label { font-weight: bold; @@ -465,7 +465,7 @@ .create-edit-alert-notification-popup { .modal { - margin-top: 0px; + margin-top: 0; top: 5%; width: 600px; } @@ -512,10 +512,10 @@ height: 250px; } .btn-toolbar { - margin-top: 0px; + margin-top: 0; } .manage-configuration-group-content { - margin-bottom: 0px; + margin-bottom: 0; } .notification-editable-list { .title { @@ -576,12 +576,17 @@ } .alerts-popup-wrap { + .trim_hostname{ + display: block; + overflow: hidden; + text-overflow: ellipsis; + } .top-wrap { width: 100%; border-bottom: 1px solid #CCC; text-align: center; font-size: 15px; - padding: 0px 0px 20px 0px; + padding: 0 0 20px 0; height: 20px; .name-top { width: 32%; @@ -639,7 +644,7 @@ cursor: pointer; border-top: 1px solid #CCC; text-align: center; - padding: 10px 10px 10px 0px; + padding: 10px 10px 10px 0; font-size: 16px; } } http://git-wip-us.apache.org/repos/asf/ambari/blob/ea699bb9/ambari-web/app/templates/main/alerts/instance_service_host.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/alerts/instance_service_host.hbs b/ambari-web/app/templates/main/alerts/instance_service_host.hbs index cff614c..9aca8df 100644 --- a/ambari-web/app/templates/main/alerts/instance_service_host.hbs +++ b/ambari-web/app/templates/main/alerts/instance_service_host.hbs @@ -15,18 +15,20 @@ * See the License for the specific language governing permissions and * limitations under the License. }} -{{#if view.instance.serviceDisplayName}} - {{#if view.serviceIsLink}} - <a {{action goToService view.instance.service target="view.parentView"}} href="#">{{view.instance.serviceDisplayName}}</a> - {{else}} - {{view.instance.serviceDisplayName}} +<span class="trim_hostname"> + {{#if view.instance.serviceDisplayName}} + {{#if view.serviceIsLink}} + <a {{action goToService view.instance.service target="view.parentView"}} href="#">{{view.instance.serviceDisplayName}}</a> + {{else}} + {{view.instance.serviceDisplayName}} + {{/if}} {{/if}} -{{/if}} -{{#if view.showSeparator}} - / -{{/if}} -{{#if view.instance.hostName}} - <a {{action goToHostAlerts view.instance.host target="view.parentView"}} href="#"> - {{view.instance.hostName}} - </a> -{{/if}} \ No newline at end of file + {{#if view.showSeparator}} + / + {{/if}} + {{#if view.instance.hostName}} + <a rel="UsageTooltip" {{action goToHostAlerts view.instance.host target="view.parentView"}} data-original-title="{{unbound view.instance.hostName}}" href="#"> + {{view.instance.hostName}} + </a> + {{/if}} +</span> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/ea699bb9/ambari-web/app/views/main/alerts/definition_details_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/alerts/definition_details_view.js b/ambari-web/app/views/main/alerts/definition_details_view.js index 7467b0f..2fc75c1 100644 --- a/ambari-web/app/views/main/alerts/definition_details_view.js +++ b/ambari-web/app/views/main/alerts/definition_details_view.js @@ -298,6 +298,14 @@ App.AlertInstanceServiceHostView = Em.View.extend({ templateName: require('templates/main/alerts/instance_service_host'), + didInsertElement: function () { + App.tooltip(this.$("[rel='UsageTooltip']")); + }, + + willDestroyElement: function() { + this.$("[rel='UsageTooltip']").remove(); + }, + /** * Define whether show link for transition to service page */
