Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sysutils/smart: fix coloring for themes; "s/\t/ /g"; cleanup php #957

Merged
merged 5 commits into from Nov 5, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
67 changes: 34 additions & 33 deletions sysutils/smart/src/www/widgets/widgets/smart_status.widget.php
@@ -1,30 +1,31 @@
<?php

/*
Copyright (C) 2014 Deciso B.V.
Copyright 2012 mkirbst @ pfSense Forum
All rights reserved.
Copyright (C) 2018 Fabian Franz
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok if you want to reformat, but use " * " indent

Copy link
Member

@fichtner fichtner Nov 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, I have to reject this: checked file history and reformatting does not warrant copyright even if it is done cleverly. no substantial changes in this particular file of the code implementation.

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
fabianfrz marked this conversation as resolved.
Show resolved Hide resolved
modification, are permitted provided that the following conditions are met:
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.
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.
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.
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");
Expand All @@ -33,11 +34,11 @@
?>

<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 +56,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 class="listlr"><?= $dev ?></td>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

listlr and listr can be removed

<td class="listr" style="text-align:center"><?= $dev_ident ?></td>
<td class="listr" style="text-align:center"><span class="label label-<?= $color ?>">&nbsp;<?= $dev_state_translated ?>&nbsp;</span></td>
</tr>
<?php
}
}
Expand Down