github.com/billybanfield/evergreen@v0.0.0-20170525200750-eeee692790f7/service/templates/spawned_hosts.html (about) 1 {{define "scripts"}} 2 {{if .User}} 3 <script type="text/javascript" src="{{Static "js" "spawned_hosts.js"}}?hash={{ StaticsMD5 }}"></script> 4 <script type="text/javascript" src="{{Static "js" "js-yaml.min.js"}}?hash={{ StaticsMD5 }}"></script> 5 {{end}} 6 <script type="text/javascript"> 7 window.userTz = {{ GetTimezone $.User }}; 8 window.maxHostsPerUser = {{$.MaxHostsPerUser}} 9 {{if .Task}} 10 window.spawnTask = {{.Task}} 11 {{end}} 12 {{if .Distro}} 13 window.spawnDistro = {{.Distro}} 14 {{end}} 15 </script> 16 {{end}} 17 18 {{define "title"}} 19 Evergreen - My Hosts 20 {{end}} 21 22 {{define "content"}} 23 <div id="content" class="container-fluid" ng-controller="SpawnedHostsCtrl"> 24 <notify-box ng-init="destination='errorHeader'"></notify-box> 25 {{template "flash" . }} 26 <div class="col-lg-6"> 27 <div ng-show="hosts && hosts.length == 0"> 28 <h2>No hosts for user</h2> 29 </div> 30 <div id="hosts-info" class="panel" ng-show="!!hosts && hosts.length > 0"> 31 <div class="panel-heading"> 32 <h2> 33 <i class="fa fa-list-alt" style="margin-right:10px"></i> 34 Hosts 35 </h2> 36 </div> 37 <div class="panel-body" id="host-info-elements"> 38 <table class="table"> 39 <div class="dropdown" style="float: left"> 40 <button class="btn btn-link btn-dropdown" data-toggle="dropdown" href="#" id="dLabel"> 41 <span class="semi-muted"> 42 Sort By: 43 </span> 44 <strong> 45 [[sortBy.name]] 46 <span class="fa fa-caret-down"></span> 47 </strong> 48 </button> 49 <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"> 50 <li role="presentation" class="dropdown-header">Sort Options</li> 51 <li role="presentation" ng-repeat="order in sortOrders"> 52 <a role="menuitem" ng-click="setSortBy(order)"> 53 [[order.name]] 54 </a> 55 </li> 56 </ul> 57 </div> 58 <div style="float: right;"> 59 <span class="label success" style="margin-right: 5px"> 60 [[(hosts | filter:{'status' : 'running'}).length]] Running 61 </span> 62 <span class="label failed"> 63 [[(hosts | filter:{'status' : 'terminated'}).length]] Terminated 64 </span> 65 </div> 66 <div style="clear: both"></div> 67 <thead> 68 <tr> 69 <th class="col-lg-2 no-word-wrap">Host</th> 70 <th class="col-lg-2 no-word-wrap">Distro</th> 71 <th class="col-lg-2 no-word-wrap">Status</th> 72 <th class="col-lg-2 no-word-wrap">Expires In</th> 73 <th class="col-lg-2 no-word-wrap">Uptime</th> 74 </tr> 75 </thead> 76 <tbody> 77 <tr ng-repeat="host in hosts | orderBy:sortBy.by" ng-click="setSelected(host)" ng-class="host.selected"> 78 <td class="col-lg-2 no-word-wrap"> 79 [[host.id]] 80 </td> 81 <td class="col-lg-2 no-word-wrap"> 82 [[host.distro._id]] 83 </td> 84 <td class="col-sm-2"> 85 <span class= "no-word-wrap" ng-class="getSpawnStatusLabel(host)" style="margin-right: 5px">[[host.status]]</span> 86 </td> 87 <td class="col-lg-2 no-word-wrap"> 88 [[host.expires_in]] 89 </td> 90 <td class="col-lg-2 no-word-wrap"> 91 [[host.uptime]] 92 <i class="fa fa-trash pointer" ng-show="host.status!='terminated'" style="float: right" ng-click="openSpawnModal('terminateHost')"></i> 93 </td> 94 </tr> 95 </tbody> 96 </table> 97 </div> 98 </div> 99 <button type="button" class="btn btn-info" ng-click="openSpawnModal('spawnHost')" ng-disabled="!availableHosts()" ng-cloak> 100 Spawn Host 101 </button> 102 <em ng-class="{'text-muted': availableHosts(), 'text-error': !availableHosts()}" style="margin-left: 5px;" ng-cloak> 103 Limit [[maxHostsPerUser]] [[maxHostsPerUser | pluralize:'Host']] 104 </em> 105 </div> 106 <div> 107 <user-host-details class="col-lg-6" ng-show="curHostData"></user-host-details> 108 <user-spawn-modal> 109 <user-host-options ng-show="modalOption=='spawnHost'"></user-host-options> 110 <user-host-terminate ng-show="modalOption=='terminateHost'"></user-host-terminate> 111 <user-host-update ng-show="modalOption=='updateRDPPassword'"></user-host-update> 112 </user-spawn-modal> 113 </div> 114 </div> 115 {{end}}