Skip to content

Commit

Permalink
sysutils/smart: fix coloring for themes; "s/\t/ /g"; cleanup php (#957)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianfrz authored and fichtner committed Nov 5, 2018
1 parent 80e0491 commit f0d2a2e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion sysutils/smart/Makefile
@@ -1,5 +1,5 @@
PLUGIN_NAME= smart
PLUGIN_VERSION= 1.4
PLUGIN_VERSION= 1.5
PLUGIN_COMMENT= SMART tools
PLUGIN_DEPENDS= smartmontools
PLUGIN_MAINTAINER= franco@opnsense.org
Expand Down
76 changes: 38 additions & 38 deletions sysutils/smart/src/www/widgets/widgets/smart_status.widget.php
@@ -1,43 +1,43 @@
<?php

/*
Copyright (C) 2014 Deciso B.V.
Copyright 2012 mkirbst @ pfSense Forum
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
* Copyright (C) 2014 Deciso B.V.
* Copyright 2012 mkirbst @ pfSense Forum
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

require_once("guiconfig.inc");
require_once("widgets/include/smart_status.inc");

?>

<table class="table table-striped" style="width:100%; border:0; cellpadding:0; cellspacing:0">
<tr>
<td class="widgetsubheader" style="text-align:center"><b><?php echo gettext("Drive") ?></b></td>
<td class="widgetsubheader" style="text-align:center"><b><?php echo gettext("Ident") ?></b></td>
<td class="widgetsubheader" style="text-align:center"><b><?php echo gettext("SMART Status") ?></b></td>
</tr>
<tr>
<td class="widgetsubheader" style="text-align:center"><b><?php echo gettext("Drive") ?></b></td>
<td class="widgetsubheader" style="text-align:center"><b><?php echo gettext("Ident") ?></b></td>
<td class="widgetsubheader" style="text-align:center"><b><?php echo gettext("SMART Status") ?></b></td>
</tr>

<?php
$devs = array();
Expand All @@ -55,23 +55,23 @@
case "PASSED":
case "OK":
$dev_state_translated = gettext('OK');
$color = "#90EE90";
$color = "success";
break;
case "":
$dev_state = "Unknown";
$dev_state_translated = gettext('Unknown');
$color = "#C0B788";
$color = "warning";
break;
default:
$color = "#F08080";
$color = "danger";
break;
}
?>
<tr>
<td class="listlr"><?php echo $dev; ?></td>
<td class="listr" style="text-align:center"><?php echo $dev_ident; ?></td>
<td class="listr" style="text-align:center"><span style="background-color:<?php echo $color; ?>">&nbsp;<?php echo $dev_state_translated ?>&nbsp;</span></td>
</tr>
<tr>
<td><?= $dev ?></td>
<td style="text-align:center"><?= $dev_ident ?></td>
<td style="text-align:center"><span class="label label-<?= $color ?>">&nbsp;<?= $dev_state_translated ?>&nbsp;</span></td>
</tr>
<?php
}
}
Expand Down

0 comments on commit f0d2a2e

Please sign in to comment.