forked from FirstLegoLeague/on-q
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
187 lines (187 loc) · 8.48 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ON-Q</title>
<script src="config.js"></script>
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<script src="bower_components/angular/angular.min.js"></script>
<script src="bower_components/angular-animate/angular-animate.min.js"></script>
<script src="bower_components/angular-aria/angular-aria.min.js"></script>
<script src="bower_components/angular-messages/angular-messages.min.js"></script>
<script src="bower_components/angular-material/angular-material.min.js"></script>
<script src="bower_components/ngstorage/ngStorage.min.js"></script>
<script src="bower_components/js-yaml/dist/js-yaml.min.js"></script>
<link rel="stylesheet" href="bower_components/angular-material/angular-material.min.css">
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=RobotoDraft:300,400,500,700,400italic">
<link href="//fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<style>
.md-chip {
background: rgb(224,224,224);
color: rgb(66,66,66);
}
md-toolbar.offline {
background-color: #444;
}
md-input-container.md-icon-right {
padding-right: 36px;
padding-left: 2px;
}
.md-chips .md-chip {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.noTopics {
text-align: center;
color: silver;
font-size: 20px;
}
pre {
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
</style>
</head>
<body ng-app="onq">
<!-- Settings dialog -->
<script type="text/ng-template" id="editSettingsDialogTemplate">
<md-dialog style="width: 400px">
<md-dialog-content class="md-dialog-content">
<h2 class="md-title">
Settings
</h2>
<md-input-container class="md-block">
<label>Host</label>
<input type="text" ng-model="$storage.settings.host" />
</md-input-container>
<md-input-container class="md-block">
<label>Input node</label>
<input type="text" ng-model="$storage.settings.nodeIn" />
</md-input-container>
<md-input-container class="md-block">
<label>Output node</label>
<input type="text" ng-model="$storage.settings.nodeOut" />
</md-input-container>
</md-dialog-content>
<md-dialog-actions>
<md-button ng-click="hide()">
Cancel
</md-button>
<md-button ng-click="answer($storage.settings)">
Ok
</md-button>
</md-dialog-actions>
</md-dialog>
</script>
<!-- Message dialog -->
<script type="text/ng-template" id="addMessageDialogTemplate">
<md-dialog style="width: 70%">
<md-dialog-content class="md-dialog-content">
<h2 class="md-title">
Add message
</h2>
<p>
You can type yaml in the data field
</p>
<md-input-container class="md-block">
<label>Keep</label>
<input type="checkbox" ng-model="message.headerkeep" />
</md-input-container>
<md-input-container class="md-block">
<label>Topic</label>
<input type="text" ng-model="message.topic" />
</md-input-container>
<div layout="row">
<md-input-container flex="40" class="md-block md-icon-right">
<label>Data (yaml)</label>
<textarea ng-model="message.yaml" md-autofocus=""></textarea>
<md-icon ng-if="isJSON(message.data)">code</md-icon>
</md-input-container>
<div flex="60">
<pre>{{message.data | json}}</pre>
</div>
</div>
</md-dialog-content>
<md-dialog-actions>
<md-button ng-click="hide()">
Cancel
</md-button>
<md-button ng-click="answer(message)">
Ok
</md-button>
</md-dialog-actions>
</md-dialog>
</script>
<div class="content" ng-controller="queueController">
<!-- Toolbar -->
<md-toolbar ng-class="{offline: !connected}">
<div class="md-toolbar-tools">
<h2>
<span>ON-Q</span>
</h2>
<span flex></span>
<md-button class="md-icon-button" aria-label="reconnect" ng-if="connected">
<md-icon>network_wifi</md-icon>
</md-button>
<md-button class="md-icon-button md-warn" aria-label="reconnect" ng-if="!connected" ng-click="connect()">
<md-icon>perm_scan_wifi</md-icon>
</md-button>
<md-button class="md-icon-button" aria-label="settings" ng-click="editSettingsDlg()">
<md-icon>settings</md-icon>
</md-button>
</div>
</md-toolbar>
<!-- Topic tabs -->
<md-tabs md-dynamic-height md-border-bottom>
<md-tab ng-repeat="(topic,messages) in $storage.topics track by $index">
<md-tab-label>
{{topic}} ({{messages.length}})
</md-tab-label>
<md-tab-body>
<md-card>
<md-card-actions layout="row" layout-align="end center">
<md-button class="md-warn" ng-click="declineAll(topic)">Decline all</md-button>
</md-card-actions>
</md-card>
<md-card ng-repeat="message in messages">
<md-card-content>
<div class="md-chips">
<div ng-if="isObject(message.data)" class="md-chip" ng-repeat="(key,val) in message.data track by $index">{{key}}: {{val}}</div>
<div ng-if="isString(message.data)" class="md-chip" >{{message.data}}</div>
</div>
</md-card-content>
<md-card-actions layout="row" layout-align="end center">
<md-button ng-click="forward(message)">Forward</md-button>
<md-button class="md-warn" ng-click="decline(message)">Decline</md-button>
</md-card-actions>
</md-card>
<md-button class="md-accent md-fab md-fab-bottom-right" style="position: fixed" ng-click="addMessageDlg(topic)">
<md-icon>add</md-icon>
</md-button>
</md-tab-body>
</md-tab>
<md-tab>
<md-tab-label>
<md-button class="md-icon-button md-primary" aria-label="Add topic" ng-click="addMessageDlg()">
<md-icon>add</md-icon>
</md-button>
</md-tab-label>
<md-tab-body class="noTopics">
<div class="noTopics" ng-if="noTopics()">
<p>There are no messages here yet</p>
<p>Add by pressing the (+) button or by sending some messages over the bus:</p>
<p><code>mclient -n onq-in -t test -d "[""hello"",""world""]"</code> (windows)</p>
<p><code>mclient -n onq-in -t test -d '["hello","world"]'</code> (linux)</p>
</div>
</md-tab-body>
</md-tab>
</md-tabs>
</div>
<script src="js/main.js"></script>
</body>
</html>