Merge "divide resources into handlers and models"
[releng.git] / utils / test / testapi / opnfv_testapi / ui / pods / pods.html
1 <h3>Pods</h3>
2 <p>This page is used to create or query pods.<br>
3     Querying pods is open to everybody.<br>
4     But only login users are granted the privilege to create the new pod.
5 </p>
6
7 <div class="row" style="margin-bottom:24px;"></div>
8
9 <div class="pod-create" ng-class="{ 'hidden': ! auth.isAuthenticated }">
10     <h4>Create</h4>
11     <div class="row">
12         <div ng-repeat="require in ctrl.createRequirements">
13             <div class="create-pod" style="margin-left:24px;">
14                 <p class="input-group">
15                     <label for="cpid">{{require.label|capitalize}}: </label>
16                     <a ng-if="require.type == 'select'">
17                         <select dynamic-model="'ctrl.' + require.label" ng-options="option for option in require.selects"></select>
18                     </a>
19                     <a ng-if="require.type == 'text'">
20                         <input type="text" dynamic-model="'ctrl.' + require.label"/>
21                     </a>
22                     <a ng-if="require.type == 'textarea'">
23                         <textarea rows="2" cols="50" dynamic-model="'ctrl.' + require.label">
24                         </textarea>
25                     </a>
26                 </p>
27             </div>
28         </div>
29
30         <div class="col-md-3" style="margin-top:12px; margin-left:8px;">
31             <button type="submit" class="btn btn-primary" ng-click="ctrl.create()">Create</button>
32         </div>
33     </div>
34 </div>
35
36 <div class="pods-filters" style="margin-top:36px;">
37     <h4>Filters</h4>
38     <div class="row">
39         <div class="col-md-3" style="margin-top:12px; margin-left:8px;">
40             <button type="submit" class="btn btn-primary" ng-click="ctrl.update()">Filter</button>
41             <button type="submit" class="btn btn-primary btn-danger" ng-click="ctrl.clearFilters()">Clear</button>
42         </div>
43     </div>
44 </div>
45
46 <div cg-busy="{promise:ctrl.authRequest,message:'Loading'}"></div>
47 <div cg-busy="{promise:ctrl.podsRequest,message:'Loading'}"></div>
48
49 <div ng-show="ctrl.data" class="pods-table" style="margin-top:24px; margin-left:8px;">
50     <table ng-data="ctrl.data.pods" ng-show="ctrl.data" class="table table-striped table-hover">
51         <tbody>
52             <tr ng-repeat-start="(index, pod) in ctrl.data.pods">
53                 <td>
54                     <a href="#" ng-click="showPod = !showPod">{{pod.name}}</a>
55                     <div class="show-pod" ng-class="{ 'hidden': ! showPod }" style="margin-left:24px;">
56                         <p>
57                             owner: {{pod.owner}}<br>
58                             role: {{pod.role}}<br>
59                             mode: {{pod.mode}}<br>
60                             create_date: {{pod.creation_date}}<br>
61                             details: {{pod.details}}
62                         </p>
63                     </div>
64                 </td>
65             </tr>
66             <tr ng-repeat-end=>
67             </tr>
68         </tbody>
69     </table>
70 </div>
71 <br>
72 <div ng-show="ctrl.showError" class="alert alert-danger" role="alert">
73     <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
74     <span class="sr-only">Error:</span>
75     {{ctrl.error}}
76 </div>