mirror of
				https://github.com/hyperion-project/hyperion.ng.git
				synced 2025-03-01 10:33:28 +00:00 
			
		
		
		
	update/fix remote
This commit is contained in:
		@@ -63,7 +63,7 @@
 | 
			
		||||
							</tr>
 | 
			
		||||
						</tbody>
 | 
			
		||||
					</table>
 | 
			
		||||
					<button data-i18n="remote_color_button_reset" type="button" class="btn btn-warning" id="reset_color" style="margin-top:10px;">Reset Color/Effect</button>
 | 
			
		||||
					<button data-i18n="remote_color_button_reset" type="button" class="btn btn-primary" id="reset_color" style="margin-top:10px;">Reset Color/Effect</button>
 | 
			
		||||
				</div>
 | 
			
		||||
			</div>
 | 
			
		||||
		</div>
 | 
			
		||||
 
 | 
			
		||||
@@ -253,7 +253,6 @@
 | 
			
		||||
	"infoDialog_general_error_title" : "Fehler",
 | 
			
		||||
	"infoDialog_general_warning_title" : "Warnung",
 | 
			
		||||
	"infoDialog_checklist_title" : "Checkliste!",
 | 
			
		||||
	"InfoDialog_leds_validfail_title" : "JSON Überprüfung fehlgeschlagen!",
 | 
			
		||||
	"infoDialog_effconf_deleted_text" : "Der Effekt \"$1\" wurde erfolgreich entfernt!",
 | 
			
		||||
	"infoDialog_effconf_created_text" : "Der Effekt \"$1\" wurde erfolgreich erstellt!",
 | 
			
		||||
	"InfoDialog_lang_title" : "Spracheinstellung",
 | 
			
		||||
 
 | 
			
		||||
@@ -253,7 +253,6 @@
 | 
			
		||||
	"infoDialog_general_error_title" : "Error",
 | 
			
		||||
	"infoDialog_general_warning_title" : "Warning",
 | 
			
		||||
	"infoDialog_checklist_title" : "Checklist!",
 | 
			
		||||
	"InfoDialog_leds_validfail_title" : "JSON Validation failed!",
 | 
			
		||||
	"infoDialog_effconf_deleted_text" : "The effect \"$1\" has been deleted successfully!",
 | 
			
		||||
	"infoDialog_effconf_created_text" : "The effect \"$1\" has been created successfully!",
 | 
			
		||||
	"InfoDialog_lang_title" : "Language setting",
 | 
			
		||||
 
 | 
			
		||||
@@ -92,7 +92,15 @@ $(document).ready(function() {
 | 
			
		||||
		for(i = 0; i < prios.length; i++)
 | 
			
		||||
		{
 | 
			
		||||
			var origin   = prios[i].origin;
 | 
			
		||||
			var ip       = "xxx.xxx.xxx.xxx";
 | 
			
		||||
			if(typeof origin !== "undefined" && origin != "")
 | 
			
		||||
			{
 | 
			
		||||
				origin = origin.split("@");
 | 
			
		||||
				var ip = origin[1];
 | 
			
		||||
				origin = origin[0];
 | 
			
		||||
			}
 | 
			
		||||
			else
 | 
			
		||||
				origin = "System";
 | 
			
		||||
 | 
			
		||||
			var owner    = prios[i].owner;
 | 
			
		||||
			var active   = prios[i].active;
 | 
			
		||||
			var visible  = prios[i].visible;
 | 
			
		||||
@@ -102,7 +110,7 @@ $(document).ready(function() {
 | 
			
		||||
			var btn_type = "default";
 | 
			
		||||
			var btn_text = $.i18n('remote_input_setsource_btn');
 | 
			
		||||
			var btn_state = "enabled";
 | 
			
		||||
			if (active) btn_type = "warning";
 | 
			
		||||
			if (active) btn_type = "primary";
 | 
			
		||||
			if (visible)
 | 
			
		||||
			{
 | 
			
		||||
				 btn_state = "disabled";
 | 
			
		||||
@@ -111,26 +119,26 @@ $(document).ready(function() {
 | 
			
		||||
			}
 | 
			
		||||
			if(ip)
 | 
			
		||||
				origin += '<br/><span style="font-size:80%; color:grey;">'+$.i18n('remote_input_ip')+' '+ip+'</span>';
 | 
			
		||||
			if(compId == "10")
 | 
			
		||||
			if(compId == 10)
 | 
			
		||||
				owner = $.i18n('remote_effects_label_effects')+'  '+owner;
 | 
			
		||||
			if(compId == "9")
 | 
			
		||||
			if(compId == 9)
 | 
			
		||||
				owner = $.i18n('remote_color_label_color')+'  '+'<div style="width:18px; height:18px; border-radius:20px; margin-bottom:-4px; border:1px grey solid; background-color: rgb('+prios[i].value.RGB+'); display:inline-block" title="RGB: ('+prios[i].value.RGB+')"></div>';
 | 
			
		||||
			if(compId == "7")
 | 
			
		||||
			if(compId == 7)
 | 
			
		||||
				owner = $.i18n('general_comp_GRABBER')+': ('+owner+')';
 | 
			
		||||
			if(compId == "8")
 | 
			
		||||
			if(compId == 8)
 | 
			
		||||
				owner = $.i18n('general_comp_V4L')+': ('+owner+')';
 | 
			
		||||
			if(compId == "6")
 | 
			
		||||
			if(compId == 6)
 | 
			
		||||
				owner = $.i18n('general_comp_BOBLIGHTSERVER');
 | 
			
		||||
			if(compId == "5")
 | 
			
		||||
			if(compId == 5)
 | 
			
		||||
				owner = $.i18n('general_comp_UDPLISTENER');
 | 
			
		||||
			if(owner == "Off")
 | 
			
		||||
				owner = $.i18n('general_btn_off');
 | 
			
		||||
			if(duration)
 | 
			
		||||
			if(duration && compId != 7 && compId != 11)
 | 
			
		||||
				owner += '<br/><span style="font-size:80%; color:grey;">'+$.i18n('remote_input_duration')+' '+duration.toFixed(0)+$.i18n('edt_append_s')+'</span>';
 | 
			
		||||
			
 | 
			
		||||
			var btn = '<button id="srcBtn'+i+'" type="button" '+btn_state+' class="btn btn-'+btn_type+' btn_input_selection" onclick="requestSetSource('+priority+');">'+btn_text+'</button>';
 | 
			
		||||
			
 | 
			
		||||
			if((compId == "10" || compId == "9") && priority != 254)
 | 
			
		||||
			if((compId == 10 || compId == 9) && priority != 254)
 | 
			
		||||
				btn += '<button type="button" class="btn btn-sm btn-danger" style="margin-left:10px;" onclick="requestPriorityClear('+priority+');"><i class="fa fa-close"></button>';
 | 
			
		||||
			
 | 
			
		||||
			if(btn_type != 'default')
 | 
			
		||||
@@ -159,7 +167,7 @@ $(document).ready(function() {
 | 
			
		||||
			if(mapping == mappingList[ix])
 | 
			
		||||
				btn_style = 'btn-success';
 | 
			
		||||
			else
 | 
			
		||||
				btn_style = 'btn-warning';
 | 
			
		||||
				btn_style = 'btn-primary';
 | 
			
		||||
 | 
			
		||||
			$('#mappingsbutton').append('<button type="button" id="lmBtn_'+mappingList[ix]+'" class="btn '+btn_style+'" style="margin:10px;min-width:200px" onclick="requestMappingType(\''+mappingList[ix]+'\');">'+$.i18n('remote_maptype_label_'+mappingList[ix])+'</button><br/>');
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -219,33 +219,18 @@ function requestPriorityClear(prio)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function requestPlayEffect(effectName, duration)
 | 
			
		||||
{
 | 
			
		||||
	if(typeof duration === "undefined" || duration < 0)
 | 
			
		||||
		duration = 0;
 | 
			
		||||
	else
 | 
			
		||||
		duration *= 1000;
 | 
			
		||||
	
 | 
			
		||||
	sendToHyperion("effect", "", '"effect":{"name":"'+effectName+'"},"priority":'+webPrio+',"duration":'+duration+',"origin":"'+webOrigin+'"');
 | 
			
		||||
{	
 | 
			
		||||
	sendToHyperion("effect", "", '"effect":{"name":"'+effectName+'"},"priority":'+webPrio+',"duration":'+validateDuration(duration)+',"origin":"'+webOrigin+'"');
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function requestSetColor(r,g,b,duration)
 | 
			
		||||
{
 | 
			
		||||
	if(typeof duration === "undefined" || duration < 0)
 | 
			
		||||
		duration = 0;
 | 
			
		||||
	else
 | 
			
		||||
		duration *= 1000;
 | 
			
		||||
	
 | 
			
		||||
	sendToHyperion("color", "",  '"color":['+r+','+g+','+b+'], "priority":'+webPrio+',"duration":'+duration+',"origin":"'+webOrigin+'"');
 | 
			
		||||
{	
 | 
			
		||||
	sendToHyperion("color", "",  '"color":['+r+','+g+','+b+'], "priority":'+webPrio+',"duration":'+validateDuration(duration)+',"origin":"'+webOrigin+'"');
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function requestSetImage(data,width,height,duration)
 | 
			
		||||
{
 | 
			
		||||
	if(typeof duration === "undefined" || duration < 0)
 | 
			
		||||
		duration = 0;
 | 
			
		||||
	else
 | 
			
		||||
		duration *= 1000;
 | 
			
		||||
	
 | 
			
		||||
	sendToHyperion("image", "",  '"imagedata":"'+data+'", "imagewidth":'+width+',"imageheight":'+height+', "priority":'+webPrio+',"duration":'+duration+'');
 | 
			
		||||
{	
 | 
			
		||||
	sendToHyperion("image", "",  '"imagedata":"'+data+'", "imagewidth":'+width+',"imageheight":'+height+', "priority":'+webPrio+',"duration":'+validateDuration(duration)+'');
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function requestSetComponentState(comp, state)
 | 
			
		||||
@@ -292,7 +277,7 @@ function requestWriteEffect(effectName,effectPy,effectArgs)
 | 
			
		||||
 | 
			
		||||
function requestTestEffect(effectName,effectPy,effectArgs)
 | 
			
		||||
{
 | 
			
		||||
	sendToHyperion("effect", "", '"effect":{"name":"'+effectName+'", "args":'+effectArgs+'},"priority":'+webPrio+', "pythonScript":"'+effectPy+'"}');
 | 
			
		||||
	sendToHyperion("effect", "", '"effect":{"name":"'+effectName+'", "args":'+effectArgs+'}, "priority":'+webPrio+', "origin":"'+webOrigin+'", "pythonScript":"'+effectPy+'"}');
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function requestDeleteEffect(effectName)
 | 
			
		||||
 
 | 
			
		||||
@@ -48,6 +48,14 @@ function debugMessage(msg)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function validateDuration(d)
 | 
			
		||||
{
 | 
			
		||||
	if(typeof d === "undefined" || d < 0)
 | 
			
		||||
		return d = 0;
 | 
			
		||||
	else
 | 
			
		||||
		return d *= 1000;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function getHashtag()
 | 
			
		||||
{
 | 
			
		||||
	if(getStorage('lasthashtag', true) != null)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user