Commit a163a50e authored by nextime's avatar nextime

gxv3175 gmi interface: base scheleton

parent 14d02200
<?
include_once("common_includes.php");
$buttonar_left=getPanelButtons($_DOMOTIKA['username'], "*","*","_grandstream_left", "dmdomain","true",7);
$buttonar_right=getPanelButtons($_DOMOTIKA['username'], "*","*","_grandstream_right", "dmdomain","true",7);
?>
<html>
<head>
<title>Domotika GMI Interface</title>
<link rel="stylesheet" href="/resources/pure/pure-nr-min.css">
<link rel="stylesheet" href="/resources/fontawesome/css/font-awesome.min.css">
<link href='style.css' type='text/css' rel='stylesheet'>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!--
<script src="/resources/js/sockjs-0.3.min.js" ></script>
<script src="/resources/js/ajaxsocket.js" ></script>
-->
<script src="/resources/js/jquery-1.9.0.min.js"></script>
<script src="/resources/EventSource/eventsource.js"></script>
<script language="javascript" src="simpleGMI.js"></script>
<style>
#antani {
top: 100px;
left: 50px;
}
</style>
<script type="text/javascript">
simpleGMI.fullScreen();
function sarca(data)
......@@ -18,29 +25,82 @@ function sarca(data)
alert(data);
}
setInterval(function(){
simpleGMI.post('http://admin:domotika@q.unixmedia.net/domotika/gmi/style.css', 'aaa=sarca', sarca);
simpleGMI.post('http://q.unixmedia.net/domotika/gmi/style.css', 'aaa=sarca', sarca);
}, 5000);
</script>
</head>
<body>
<div class="pure-g">
<div class="pure-u-1-3">
<button class="pure-button pure-button-primary" onclick="simpleGMI.refresh()">REFRESH</button>
<div class="pure-g" >
<div class="pure-u-1-3" style="padding-left:1.3333%;">
<?
foreach($buttonar_left as $but) {
?>
<div style="padding:5px;">
<button class="pure-button pure-button-primary" style="width:100%;height:50px;" onclick="simpleGMI.refresh()"><?=$but['button_name']?></button>
</div>
<?
}
?>
</div>
<div class="pure-u-1-3">
<div class="pure-u-1-3" style="width:31%">
<div style="padding:5px;">
<button class="pure-button pure-button-primary" style="width:100%;height:130px;" onclick="simpleGMI.refresh()">test</button>
</div>
<div style="height:80px" onclick="simpleGMI.refresh()">
</div>
<div style="padding:5px;display:none">
<img src="https://192.168.4.45/enu/camera320x240.jpg" style="width:100%;height:190px" onclick="simpleGMI.refresh()"></img>
</div>
<div style="padding:5px;">
<div class="pure-g">
<div class="pure-u-1-3" >
<button class="pure-button"><h1>15</h1></button>
</div>
<div class="pure-u-1-3" style="width:28%">
<button class="pure-button"><h1>:</h1></button>
</div>
<div class="pure-u-1-3" >
<button class="pure-button"><h1>15</h1></button>
</div>
</div>
</div>
</div>
<div class="pure-u-1-3" style="float:right">
<button class="pure-button pure-button-primary" onclick="simpleGMI.refresh()">REFRESH</button>
<div class="pure-u-1-3" >
<?
foreach($buttonar_right as $but) {
?>
<div style="padding:5px;">
<button class="pure-button pure-button-primary" style="width:100%;height:50px;" onclick="simpleGMI.refresh()"><?=$but['button_name']?></button>
</div>
<?
}
?>
</div>
</div>
<div class="footer-bar">
<button onClick="simpleGMI.dial(0, 0, 0, 281, '', 1)" class="pure-button pure-button-secondary">
<img src="img/microphone-little.png"></img>
<i class="fa fa-microphone fa-2x blackiconcolor"></i>
</button>
<span> STATUS: DEFAULT</span>
<button onClick="simpleGMI.refresh()" class="pure-button pure-button-secondary" style="float:right">
<i class="fa fa-refresh fa-2x fa-spin blackiconcolor"></i>
</button>
</div>
<script>
var es = new EventSource("/sse");
var syncReceived = function(event) {
var res=$.parseJSON(event.data);
$.each(res.data.statuses, function(idx, val){
// alert(val[3]);
});
}
es.addEventListener("sync", syncReceived);
</script>
</body>
</html>
......@@ -4,6 +4,8 @@ body {
font-color: #FFF;
}
.blackiconcolor {color:black;}
.footer-bar {
position: fixed;
bottom: 0;
......
......@@ -96,210 +96,5 @@ function notifyListItem()
return $ret;
}
function getPanelIO($table, $content, $websection, $activeonly=true, $where="",$orderby="")
{
if($table=='input')
{
$dom="inpname";
$ljoin="inpstatus on input.id=inpstatus.buttonid";
$add="inpstatus.status as status";
}
elseif($table=='analog')
{
$dom="ananame";
$ljoin="anastatus on analog.id=anastatus.buttonid";
$add="anastatus.status as status";
}
elseif($table=="relay")
{
$add="relstatus.status as status,relstatus.ampere as ampere";
$dom="domain";
$ljoin="relstatus on relay.id=relstatus.buttonid";
}
elseif($table=='actions')
{
$dom="ikap_dst";
$ljoin="actstatus on actions.id=actstatus.buttonid";
$add="actstatus.status as status, actstatus.status2 as status2";
}
else // output
{
$add="";
$ljoin="";
$dom="domain";
}
$sqlquery="SELECT $table.*,'$table' as devtype";
if($add!="")
$sqlquery.=",$add";
$sqlquery.=" FROM $table";
if($ljoin!="")
$sqlquery.=" LEFT JOIN ".$ljoin;
if($websection!="*" || $content!="" || $activeonly || $where)
$sqlquery.=" WHERE";
if($websection!="*")
{
$wbss=explode(',',str_replace('DMDOMAIN:','',$websection));
if(count($wbss)>1)
{
}
if(startsWith($websection, 'DMDOMAIN:'))
{
if(count($wbss)>1)
{
$sqlquery.=" (";
$wbstart=TRUE;
foreach($wbss as $wbs)
{
if($wbstart==TRUE)
$wbstart=FALSE;
else
$sqlquery.=" OR ";
$sqlquery.=" DMDOMAIN(websection, '".$wbs."')=1";
}
$sqlquery.=" )";
}
else
$sqlquery.=" DMDOMAIN(websection, '".str_replace('DMDOMAIN:','',$websection)."')=1";
}
else
{
if(count($wbss)>1)
{
$sqlquery.=" websection IN (";
$wbstart=TRUE;
foreach($wbss as $wbs)
{
if($wbstart==TRUE)
$wbstart=FALSE;
else
$sqlquery.=",";
$sqlquery.="'".$wbs."'";
}
$sqlquery.=")";
}
else
$sqlquery.=" websection='".$websection."'";
}
}
if($websection!="*" && $activeonly)
$sqlquery.=" AND";
if($activeonly)
$sqlquery.=" active>0";
if(($websection!="*" || $activeonly) && $content!="")
$sqlquery.=" AND";
if($content!="")
{
$dmds=explode(',',$content);
if(count($dmds)<2)
$sqlquery.=" DMDOMAIN($table.$dom, '".$content."')=1";
else
{
$sqlquery.=" (";
$dmstart=TRUE;
foreach($dmds as $dmd)
{
if($dmstart==TRUE)
$dmstart=FALSE;
else
$sqlquery.=" OR ";
$sqlquery.=" DMDOMAIN($table.$dom, '".$dmd."')=1";
}
$sqlquery.=" )";
}
}
if(($websection!="*" || $activeonly || $content!="") && $where!="")
$sqlquery.=" AND";
if($where!="")
$sqlquery.=" ".$where;
if($orderby=="")
$sqlquery.=" ORDER by position,button_name ASC";
else
$sqlquery.=" ORDER by $orderby";
//print_r($sqlquery."\n");
$ret=DB::query($sqlquery);
if($table=="output")
{
foreach($ret as $k => $row)
{
$ret[$k]['relays'] = array();
$ret[$k]['pwms'] = array();
$ret[$k]['inputs'] = array();
$ret[$k]['analogs'] = array();
if(intval($row['has_relays'])>0) {
$ret[$k]['relays'] = getPanelIO('relay', $ret[$k]['domain'], $websection, $activeonly,
"relay.board_ip='".$row['board_ip']."' AND relay.outnum='".$row['outnum']."' and relay.outtype='".$row['outtype']."'",
"position,button_name");
}
if(intval($row['has_pwms'])>0) {
$ret[$k]['pwms'] = array();
}
$wheredomain_inp="(DMDOMAIN(input.inpname, '".$ret[$k]['domain']."')=1";
$wheredomain_ana="(DMDOMAIN(analog.ananame, '".$ret[$k]['domain']."')=1";
if(strlen($ret[$k]['domain'])<=28) {
$wheredomain_inp.=" OR DMDOMAIN(input.inpname, '".$ret[$k]['domain'].".[*]')=1";
$wheredomain_ana.=" OR DMDOMAIN(analog.ananame, '".$ret[$k]['domain'].".[*]')=1";
}
elseif(strlen($ret[$k]['domain'])<=30) {
$wheredomain_inp.=" OR DMDOMAIN(input.inpname, '".$ret[$k]['domain'].".*')=1";
$wheredomain_ana.=" OR DMDOMAIN(analog.ananame, '".$ret[$k]['domain'].".*')=1";
}
$wheredomain_inp.=")";
$wheredomain_ana.=")";
$ret[$k]['inputs'] = getPanelIO('input', "", "*", $activeonly,
$wheredomain_inp, "id");
$ret[$k]['analogs'] = getPanelIO('analog', "", "*", $activeonly,
$wheredomain_ana, "id");
}
}
//print_r($ret);
return $ret;
}
function getPanelActions($table, $content, $websection, $activeonly=true)
{
$sqlquery="SELECT $table.*,'$table' as devtype,$add FROM $table";
}
function getPanelButtons($user, $content, $sections="*", $websection="*", $selector='dmdomain',$activeonly=true)
{
$buts=array();
$sectar=explode(",",str_replace(" ","",$sections));
if($selector=="dmdomain")
{
foreach($sectar as $sect)
{
$res=array();
switch($sect)
{
case "relay":
$res=getPanelIO("relay",$content, $websection, $activeonly);
$buts=$buts+$res;
break;
case "input":
$res=getPanelIO("input", $content, $websection, $activeonly);
$buts=$buts+$res;
break;
case "analog":
$res=getPanelIO("analog", $content, $websection, $activeonly);
$buts=$buts+$res;
break;
case "output":
$res=getPanelIO("output",$content, $websection, $activeonly);
$buts=$buts+$res;
break;
case "actions":
$res=getPanelIO("actions",$content, $websection, $activeonly);
$buts=$buts+$res;
break;
}
}
}
return $buts;
}
?>
......@@ -15,8 +15,6 @@ include_once("include.php");
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<script src="/resources/js/jquery-1.9.0.min.js" type="text/javascript" ></script>
<script src="/resources/js/jquery-migrate-1.0.0.min.js" type="text/javascript" ></script>
<script src="/resources/js/sockjs-0.3.min.js" ></script>
<script src="/resources/js/ajaxsocket.js" ></script>
<style>
</style>
</head>
......
......@@ -5,8 +5,8 @@ require_once("config.inc.php");
require_once("constants.php");
require_once("meekrodb.php");
require_once("conn.php");
require_once("libraries.php");
require_once("helpers.php");
require_once("libraries.php");
define("DOMOTIKA", true);
if(startsWith($_SERVER['SCRIPT_FILENAME'], DOMOTIKAD_HTTPPATH)) {
if(file_exists(DOMOTIKAD_HTTPPATH."includes/common.php"))
......
......@@ -87,4 +87,218 @@ function getSectionElements($section, $table='relay', $activeonly=true) {
return DB::query($query);
}
/* NEW FUNCTIONS */
function getPanelIO($table, $content, $websection, $activeonly=true, $where="",$orderby="", $limit="")
{
if($table=='input')
{
$dom="inpname";
$ljoin="inpstatus on input.id=inpstatus.buttonid";
$add="inpstatus.status as status";
}
elseif($table=='analog')
{
$dom="ananame";
$ljoin="anastatus on analog.id=anastatus.buttonid";
$add="anastatus.status as status";
}
elseif($table=="relay")
{
$add="relstatus.status as status,relstatus.ampere as ampere";
$dom="domain";
$ljoin="relstatus on relay.id=relstatus.buttonid";
}
elseif($table=='actions')
{
$dom="ikap_dst";
$ljoin="actstatus on actions.id=actstatus.buttonid";
$add="actstatus.status as status, actstatus.status2 as status2";
}
else // output
{
$add="";
$ljoin="";
$dom="domain";
}
$sqlquery="SELECT $table.*,'$table' as devtype";
if($add!="")
$sqlquery.=",$add";
$sqlquery.=" FROM $table";
if($ljoin!="")
$sqlquery.=" LEFT JOIN ".$ljoin;
if($websection!="*" || $content!="" || $activeonly || $where)
$sqlquery.=" WHERE";
if($websection!="*")
{
$wbss=explode(',',str_replace('DMDOMAIN:','',$websection));
if(count($wbss)>1)
{
}
if(startsWith($websection, 'DMDOMAIN:'))
{
if(count($wbss)>1)
{
$sqlquery.=" (";
$wbstart=TRUE;
foreach($wbss as $wbs)
{
if($wbstart==TRUE)
$wbstart=FALSE;
else
$sqlquery.=" OR ";
$sqlquery.=" DMDOMAIN(websection, '".$wbs."')=1";
}
$sqlquery.=" )";
}
else
$sqlquery.=" DMDOMAIN(websection, '".str_replace('DMDOMAIN:','',$websection)."')=1";
}
else
{
if(count($wbss)>1)
{
$sqlquery.=" websection IN (";
$wbstart=TRUE;
foreach($wbss as $wbs)
{
if($wbstart==TRUE)
$wbstart=FALSE;
else
$sqlquery.=",";
$sqlquery.="'".$wbs."'";
}
$sqlquery.=")";
}
else
$sqlquery.=" websection='".$websection."'";
}
}
if($websection!="*" && $activeonly)
$sqlquery.=" AND";
if($activeonly)
$sqlquery.=" active>0";
if(($websection!="*" || $activeonly) && $content!="")
$sqlquery.=" AND";
if($content!="")
{
$dmds=explode(',',$content);
if(count($dmds)<2)
$sqlquery.=" DMDOMAIN($table.$dom, '".$content."')=1";
else
{
$sqlquery.=" (";
$dmstart=TRUE;
foreach($dmds as $dmd)
{
if($dmstart==TRUE)
$dmstart=FALSE;
else
$sqlquery.=" OR ";
$sqlquery.=" DMDOMAIN($table.$dom, '".$dmd."')=1";
}
$sqlquery.=" )";
}
}
if(($websection!="*" || $activeonly || $content!="") && $where!="")
$sqlquery.=" AND";
if($where!="")
$sqlquery.=" ".$where;
if($orderby=="")
$sqlquery.=" ORDER by position,button_name ASC";
else
$sqlquery.=" ORDER by $orderby";
if($limit!="")
$sqlquery.=" LIMIT ".intval($limit);
//print_r($sqlquery."\n");
$ret=DB::query($sqlquery);
if($table=="output")
{
foreach($ret as $k => $row)
{
$ret[$k]['relays'] = array();
$ret[$k]['pwms'] = array();
$ret[$k]['inputs'] = array();
$ret[$k]['analogs'] = array();
if(intval($row['has_relays'])>0) {
$ret[$k]['relays'] = getPanelIO('relay', $ret[$k]['domain'], $websection, $activeonly,
"relay.board_ip='".$row['board_ip']."' AND relay.outnum='".$row['outnum']."' and relay.outtype='".$row['outtype']."'",
"position,button_name");
}
if(intval($row['has_pwms'])>0) {
$ret[$k]['pwms'] = array();
}
$wheredomain_inp="(DMDOMAIN(input.inpname, '".$ret[$k]['domain']."')=1";
$wheredomain_ana="(DMDOMAIN(analog.ananame, '".$ret[$k]['domain']."')=1";
if(strlen($ret[$k]['domain'])<=28) {
$wheredomain_inp.=" OR DMDOMAIN(input.inpname, '".$ret[$k]['domain'].".[*]')=1";
$wheredomain_ana.=" OR DMDOMAIN(analog.ananame, '".$ret[$k]['domain'].".[*]')=1";
}
elseif(strlen($ret[$k]['domain'])<=30) {
$wheredomain_inp.=" OR DMDOMAIN(input.inpname, '".$ret[$k]['domain'].".*')=1";
$wheredomain_ana.=" OR DMDOMAIN(analog.ananame, '".$ret[$k]['domain'].".*')=1";
}
$wheredomain_inp.=")";
$wheredomain_ana.=")";
$ret[$k]['inputs'] = getPanelIO('input', "", "*", $activeonly,
$wheredomain_inp, "id", $limit);
$ret[$k]['analogs'] = getPanelIO('analog', "", "*", $activeonly,
$wheredomain_ana, "id", $limit);
}
}
//print_r($ret);
return $ret;
}
function getPanelActions($table, $content, $websection, $activeonly=true)
{
$sqlquery="SELECT $table.*,'$table' as devtype,$add FROM $table";
}
function getPanelButtons($user, $content, $sections="*", $websection="*", $selector='dmdomain',$activeonly=true, $limit="")
{
$buts=array();
if($sections=='*') {
$sectar=array('relay','input','analog','output','actions');
} else {
$sectar=explode(",",str_replace(" ","",$sections));
}
if($selector=="dmdomain")
{
foreach($sectar as $sect)
{
$res=array();
switch($sect)
{
case "relay":
$res=getPanelIO("relay",$content, $websection, $activeonly, "", "", $limit);
$buts=$buts+$res;
break;
case "input":
$res=getPanelIO("input", $content, $websection, $activeonly, "", "", $limit);
$buts=$buts+$res;
break;
case "analog":
$res=getPanelIO("analog", $content, $websection, $activeonly, "", "", $limit);
$buts=$buts+$res;
break;
case "output":
$res=getPanelIO("output",$content, $websection, $activeonly, "", "", $limit);
$buts=$buts+$res;
break;
case "actions":
$res=getPanelIO("actions",$content, $websection, $activeonly, "", "", $limit);
$buts=$buts+$res;
break;
}
}
}
return $buts;
}
?>
This diff is collapsed.
This diff is collapsed.
File added
File added
This source diff could not be displayed because it is too large. You can view the blob instead.
File added
File added
// Bordered & Pulled
// -------------------------
.@{fa-css-prefix}-border {
padding: .2em .25em .15em;
border: solid .08em @fa-border-color;
border-radius: .1em;
}
.pull-right { float: right; }
.pull-left { float: left; }
.@{fa-css-prefix} {
&.pull-left { margin-right: .3em; }
&.pull-right { margin-left: .3em; }
}
// Base Class Definition
// -------------------------
.@{fa-css-prefix} {
display: inline-block;
font-family: FontAwesome;
font-style: normal;
font-weight: normal;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
// Fixed Width Icons
// -------------------------
.@{fa-css-prefix}-fw {
width: (18em / 14);
text-align: center;
}
/*!
* Font Awesome 4.0.3 by @davegandy - http://fontawesome.io - @fontawesome
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
*/
@import "variables";
@import "mixins";
@import "path";
@import "core";
@import "larger";
@import "fixed-width";
@import "list";
@import "bordered-pulled";
@import "spinning";
@import "rotated-flipped";
@import "stacked";
@import "icons";
This diff is collapsed.
// Icon Sizes
// -------------------------
/* makes the font 33% larger relative to the icon container */
.@{fa-css-prefix}-lg {
font-size: (4em / 3);
line-height: (3em / 4);
vertical-align: -15%;
}
.@{fa-css-prefix}-2x { font-size: 2em; }
.@{fa-css-prefix}-3x { font-size: 3em; }
.@{fa-css-prefix}-4x { font-size: 4em; }
.@{fa-css-prefix}-5x { font-size: 5em; }
// List Icons
// -------------------------
.@{fa-css-prefix}-ul {
padding-left: 0;
margin-left: @fa-li-width;
list-style-type: none;
> li { position: relative; }
}
.@{fa-css-prefix}-li {
position: absolute;
left: -@fa-li-width;
width: @fa-li-width;
top: (2em / 14);
text-align: center;
&.@{fa-css-prefix}-lg {
left: -@fa-li-width + (4em / 14);
}
}
// Mixins
// --------------------------
.fa-icon-rotate(@degrees, @rotation) {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation);
-webkit-transform: rotate(@degrees);
-moz-transform: rotate(@degrees);
-ms-transform: rotate(@degrees);
-o-transform: rotate(@degrees);
transform: rotate(@degrees);
}
.fa-icon-flip(@horiz, @vert, @rotation) {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation, mirror=1);
-webkit-transform: scale(@horiz, @vert);
-moz-transform: scale(@horiz, @vert);
-ms-transform: scale(@horiz, @vert);
-o-transform: scale(@horiz, @vert);
transform: scale(@horiz, @vert);
}
/* FONT PATH
* -------------------------- */
@font-face {
font-family: 'FontAwesome';
src: url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}');
src: url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype'),
url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff'),
url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype'),
url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg');
// src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts
font-weight: normal;
font-style: normal;
}
// Rotated & Flipped Icons
// -------------------------
.@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); }
.@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); }
.@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); }
.@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); }
.@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); }
// Spinning Icons
// --------------------------
.@{fa-css-prefix}-spin {
-webkit-animation: spin 2s infinite linear;
-moz-animation: spin 2s infinite linear;
-o-animation: spin 2s infinite linear;
animation: spin 2s infinite linear;
}
@-moz-keyframes spin {
0% { -moz-transform: rotate(0deg); }
100% { -moz-transform: rotate(359deg); }
}
@-webkit-keyframes spin {
0% { -webkit-transform: rotate(0deg); }
100% { -webkit-transform: rotate(359deg); }
}
@-o-keyframes spin {
0% { -o-transform: rotate(0deg); }
100% { -o-transform: rotate(359deg); }
}
@-ms-keyframes spin {
0% { -ms-transform: rotate(0deg); }
100% { -ms-transform: rotate(359deg); }
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(359deg); }
}
// Stacked Icons
// -------------------------
.@{fa-css-prefix}-stack {
position: relative;
display: inline-block;
width: 2em;
height: 2em;
line-height: 2em;
vertical-align: middle;
}
.@{fa-css-prefix}-stack-1x, .@{fa-css-prefix}-stack-2x {
position: absolute;
left: 0;
width: 100%;
text-align: center;
}
.@{fa-css-prefix}-stack-1x { line-height: inherit; }
.@{fa-css-prefix}-stack-2x { font-size: 2em; }
.@{fa-css-prefix}-inverse { color: @fa-inverse; }
This diff is collapsed.
// Bordered & Pulled
// -------------------------
.#{$fa-css-prefix}-border {
padding: .2em .25em .15em;
border: solid .08em $fa-border-color;
border-radius: .1em;
}
.pull-right { float: right; }
.pull-left { float: left; }
.#{$fa-css-prefix} {
&.pull-left { margin-right: .3em; }
&.pull-right { margin-left: .3em; }
}
// Base Class Definition
// -------------------------
.#{$fa-css-prefix} {
display: inline-block;
font-family: FontAwesome;
font-style: normal;
font-weight: normal;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
// Fixed Width Icons
// -------------------------
.#{$fa-css-prefix}-fw {
width: (18em / 14);
text-align: center;
}
This diff is collapsed.
// Icon Sizes
// -------------------------
/* makes the font 33% larger relative to the icon container */
.#{$fa-css-prefix}-lg {
font-size: (4em / 3);
line-height: (3em / 4);
vertical-align: -15%;
}
.#{$fa-css-prefix}-2x { font-size: 2em; }
.#{$fa-css-prefix}-3x { font-size: 3em; }
.#{$fa-css-prefix}-4x { font-size: 4em; }
.#{$fa-css-prefix}-5x { font-size: 5em; }
// List Icons
// -------------------------
.#{$fa-css-prefix}-ul {
padding-left: 0;
margin-left: $fa-li-width;
list-style-type: none;
> li { position: relative; }
}
.#{$fa-css-prefix}-li {
position: absolute;
left: -$fa-li-width;
width: $fa-li-width;
top: (2em / 14);
text-align: center;
&.#{$fa-css-prefix}-lg {
left: -$fa-li-width + (4em / 14);
}
}
// Mixins
// --------------------------
@mixin fa-icon-rotate($degrees, $rotation) {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=$rotation);
-webkit-transform: rotate($degrees);
-moz-transform: rotate($degrees);
-ms-transform: rotate($degrees);
-o-transform: rotate($degrees);
transform: rotate($degrees);
}
@mixin fa-icon-flip($horiz, $vert, $rotation) {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=$rotation);
-webkit-transform: scale($horiz, $vert);
-moz-transform: scale($horiz, $vert);
-ms-transform: scale($horiz, $vert);
-o-transform: scale($horiz, $vert);
transform: scale($horiz, $vert);
}
/* FONT PATH
* -------------------------- */
@font-face {
font-family: 'FontAwesome';
src: url('#{$fa-font-path}/fontawesome-webfont.eot?v=#{$fa-version}');
src: url('#{$fa-font-path}/fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'),
url('#{$fa-font-path}/fontawesome-webfont.woff?v=#{$fa-version}') format('woff'),
url('#{$fa-font-path}/fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'),
url('#{$fa-font-path}/fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg');
//src: url('#{$fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts
font-weight: normal;
font-style: normal;
}
// Rotated & Flipped Icons
// -------------------------
.#{$fa-css-prefix}-rotate-90 { @include fa-icon-rotate(90deg, 1); }
.#{$fa-css-prefix}-rotate-180 { @include fa-icon-rotate(180deg, 2); }
.#{$fa-css-prefix}-rotate-270 { @include fa-icon-rotate(270deg, 3); }
.#{$fa-css-prefix}-flip-horizontal { @include fa-icon-flip(-1, 1, 0); }
.#{$fa-css-prefix}-flip-vertical { @include fa-icon-flip(1, -1, 2); }
// Spinning Icons
// --------------------------
.#{$fa-css-prefix}-spin {
-webkit-animation: spin 2s infinite linear;
-moz-animation: spin 2s infinite linear;
-o-animation: spin 2s infinite linear;
animation: spin 2s infinite linear;
}
@-moz-keyframes spin {
0% { -moz-transform: rotate(0deg); }
100% { -moz-transform: rotate(359deg); }
}
@-webkit-keyframes spin {
0% { -webkit-transform: rotate(0deg); }
100% { -webkit-transform: rotate(359deg); }
}
@-o-keyframes spin {
0% { -o-transform: rotate(0deg); }
100% { -o-transform: rotate(359deg); }
}
@-ms-keyframes spin {
0% { -ms-transform: rotate(0deg); }
100% { -ms-transform: rotate(359deg); }
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(359deg); }
}
// Stacked Icons
// -------------------------
.#{$fa-css-prefix}-stack {
position: relative;
display: inline-block;
width: 2em;
height: 2em;
line-height: 2em;
vertical-align: middle;
}
.#{$fa-css-prefix}-stack-1x, .#{$fa-css-prefix}-stack-2x {
position: absolute;
left: 0;
width: 100%;
text-align: center;
}
.#{$fa-css-prefix}-stack-1x { line-height: inherit; }
.#{$fa-css-prefix}-stack-2x { font-size: 2em; }
.#{$fa-css-prefix}-inverse { color: $fa-inverse; }
This diff is collapsed.
/*!
* Font Awesome 4.0.3 by @davegandy - http://fontawesome.io - @fontawesome
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
*/
@import "variables";
@import "mixins";
@import "path";
@import "core";
@import "larger";
@import "fixed-width";
@import "list";
@import "bordered-pulled";
@import "spinning";
@import "rotated-flipped";
@import "stacked";
@import "icons";
......@@ -124,7 +124,7 @@ class domotikaService(service.Service):
actstatusremain = 0
actionloops={}
lastsync=0.0
lastSSEsync=0.0
lastCLIENTSync=0.0
boardconfigchanged = False
upnp_detected_ips=[]
udp=False
......@@ -225,21 +225,21 @@ class domotikaService(service.Service):
def startClientsSync(self):
self.lastsync=float(time.time())
self.lastSSEsync=self.lastsync
self.lastCLIENTSync=self.lastsync
t = task.LoopingCall(self.clientsSync)
t.start(0.5)
def updateDaemonStatus(self, status='normal'):
self.daemonstatus=status
self.sseSend('daemonstatus', self.daemonstatus)
self.clientSend('daemonstatus', self.daemonstatus)
def clientsSync(self):
def _clientSend(res, ts):
#log.info(res)
if res and len(res) > 0:
log.debug("Sending SSE Sync "+str({'lastupdate': ts, 'statuses': res}))
self.lastSSEsync=ts
self.sseSend('sync', {'lastupdate': ts, 'statuses': res})
log.debug("Sending CLIENT Sync "+str({'lastupdate': ts, 'statuses': res}))
self.lastCLIENTSync=ts
self.clientSend('sync', {'lastupdate': ts, 'statuses': res})
ts=self.lastsync
self.lastsync=float(time.time())
#log.info(str(ts)+" "+str(self.lastsync))
......@@ -1208,12 +1208,12 @@ class domotikaService(service.Service):
for c in self.clients.getAll():
try:
if c['session'].mind.perms.username==username:
c['session'].sse.sendJSON(event='notify', data={'msg':msg,'nid':res.id,'source':res.source})
self.clientSend('notify',{'msg':msg,'nid':res.id,'source':res.source})
except:
pass
dmdb.insertNotify(nsource, username, msg, expiretime).addCallback(_inserted)
def sseSend(self, event, data):
def clientSend(self, event, data):
for c in self.clients.getAll():
try:
#if not 'ts' in data.keys():
......
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