forked from henszey/etcd-browser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
123 lines (116 loc) · 5.6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<!DOCTYPE html>
<html ng-app="app">
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular-cookies.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.2.0/css/bootstrap-theme.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.2.0/js/bootstrap.min.js"></script>
<link href="angular-xeditable/css/xeditable.css" rel="stylesheet">
<script src="angular-xeditable/js/xeditable.js"></script>
<link rel="stylesheet" href="main.css">
<script src="etcdbrowser.js"></script>
</head>
<body>
<script type="text/ng-template" id="prop-block">
<button type="button" class="btn btn-default btn-xs" ng-click="addNode(activeNode)" title="Add Property">
Add Property
</button>
<table class="property-table">
<tr ng-repeat="node in activeNode.nodes | orderBy:'name'" ng-if="!node.dir" ng-class-odd="'odd-row'">
<td>
<button type="button" class="btn btn-default btn-xs" ng-click="copyNode(node)" title="Copy Node">
<span class="glyphicon glyphicon-floppy-open"></span>
</button>
<button type="button" class="btn btn-default btn-xs" ng-click="deleteNode(node)" title="Delete Node">
<span class="glyphicon glyphicon-trash"></span>
</button>
</td>
<td style="text-align:left;font-weight:bold;padding: 5px 4px;">
<span>{{node.name}}:</span>
</td>
<td style="padding-right: 5px;">
<span class="value" editable-text="node.value" onbeforesave="updateNode(node,$data)">{{node.value || '(empty)'}}</span>
</td>
</tr>
</table>
</script>
<script type="text/ng-template" id="tree-item">
<span ng-click="toggleNode(node)" class="glyphicon glyphicon-minus toggle-icon" ng-if="node.open"></span>
<span ng-click="toggleNode(node)" class="glyphicon glyphicon-plus toggle-icon" ng-if="!node.open"></span>
<a href="" ng-click="setActiveNode(node)" ng-if="node.dir" class="{{node.key == activeNode.key ? 'active-node' : ''}}">{{node.name}}</a>
<div class="btn-group" ng-if="node.key == activeNode.key">
<button ng-if="node.open" ng-click="createDir(node)" class="btn btn-default btn-xs" type="button" title="Create Directory">
<span class="glyphicon glyphicon-plus"></span>
</button>
<button ng-if="node.open" ng-click="copyDir(node)" class="btn btn-default btn-xs" type="button" title="Copy Directory">
<span class="glyphicon glyphicon-floppy-open"></span>
</button>
<button ng-if="node.open" type="button" class="btn btn-default btn-xs" ng-click="deleteDir(node)" title="Delete Directory">
<span class="glyphicon glyphicon-trash"></span>
</button>
</div>
<ul >
<li ng-repeat="node in node.nodes | orderBy:'name'" ng-include="'tree-item'" ng-if="node.dir"></li>
</ul>
</script>
<div class="container-fluid" role="main" ng-controller="NodeCtrl">
<h1 class="warning">etcd browser</h1>
<div class="row">
<div class="col-md-12">
<form ng-submit="submit()">
<div class="input-group" ng-submit="submit()">
<input type="text" class="form-control" ng-model="urlPrefix" placeholder="http://localhost:4001">
<span class="input-group-btn">
<button class="btn btn-default" type="submit">Go!</button>
</span>
</div>
</form>
</div>
</div>
<div ng-if="error" class="alert alert-danger alert-dismissible" role="alert">{{error}}</div>
<div class="row top-buffer">
<div class="col-md-6">
<div class="tree prop-block" >
<ul>
<li>
<a href="#" ng-click="setActiveNode(root)" class="{{root.key == activeNode.key ? 'active-node' : ''}}">root</a>
<div class="btn-group">
<button ng-click="createDir(root)" class="btn btn-default btn-xs" type="button" title="Create Directory">
<span class="glyphicon glyphicon-plus"></span>
</button>
</div>
<button class="btn btn-primary btn-xs" data-toggle="modal" data-target="#myModal" ng-click="loadStats()">Stats</button>
<ul>
<li ng-repeat="node in root.nodes | orderBy:'name'" ng-include="'tree-item'" ng-if="node.dir"></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="col-md-6">
<div class="prop-block" ng-include="'prop-block'" ng-if="activeNode"></div>
</div>
</div>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="myModalLabel">Stats</h4>
</div>
<div class="modal-body">
<pre>{{stats.store}}</pre>
<pre>{{stats.leader}}</pre>
<pre>{{stats.self}}</pre>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
</body>
</html>