mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Convert About page to Laravel (#10551)
* Convert About page to laravel * clean up callback stuff * More translatable strings
This commit is contained in:
@@ -74,4 +74,18 @@ class Version
|
||||
{
|
||||
return rtrim(shell_exec('git describe --tags 2>/dev/null'));
|
||||
}
|
||||
|
||||
public function gitChangelog()
|
||||
{
|
||||
if ($this->is_git_install) {
|
||||
return shell_exec('git log -10');
|
||||
}
|
||||
}
|
||||
|
||||
public function gitDate()
|
||||
{
|
||||
if ($this->is_git_install) {
|
||||
return shell_exec("git show --pretty='%ct' --no-patch HEAD");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
105
app/Http/Controllers/AboutController.php
Normal file
105
app/Http/Controllers/AboutController.php
Normal file
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
/**
|
||||
* AboutController.php
|
||||
*
|
||||
* -Description-
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @package LibreNMS
|
||||
* @link http://librenms.org
|
||||
* @copyright 2018 Tony Murray
|
||||
* @author Tony Murray <murraytony@gmail.com>
|
||||
*/
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Application;
|
||||
use App\Models\Callback;
|
||||
use App\Models\Device;
|
||||
use App\Models\DiskIo;
|
||||
use App\Models\EntPhysical;
|
||||
use App\Models\Eventlog;
|
||||
use App\Models\HrDevice;
|
||||
use App\Models\Ipv4Address;
|
||||
use App\Models\Ipv4Network;
|
||||
use App\Models\Ipv6Address;
|
||||
use App\Models\Ipv6Network;
|
||||
use App\Models\Mempool;
|
||||
use App\Models\Port;
|
||||
use App\Models\Processor;
|
||||
use App\Models\Pseudowire;
|
||||
use App\Models\Sensor;
|
||||
use App\Models\Service;
|
||||
use App\Models\Storage;
|
||||
use App\Models\Syslog;
|
||||
use App\Models\Toner;
|
||||
use App\Models\Vlan;
|
||||
use App\Models\Vrf;
|
||||
use App\Models\WirelessSensor;
|
||||
use DB;
|
||||
use Illuminate\Http\Request;
|
||||
use LibreNMS\Config;
|
||||
use LibreNMS\Util\Version;
|
||||
|
||||
class AboutController extends Controller
|
||||
{
|
||||
public function index(Request $request)
|
||||
{
|
||||
$callback_status = Callback::get('enabled') === '1';
|
||||
$version = Version::get();
|
||||
|
||||
return view('about.index', [
|
||||
'callback_status' => $callback_status,
|
||||
'callback_uuid' => $callback_status ? Callback::get('uuid') : null,
|
||||
|
||||
'db_schema' => vsprintf('%s (%s)', $version->database()),
|
||||
'git_log' => $version->gitChangelog(),
|
||||
'git_date' => $version->gitDate(),
|
||||
'project_name' => Config::get('project_name'),
|
||||
|
||||
'version_local' => $version->local(),
|
||||
'version_mysql' => current(DB::selectOne('select version()')),
|
||||
'version_php' => phpversion(),
|
||||
'version_webserver' => $request->server('SERVER_SOFTWARE'),
|
||||
'version_rrdtool' => str_replace('1.7.01.7.0', '1.7.0', implode(' ', array_slice(explode(' ', shell_exec(
|
||||
Config::get('rrdtool', 'rrdtool') . ' --version | head -n1'
|
||||
)), 1, 1))),
|
||||
'version_netsnmp' => str_replace('version: ', '', rtrim(shell_exec(Config::get('snmpget', 'snmpget') . ' -V 2>&1'))),
|
||||
|
||||
'stat_apps' => Application::count(),
|
||||
'stat_devices' => Device::count(),
|
||||
'stat_diskio' => DiskIo::count(),
|
||||
'stat_entphys' => EntPhysical::count(),
|
||||
'stat_events' => Eventlog::count(),
|
||||
'stat_hrdev' => HrDevice::count(),
|
||||
'stat_ipv4_addy' => Ipv4Address::count(),
|
||||
'stat_ipv4_nets' => Ipv4Network::count(),
|
||||
'stat_ipv6_addy' => Ipv6Address::count(),
|
||||
'stat_ipv6_nets' => Ipv6Network::count(),
|
||||
'stat_memory' => Mempool::count(),
|
||||
'stat_ports' => Port::count(),
|
||||
'stat_processors' => Processor::count(),
|
||||
'stat_pw' => Pseudowire::count(),
|
||||
'stat_sensors' => Sensor::count(),
|
||||
'stat_services' => Service::count(),
|
||||
'stat_storage' => Storage::count(),
|
||||
'stat_syslog' => Syslog::count(),
|
||||
'stat_toner' => Toner::count(),
|
||||
'stat_vlans' => Vlan::count(),
|
||||
'stat_vrf' => Vrf::count(),
|
||||
'stat_wireless' => WirelessSensor::count(),
|
||||
]);
|
||||
}
|
||||
}
|
46
app/Models/Callback.php
Normal file
46
app/Models/Callback.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Callback.php
|
||||
*
|
||||
* -Description-
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @package LibreNMS
|
||||
* @link http://librenms.org
|
||||
* @copyright 2018 Tony Murray
|
||||
* @author Tony Murray <murraytony@gmail.com>
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Callback extends Model
|
||||
{
|
||||
public $timestamps = false;
|
||||
protected $table = 'callback';
|
||||
protected $primaryKey = 'callback_id';
|
||||
protected $fillable = ['name', 'value'];
|
||||
|
||||
public static function get($name)
|
||||
{
|
||||
return static::query()->where('name', $name)->value('value');
|
||||
}
|
||||
|
||||
public static function set($name, $value)
|
||||
{
|
||||
return static::query()->updateOrCreate(['name' => $name], ['name' => $name, 'value' => $value]);
|
||||
}
|
||||
}
|
11
app/Models/DiskIo.php
Normal file
11
app/Models/DiskIo.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class DiskIo extends DeviceRelatedModel
|
||||
{
|
||||
|
||||
protected $table = 'ucd_diskio';
|
||||
|
||||
protected $primaryKey = 'diskio_id';
|
||||
}
|
11
app/Models/EntPhysical.php
Normal file
11
app/Models/EntPhysical.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class EntPhysical extends DeviceRelatedModel
|
||||
{
|
||||
|
||||
protected $table = 'entPhysical';
|
||||
|
||||
protected $primaryKey = 'entPhysical_id';
|
||||
}
|
11
app/Models/HrDevice.php
Normal file
11
app/Models/HrDevice.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class HrDevice extends DeviceRelatedModel
|
||||
{
|
||||
|
||||
protected $table = 'hrDevice';
|
||||
|
||||
protected $primaryKey = 'hrDevice_id';
|
||||
}
|
41
app/Models/Ipv6Network.php
Normal file
41
app/Models/Ipv6Network.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Ipv6Network.php
|
||||
*
|
||||
* -Description-
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @package LibreNMS
|
||||
* @link http://librenms.org
|
||||
* @copyright 2018 Tony Murray
|
||||
* @author Tony Murray <murraytony@gmail.com>
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Ipv6Network extends Model
|
||||
{
|
||||
public $timestamps = false;
|
||||
protected $primaryKey = 'ipv6_network_id';
|
||||
|
||||
// ---- Define Relationships ----
|
||||
|
||||
public function ipv6()
|
||||
{
|
||||
return $this->hasMany('App\Models\Ipv6Address', 'ipv6_network_id');
|
||||
}
|
||||
}
|
@@ -18,4 +18,4 @@ if (!Auth::user()->hasGlobalAdmin()) {
|
||||
die('ERROR: You need to be admin');
|
||||
}
|
||||
|
||||
dbUpdate(array('value' => '2'), 'callback', '`name` = "enabled"', array());
|
||||
\App\Models\Callback::set('enabled', '2');
|
||||
|
@@ -18,14 +18,4 @@ if (!Auth::user()->hasGlobalAdmin()) {
|
||||
die('ERROR: You need to be admin');
|
||||
}
|
||||
|
||||
if ($_POST['state'] == 'true') {
|
||||
$state = 1;
|
||||
} elseif ($_POST['state'] == 'false') {
|
||||
$state = 0;
|
||||
} else {
|
||||
$state = 0;
|
||||
}
|
||||
|
||||
if (dbUpdate(array('value' => $state), 'callback', '`name` = "enabled"', array()) == 0) {
|
||||
dbInsert(array('value' => $state,'name' => 'enabled'), 'callback');
|
||||
}
|
||||
\App\Models\Callback::set('enabled', (int)($_POST['state'] == 'true'));
|
||||
|
@@ -1,248 +0,0 @@
|
||||
<?php
|
||||
|
||||
$pagetitle[] = 'About';
|
||||
$git_log = `git log -10`;
|
||||
?>
|
||||
<div class="modal fade" id="git_log" tabindex="-1" role="dialog" aria-labelledby="git_log_label" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel">Local git log</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<pre><?php echo htmlspecialchars($git_log, ENT_COMPAT, 'ISO-8859-1', true); ?></pre>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin: 10px;">
|
||||
<div style="float: right; padding: 0px; width: 49%">
|
||||
<h3>License</h3>
|
||||
<pre>
|
||||
Copyright (C) 2013-<?php echo date('Y') . ' ' . \LibreNMS\Config::get('project_name'); ?> Contributors
|
||||
Copyright (C) 2006-2012 Adam Armstrong
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.</pre>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Statistics</h3>
|
||||
|
||||
<?php
|
||||
$stat_devices = dbFetchCell('SELECT COUNT(*) FROM `devices`');
|
||||
$stat_ports = dbFetchCell('SELECT COUNT(*) FROM `ports`');
|
||||
$stat_syslog = dbFetchCell('SELECT COUNT(*) FROM `syslog`');
|
||||
$stat_events = dbFetchCell('SELECT COUNT(*) FROM `eventlog`');
|
||||
$stat_apps = dbFetchCell('SELECT COUNT(*) FROM `applications`');
|
||||
$stat_services = dbFetchCell('SELECT COUNT(*) FROM `services`');
|
||||
$stat_storage = dbFetchCell('SELECT COUNT(*) FROM `storage`');
|
||||
$stat_diskio = dbFetchCell('SELECT COUNT(*) FROM `ucd_diskio`');
|
||||
$stat_processors = dbFetchCell('SELECT COUNT(*) FROM `processors`');
|
||||
$stat_memory = dbFetchCell('SELECT COUNT(*) FROM `mempools`');
|
||||
$stat_sensors = dbFetchCell('SELECT COUNT(*) FROM `sensors`');
|
||||
$stat_wireless = dbFetchCell('SELECT COUNT(*) FROM `wireless_sensors`');
|
||||
$stat_toner = dbFetchCell('SELECT COUNT(*) FROM `toner`');
|
||||
$stat_hrdev = dbFetchCell('SELECT COUNT(*) FROM `hrDevice`');
|
||||
$stat_entphys = dbFetchCell('SELECT COUNT(*) FROM `entPhysical`');
|
||||
|
||||
$stat_ipv4_addy = dbFetchCell('SELECT COUNT(*) FROM `ipv4_addresses`');
|
||||
$stat_ipv4_nets = dbFetchCell('SELECT COUNT(*) FROM `ipv4_networks`');
|
||||
$stat_ipv6_addy = dbFetchCell('SELECT COUNT(*) FROM `ipv6_addresses`');
|
||||
$stat_ipv6_nets = dbFetchCell('SELECT COUNT(*) FROM `ipv6_networks`');
|
||||
|
||||
$stat_pw = dbFetchCell('SELECT COUNT(*) FROM `pseudowires`');
|
||||
$stat_vrf = dbFetchCell('SELECT COUNT(*) FROM `vrfs`');
|
||||
$stat_vlans = dbFetchCell('SELECT COUNT(*) FROM `vlans`');
|
||||
|
||||
$callback_status = dbFetchCell("SELECT `value` FROM `callback` WHERE `name` = 'enabled'");
|
||||
if ($callback_status == 1) {
|
||||
$stats_checked = 'checked';
|
||||
} else {
|
||||
$stats_checked = '';
|
||||
}
|
||||
|
||||
if (extension_loaded('curl')) {
|
||||
$callback = '<label for="callback"> Opt in to send anonymous usage statistics to LibreNMS?</label><br /><input type="checkbox" id="callback" data-size="normal" name="statistics" '.$stats_checked.'>';
|
||||
} else {
|
||||
$callback = "PHP Curl module isn't installed, please install this, restart your web service and refresh this page.";
|
||||
}
|
||||
|
||||
echo "
|
||||
<div class='table-responsive'>
|
||||
<table class='table table-condensed'>
|
||||
<tr>";
|
||||
|
||||
if (Auth::user()->hasGlobalAdmin()) {
|
||||
echo " <td colspan='4'><span class='bg-danger'>$callback</span><br />
|
||||
Online stats: <a href='https://stats.librenms.org/'>stats.librenms.org</a></td>
|
||||
<tr>
|
||||
";
|
||||
}
|
||||
|
||||
if (dbFetchCell("SELECT `value` FROM `callback` WHERE `name` = 'uuid'") != '' && $callback_status != 2) {
|
||||
echo "
|
||||
<tr>
|
||||
<td colspan='4'><button class='btn btn-danger btn-xs' type='submit' name='clear-stats' id='clear-stats'>Clear remote stats</button></td>
|
||||
</tr>
|
||||
";
|
||||
}
|
||||
|
||||
echo "
|
||||
<td><i class='fa fa-fw fa-server fa-lg icon-theme' aria-hidden='true'></i> <b>Devices</b></td><td class='text-right'>$stat_devices</td>
|
||||
<td><i class='fa fa-fw fa-link fa-lg icon-theme' aria-hidden='true'></i> <b>Ports</b></td><td class='text-right'>$stat_ports</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class='fa fa-fw fa-battery-empty fa-lg icon-theme' aria-hidden='true'></i> <b>IPv4 Addresses<b></td><td class='text-right'>$stat_ipv4_addy</td>
|
||||
<td><i class='fa fa-fw fa-battery-empty fa-lg icon-theme' aria-hidden='true'></i> <b>IPv4 Networks</b></td><td class='text-right'>$stat_ipv4_nets</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class='fa fa-fw fa-battery-full fa-lg icon-theme' aria-hidden='true'></i> <b>IPv6 Addresses<b></td><td class='text-right'>$stat_ipv6_addy</td>
|
||||
<td><i class='fa fa-fw fa-battery-full fa-lg icon-theme' aria-hidden='true'></i> <b>IPv6 Networks</b></td><td class='text-right'>$stat_ipv6_nets</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class='fa fa-fw fa-cogs fa-lg icon-theme' aria-hidden='true'></i> <b>Services<b></td><td class='text-right'>$stat_services</td>
|
||||
<td><i class='fa fa-fw fa-cubes fa-lg icon-theme' aria-hidden='true'></i> <b>Applications</b></td><td class='text-right'>$stat_apps</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class='fa fa-fw fa-microchip fa-lg icon-theme' aria-hidden='true'></i> <b>Processors</b></td><td class='text-right'>$stat_processors</td>
|
||||
<td><i class='fa fa-fw fa-braille fa-lg icon-theme' aria-hidden='true'></i> <b>Memory</b></td><td class='text-right'>$stat_memory</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class='fa fa-fw fa-database fa-lg icon-theme' aria-hidden='true'></i> <b>Storage</b></td><td class='text-right'>$stat_storage</td>
|
||||
<td><i class='fa fa-fw fa-hdd-o fa-lg icon-theme' aria-hidden='true'></i> <b>Disk I/O</b></td><td class='text-right'>$stat_diskio</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class='fa fa-fw fa-cube fa-lg icon-theme' aria-hidden='true'></i> <b>HR-MIB</b></td><td class='text-right'>$stat_hrdev</td>
|
||||
<td><i class='fa fa-fw fa-cube fa-lg icon-theme' aria-hidden='true'></i> <b>Entity-MIB</b></td><td class='text-right'>$stat_entphys</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class='fa fa-fw fa-clone fa-lg icon-theme' aria-hidden='true'></i> <b>Syslog Entries</b></td><td class='text-right'>$stat_syslog</td>
|
||||
<td><i class='fa fa-fw fa-bookmark fa-lg icon-theme' aria-hidden='true'></i> <b>Eventlog Entries</b></td><td class='text-right'>$stat_events</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class='fa fa-fw fa-dashboard fa-lg icon-theme' aria-hidden='true'></i> <b>Sensors</b></td><td class='text-right'>$stat_sensors</td>
|
||||
<td><i class='fa fa-fw fa-wifi fa-lg icon-theme' aria-hidden='true'></i> <b>Wireless Sensors</b></td><td class='text-right'>$stat_wireless</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class='fa fa-fw fa-print fa-lg icon-theme' aria-hidden='true'></i> <b>Toner</b></td><td class='text-right'>$stat_toner</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
";
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div style="float: left; padding: 0px; width: 49%">
|
||||
|
||||
<h3>LibreNMS is an autodiscovering PHP/MySQL-based network monitoring system.</h3>
|
||||
<?php
|
||||
$versions = version_info();
|
||||
$project_name = \LibreNMS\Config::get('project_name');
|
||||
$webserv_version = $_SERVER['SERVER_SOFTWARE'];
|
||||
$php_version = $versions['php_ver'];
|
||||
$mysql_version = $versions['mysql_ver'];
|
||||
$netsnmp_version = $versions['netsnmp_ver'];
|
||||
$rrdtool_version = $versions['rrdtool_ver'];
|
||||
$schema_version = $versions['db_schema'];
|
||||
$version = $versions['local_ver'];
|
||||
$version_date = $versions['local_date'];
|
||||
|
||||
echo "
|
||||
<div class='table-responsive'>
|
||||
<table class='table table-condensed' border='0'>
|
||||
<tr><td><b>Version</b></td><td><a href='http://www.librenms.org/changelog.html'>$version - <span id='version_date'>$version_date</span></a></td></tr>
|
||||
<tr><td><b>DB Schema</b></td><td>$schema_version</td></tr>
|
||||
<tr><td><b>Web Server</b></td><td>$webserv_version</td></tr>
|
||||
<tr><td><b>PHP</b></td><td>$php_version</td></tr>
|
||||
<tr><td><b>MySQL</b></td><td>$mysql_version</td></tr>
|
||||
<tr><td><b>RRDtool</b></td><td>$rrdtool_version</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
";
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<h5>LibreNMS is a community-based project. Please feel free to join us and contribute code, documentation, and bug reports:</h5>
|
||||
|
||||
<p>
|
||||
<a href="http://www.librenms.org/">Web site</a> |
|
||||
<a href="https://docs.librenms.org/">Docs</a> |
|
||||
<a href="https://github.com/librenms/">GitHub</a> |
|
||||
<a href="https://community.librenms.org/c/help">Bug tracker</a> |
|
||||
<a href="https://community.librenms.org">Community Forum</a> |
|
||||
<a href="http://twitter.com/librenms">Twitter</a> |
|
||||
<a href="http://www.librenms.org/changelog.html">Changelog</a> |
|
||||
<a href="#" data-toggle="modal" data-target="#git_log">Git log</a>
|
||||
</p>
|
||||
|
||||
<div style="margin-top:10px;">
|
||||
</div>
|
||||
|
||||
<h3>Contributors</h3>
|
||||
|
||||
<p>See the <a href="https://github.com/librenms/librenms/blob/master/AUTHORS.md">list of contributors</a> on GitHub.</p>
|
||||
|
||||
<h3>Acknowledgements</h3>
|
||||
|
||||
<b>Bruno Pramont</b> Collectd code. <br />
|
||||
<b>Dennis de Houx</b> Application monitors for PowerDNS, Shoutcast, NTPD (Client, Server). <br />
|
||||
<b>Erik Bosrup</b> Overlib Library. <br />
|
||||
<b>Jonathan De Graeve</b> SNMP code improvements. <br />
|
||||
<b>Mark James</b> Silk Iconset. <br />
|
||||
<b>Observium</b> Codebase for fork. <br />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$("[name='statistics']").bootstrapSwitch('offColor','danger','size','mini');
|
||||
$('input[name="statistics"]').on('switchChange.bootstrapSwitch', function(event, state) {
|
||||
event.preventDefault();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '<?php echo url('/ajax/form'); ?>',
|
||||
data: { type: "callback-statistics", state: state},
|
||||
dataType: "json",
|
||||
success: function(data){
|
||||
},
|
||||
error:function(){
|
||||
return $("#switch-state").bootstrapSwitch("toggle");
|
||||
}
|
||||
});
|
||||
});
|
||||
$('#clear-stats').click(function(event) {
|
||||
event.preventDefault();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '<?php echo url('/ajax/form'); ?>',
|
||||
data: { type: "callback-clear"},
|
||||
dataType: "json",
|
||||
success: function(data){
|
||||
location.reload(true);
|
||||
},
|
||||
error:function(){
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var ver_date = $('#version_date');
|
||||
ver_date.text(moment.unix(ver_date.text()));
|
||||
</script>
|
227
resources/views/about/index.blade.php
Normal file
227
resources/views/about/index.blade.php
Normal file
@@ -0,0 +1,227 @@
|
||||
@extends('layouts.librenmsv1')
|
||||
|
||||
@section('title', __('About'))
|
||||
|
||||
@section('content')
|
||||
<div class="modal fade" id="git_log" tabindex="-1" role="dialog" aria-labelledby="git_log_label" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel">@lang('Local git log')</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<pre>{!! $git_log !!}</pre>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">@Lang('Close')</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
|
||||
<h3>@lang('LibreNMS is an autodiscovering PHP/MySQL-based network monitoring system')</h3>
|
||||
<table class='table table-condensed table-hover'>
|
||||
<tr>
|
||||
<td><b>@lang('Version')</b></td>
|
||||
<td><a href='http://www.librenms.org/changelog.html'>{{ $version_local }} - <span id='version_date'>{{ $git_date }}</span></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>@lang('Database Schema')</b></td>
|
||||
<td>{{ $db_schema }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>@lang('Web Server')</b></td>
|
||||
<td>{{ $version_webserver }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>@lang('PHP')</b></td>
|
||||
<td>{{ $version_php }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>@lang('MySQL')</b></td>
|
||||
<td>{{ $version_mysql }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>@lang('RRDtool')</b></td>
|
||||
<td>{{ $version_rrdtool }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
<h3>@lang('LibreNMS is a community-based project')</h3>
|
||||
@lang('Please feel free to join us and contribute code, documentation, and bug reports:')
|
||||
<br>
|
||||
<a href="http://www.librenms.org/">@lang('Web site')</a> |
|
||||
<a href="https://docs.librenms.org/">@lang('Docs')</a> |
|
||||
<a href="https://github.com/librenms/">@lang('GitHub')</a> |
|
||||
<a href="https://community.librenms.org/c/help">@lang('Bug tracker')</a> |
|
||||
<a href="https://community.librenms.org">@lang('Community Forum')</a> |
|
||||
<a href="http://twitter.com/librenms">@lang('Twitter')</a> |
|
||||
<a href="http://www.librenms.org/changelog.html">@lang('Changelog')</a> |
|
||||
<a href="#" data-toggle="modal" data-target="#git_log">@lang('Local git log')</a>
|
||||
</p>
|
||||
|
||||
<h3>@lang('Contributors')</h3>
|
||||
|
||||
<p>@lang('See the <a href=":url">list of contributors</a> on GitHub.', ['url' => 'https://github.com/librenms/librenms/blob/master/AUTHORS.md'])</p>
|
||||
|
||||
<h3>@lang('Acknowledgements')</h3>
|
||||
|
||||
<b>Bruno Pramont</b> Collectd code.<br />
|
||||
<b>Dennis de Houx</b> Application monitors for PowerDNS, Shoutcast, NTPD (Client, Server).<br />
|
||||
<b>Erik Bosrup</b> Overlib Library.<br />
|
||||
<b>Jonathan De Graeve</b> SNMP code improvements.<br />
|
||||
<b>Mark James</b> Silk Iconset.<br />
|
||||
<b>Observium</b> Codebase for fork.<br />
|
||||
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
|
||||
<h3>@lang('Statistics')</h3>
|
||||
|
||||
<table class='table table-condensed'>
|
||||
|
||||
@admin
|
||||
<tr>
|
||||
<td colspan='4'>
|
||||
<span class='bg-danger'>
|
||||
<label for="callback">@lang('Opt in to send anonymous usage statistics to LibreNMS?')</label><br />
|
||||
<input type="checkbox" id="callback" data-size="normal" name="statistics" @if($callback_status) checked @endif>
|
||||
</span><br />
|
||||
@lang('Online stats:') <a href='https://stats.librenms.org/'>stats.librenms.org</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@isset($callback_uuid)
|
||||
<tr>
|
||||
<td colspan='4'>
|
||||
<button class='btn btn-danger btn-xs' type='submit' name='clear-stats' id='clear-stats'>@lang('Clear remote stats')</button>
|
||||
</td>
|
||||
</tr>
|
||||
@endisset
|
||||
@endadmin
|
||||
|
||||
<tr>
|
||||
<td><i class='fa fa-fw fa-server fa-lg icon-theme' aria-hidden='true'></i> <b>@lang('Devices')</b></td>
|
||||
<td class='text-right'>{{ $stat_devices }}</td>
|
||||
<td><i class='fa fa-fw fa-link fa-lg icon-theme' aria-hidden='true'></i> <b>@lang('Ports')</b></td>
|
||||
<td class='text-right'>{{ $stat_ports }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class='fa fa-fw fa-battery-empty fa-lg icon-theme' aria-hidden='true'></i> <b>@lang('IPv4 Addresses')</b></td>
|
||||
<td class='text-right'>{{ $stat_ipv4_addy }}</td>
|
||||
<td><i class='fa fa-fw fa-battery-empty fa-lg icon-theme' aria-hidden='true'></i> <b>@lang('IPv4 Networks')</b></td>
|
||||
<td class='text-right'>{{ $stat_ipv4_nets }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class='fa fa-fw fa-battery-full fa-lg icon-theme' aria-hidden='true'></i> <b>@lang('IPv6 Addresses')</b></td>
|
||||
<td class='text-right'>{{ $stat_ipv6_addy }}</td>
|
||||
<td><i class='fa fa-fw fa-battery-full fa-lg icon-theme' aria-hidden='true'></i> <b>@lang('IPv6 Networks')</b></td>
|
||||
<td class='text-right'>{{ $stat_ipv6_nets }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class='fa fa-fw fa-cogs fa-lg icon-theme' aria-hidden='true'></i> <b>@lang('Services')</b></td>
|
||||
<td class='text-right'>{{ $stat_services }}</td>
|
||||
<td><i class='fa fa-fw fa-cubes fa-lg icon-theme' aria-hidden='true'></i> <b>@lang('Applications')</b></td>
|
||||
<td class='text-right'>{{ $stat_apps }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class='fa fa-fw fa-microchip fa-lg icon-theme' aria-hidden='true'></i> <b>@lang('Processors')</b></td>
|
||||
<td class='text-right'>{{ $stat_processors }}</td>
|
||||
<td><i class='fa fa-fw fa-braille fa-lg icon-theme' aria-hidden='true'></i> <b>@lang('Memory')</b></td>
|
||||
<td class='text-right'>{{ $stat_memory }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class='fa fa-fw fa-database fa-lg icon-theme' aria-hidden='true'></i> <b>@lang('Storage')</b></td>
|
||||
<td class='text-right'>{{ $stat_storage }}</td>
|
||||
<td><i class='fa fa-fw fa-hdd-o fa-lg icon-theme' aria-hidden='true'></i> <b>@lang('Disk I/O')</b></td>
|
||||
<td class='text-right'>{{ $stat_diskio }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class='fa fa-fw fa-cube fa-lg icon-theme' aria-hidden='true'></i> <b>@lang('HR-MIB')</b></td>
|
||||
<td class='text-right'>{{ $stat_hrdev }}</td>
|
||||
<td><i class='fa fa-fw fa-cube fa-lg icon-theme' aria-hidden='true'></i> <b>@lang('Entity-MIB')</b></td>
|
||||
<td class='text-right'>{{ $stat_entphys }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class='fa fa-fw fa-clone fa-lg icon-theme' aria-hidden='true'></i> <b>@lang('Syslog Entries')</b></td>
|
||||
<td class='text-right'>{{ $stat_syslog }}</td>
|
||||
<td><i class='fa fa-fw fa-bookmark fa-lg icon-theme' aria-hidden='true'></i> <b>@lang('Eventlog Entries')</b></td>
|
||||
<td class='text-right'>{{ $stat_events }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class='fa fa-fw fa-dashboard fa-lg icon-theme' aria-hidden='true'></i> <b>@lang('Sensors')</b></td>
|
||||
<td class='text-right'>{{ $stat_sensors }}</td>
|
||||
<td><i class='fa fa-fw fa-wifi fa-lg icon-theme' aria-hidden='true'></i> <b>@lang('Wireless Sensors')</b></td>
|
||||
<td class='text-right'>{{ $stat_wireless }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class='fa fa-fw fa-print fa-lg icon-theme' aria-hidden='true'></i> <b>@lang('Toner')</b></td>
|
||||
<td class='text-right'>{{ $stat_toner }}</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h3>@lang('License')</h3>
|
||||
<pre>
|
||||
Copyright (C) 2013-{{ date('Y') }} {{ $project_name }} Contributors
|
||||
Copyright (C) 2006-2012 Adam Armstrong
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.</pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
<script>
|
||||
$("[name='statistics']").bootstrapSwitch('offColor','danger','size','mini');
|
||||
$('input[name="statistics"]').on('switchChange.bootstrapSwitch', function(event, state) {
|
||||
event.preventDefault();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'ajax_form.php',
|
||||
data: { type: "callback-statistics", state: state},
|
||||
dataType: "json",
|
||||
success: function(data){},
|
||||
error:function(){
|
||||
return $("#switch-state").bootstrapSwitch("toggle");
|
||||
}
|
||||
});
|
||||
});
|
||||
$('#clear-stats').click(function(event) {
|
||||
event.preventDefault();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'ajax_form.php',
|
||||
data: { type: "callback-clear"},
|
||||
dataType: "json",
|
||||
success: function(data){
|
||||
location.reload(true);
|
||||
},
|
||||
error:function(){}
|
||||
});
|
||||
});
|
||||
|
||||
var ver_date = $('#version_date');
|
||||
ver_date.text(moment.unix(ver_date.text()));
|
||||
</script>
|
||||
@endsection
|
@@ -26,6 +26,7 @@ Route::group(['middleware' => ['auth', '2fa'], 'guard' => 'auth'], function () {
|
||||
Route::get('locations', 'LocationController@index');
|
||||
Route::resource('preferences', 'UserPreferencesController', ['only' => ['index', 'store']]);
|
||||
Route::resource('users', 'UserController');
|
||||
Route::get('about', 'AboutController@index');
|
||||
|
||||
// old route redirects
|
||||
Route::permanentRedirect('poll-log', 'pollers/tab=log/');
|
||||
|
Reference in New Issue
Block a user