-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
772 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
define("IP_INTERFACE", "interface"); | ||
|
||
function _ip(array $opts) { | ||
$ip = exec("ifconfig {$opts['interface']} | awk '/inet addr/{print substr($2,6)}'"); | ||
$attr = [ | ||
'class' => 'network', | ||
'status' => (!!$ip)?'up':'down' | ||
]; | ||
return panel($ip, $attr, 'ip'); | ||
} | ||
module("ip", "Show the IP of a network device"); | ||
option("interface", IP_INTERFACE, "string", "The interface to dispaly", "eth0"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
define("TIME_FORMAT", "format"); | ||
define("TIME_CLASS", "class"); | ||
define("TIME_ANALOG", "analog"); | ||
|
||
function _time(array $opts) { | ||
$attr = []; | ||
if ($opts[TIME_ANALOG]) { | ||
$analog = [ '🕛','🕧','🕐','🕜','🕑','🕝','🕒','🕞','🕓','🕟','🕔','🕠','🕕','🕡','🕖','🕢','🕗','🕣','🕘','🕤','🕙','🕥','🕚','🕦' ]; | ||
$hour = (int)date('h'); $minute = (int)date('i'); $ti = $hour * 2 + ($minute>30?1:0); | ||
$time = $analog[$ti%24]." "; | ||
} else { | ||
$time = null; | ||
} | ||
if ($opts[TIME_CLASS]) $attr['class'] = $opts[TIME_CLASS]; | ||
return panel($time.@date($opts['format']), $attr, 'time'); | ||
} | ||
module("time", "Show the current time and/or date"); | ||
option("format", TIME_FORMAT, OPT_TYPE_STRING, "The time format", "H:i"); | ||
option("class", TIME_CLASS, OPT_TYPE_STRING, "The class to use", "info"); | ||
option("analog", TIME_ANALOG, OPT_TYPE_BOOL, "Show an analog watch", false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
* { | ||
background: blue; | ||
color: white; | ||
pad-before: 1; | ||
pad-after: 1; | ||
} | ||
|
||
vcs { | ||
background: bright-blue; | ||
} | ||
|
||
.system .info { | ||
background: bright-blue; | ||
color: bright-white; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters