CC-3469: Stream settings: Connection URLs are not generated correctly
- done
This commit is contained in:
parent
b7634098d3
commit
e194ff0dc8
|
@ -231,6 +231,7 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
Application_Model_RabbitMq::SendMessageToPypo("update_stream_setting", $data);
|
Application_Model_RabbitMq::SendMessageToPypo("update_stream_setting", $data);
|
||||||
$this->view->statusMsg = "<div class='success'>Stream Setting Updated.</div>";
|
$this->view->statusMsg = "<div class='success'>Stream Setting Updated.</div>";
|
||||||
}
|
}
|
||||||
|
$live_stream_subform->updateConnectionURLs();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->view->confirm_pypo_restart_text = "Updating settings will temporarily interrupt any currently playing shows. Click \'OK\' to continue.";
|
$this->view->confirm_pypo_restart_text = "Updating settings will temporarily interrupt any currently playing shows. Click \'OK\' to continue.";
|
||||||
|
|
|
@ -70,8 +70,39 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
||||||
$master_dj_connection_url = ($master_dj_connection_url == "")?("http://".$_SERVER['SERVER_NAME'].":".$m_port."/".$m_mount):$master_dj_connection_url;
|
$master_dj_connection_url = ($master_dj_connection_url == "")?("http://".$_SERVER['SERVER_NAME'].":".$m_port."/".$m_mount):$master_dj_connection_url;
|
||||||
$live_dj_connection_url = ($live_dj_connection_url == "")?"http://".$_SERVER['SERVER_NAME'].":".$l_port."/".$l_mount:$live_dj_connection_url;
|
$live_dj_connection_url = ($live_dj_connection_url == "")?"http://".$_SERVER['SERVER_NAME'].":".$l_port."/".$l_mount:$live_dj_connection_url;
|
||||||
|
|
||||||
|
if($m_port=="" || $m_mount==""){
|
||||||
|
$master_dj_connection_url = "N/A";
|
||||||
|
}
|
||||||
|
if($l_port=="" || $l_mount==""){
|
||||||
|
$live_dj_connection_url = "N/A";
|
||||||
|
}
|
||||||
|
|
||||||
$this->setDecorators(array(
|
$this->setDecorators(array(
|
||||||
array('ViewScript', array('viewScript' => 'form/preferences_livestream.phtml', 'master_dj_connection_url'=>$master_dj_connection_url, 'live_dj_connection_url'=>$live_dj_connection_url,))
|
array('ViewScript', array('viewScript' => 'form/preferences_livestream.phtml', 'master_dj_connection_url'=>$master_dj_connection_url, 'live_dj_connection_url'=>$live_dj_connection_url,))
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function updateConnectionURLs(){
|
||||||
|
$m_port = Application_Model_StreamSetting::GetMasterLiveSteamPort();
|
||||||
|
$m_mount = Application_Model_StreamSetting::GetMasterLiveSteamMountPoint();
|
||||||
|
$l_port = Application_Model_StreamSetting::GetDJLiveSteamPort();
|
||||||
|
$l_mount = Application_Model_StreamSetting::GetDJLiveSteamMountPoint();
|
||||||
|
|
||||||
|
$master_dj_connection_url = Application_Model_Preference::GetMasterDJSourceConnectionURL();
|
||||||
|
$live_dj_connection_url = Application_Model_Preference::GetLiveDJSourceConnectionURL();
|
||||||
|
|
||||||
|
$master_dj_connection_url = ($master_dj_connection_url == "")?("http://".$_SERVER['SERVER_NAME'].":".$m_port."/".$m_mount):$master_dj_connection_url;
|
||||||
|
$live_dj_connection_url = ($live_dj_connection_url == "")?"http://".$_SERVER['SERVER_NAME'].":".$l_port."/".$l_mount:$live_dj_connection_url;
|
||||||
|
|
||||||
|
if($m_port=="" || $m_mount==""){
|
||||||
|
$master_dj_connection_url = "N/A";
|
||||||
|
}
|
||||||
|
if($l_port=="" || $l_mount==""){
|
||||||
|
$live_dj_connection_url = "N/A";
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->setDecorators(array(
|
||||||
|
array('ViewScript', array('viewScript' => 'form/preferences_livestream.phtml', 'master_dj_connection_url'=>$master_dj_connection_url, 'live_dj_connection_url'=>$live_dj_connection_url,))
|
||||||
|
));
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -107,10 +107,11 @@ function checkLiquidsoapStatus(){
|
||||||
}
|
}
|
||||||
|
|
||||||
function setLiveSourceConnectionOverrideListener(){
|
function setLiveSourceConnectionOverrideListener(){
|
||||||
$("[id=connection_url_override]").click(function(){
|
$("[id=connection_url_override]").click(function(event){
|
||||||
var div_ele = $(this).parent().find("div[id$='_dj_connection_url_tb']")
|
var div_ele = $(this).parent().find("div[id$='_dj_connection_url_tb']")
|
||||||
div_ele.find(":input").val("")
|
div_ele.find(":input").val("")
|
||||||
div_ele.show()
|
div_ele.show()
|
||||||
|
event.preventDefault()
|
||||||
})
|
})
|
||||||
|
|
||||||
// set action for "OK" and "X"
|
// set action for "OK" and "X"
|
||||||
|
@ -119,36 +120,42 @@ function setLiveSourceConnectionOverrideListener(){
|
||||||
var master_dj_input = $("#master_dj_connection_url_tb")
|
var master_dj_input = $("#master_dj_connection_url_tb")
|
||||||
var master_dj_label = master_dj_input.parent().find("span")
|
var master_dj_label = master_dj_input.parent().find("span")
|
||||||
|
|
||||||
live_dj_input.find("#ok").click(function(){
|
live_dj_input.find("#ok").click(function(event){
|
||||||
|
event.preventDefault()
|
||||||
var url = $(this).parent().find(":input").val()
|
var url = $(this).parent().find(":input").val()
|
||||||
live_dj_label.html(url)
|
live_dj_label.html(url)
|
||||||
live_dj_input.hide()
|
live_dj_input.hide()
|
||||||
$.get("/Preference/set-source-connection-url/", {format: "json", type: "livedj", url:encodeURIComponent(url)});
|
$.get("/Preference/set-source-connection-url/", {format: "json", type: "livedj", url:encodeURIComponent(url)});
|
||||||
|
event.preventDefault()
|
||||||
})
|
})
|
||||||
|
|
||||||
live_dj_input.find("#reset").click(function(){
|
live_dj_input.find("#reset").click(function(event){
|
||||||
|
event.preventDefault()
|
||||||
var port = $("#dj_harbor_input_port").val()
|
var port = $("#dj_harbor_input_port").val()
|
||||||
var mount = $("#dj_harbor_input_mount_point").val()
|
var mount = $("#dj_harbor_input_mount_point").val()
|
||||||
var url = "http://"+location.hostname+":"+port+"/"+mount
|
var url = "http://"+location.hostname+":"+port+"/"+mount
|
||||||
live_dj_label.html(url)
|
live_dj_label.html(url)
|
||||||
live_dj_input.hide()
|
live_dj_input.hide()
|
||||||
$.get("/Preference/set-source-connection-url", {format: "json", type: "livedj", url:encodeURIComponent(url)});
|
$.get("/Preference/set-source-connection-url", {format: "json", type: "livedj", url:encodeURIComponent(url)});
|
||||||
|
event.preventDefault()
|
||||||
})
|
})
|
||||||
|
|
||||||
master_dj_input.find("#ok").click(function(){
|
master_dj_input.find("#ok").click(function(event){
|
||||||
var url = $(this).parent().find(":input").val()
|
var url = $(this).parent().find(":input").val()
|
||||||
master_dj_label.html(url)
|
master_dj_label.html(url)
|
||||||
master_dj_input.hide()
|
master_dj_input.hide()
|
||||||
$.get("/Preference/set-source-connection-url", {format: "json", type: "masterdj", url:encodeURIComponent(url)})
|
$.get("/Preference/set-source-connection-url", {format: "json", type: "masterdj", url:encodeURIComponent(url)})
|
||||||
|
event.preventDefault()
|
||||||
})
|
})
|
||||||
|
|
||||||
master_dj_input.find("#reset").click(function(){
|
master_dj_input.find("#reset").click(function(event){
|
||||||
var port = $("#master_harbor_input_port").val()
|
var port = $("#master_harbor_input_port").val()
|
||||||
var mount = $("#master_harbor_input_mount_point").val()
|
var mount = $("#master_harbor_input_mount_point").val()
|
||||||
var url = "http://"+location.hostname+":"+port+"/"+mount
|
var url = "http://"+location.hostname+":"+port+"/"+mount
|
||||||
master_dj_label.html(url)
|
master_dj_label.html(url)
|
||||||
master_dj_input.hide()
|
master_dj_input.hide()
|
||||||
$.get("/Preference/set-source-connection-url", {format: "json", type: "masterdj", url:encodeURIComponent(url)})
|
$.get("/Preference/set-source-connection-url", {format: "json", type: "masterdj", url:encodeURIComponent(url)})
|
||||||
|
event.preventDefault()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue