Updates realtime-advanced
This commit is contained in:
@ -84,18 +84,11 @@
|
||||
</div>
|
||||
<input type="submit" class="btn btn-primary" value="Send" />
|
||||
</form>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
{{if .nick}}
|
||||
<h3>Inbound/Outbound</h3>
|
||||
<div id="messagesChart" class="epoch category20c"></div>
|
||||
{{else}}
|
||||
<form action="" method="get">
|
||||
<form action="" method="get" class="form-inline">
|
||||
<legend>Join the SSE real-time chat</legend>
|
||||
<div class="form-group">
|
||||
<label for="nick">Your Name</label>
|
||||
<input value='' name="nick" id="nick" placeholder="John" type="text" class="form-control" />
|
||||
<input value='' name="nick" id="nick" placeholder="Your Name" type="text" class="form-control" />
|
||||
</div>
|
||||
<div class="form-group text-center">
|
||||
<input type="submit" class="btn btn-success btn-login-submit" value="Join" />
|
||||
@ -103,6 +96,10 @@
|
||||
</form>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3>Inbound/Outbound</h3>
|
||||
<div id="messagesChart" class="epoch category20c"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -47,17 +47,15 @@ function StartEpoch(timestamp) {
|
||||
]
|
||||
});
|
||||
|
||||
if($('#messagesChart').length ) {
|
||||
window.messagesChart = $('#messagesChart').epoch({
|
||||
type: 'time.area',
|
||||
axes: ['bottom', 'left'],
|
||||
height: 250,
|
||||
data: [
|
||||
{values: defaultData},
|
||||
{values: defaultData}
|
||||
]
|
||||
});
|
||||
}
|
||||
window.messagesChart = $('#messagesChart').epoch({
|
||||
type: 'time.area',
|
||||
axes: ['bottom', 'left'],
|
||||
height: 250,
|
||||
data: [
|
||||
{values: defaultData},
|
||||
{values: defaultData}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
function StartSSE(roomid) {
|
||||
@ -75,9 +73,7 @@ function stats(e) {
|
||||
heapChart.push(data.heap)
|
||||
mallocsChart.push(data.mallocs)
|
||||
goroutinesChart.push(data.goroutines)
|
||||
if (typeof messagesChart !== 'undefined') {
|
||||
messagesChart.push(data.messages)
|
||||
}
|
||||
messagesChart.push(data.messages)
|
||||
}
|
||||
|
||||
function parseJSONStats(e) {
|
||||
|
Reference in New Issue
Block a user