ui-modules/app-inspector/app/components/entity-tree/entity-node.html (55 lines of code) (raw):

<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <div class="entity-node"> <div ng-if="isOpen" class="entity-node-item" ng-class="{ 'active': isSelected(), 'highlight' : isHighlight() && !isSelected() }" uib-popover-template="'EntityNodeInfoTemplate.html'" popover-trigger="'mouseenter'" popover-placement="right" popover-popup-delay="1000"> <a ng-href="{{getHref()}}" class="entity-node-link"> <brooklyn-status-icon value="{{entity.serviceState}}" ng-if="entity.serviceState || entity.applicationId"></brooklyn-status-icon> <i class="fa fa-2x fa-external-link" ng-if="!entity.serviceState && !entity.applicationId"></i> <span>{{entity.name}}</span> <div class="node-icon" ng-if="iconUrl"><img ng-src="{{ iconUrl }}"/></div> </a> <div class="entity-node-toggle-wrapper"> <div class="entity-node-toggle" ng-if="nodesInCurrentView() > 0" ng-click="onToggle($event)" > <span class="glyphicon" ng-class="isChildrenOpen ? 'glyphicon-chevron-up' : 'glyphicon-chevron-down'"></span> </div> </div> </div> <div class="entity-node-children" ng-show="isChildrenOpen"> <!-- Entity children --> <entity-node ng-repeat="child in entity.children track by child.id" ng-if="child.viewModes.has(viewMode)" entity="child" application-id="applicationId" view-mode="viewMode"></entity-node> <!-- Or entity members --> <entity-node ng-repeat="child in entity.members track by child.id" ng-if="child.viewModes.has(viewMode) && (!entity.children || entity.children.length === 0)" entity="child" application-id="applicationId" view-mode="viewMode"></entity-node> <!-- Other nodes under entity --> <entity-node ng-repeat="child in entity.otherNodes track by 'other-'+$index+'-'+child.id" ng-if="child.viewModes.has(viewMode)" entity="child" application-id="applicationId" view-mode="viewMode"></entity-node> </div> <script type="text/ng-template" id="EntityNodeInfoTemplate.html"> <table ng-if="isOpen" class="info-table"> <tr> <td><b>Name</b></td> <td>{{entity.name}}</td> </tr> <tr ng-if="entity.description"> <td><b>Description</b></td> <td>{{entity.description}}</td> </tr> <tr> <td><b>Number of children</b></td> <td>{{nodesInCurrentView()}}</td> </tr> <tr ng-repeat="(key, value) in (entity.sensors && entity.sensors['deployment.metadata']) || [] track by key"> <td ng-switch="key"> <strong ng-switch-when="user">Deployed by</strong> <strong ng-switch-when="deploy_time">Deployed at</strong> <strong ng-switch-default>{{key}}</strong> </td> <td ng-switch="key"> <span ng-switch-when="deploy_time">{{value | timeAgoFilter}}</span> <span ng-switch-default>{{value}}</span> </td> </tr> </table> </script> </div>