mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
System hardware widget (#1117)
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
PLUGIN_NAME= dmidecode
|
||||
PLUGIN_VERSION= 0.1
|
||||
PLUGIN_COMMENT= System hardware widget
|
||||
PLUGIN_DEPENDS= dmidecode
|
||||
PLUGIN_MAINTAINER= evbevz@gmail.com
|
||||
PLUGIN_DEVEL= YES
|
||||
|
||||
.include "../../Mk/plugins.mk"
|
||||
@@ -0,0 +1 @@
|
||||
Dmidecode based system hardware widget for dashboard.
|
||||
@@ -0,0 +1,9 @@
|
||||
[system]
|
||||
command:/usr/local/sbin/dmidecode -q -t system | grep ':' | tr -d '\t' | awk -F: '{print $1" ="$2}' | grep 'Manufacturer\|Product\|Version\|Serial\|Family'
|
||||
parameters:
|
||||
type:script_output
|
||||
|
||||
[bios]
|
||||
command:/usr/local/sbin/dmidecode -q -t bios | grep ':' | tr -d '\t' | awk -F: '{print $1" ="$2}' | grep 'Vendor\|Version\|Release'
|
||||
parameters:
|
||||
type:script_output
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
$dmidecode_title = gettext('Hardware information (dmidecode)');
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019 Smart-Soft Ltd.
|
||||
* 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("widgets/include/dmidecode.inc");
|
||||
|
||||
$hardwareData = parse_ini_string(configd_run("dmidecode system"));
|
||||
$biosData = parse_ini_string(configd_run("dmidecode bios"));
|
||||
|
||||
?>
|
||||
|
||||
<table class="table table-striped table-condensed">
|
||||
<tbody>
|
||||
<tr><th colspan="2"><?=gettext("Platform");?></th></tr>
|
||||
<?php foreach($hardwareData as $key => $val) { ?>
|
||||
<tr>
|
||||
<td style="width: 30%;"><?=gettext($key);?></td>
|
||||
<td><?=html_safe($val);?></td>
|
||||
</tr>
|
||||
<? } ?>
|
||||
<tr><th colspan="2"><?=gettext("BIOS");?></th></tr>
|
||||
<?php foreach($biosData as $key => $val) { ?>
|
||||
<tr>
|
||||
<td style="width: 30%;"><?=gettext($key);?></td>
|
||||
<td><?=html_safe($val);?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
Reference in New Issue
Block a user