Part of streams, channel and limits (#17, 1h, +1h)
This commit is contained in:
parent
050152b7b9
commit
c5ae10bb33
1 changed files with 92 additions and 4 deletions
94
server.html
94
server.html
|
@ -30,6 +30,11 @@
|
||||||
display: inline;
|
display: inline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#streams-list li > span
|
||||||
|
{
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
@ -57,7 +62,7 @@
|
||||||
|
|
||||||
<label for='server'>
|
<label for='server'>
|
||||||
Server
|
Server
|
||||||
<input type='text' id='server' value='http://localhost:7333' />
|
<input type='text' id='server' value='http://localhost:7334' />
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<button id='login'>login</button>
|
<button id='login'>login</button>
|
||||||
|
@ -396,13 +401,96 @@
|
||||||
|
|
||||||
function fillStreams()
|
function fillStreams()
|
||||||
{
|
{
|
||||||
var stream, li;
|
var stream, cur, li, channel, limit;
|
||||||
|
|
||||||
$('#streams-list').html('');
|
$('#streams-list').html('');
|
||||||
|
|
||||||
for(stream in settings.settings.streams)
|
for(stream in settings.settings.streams)
|
||||||
{
|
{
|
||||||
li = $('<li>').text(stream);
|
var d = $('<span>').text(' <delete>').attr('id', 'stream-delete-' + stream).click(function()
|
||||||
|
{
|
||||||
|
console.log('delete this stream', $(this).attr('id').replace('stream-delete-', ''));
|
||||||
|
// TODO
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
li = $('<li>').append($('<h3>').text(stream).append(d));
|
||||||
|
|
||||||
|
cur = settings.settings.streams[stream];
|
||||||
|
|
||||||
|
li.append($('<span>').text('Name: ' + cur.name));
|
||||||
|
li.append($('<span>').text('Group: ' + cur.group));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// add channel info
|
||||||
|
channel = $('<div>').attr('id', 'stream-channel-' + stream).text('Channel: ');
|
||||||
|
channel.append($('<input>').attr('type', 'text').attr('id', 'stream-channel-url-' + stream).attr('value', cur.channel.URL));
|
||||||
|
channel.append($('<input>').attr('type', 'text').attr('id', 'stream-channel-account-' + stream).attr('value', cur.channel.account));
|
||||||
|
channel.append($('<span>').text('<save>').click(function()
|
||||||
|
{
|
||||||
|
var cname = $(this).parent().attr('id').replace('stream-channel-', ''),
|
||||||
|
url = $('#stream-channel-url-' + cname).val(),
|
||||||
|
acc = $('#stream-channel-account-' + cname).val();
|
||||||
|
|
||||||
|
settings.settings.streams[cname].channel = {URL: url, account: acc};
|
||||||
|
|
||||||
|
loadSettings(fillStreams);
|
||||||
|
}));
|
||||||
|
li.append(channel);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// add limits
|
||||||
|
limit = $('<div>').attr('id', 'stream-limit-' + stream).text('Limits: ');
|
||||||
|
for(var i = 0; i < cur.limits.length; i++)
|
||||||
|
{
|
||||||
|
|
||||||
|
var climit = $('<div>').attr('id', 'stream-limit-' + stream + '-' + i);
|
||||||
|
|
||||||
|
var del = $('<span>').click(function()
|
||||||
|
{
|
||||||
|
console.log('DELETE', i, climit, stream);
|
||||||
|
// TODO
|
||||||
|
}).text(' <delete>');
|
||||||
|
|
||||||
|
climit.append($('<span>').text(cur.limits[i].name + ' | ' + cur.limits[i].type + ' | ' + cur.limits[i].val));
|
||||||
|
|
||||||
|
climit.append(del);
|
||||||
|
|
||||||
|
limit.append(climit);
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
cur = $('<div>').attr('id', 'limits-' + i);
|
||||||
|
lim = settings.settings.config.limits[i];
|
||||||
|
del = $('<span>').click(function()
|
||||||
|
{
|
||||||
|
var sfrom = $(this).parent().attr('id').replace('limits-', '');
|
||||||
|
settings.settings.config.limits.splice(sfrom, 1);
|
||||||
|
$(this).parent().remove();
|
||||||
|
|
||||||
|
loadSettings(fillLimits);
|
||||||
|
}).text(' <delete> ');
|
||||||
|
|
||||||
|
cur.append($('<span>').text(lim.name + ' | ' + lim.type + ' | ' + lim.val));
|
||||||
|
|
||||||
|
cur.append(del);
|
||||||
|
|
||||||
|
$('#limits-list').append(cur);
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
li.append(limit);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#streams-list').append(li);
|
$('#streams-list').append(li);
|
||||||
|
|
Loading…
Add table
Reference in a new issue