added force-save feature, fixed log/stat send 'bug'
This commit is contained in:
parent
28fc63c5d0
commit
80a983ee32
1 changed files with 1003 additions and 980 deletions
67
server.html
67
server.html
|
@ -520,6 +520,43 @@ td
|
|||
}
|
||||
|
||||
|
||||
|
||||
function forceJSONSave(callback)
|
||||
{
|
||||
// sends the 'force json save' command to the server
|
||||
var data =
|
||||
{
|
||||
'authorize':
|
||||
{
|
||||
'username': settings.credentials.username,
|
||||
'password': MD5(MD5(settings.credentials.password) + settings.credentials.authstring)
|
||||
},
|
||||
'save': 1
|
||||
};
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
'url': settings.server,
|
||||
'data':
|
||||
{
|
||||
"command": JSON.stringify(data)
|
||||
},
|
||||
'dataType': 'jsonp',
|
||||
'timeout': 10000,
|
||||
'error': function()
|
||||
{
|
||||
console.log('forceJSONSave ERROR');
|
||||
},
|
||||
'success': function(d)
|
||||
{
|
||||
console.log('forceJSONSave returned', d);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function getData(callback)
|
||||
{
|
||||
// this beast returns the server settings, but doesn't authorize first,
|
||||
|
@ -613,6 +650,9 @@ td
|
|||
}
|
||||
});
|
||||
|
||||
delete data.log; // don't send the logs back to the server
|
||||
delete data.statistics; // same goes for the stats
|
||||
|
||||
console.log('SEND', data);
|
||||
|
||||
$.ajax(
|
||||
|
@ -665,23 +705,6 @@ td
|
|||
//console.log('new (shinyness) object:', settings.settings);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
var fobj1 = {connector: 'HTTP', port: 42};
|
||||
fobj1['interface'] = 'kekeksauce';
|
||||
|
||||
var fobj2 = {connector: 'RTMP', port: 1337};
|
||||
fobj2['interface'] = 'rtmwhat';
|
||||
|
||||
var fobj3 = {connector: 'HTTP', port: 43};
|
||||
fobj3['interface'] = 'moarmoar';
|
||||
|
||||
settings.settings.config.protocols = [fobj1, fobj2, fobj3];
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
if(callback)
|
||||
{
|
||||
callback(errorstr);
|
||||
|
@ -888,9 +911,7 @@ settings.settings.config.protocols = [fobj1, fobj2, fobj3];
|
|||
{
|
||||
if(confirmDelete('Are you sure you want to force a JSON save?') == true)
|
||||
{
|
||||
// TODO FIXME
|
||||
console.log('magie hier!'); // TODO FIXME
|
||||
// /TODO /FIXME
|
||||
forceJSONSave(); // :)
|
||||
}
|
||||
}).text( 'force save to JSON file' )
|
||||
);
|
||||
|
@ -1267,7 +1288,7 @@ settings.settings.config.protocols = [fobj1, fobj2, fobj3];
|
|||
|
||||
var url = settings.settings.streams[streamname].channel.URL;
|
||||
|
||||
// TODO FIXME
|
||||
// TODO when embed code is done.
|
||||
|
||||
$('#page').append( $('<p>').text('This feature is not yet implemented.') );
|
||||
$('#page').append( $('<p>').text('The URL for this stream is ').append( $('<span>').attr('class', 'nocapitals').text(url) ) );
|
||||
|
@ -1483,7 +1504,7 @@ settings.settings.config.protocols = [fobj1, fobj2, fobj3];
|
|||
settings: {}
|
||||
};
|
||||
break;
|
||||
} // end switch :D
|
||||
} // end switch
|
||||
|
||||
|
||||
//placeholder for older browsers
|
||||
|
@ -1493,4 +1514,6 @@ settings.settings.config.protocols = [fobj1, fobj2, fobj3];
|
|||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
Loading…
Add table
Reference in a new issue