yWeb: simplify code by using find-exec function

Origin commit data
------------------
Commit: 4eab09ae02
Author: vanhofen <vanhofen@gmx.de>
Date: 2015-03-31 (Tue, 31 Mar 2015)

Origin message was:
------------------
- yWeb: simplify code by using find-exec function
This commit is contained in:
vanhofen
2015-03-31 01:34:13 +02:00
parent 434a9c9745
commit 7769ba1514
6 changed files with 26 additions and 26 deletions

View File

@@ -129,7 +129,7 @@ function get_data(){
//]]> //]]>
</script> </script>
</head> </head>
{=var-set:lcshot={=if-file-exists:/bin/lcshot~true~{=if-file-exists:/var/bin/lcshot~true~false=}=}=} {=var-set:lcshot={=find-exec:lcshot=}=}
<body> <body>
<div class="y_menu_sec_box"> <div class="y_menu_sec_box">
<div class="y_menu_sec_box_head"><h2>{=L:main.boxcontrol=}</h2></div> <div class="y_menu_sec_box_head"><h2>{=L:main.boxcontrol=}</h2></div>
@@ -150,7 +150,7 @@ function get_data(){
</li> </li>
{=if-not-equal:{=global-var-get:boxtype=}~coolstream~ {=if-not-equal:{=global-var-get:boxtype=}~coolstream~
<li> <li>
{=if-equal:{=var-get:lcshot=}~true~ {=if-empty:{=var-get:lcshot=}~
<a target="work" title="{=L:bc.menue.lcd_screenshot_desc=}" href="Y_Tools_lcshot.yhtm">{=L:bc.menue.lcd_screenshot=}</a> <a target="work" title="{=L:bc.menue.lcd_screenshot_desc=}" href="Y_Tools_lcshot.yhtm">{=L:bc.menue.lcd_screenshot=}</a>
~ ~
<a href="javascript:void(0)" class="disabled" title="{=L:bc.menue.lcd_screenshot_desc_ni=}">{=L:bc.menue.lcd_screenshot=}</a> <a href="javascript:void(0)" class="disabled" title="{=L:bc.menue.lcd_screenshot_desc_ni=}">{=L:bc.menue.lcd_screenshot=}</a>

View File

@@ -77,45 +77,45 @@ function do_check(){
=} =}
/*programs*/ /*programs*/
{=var-set:fbshot={=if-file-exists:/bin/fbshot~/bin/fbshot~{=if-file-exists:/var/bin/fbshot~/var/bin/fbshot~false=}=}=} {=var-set:fbshot={=find-exec:fbshot=}=}
{=if-equal:{=var-get:fbshot=}~false~ {=if-empty:{=var-get:fbshot=}~
sLog_addRow(sLog_body, "red", "Programs: fbshot is not installed. OSD Screenshot is disabled. ", "failed"); sLog_addRow(sLog_body, "red", "Programs: fbshot is not installed. OSD Screenshot is disabled. ", "failed");
~ ~
sLog_addRow(sLog_body, "green", "Programs: fbshot is installed at: {=var-get:fbshot=}. OSD Screenshot is enabled.", "ok"); sLog_addRow(sLog_body, "green", "Programs: fbshot is installed at: {=var-get:fbshot=}. OSD Screenshot is enabled.", "ok");
=} =}
{=var-set:dboxshot={=if-file-exists:/bin/dboxshot~/bin/dboxshot~{=if-file-exists:/var/bin/dboxshot~/var/bin/dboxshot~false=}=}=} {=var-set:dboxshot={=find-exec:dboxshot=}=}
{=if-equal:{=var-get:dboxshot=}~false~ {=if-empty:{=var-get:dboxshot=}~
sLog_addRow(sLog_body, "red", "Programs: dboxshot is not installed. Remote &amp; OSD is disabled.", "failed"); sLog_addRow(sLog_body, "red", "Programs: dboxshot is not installed. Remote &amp; OSD is disabled.", "failed");
~ ~
sLog_addRow(sLog_body, "green", "Programs: dboxshot is installed at: {=var-get:dboxshot=}. Remote &amp; OSD is enabled.", "ok"); sLog_addRow(sLog_body, "green", "Programs: dboxshot is installed at: {=var-get:dboxshot=}. Remote &amp; OSD is enabled.", "ok");
=} =}
{=if-not-equal:{=global-var-get:boxtype=}~coolstream~ {=if-not-equal:{=global-var-get:boxtype=}~coolstream~
{=var-set:fcp={=if-file-exists:/sbin/fcp~/sbin/fcp~{=if-file-exists:/var/bin/fcp~/var/bin/fcp~{=if-file-exists:/bin/fcp~/bin/fcp~false=}=}=}=} {=var-set:fcp={=find-exec:fcp=}=}
{=if-equal:{=var-get:fcp=}~false~ {=if-empty:{=var-get:fcp=}~
sLog_addRow(sLog_body, "red", "Programs: fcp is not installed. Image flashing is disabled. ", "failed"); sLog_addRow(sLog_body, "red", "Programs: fcp is not installed. Image flashing is disabled. ", "failed");
~ ~
sLog_addRow(sLog_body, "green", "Programs: fcp is installed at: {=var-get:fcp=}. Image flashing is enabled.", "ok"); sLog_addRow(sLog_body, "green", "Programs: fcp is installed at: {=var-get:fcp=}. Image flashing is enabled.", "ok");
=} =}
~=} ~=}
{=var-set:ether-wake={=if-file-exists:/bin/ether-wake~/bin/ether-wake~{=if-file-exists:/var/bin/ether-wake~/var/bin/ether-wake~false=}=}=} {=var-set:ether-wake={=find-exec:ether-wake=}=}
{=if-equal:{=var-get:ether-wake=}~false~ {=if-empty:{=var-get:ether-wake=}~
sLog_addRow(sLog_body, "red", "Programs: ether-wake is not installed. Wake on LAN is disabled. ", "failed"); sLog_addRow(sLog_body, "red", "Programs: ether-wake is not installed. Wake on LAN is disabled. ", "failed");
~ ~
sLog_addRow(sLog_body, "green", "Programs: ether-wake is installed at: {=var-get:ether-wake=}. Wake on LAN is enabled.", "ok"); sLog_addRow(sLog_body, "green", "Programs: ether-wake is installed at: {=var-get:ether-wake=}. Wake on LAN is enabled.", "ok");
=} =}
{=if-not-equal:{=global-var-get:boxtype=}~coolstream~
/*automount*/ /*automount*/
{=var-set:automount={=if-file-exists:/sbin/automount~/sbin/automount~{=if-file-exists:/var/bin/automount~/var/bin/automount~false=}=}=} {=var-set:automount={=find-exec:automount=}=}
{=if-equal:{=var-get:automount=}~false~ {=if-empty:{=var-get:automount=}~
sLog_addRow(sLog_body, "red", "Programs: automount is not installed. AutoMount is disabled. ", "failed"); sLog_addRow(sLog_body, "red", "Programs: automount is not installed. AutoMount is disabled. ", "failed");
~ ~
sLog_addRow(sLog_body, "green", "Programs: automount is installed at: {=var-get:automount=}. AutoMount is enabled.", "ok"); sLog_addRow(sLog_body, "green", "Programs: automount is installed at: {=var-get:automount=}. AutoMount is enabled.", "ok");
=} =}
{=if-not-equal:{=global-var-get:boxtype=}~coolstream~
/* udp */ /* udp */
{=var-set:udpstreamts={=if-file-exists:/sbin/udpstreamts~/sbin/udpstreamts~{=if-file-exists:/var/bin/udpstreamts~/var/bin/udpstreamts~false=}=}=} {=var-set:udpstreamts={=find-exec:udpstreamts=}=}
{=if-equal:{=var-get:udpstreamts=}~false~ {=if-empty:{=var-get:udpstreamts=}~
sLog_addRow(sLog_body, "red", "Programs: udpstreamts is not installed. udp-streaming is disabled. ", "failed"); sLog_addRow(sLog_body, "red", "Programs: udpstreamts is not installed. udp-streaming is disabled. ", "failed");
~ ~
sLog_addRow(sLog_body, "green", "Programs: udpstreamts is installed at: {=var-get:udpstreamts=}. udp-streaming is enabled.", "ok"); sLog_addRow(sLog_body, "green", "Programs: udpstreamts is installed at: {=var-get:udpstreamts=}. udp-streaming is enabled.", "ok");

View File

@@ -21,7 +21,7 @@ function do_image_upload_ready()
</script> </script>
</head> </head>
<body> <body>
{=var-set:fcp={=if-file-exists:/sbin/fcp~true~{=if-file-exists:/var/bin/fcp~true~{=if-file-exists:/bin/fcp~true~false=}=}=}=} {=var-set:fcp={=find-exec:fcp=}=}
{=var-set:wait_text=Image wird hochgeladen (upload image).=}{=include-block:Y_Blocks.txt;snip_wait=} {=var-set:wait_text=Image wird hochgeladen (upload image).=}{=include-block:Y_Blocks.txt;snip_wait=}
<div id="wait_flash" class="ydiagfree" style="left: 100px; position: absolute; top: 100px; display: none;"> <div id="wait_flash" class="ydiagfree" style="left: 100px; position: absolute; top: 100px; display: none;">
<div class="y_wait_box_visible"> <div class="y_wait_box_visible">
@@ -74,7 +74,9 @@ function do_image_upload_ready()
{=var-set:help_url=Help-Tools-Image=}{=var-set:menu=Image flashen=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> {=var-set:help_url=Help-Tools-Image=}{=var-set:menu=Image flashen=}{=include-block:Y_Blocks.txt;work_menu=}</div></div>
<div class="work_box_body"> <div class="work_box_body">
<b><font size="2">Partition mtd {=mtd=}</font><br/>{=mtd_text=}</b> <b><font size="2">Partition mtd {=mtd=}</font><br/>{=mtd_text=}</b>
{=if-equal:{=var-get:fcp=}~true~ {=if-empty:{=var-get:fcp=}~
<h2><br/><br/><br/><b><font color="#FF0000">fcp ist nicht installiert!</font></b></h2>
~
<form method="post" name="f" id="f" enctype="multipart/form-data" action="/control/exec?Y_Tools&amp;image_upload" target="out"> <form method="post" name="f" id="f" enctype="multipart/form-data" action="/control/exec?Y_Tools&amp;image_upload" target="out">
<p> <p>
<input type="file" name="file" size="40"/><br/> <input type="file" name="file" size="40"/><br/>
@@ -82,8 +84,6 @@ function do_image_upload_ready()
<button type="button" ytype="flash" title="upload and flash" name="su" onclick="do_submit()">Image flashen</button><br/> <button type="button" ytype="flash" title="upload and flash" name="su" onclick="do_submit()">Image flashen</button><br/>
</p> </p>
</form> </form>
~
<h2><br/><br/><br/><b><font color="#FF0000">fcp ist nicht installiert!</font></b></h2>
=} =}
</div> </div>
</div> </div>

View File

@@ -14,8 +14,8 @@ function init(){
</script> </script>
</head> </head>
{=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=}~1~=}=} {=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=}~1~=}=}
{=var-set:automount={=if-file-exists:/sbin/automount~true~{=if-file-exists:/var/bin/automount~true~=}=}=} {=var-set:automount={=find-exec:automount=}=}
{=var-set:ether-wake={=if-equal:{=global-var-get:boxtype=}~coolstream~{=if-file-exists:/bin/ether-wake~/bin/ether-wake~{=if-file-exists:/var/bin/ether-wake~/var/bin/ether-wake~=}=}~{=if-file-exists:/bin/ether-wake~/bin/ether-wake~{=if-file-exists:/var/bin/ether-wake~/var/bin/ether-wake~=}=}=}=} {=var-set:ether-wake={=find-exec:ether-wake=}=}
<body onload="init()"> <body onload="init()">
<div class="y_menu_sec_box"> <div class="y_menu_sec_box">
<div class="y_menu_sec_box_head"><h2>{=L:main.tools=}</h2></div> <div class="y_menu_sec_box_head"><h2>{=L:main.tools=}</h2></div>

View File

@@ -1,4 +1,4 @@
{=var-set:fbshot={=if-file-exists:/bin/fbshot~true~{=if-file-exists:/var/bin/fbshot~true~false=}=}=} {=var-set:fbshot={=find-exec:fbshot=}=}
{=include-block:Y_Blocks.txt;head=} {=include-block:Y_Blocks.txt;head=}
<script type="text/javascript" src="/Y_Baselib.js"></script> <script type="text/javascript" src="/Y_Baselib.js"></script>
@@ -43,8 +43,8 @@ function do_snapshot() {
filename = id("filename").value; filename = id("filename").value;
} }
if ({=var-get:fbshot=} == true && enableVideo == 0) if ("{=var-get:fbshot=}" != "" && enableVideo == 0)
dbox_exec_tools("fbshot fb /tmp/"+filename+".png"); dbox_exec_tools("{=var-get:fbshot=} fb /tmp/"+filename+".png");
else else
loadSyncURL("/control/screenshot?name="+filename+"&osd="+enableOSD+"&video="+enableVideo); loadSyncURL("/control/screenshot?name="+filename+"&osd="+enableOSD+"&video="+enableVideo);

View File

@@ -1,4 +1,4 @@
version=2.9.0.14 version=2.9.0.15
date=30.03.2015 date=31.03.2015
type=Release type=Release
info=Port CST info=Port CST