Skip to content
Snippets Groups Projects
Verified Commit 9b66a73e authored by Andrej Ramašeuski's avatar Andrej Ramašeuski
Browse files

Inteligentnejsi aktualizace stavu nahravani

parent a4b274e5
No related branches found
No related tags found
No related merge requests found
...@@ -5,9 +5,11 @@ ...@@ -5,9 +5,11 @@
<table id="Streams" <table id="Streams"
class="table table--bordered" class="table table--bordered"
data-row-style="rowStyle" data-row-style="rowStyle"
data-unique-id="id"
data-url="/api/streams?live=true"> data-url="/api/streams?live=true">
<thead> <thead>
<tr> <tr>
<th data-field="id" data-visible="false">ID</th>
<th data-field="name" data-width="60" data-width-unit="%">Stream</th> <th data-field="name" data-width="60" data-width-unit="%">Stream</th>
<th data-field="publish_user_name" data-width="30" data-width-unit="%">Vysílá</th> <th data-field="publish_user_name" data-width="30" data-width-unit="%">Vysílá</th>
<th data-field="recording" data-width="10" data-width-unit="%" data-formatter="formatterRecording">Nahrávání</th> <th data-field="recording" data-width="10" data-width-unit="%" data-formatter="formatterRecording">Nahrávání</th>
...@@ -26,8 +28,10 @@ $('#Streams').bootstrapTable({ ...@@ -26,8 +28,10 @@ $('#Streams').bootstrapTable({
url: '/streams/' + row.id + '/recording', url: '/streams/' + row.id + '/recording',
data: { action: (value ? 'stop':'start') }, data: { action: (value ? 'stop':'start') },
success: function(rc) { success: function(rc) {
var content = formatterRecording(rc.recording, row); $('#Streams').bootstrapTable('updateByUniqueId', {
$element.html(content); id: row.id,
row: rc
});
} }
}); });
} }
...@@ -58,7 +62,7 @@ function rowStyle(row, index) { ...@@ -58,7 +62,7 @@ function rowStyle(row, index) {
} }
} }
var ws = new WebSocket('<%= $c->config->{ws_url} %>'); var ws = new WebSocket('<%= $c->config->{ws_url} %>/streams');
ws.onmessage = function (event) { ws.onmessage = function (event) {
console.log(event.data); console.log(event.data);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment