diff --git a/index.html b/index.html index c77922e4..e6c9bad0 100644 --- a/index.html +++ b/index.html @@ -71,6 +71,8 @@
Playing
+
Decoder
+
Encoder
System
diff --git a/resources/css/style.css b/resources/css/style.css index ad97d76b..50823ec3 100644 --- a/resources/css/style.css +++ b/resources/css/style.css @@ -647,7 +647,7 @@ footer logging taps .log-tabs { overflow: hidden; - max-width: 127px; + max-width: 263px; color: #111111; } diff --git a/resources/js/custom.js b/resources/js/custom.js index d282ea1b..127c5272 100644 --- a/resources/js/custom.js +++ b/resources/js/custom.js @@ -344,13 +344,35 @@ function get_log(logtype) { $('#bt_play').click(function() { $(this).addClass("active"); $('#bt_sys').removeClass("active"); + $('#bt_enc').removeClass("active"); + $('#bt_dec').removeClass("active"); get_log("playing"); }); +$('#bt_dec').click(function() { + $(this).addClass("active"); + $('#bt_sys').removeClass("active"); + $('#bt_enc').removeClass("active"); + $('#bt_play').removeClass("active"); + + get_log("decoder"); +}); + +$('#bt_enc').click(function() { + $(this).addClass("active"); + $('#bt_sys').removeClass("active"); + $('#bt_dec').removeClass("active"); + $('#bt_play').removeClass("active"); + + get_log("encoder"); +}); + $('#bt_sys').click(function() { $(this).addClass("active"); $('#bt_play').removeClass("active"); + $('#bt_enc').removeClass("active"); + $('#bt_dec').removeClass("active"); get_log("system"); }); diff --git a/resources/logging.php b/resources/logging.php index 10185aba..1d02e515 100644 --- a/resources/logging.php +++ b/resources/logging.php @@ -2,20 +2,33 @@ error_reporting(E_ALL); ini_set('display_errors', 'On'); +// get config file +function get_ini() { + return parse_ini_file("/etc/ffplayout/ffplayout.conf", TRUE, INI_SCANNER_RAW); +} + +function printer($file) { + $ini = get_ini(); + $log_file = $ini['LOGGING']['log_path'] . $file; + $open_log = fopen($log_file, "r") or die("Unable to open file!"); + echo fread($open_log,filesize($log_file)); + fclose($open_log); +} + // get playout log if(!empty($_GET['log_from'])) { $log_from = $_GET['log_from']; if ($log_from === "playing") { - $get_ini = file_get_contents("/etc/ffplayout/ffplayout.conf"); - $get_path = "/^log_file.*\$/m"; - preg_match_all($get_path, $get_ini, $matches); - $line = implode("\n", $matches[0]); - $log_file = explode("= ", $line)[1]; + printer("/ffplayout.log"); + } - $open_log = fopen($log_file, "r") or die("Unable to open file!"); - echo fread($open_log,filesize($log_file)); - fclose($open_log); + if ($log_from === "decoder") { + printer("/decoder.log"); + } + + if ($log_from === "encoder") { + printer("/encoder.log"); } if ($log_from === "system") {