Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
James 2011-09-29 10:22:25 -04:00
commit e4959739dc
6 changed files with 50 additions and 23 deletions

View File

@ -21,8 +21,9 @@ function setjPlayer(url, type){
$(document).ready(function(){
$('.bit-rates').click(function(eventObject){
var elem = $(eventObject.target);
$("#combo-box").change(function(eventObject){
var elem = $("#combo-box option:selected");
console.log(elem);
setjPlayer(elem.attr("data-url"), elem.attr("data-type"));
});
@ -45,22 +46,20 @@ $(document).ready(function(){
<div class="jp-stream-text">Select stream:</div>
<form id="form1" method="post" action="">
<?php
$i=0;
foreach($ids as $id):
$streamData = Application_Model_StreamSetting::getStreamData($id);
Logging::log("id: ".print_r($streamData, true));
<select id="combo-box">
<?php
foreach($ids as $id) {
$streamData = Application_Model_StreamSetting::getStreamData($id);
$url = "http://".$streamData["${id}_host"].":".$streamData["${id}_port"]."/".$streamData["${id}_mount"];
$type = $streamData["${id}_type"];
if ($type == "ogg")
$type = "oga";
$url = "http://".$streamData["${id}_host"].":".$streamData["${id}_port"]."/".$streamData["${id}_mount"];
$type = $streamData["${id}_type"];
if ($type == "ogg")
$type = "oga";
$label = "Stream ".substr($id, 1)." (".$streamData["${id}_bitrate"]." Kbit/s)";
echo sprintf("<option class='stream' value='%s' data-url='%s' data-type='%s'>%s</option>", $id, $url, $type, $label);
}
?>
<label>
<input class='bit-rates' type="radio" name="select-stream" value="radio" data-url="<?php echo $url ?>" data-type="<?php echo $type ?>" id="select-stream_<?php echo $id ?>" <?php echo $i==0 ? "checked=\"checked\"": ""; ?>/>
<?php echo "Stream ".substr($id, 1)." (".$streamData["${id}_bitrate"]; ?> Kbit/s)</label>
<?php $i++; endforeach; ?>
</select>
</form>
</div>
<div id="jquery_jplayer_1" class="jp-jplayer"></div>

View File

@ -54,6 +54,8 @@ python ${SCRIPTPATH}/../python_apps/show-recorder/install/recorder-install.py
echo -e "\n*** Media Monitor Installation ***"
python ${SCRIPTPATH}/../python_apps/media-monitor/install/media-monitor-install.py
python ${SCRIPTPATH}/../python_apps/icecast2/install/icecast2-install.py
# Need to ensure monit is running before Airtime daemons are run. This is
# so we can ensure they can register with monit to monitor them when they start.
# If monit is already running, this step is still useful as we need monit to

View File

@ -102,6 +102,8 @@ passthru("python $SCRIPTPATH/../../python_apps/show-recorder/install/recorder-in
echo PHP_EOL."*** Updating Media Monitor ***".PHP_EOL;
passthru("python $SCRIPTPATH/../../python_apps/media-monitor/install/media-monitor-install.py");
passthru("python $SCRIPTPATH/../../python_apps/icecast2/install/icecast2-install.py");
sleep(4);
passthru("airtime-check-system");

View File

@ -341,7 +341,6 @@ class AirtimeIni200{
const CONF_FILE_LIQUIDSOAP = "/etc/airtime/liquidsoap.cfg";
const CONF_FILE_MEDIAMONITOR = "/etc/airtime/media-monitor.cfg";
const CONF_FILE_API_CLIENT = "/etc/airtime/api_client.cfg";
const CONF_FILE_MONIT = "/etc/monit/conf.d/airtime-monit.cfg";
const CONF_PYPO_GRP = "pypo";
const CONF_WWW_DATA_GRP = "www-data";
@ -405,7 +404,7 @@ class AirtimeIni200{
foreach ($configFiles as $conf) {
// we want to use new liquidsoap.cfg so don't merge
// also for monit
if( $conf == AirtimeIni200::CONF_FILE_LIQUIDSOAP || $conf == AirtimeIni200::CONF_FILE_MONIT){
if( $conf == AirtimeIni200::CONF_FILE_LIQUIDSOAP){
continue;
}
if (file_exists("$conf$suffix.bak")) {
@ -493,7 +492,7 @@ class AirtimeIni200{
$suffix = date("Ymdhis")."-2.0.0";
foreach ($configFiles as $conf) {
// do not back up monit cfg
if (file_exists($conf) && $conf != AirtimeIni200::CONF_FILE_MONIT) {
if (file_exists($conf)) {
echo "Backing up $conf to $conf$suffix.bak".PHP_EOL;
//copy($conf, $conf.$suffix.".bak");
exec("cp -p $conf $conf$suffix.bak"); //use cli version to preserve file attributes
@ -538,10 +537,6 @@ class AirtimeIni200{
echo "Could not copy airtime-monit.cfg to /etc/monit/conf.d/. Exiting.";
exit(1);
}
if (!copy(__DIR__."/airtime-monit.cfg.$suffix", AirtimeIni200::CONF_FILE_MONIT)){
echo "Could not copy airtime-monit.cfg to /etc/monit/conf.d/. Exiting.";
exit(1);
}
}
}

View File

@ -0,0 +1,7 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
import shutil
import os
import sys
if os.geteuid() != 0:
print "Please run this as root."
sys.exit(1)
def get_current_script_dir():
current_script_dir = os.path.realpath(__file__)
index = current_script_dir.rindex('/')
return current_script_dir[0:index]
try:
current_script_dir = get_current_script_dir()
shutil.copy(current_script_dir+"/../airtime-icecast-status.xsl", "/usr/share/icecast2/web")
except Exception, e:
print "exception: %s" % e
sys.exit(1)