mirror of
https://github.com/opnsense/plugins.git
synced 2026-04-15 22:20:31 -04:00
sysutils/smart: fix coloring for themes; "s/\t/ /g"; cleanup php (#957)
This commit is contained in:
parent
80e04912a5
commit
f0d2a2edb0
2 changed files with 39 additions and 39 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,31 +1,31 @@
|
|||
<?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");
|
||||
|
|
@ -33,11 +33,11 @@ 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();
|
||||
|
|
@ -55,23 +55,23 @@ if (count($devs) > 0) {
|
|||
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; ?>"> <?php echo $dev_state_translated ?> </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 ?>"> <?= $dev_state_translated ?> </span></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue