-
Notifications
You must be signed in to change notification settings - Fork 13
/
index.php
101 lines (89 loc) · 3.56 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php
/**
* sysMonDash
*
* @author nuxsmin
* @link https://github.com/nuxsmin/sysMonDash
* @copyright 2012-2018 Rubén Domínguez [email protected]
*
* This file is part of sysMonDash.
*
* sysMonDash 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.
*
* sysMonDash 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 sysMonDash. If not, see <http://www.gnu.org/licenses/gpl-3.0-standalone.html>.
*/
use SMD\Core\Config;
use SMD\Core\Init;
use SMD\Core\Language;
use SMD\Core\Session;
use SMD\Http\Request;
use SMD\Util\Util;
define('APP_ROOT', '.');
require APP_ROOT . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'Base.php';
Init::start();
$type = Request::analyze('t', VIEW_FRONTLINE);
$timeout = Request::analyze('to', Config::getConfig()->getRefreshValue());
$scroll = Request::analyze('scroll', ($type === VIEW_FRONTLINE || $type === VIEW_DISPLAY) ? 1 : 0);
$ajaxFile = '/ajax/getData.php?t=' . $type . '&to=' . $timeout;
Session::setCssHash(Util::getCssHash());
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>sysMonDash :: <?php echo Config::getConfig()->getPageTitle(); ?></title>
<meta name="author" content="Rubén Domínguez">
<link rel="icon" type="image/png" href="imgs/logo_small.png">
<script type="text/javascript" src="js/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/reset.min.css">
<link rel="stylesheet" type="text/css" href="css/pure.min.css">
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/styles.min.css?v=<?php echo Session::getCssHash(); ?>">
</head>
<body>
<div id="logo">
<img src="imgs/logo.png"/>
<div id="hora"><h1></h1></div>
<div id="titulo">
<h1><?php echo Config::getConfig()->getPageTitle(); ?></h1>
<h2><?php echo Config::getConfig()->getPageSubtitle(); ?></h2>
</div>
</div>
<div id="monitor-data"></div>
<footer>
<div id="project">
<span id="updates"></span>
<a href="config.php" title="Config" class="a-nodecorate">
<i class="fa fa-wrench" aria-hidden="true"></i>
</a>
::
<?php printf('%s :: %s :: %s', Util::getAppInfo('appVersion'), Util::getAppInfo('appCode'), Util::getAppInfo('appAuthor')); ?>
</div>
</footer>
<?php if (Config::getConfig()->isNewItemAudioEnabled()): ?>
<audio id="audio-alarm" src="audio/beep.mp3" preload></audio>
<?php endif; ?>
<script type="text/javascript" src="js/functions.min.js"></script>
<script type="text/javascript">
(function () {
smd.Config.setRemoteServer('<?php echo Config::getConfig()->getRemoteServer(); ?>');
smd.Config.setAjaxFile('<?php echo $ajaxFile; ?>');
smd.Config.setScroll(<?php echo $scroll ? 'true' : 'false'; ?>);
smd.Config.setTimeout(<?php echo $timeout; ?>);
smd.Config.setLang('<?php echo Language::t('Error al obtener los eventos de monitorización'); ?>');
smd.Config.setAudioEnabled(<?php echo Config::getConfig()->isNewItemAudioEnabled() ? 'true' : 'false'; ?>);
smd.startSMD();
smd.getUpdates();
}());
</script>
</body>
</html>