Commit efd40e5b authored by nextime's avatar nextime

Fixed 2 minor bugs and add FILEEXISTS status action

parent d2abecb7
...@@ -18,7 +18,7 @@ if(intval($button['status2'])>0) { ...@@ -18,7 +18,7 @@ if(intval($button['status2'])>0) {
<div class="badge devlist-topdata <?=$badgecolor?>" data-domotika-act2col="<?=$button['id']?>" <div class="badge devlist-topdata <?=$badgecolor?>" data-domotika-act2col="<?=$button['id']?>"
data-dmcolor-off="badge-<?=$dmcolors[$button['color2_off']]?>" data-dmcolor-on="badge-<?=$dmcolors[$button['color2_on']]?>"> data-dmcolor-off="badge-<?=$dmcolors[$button['color2_off']]?>" data-dmcolor-on="badge-<?=$dmcolors[$button['color2_on']]?>">
<div style="width:100%;min-width:-moz-fit-content;"><span data-domotika-act2textid="<?=$button['id']?>" <div style="width:100%;min-width:-moz-fit-content;"><span data-domotika-act2textid="<?=$button['id']?>"
data-dmtext-on=<?=$button['text2_on']?>"" data-dmtext-off="<?=$button['text2_off']?>"><?=$badgetext;?></span></div> data-dmtext-on="<?=$button['text2_on']?>" data-dmtext-off="<?=$button['text2_off']?>"><?=$badgetext;?></span></div>
<? <?
if(is_array($button_switchar) && in_array($button['ctx'], $button_switchar)) { if(is_array($button_switchar) && in_array($button['ctx'], $button_switchar)) {
......
...@@ -120,7 +120,7 @@ function getPanelIO($table, $content, $websection, $activeonly=true, $where="",$ ...@@ -120,7 +120,7 @@ function getPanelIO($table, $content, $websection, $activeonly=true, $where="",$
{ {
$dom="ikap_dst"; $dom="ikap_dst";
$ljoin="actstatus on actions.id=actstatus.buttonid"; $ljoin="actstatus on actions.id=actstatus.buttonid";
$add="actstatus.status as status"; $add="actstatus.status as status, actstatus.status2 as status2";
} }
else // output else // output
{ {
......
...@@ -940,6 +940,11 @@ class domotikaService(service.Service): ...@@ -940,6 +940,11 @@ class domotikaService(service.Service):
f = open(trigger[5:].split()[0], "r") f = open(trigger[5:].split()[0], "r")
ret=defer.succeed(parseReturn(f.read(), reverse)) ret=defer.succeed(parseReturn(f.read(), reverse))
f.close() f.close()
if trigger.startswith("FILEEXISTS ") or trigger.startswith("FILEEXISTS:"):
if os.path.isfile(trigger[11:].split()[0]):
ret=defer.succeed(parseReturn('1', reverse))
else:
ret=defer.succeed(parseReturn('0', reverse))
elif trigger.startswith("SYSTEM ") or trigger.startswith("SYSTEM:"): elif trigger.startswith("SYSTEM ") or trigger.startswith("SYSTEM:"):
cmdline=trigger[7:] cmdline=trigger[7:]
ret=subprocess.Popen(cmdline.replace("\r\n", " "), ret=subprocess.Popen(cmdline.replace("\r\n", " "),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment