Moved the Agents into their own repo. Kept the agent.pl just for reference

This commit is contained in:
Frank Harris 2025-09-11 13:27:32 -04:00
parent 22381be29a
commit 8680a02b13
18132 changed files with 0 additions and 2569420 deletions

View file

@ -1,7 +0,0 @@
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Main Section -->

View file

@ -1,6 +0,0 @@
</div>
<!-- /.content-wrapper -->
<footer class="main-footer">
%footer%
</footer>

File diff suppressed because it is too large Load diff

View file

@ -1,430 +0,0 @@
:root {
--dark-1: #2f3439;
--dark-2: #2a2e33;
--dark-3: #24282d;
/* 1a -> 10% */
/* 66 -> 40% */
/* cc -> 80% */
}
::-webkit-scrollbar {
width: 6px;
height: 6px;
}
::-webkit-scrollbar-button {
width: 0px;
height: 0px;
}
::-webkit-scrollbar-corner {
background: transparent;
}
@media (min-width: 768px) {
body {
padding-bottom: 25px;
}
}
.dark-mode::-webkit-scrollbar-thumb,
.dark-mode *::-webkit-scrollbar-thumb {
background: rgba(255,255,255,.4);
border: 0px none rgba(255,255,255,.4);
border-radius: 10px;
}
.dark-mode::-webkit-scrollbar-thumb:hover,
.dark-mode *::-webkit-scrollbar-thumb:hover {
background: rgba(255,255,255,.4);
}
.dark-mode::-webkit-scrollbar-thumb:activ,
.dark-mode *::-webkit-scrollbar-thumb:active {
background: rgba(255,255,255,.4);
}
.dark-mode::-webkit-scrollbar-track,
.dark-mode *::-webkit-scrollbar-track {
border: 0px none rgba(255,255,255,.4);
border-radius: 10px;
}
.light-mode::-webkit-scrollbar-thumb,
.light-mode *::-webkit-scrollbar-thumb {
background: rgba(0,0,0,.4);
border: 0px none rgba(0,0,0,.4);
border-radius: 10px;
}
.light-mode::-webkit-scrollbar-thumb:hover,
.light-mode *::-webkit-scrollbar-thumb:hover {
background: rgba(0,0,0,.4);
}
.light-mode::-webkit-scrollbar-thumb:active,
.light-mode *::-webkit-scrollbar-thumb:active {
background: rgba(0,0,0,.4);
}
.light-mode::-webkit-scrollbar-track,
.light-mode *::-webkit-scrollbar-track {
border: 0px none rgba(0,0,0,.4);
border-radius: 10px;
}
.main-sidebar .sidebar {
overflow-x: hidden !important;
}
.sidebar .os-scrollbar-handle {
width: 3px;
margin-left: 4px;
}
.mixed-mode footer a.text-dark:hover,
.dark-mode a.text-dark:hover {
color: #fff !important;
}
.light-mode .os-theme-light > .os-scrollbar > .os-scrollbar-track > .os-scrollbar-handle {
background: rgba(0,0,0,.4) !important;
}
.dark-mode .os-theme-light > .os-scrollbar > .os-scrollbar-track > .os-scrollbar-handle {
background: rgba(255,255,255,.4) !important;
}
.ace_scrollbar-v,
.ace_scrollbar-inner {
width: 6px !important;
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active{
-webkit-box-shadow: inset !important;
}
.login-page .navbar {
position: fixed;
top: 0px;
left: 0px;
width: 100%;
}
.preloader {
align-items: center;
justify-content: center;
}
.brand-link {
display: inline-block;
}
.sidebar-collapse .brand-link > img {
margin: 0px;
}
.user-panel img
{
width: 2.1rem;
height: 2.1rem;
}
.rc-anchor-dark.rc-anchor-normal {
border: 1px solid #6c757d;
background: #454d55;
}
.hide, .hidden {
display: none;
}
body.sidebar-collapse .main-sidebar:not(.hover) .text-truncate
{
text-overflow: unset;
}
.main-sidebar img.nav-icon {
width: 14px !important;
height: 14px !important;
}
body.sidebar-collapse .main-sidebar img.nav-icon {
margin-left: 7px !important;
}
body:not(.sidebar-collapse) .main-sidebar img.nav-icon {
margin-right: 7px !important;
}
.nav-sidebar .nav-link p {
white-space: nowrap !important;
}
.nav-sidebar .nav-item img.nav-icon {
margin-right: 0.5rem;
}
.card .card-body > pre {
padding: 0px;
background: transparent;
}
.card:not(.maximized-card) .card-body > pre {
max-height: 400px;
overflow: auto;
}
pre {
padding: 1rem;
}
.dark-mode pre {
color: #fff;
background-color: var(--dark-1);
}
.light-mode pre {
background-color: var(--light);
}
.callout a {
text-decoration: none;
color: #007bff;
}
.versionInfo:hover {
cursor: pointer;
color: #fff;
}
.sort-highlight {
background: rgb(52 58 64 / 50%);
border: 2px dashed #2d3338;
margin-bottom: 10px;
border-radius: 4px;
}
.collapsible:hover {
cursor: pointer;
}
.card-body.p-0 > .table > tbody > tr:nth-child(1) > td {
border-top: none;
}
.loading:before {
content: "\f110" !important;
-webkit-animation: fa-spin 2s infinite linear;
animation: fa-spin 2s infinite linear;
}
.loading {
content: "Loading..." !important;
}
.shortblink {
animation: blink 1s infinite;
}
@keyframes blink {
50% {
opacity: 0.3;
}
}
.light-mode .btn.redirectLink {
color: var(--light);
}
.dark-mode .white-popup {
background-color: var(--dark);
border: 10px solid var(--dark);
color: var(--light);
}
.dark-mode .magnificTitle {
background-color: var(--dark);
}
.btn:not(.btn-tool) {
margin-bottom: 0.1rem;
margin-right: 0.25rem;
}
.loading-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 99;
text-align: center;
background-color: rgb(0 0 0 / 40%);
}
.loading-overlay img {
top: 40%;
position: absolute;
}
.tablesorter-header {
white-space: nowrap;
}
table.tablesorter thead tr .tablesorter-header {
background-repeat: no-repeat;
background-position: center right;
cursor: pointer;
}
table.tablesorter thead tr .tablesorter-headerUnSorted {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAAkElEQVQoz7X QMQ5AQBCF4dWQSJxC5wwax1Cq1e7BAdxD5SL+Tq/QCM1oNiJidwox0355mXnG/DrEtIQ6azioNZQxI0ykPhTQIwhCR+BmBYtlK7kLJYwWCcJA9M4qdrZrd8pPjZWPtOqdRQy320YSV17OatFC4euts6z39GYMKRPCTKY9UnPQ6P+GtMRfGtPnBCiqhAeJPmkqAAAAAElFTkSuQmCC");
}
table.tablesorter thead tr .tablesorter-headerAsc {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZ0lEQVQ4y2NgGLKgquEuFxBPAGI2ahhWCsS/gDibUoO0gPgxEP8H4ttArEyuQYxAPBdqEAxPBImTY5gjEL9DM+wTENuQahAvEO9DMwiGdwAxOymGJQLxTyD+jgWDxCMZRsEoGAVoAADeemwtPcZI2wAAAABJRU5ErkJggg==");
}
table.tablesorter thead tr .tablesorter-headerDesc {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZUlEQVQ4y2NgGAWjYBSggaqGu5FA/BOIv2PBIPFEUgxjB+IdQPwfC94HxLykus4GiD+hGfQOiB3J8SojEE9EM2wuSJzcsFMG4ttQgx4DsRalkZENxL+AuJQaMcsGxBOAmGvopk8AVz1sLZgg0bsAAAAASUVORK5CYII=");
}
#toast-container {
min-width: 28%;
max-width: calc(100% - 32px);
width: auto;
}
#toast-container > div {
width: 100%;
}
.dark-mode .input-group-text {
background-color: var(--dark-2);
}
/* *** mfp popup *** */
.mfp-bg {
opacity: 0.3;
}
.light-mode .white-popup {
border-color: var(--gray);
border-radius: 6px;
background-color: var(--light);
}
.light-mode .magnificTitle {
background-color: var(--gray);
}
.ui-dialog .ui-dialog-content {
min-height: 60px !important;
}
/* Icons Default */
.administration-table a:before,
.monitorButtonContainer a:before
{ content: "\f101"; }
/* Icons Defined */
/* FA Set */
.monitorButtonContainer a:before,
.srvctrl a:before {
font-family: "Font Awesome 5 Free";
font-weight: 900;
}
/* Brands */
.nav-sidebar [href^="?m=steam_workshop"] > .nav-icon,
.administration-table [href^="?m=steam_workshop"]:before,
.monitorButtonContainer [href^="?m=steam_workshop"]:before,
.monitorButtonContainer [href^="?m=gamemanager&p=update"]:before,
.nav-sidebar [href="?m=TS3Admin"] > .nav-icon
{
font-family: "Font Awesome 5 Brands";
font-weight: 400;
}
/* Icons */
.nav-sidebar [href="?m=dashboard&p=dashboard"] > .nav-icon:before,
.administration-table [href="?m=dashboard&p=dashboard"]:before { content: "\f3fd"; }
.nav-sidebar [href="?m=gamemanager&p=game_monitor"] > .nav-icon:before,
.nav-sidebar [link="?m=gamemanager&p=game_monitor"] > .nav-icon:before { content: "\f108"; }
.nav-sidebar [href="?m=administration&p=main"] > .nav-icon:before,
.nav-sidebar [link="?m=administration&p=main"] > .nav-icon:before { content: "\f023"; }
.nav-sidebar [href="?m=TS3Admin"] > .nav-icon:before { content: "\f4f9"; }
.nav-sidebar [href^="?m=gamemanager&p=log"] > .nav-icon:before,
.monitorButtonContainer [href^="?m=gamemanager&p=log"]:before { content: "\f1da"; }
.nav-sidebar [href="?m=addonsmanager&p=addons_manager"] > .nav-icon:before,
.monitorButtonContainer [href^="?m=addonsmanager&p=user_addons"]:before,
.administration-table [href="?m=addonsmanager&p=addons_manager"]:before { content: "\f12e"; }
.nav-sidebar [href="?m=extras"] > .nav-icon:before,
.administration-table [href="?m=extras"]:before{ content: "\f1e6"; }
.nav-sidebar [href^="?m=ftp"] > .nav-icon:before,
.monitorButtonContainer [href^="?m=ftp"]:before,
.administration-table [href^="?m=ftp"]:before{ content: "\f15c"; }
.nav-sidebar [href="?m=user_games"] > .nav-icon:before,
.administration-table [href="?m=user_games"]:before{ content: "\f11b"; }
.nav-sidebar [href="?m=config_games"] > .nav-icon:before,
.administration-table [href="?m=config_games"]:before{ content: "\f044"; }
.nav-sidebar [href^="?m=litefm"] > .nav-icon:before,
.nav-sidebar [href="?m=litefm&p=litefm_settings"] > .nav-icon:before,
.administration-table [href="?m=litefm&p=litefm_settings"]:before,
.nav-sidebar [href^="?m=user_games&p=edit"] > .nav-icon:before,
.monitorButtonContainer [href^="?m=user_games&p=edit"]:before{ content: "\f085"; }
.nav-sidebar [href="?m=modulemanager"] > .nav-icon:before,
.administration-table [href="?m=modulemanager"]:before { content: "\f009"; }
.nav-sidebar [href="?m=settings"] > .nav-icon:before,
.administration-table [href="?m=settings"]:before { content: "\f1de"; }
.nav-sidebar [href="?m=server"] > .nav-icon:before,
.administration-table [href="?m=server"]:before { content: "\f233"; }
.nav-sidebar [href="?m=settings&p=themes"] > .nav-icon:before,
.administration-table [href="?m=settings&p=themes"]:before { content: "\f043"; }
.nav-sidebar [href="?m=update"] > .nav-icon:before,
.administration-table [href="?m=update"]:before { content: "\f021"; }
.nav-sidebar [href^="?m=gamemanager&p=update"] > .nav-icon:before,
.nav-sidebar [href^="?m=steam_workshop"] > .nav-icon:before,
.administration-table [href^="?m=steam_workshop"]:before,
.monitorButtonContainer [href^="?m=steam_workshop"]:before,
.monitorButtonContainer [href^="?m=gamemanager&p=update"]:before { content: "\f1b6"; }
.nav-sidebar [href^="?m=user_admin"] > .nav-icon:before,
.nav-sidebar [link^="?m=user_admin"] > .nav-icon:before,
.administration-table [href^="?m=user_admin"]:before{ content: "\f007"; }
.nav-sidebar [href="?m=user_admin&p=show_groups"] > .nav-icon:before { content: "\f0c0"; }
.nav-sidebar [href="?m=administration&p=watch_logger"] > .nav-icon:before,
.administration-table [href="?m=administration&p=watch_logger"]:before { content: "\f017"; }
.nav-sidebar [href^="?m=cron"] > .nav-icon:before,
.administration-table [href^="?m=cron"]:before { content: "\f073"; }
.nav-sidebar [href="?m=mysql&p=mysql_admin"] > .nav-icon:before,
.monitorButtonContainer [href^="?m=mysql"]:before,
.administration-table [href="?m=mysql&p=mysql_admin"]:before { content: "\f1c0"; }
.nav-sidebar [href="?m=administration&p=banlist"] > .nav-icon:before,
.administration-table [href="?m=administration&p=banlist"]:before { content: "\f05e"; }
.nav-sidebar [href^="home.php?m=gamemanager&p=rcon_presets"] > .nav-icon:before,
.monitorButtonContainer [href^="home.php?m=gamemanager&p=rcon_presets"]:before,
.nav-sidebar [href="?m=rcon&p=rcon"] > .nav-icon:before,
.administration-table [href="?m=rcon&p=rcon"]:before { content: "\f120"; }
.nav-sidebar [href^="?m=gamemanager&p=rsync_install"] > .nav-icon:before { content: "\f0ad"; }
.nav-sidebar [href^="?m=support"] > .nav-icon:before { content: "\f095"; }
.nav-sidebar [href^="?m=faq"] > .nav-icon:before,
.administration-table [href^="?m=faq"]:before{ content: "\f059"; }
.nav-sidebar [href^="?m=fast_download"] > .nav-icon:before,
.monitorButtonContainer [href^="?m=fast_download"]:before,
.administration-table [href^="?m=fast_download"]:before { content: "\f019"; }
.nav-sidebar [href^="?m=dsi"] > .nav-icon:before,
.monitorButtonContainer [href^="?m=dsi"]:before,
.administration-table [href^="?m=dsi"]:before{ content: "\f03e"; }
.nav-sidebar [href^="?m=simple-billing"] > .nav-icon:before,
.administration-table [href^="?m=simple-billing"]:before { content: "\f07a"; }
.nav-sidebar [href^="?m=util"] > .nav-icon:before { content: "\f0ad"; }
.nav-sidebar [href^="?m=lgsl_with_img_mod"] > .nav-icon:before,
.administration-table [href^="?m=lgsl_with_img_mod"]:before { content: "\f022"; }
.nav-sidebar [href^="?m=news"] > .nav-icon:before,
.administration-table [href^="?m=news"]:before { content: "\f1ea"; }
.nav-sidebar [href^="?m=register"] > .nav-icon:before { content: "\f067"; }
.nav-sidebar [href="?logout"] > .nav-icon:before { content: "\f08b"; }
.nav-sidebar [href="index.php"] > .nav-icon:before { content: "\f0e4"; }
.monitorButtonContainer [href^="?m=litefm"]:before { content: "\f03a"; }
.monitorbutton.size:before { content: "\f07c"; }
.monitorbutton.getAutoUpdateLink:before { content: "\f0c1"; }
.monitorButtonContainer [href^="?m=gamemanager&p=rsync_install"]:before { content: "\f381"; }
.administration-table.externalLinks a:before { content: "\f0c1"; }
.nav-sidebar [href^="?m=tickets"] > .nav-icon:before,
.administration-table [href^="?m=tickets"]:before { content: "\f4c4"; }
.monitorButtonContainer [href^="?m=editconfigfiles"]:before { content: "\f1c9"; }
.monitorButtonContainer [href^="?m=user_games&p=custom_fields"]:before { content: "\f1de"; }
.nav-sidebar [href="?m=tshock"] > .nav-icon:before { content: "\f1bb"; }
.nav-sidebar [href="?m=circular"] > .nav-icon:before,
.administration-table [href="?m=circular"]:before { content: "\f0e0"; }
.monitorbutton.getAPILinks:before { content: "\f1da"; }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View file

@ -1,5 +0,0 @@
<svg width="101px" height="101px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" class="lds-dual-ring">
<circle cx="50" cy="50" ng-attr-r="{{config.radius}}" ng-attr-stroke-width="{{config.width}}" ng-attr-stroke="{{config.stroke}}" ng-attr-stroke-dasharray="{{config.dasharray}}" fill="none" stroke-linecap="round" r="45" stroke-width="4" stroke="#1997c6" stroke-dasharray="70.68583470577035 70.68583470577035">
<animateTransform attributeName="transform" type="rotate" calcMode="linear" values="0 50 50;360 50 50" keyTimes="0;1" dur="1s" begin="0s" repeatCount="indefinite"></animateTransform>
</circle>
</svg>

Before

Width:  |  Height:  |  Size: 671 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 14 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 159 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

View file

@ -1,215 +0,0 @@
<?php
class ThemeDB
{
protected $link;
public $settingsTable, $serverStatsTable;
private $absolutePath = "../../../..";
public function __construct()
{
$this->settingsTable = $this->tablePrefix().'adminlte_settings';
$this->serverStatsTable = $this->tablePrefix().'adminlte_serverstats';
}
public function tablePrefix()
{
include($this->absolutePath."/includes/config.inc.php");
return $table_prefix;
}
private function getConnType()
{
if(class_exists('pdo'))
{
return 'pdo';
}
elseif(class_exists('mysqli'))
{
return 'mysqli';
}
else
{
echo 'error: neither pdo nor mysqli extensions are installed or activated';
exit;
}
}
private function connect()
{
include($this->absolutePath."/includes/config.inc.php");
if($this->getConnType()=='pdo')
{
try
{
$dbh = new PDO('mysql:host='.$db_host.';dbname='.$db_name, $db_user, $db_pass);
}
catch (PDOException $e)
{
echo 'Connection failed: ' . $e->getMessage();
exit;
}
$this->link = $dbh;
}
elseif($this->getConnType()=='mysqli')
{
$mysqli = @new mysqli($db_host, $db_user, $db_pass, $db_name);
if($mysqli->connect_error)
{
echo 'Connection error: ' . $mysqli->connect_error;
exit;
}
$this->link = $mysqli;
}
}
public function query($query, $returnData = true)
{
$this->connect();
if($this->getConnType()=='pdo')
{
try {
$stmt = $this->link->prepare($query);
$stmt->execute();
if($returnData)
{
$output = $stmt->fetchAll(PDO::FETCH_ASSOC);
}
}
catch(PDOException $e)
{
return $e->getMessage();
}
}
elseif($this->getConnType()=='mysqli')
{
$result = $this->link->query($query);
if(!$result)
{
return $this->link->error;
}
else
{
if($result=="NULL")
{
return true;
}
else
{
$output = array();
while($row = $result->fetch_assoc())
{
$output[] = $row;
}
}
}
}
if($returnData)
{
if(count($output)>=1)
{
return $output;
}
else
{
return false;
}
}
else
{
return true;
}
}
public function getSetting($name, $userId = false)
{
if($userId === false)
{
$userId = $_SESSION['user_id'];
}
$query = '
SELECT value
FROM '.$this->settingsTable.'
WHERE user = "'.$userId.'" AND name = "'.$name.'"
';
$data = $this->query($query);
if(!empty($data))
{
return unserialize($data[0]['value']);
}
else
{
return false;
}
}
public function setSetting($name, $value, $userId = false)
{
if($userId === false)
{
$userId = $_SESSION['user_id'];
}
// dont use on duplicate key update statement because of the increasing index
// so instead check if the entry exists, if yes update, if not create :)
if($this->getSetting($name, $userId))
{
return $this->query("
UPDATE ".$this->settingsTable."
SET value = '".serialize($value)."'
WHERE user = '".$userId."' AND name = '".$name."'
");
}else
{
return $this->query("
INSERT INTO ".$this->settingsTable." (user, name, value)
VALUES('".$userId."', '".$name."', '".serialize($value)."')
");
}
}
public function removeSetting($name, $userId = false)
{
if($userId === false)
{
$userId = $_SESSION['user_id'];
}
$query = "
DELETE FROM ".$this->settingsTable."
WHERE user = '".$userId."' and name = '".$name."'
";
return $this->query($query);
}
public function getMaintenanceMode()
{
$query = "
SELECT setting,value
FROM ".$this->tablePrefix()."settings
WHERE setting = 'maintenance_mode' or setting = 'maintenance_title' or setting = 'maintenance_message'
";
$data = $this->query($query);
if($data)
{
$dataOut = array();
foreach($data as $setting)
{
$dataOut[$setting['setting']] = $setting['value'];
}
return $dataOut;
}
}
}

View file

@ -1,502 +0,0 @@
<?php
include("../../../../includes/helpers.php");
include("./db.class.php");
include("./theme.class.php");
// start ogp session
startSession();
// initialize classes
$ThemeDB = new ThemeDB;
$Theme = new Theme;
// declarations
$isadmin = false;
$uploadsFolder = dirname(__FILE__).'/uploads';
$themeUploadsPath = "themes/AdminLTE/dist/php/uploads/";
// check if uploads folder exists and create if not
if(!file_exists($uploadsFolder))
{
mkdir($uploadsFolder, 0744, true);
}
// declare themeTables
$themeTables = array(
array(
'name' => $ThemeDB->settingsTable,
'query' => '
CREATE TABLE '.$ThemeDB->settingsTable.' (
id int(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
user int(4) NOT NULL,
name varchar(255) NOT NULL,
value mediumtext NOT NULL,
UNIQUE KEY UniqueSetting (user,name)
);
'
),
// id int(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
array(
'name' => $ThemeDB->serverStatsTable,
'query' => '
CREATE TABLE '.$ThemeDB->serverStatsTable.' (
home_id int(4) NOT NULL,
users_online int(4) NOT NULL,
current_stamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
);
'
)
);
// check if theme settings db exists and create if not
foreach($themeTables AS $themeTable)
{
$sql = 'show tables like "'.$themeTable['name'].'"';
if($ThemeDB->query($sql) === false)
{
// create settings table
$ThemeDBCreate = $ThemeDB->query($themeTable['query'], false);
if($ThemeDBCreate===true)
{
// echo 'table "'.$themeTable['name'].'" successfully created';
}
else
{
// throw error
echo "<pre>Error:";
print_r($ThemeDBCreate);
echo "</pre>";
exit();
}
}
}
// check & set admin
if(isset($_SESSION['user_id']))
{
$isadmin = $Theme->checkIsAdmin($_SESSION['user_id']);
}
if(isset($_GET['m']))
{
if($_GET['m']=='global')
{
if(isset($_GET['p']))
{
if($_GET['p']=='check')
{
if(isset($_GET['v']))
{
if($_GET['v']=='maintenance')
{
$data = $ThemeDB->getMaintenanceMode();
header("Content-Type: application/json");
echo json_encode($data);
exit();
}
elseif($_GET['v']=='isadmin')
{
if($isadmin)
{
echo 1;
}else
{
echo 0;
}
exit();
}
elseif($_GET['v']=='updateserverstats')
{
if(isset($_GET['token']))
{
echo $Theme->updateGameserverStats($_GET['token']);
}
}
}
}
elseif($_GET['p']=='theme')
{
// check if user session exists
if(isset($_SESSION['users_login']))
{
if(isset($_GET['v']) && ($_GET['v']=='light' || $_GET['v']=='dark' || $_GET['v']=='mixed'))
{
// write new value to db
$theme = $ThemeDB->setSetting('theme', $_GET['v']);
}
else
{
$theme = $ThemeDB->getSetting('theme');
if(empty($theme))
{
// write default value to db
$theme = $ThemeDB->setSetting('theme', 'dark');
}
}
header("Content-Type: application/json");
echo json_encode($theme);
}
exit();
}
elseif($_GET['p']=='themeLogo')
{
// load global setting (id -1)
$themeLogo = $ThemeDB->getSetting('themeLogo', -1);
if(empty($themeLogo))
{
echo 0;
exit();
}
header("Content-Type: application/json");
echo json_encode($themeLogo);
exit();
}
elseif($_GET['p']=='themeNavWidth')
{
if(isset($_SESSION['users_login']))
{
// load global setting (id -1)
$themeNavWidth = $ThemeDB->getSetting('themeNavWidth', -1);
if(empty($themeNavWidth))
{
$themeNavWidth = 250;
}
header("Content-Type: application/json");
echo json_encode($themeNavWidth);
}
exit();
}
elseif($_GET['p']=='themeServerstats')
{
if(isset($_SESSION['users_login']))
{
if(isset($_GET['v']) && $_GET['v']=='displayNum')
{
$themeServerstatsNum = $ThemeDB->getSetting('themeServerstatsNum', -1);
if(empty($themeServerstatsNum) || $themeServerstatsNum<1 || $themeServerstatsNum>20)
{
$themeServerstatsNum = 10;
}
echo $themeServerstatsNum;
}else
{
// check if token is set to check if themeServerstats are enabled or not
$themeServerstats = $ThemeDB->getSetting('updateToken', -1);
echo empty($themeServerstats) ? 'remove' : 'activate';
}
}
exit();
}
}
}
elseif($_GET['m']=='user')
{
// check if user session exists
if(isset($_SESSION['users_login']))
{
if(isset($_GET['p']))
{
if($_GET['p']=='getavatar')
{
if(isset($_GET['userid']) && is_numeric($_GET['userid']))
{
$avatar = $ThemeDB->getSetting('avatar', $_GET['userid']);
if(empty($avatar))
{
$avatarPath = "themes/AdminLTE/dist/img/default-avatar.png";
}else
{
$avatarPath = $avatar;
}
echo $avatarPath;
exit;
}
}elseif($_GET['p']=='setavatar')
{
if(isset($_GET['userid']) && is_numeric($_GET['userid']))
{
// security; for now, only allow upload for own user id
if($_GET['userid']==$_SESSION['user_id'])
{
echo _NewFileUpload($_FILES['userAvatar'], $_GET['userid'], 'avatar');
exit;
}
}
}
}
}
}
elseif($_GET['m']=='dashboard')
{
// check if user session exists
if(isset($_SESSION['users_login']))
{
if(isset($_GET['p']))
{
if($_GET['p']=='columnsettings')
{
$columns = $ThemeDB->getSetting('dashboard_columns');
if(empty($columns))
{
// no column settings available, set default settings
$newColumns = array();
// select remote server
$newColumns[] = array('item' => 'item6', 'section' => 'column4', 'collapsed' => 0);
// server status
$newColumns[] = array('item' => 'item7', 'section' => 'column5', 'collapsed' => 0);
// process monitor
$newColumns[] = array('item' => 'item8', 'section' => 'column6', 'collapsed' => 0);
// server status
$newColumns[] = array('item' => 'item9', 'section' => 'column4', 'collapsed' => 0);
// write default value to db
$setSetting = $ThemeDB->setSetting('dashboard_columns', $newColumns);
$columns = $newColumns;
}
header("Content-Type: application/json");
echo json_encode($columns);
exit();
}
elseif($_GET['p']=='updatecolumnsettings')
{
// only allow new generated items from theme
$allowedItems = array('item6', 'item7', 'item8', 'item9');
// decode all items
$items = json_decode($_POST['data'], 1)['items'];
// specify new columns
$newColumns = array();
foreach($items AS $item)
{
if(in_array($item['id'], $allowedItems))
{
$newColumns[] = array('item' => $item['id'], 'section' => $item['column'], 'collapsed' => $item['collapsed']);
}
}
// write to db
$setSetting = $ThemeDB->setSetting('dashboard_columns', $newColumns);
echo "success";
exit();
}
elseif($_GET['p']=='listservers')
{
echo $Theme->listServersFromDB();
exit();
}
}
}
}
elseif($_GET['m']=='settings')
{
if($isadmin)
{
if(isset($_GET['p']))
{
if($_GET['p']=='fileUpload')
{
echo _NewFileUpload($_FILES['themeLogo'], 'themeLogo', 'themeLogo', true);
exit;
}
elseif($_GET['p']=='themeLogo')
{
if(isset($_GET['v']) && ($_GET['v']=='remove'))
{
// load global setting (id -1)
$themeLogo = $ThemeDB->getSetting('themeLogo', -1);
if(!empty($themeLogo))
{
// build direct path
$oldLogo = $uploadsFolder."/".basename($themeLogo);
// delete old logo if exists
if(file_exists($oldLogo))
{
unlink($oldLogo);
}
// remove logo from db
echo $ThemeDB->removeSetting('themeLogo', -1);
}
}
}
elseif($_GET['p']=='themeNavWidth')
{
if(isset($_GET['v']) && is_numeric($_GET['v']) && $_GET['v']>=250 && $_GET['v']<=350)
{
// save new width
$setSetting = $ThemeDB->setSetting('themeNavWidth', $_GET['v'], -1);
echo $_GET['v'];
exit;
}else
{
// invalid value - return default width
echo 250;
exit;
}
}
elseif($_GET['p']=='themeServerstats')
{
if(isset($_GET['v']))
{
if($_GET['v']=='activate')
{
// generate token
$newToken = bin2hex(random_bytes(20));
// set token
$ThemeDB->setSetting('updateToken', $newToken, -1);
// set cronjob
$Theme->checkForCronjob();
}
elseif($_GET['v']=='remove')
{
// remove token
$ThemeDB->removeSetting('updateToken', -1);
// remove cronjob
$Theme->checkForCronjob(true);
}
elseif($_GET['v']=='setNum')
{
if(isset($_GET['num']) && is_numeric($_GET['num']))
{
$setNum = $_GET['num'];
if($setNum<1 || $setNum>20)
{
$setNum = 10;
}
// set num
$ThemeDB->setSetting('themeServerstatsNum', $setNum, -1);
}
}
}
exit;
}
}
}
}
}
// file upload function
function _NewFileUpload($filesField, $uploadName, $settingName, $systemSetting = false)
{
Global $uploadsFolder, $ThemeDB, $themeUploadsPath;
if(isset($filesField))
{
// check if uploads folder is writable
if(!is_writable($uploadsFolder))
{
$retArr = array(
'code' => 'error',
'data' => 'Error: Uploads Folder is not writable.<br>Check Folder: '.$uploadsFolder,
);
return json_encode($retArr);
}
// define svg mime types
$svgMimeTypes = array('image/svg+xml', 'image/svg');
// check if file is an image or a valid svg mime type
$isImage = getimagesize($filesField['tmp_name']);
if($isImage === false && !in_array(mime_content_type($filesField['tmp_name']), $svgMimeTypes))
{
// file is not an image; break script
$retArr = array(
'code' => 'error',
'data' => 'Error: File is no Image ('.mime_content_type($filesField['tmp_name']).')',
);
return json_encode($retArr);
}
// check file size
if($filesField['size'] > 5242880) // 5mb in bytes
{
// filesize is too big; break script
$retArr = array(
'code' => 'error',
'data' => 'Error: Filesize extends 5mb',
);
return json_encode($retArr);
}
// check if setting/upload already exists
if($systemSetting)
{
$oldUpload = $ThemeDB->getSetting($settingName, -1);
}else
{
$oldUpload = $ThemeDB->getSetting($settingName);
}
if(!empty($oldUpload))
{
// build file path
$oldLogo = $uploadsFolder."/".basename($oldUpload);
// delete old upload
if(file_exists($oldLogo))
{
unlink($oldLogo);
}
}
// get file extension
$fileExt = pathinfo($filesField['name'])['extension'];
$destFile = $uploadsFolder."/".$uploadName.".".$fileExt;
$newUpload = $themeUploadsPath.$uploadName.".".$fileExt;
if(move_uploaded_file($filesField['tmp_name'], $destFile))
{
// write to db
if($systemSetting)
{
$setSetting = $ThemeDB->setSetting($settingName, $newUpload, -1);
}else
{
$setSetting = $ThemeDB->setSetting($settingName, $newUpload);
}
$retArr = array(
'code' => 'success',
'data' => $newUpload,
);
return json_encode($retArr);
}
else
{
$retArr = array(
'code' => 'error',
'data' => 'Error: Could not move uploaded File',
);
return json_encode($retArr);
}
}else
{
return "no files";
}
}
?>

View file

@ -1,739 +0,0 @@
<?php
class Theme
{
private $absolutePath = "../../../..";
private function getOGPPublicPath()
{
return str_replace("themes/AdminLTE/dist/php/settings.php", "", $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME']);
}
public function checkIsAdmin($user_id)
{
// load ThemeDB class
require_once("./db.class.php");
$ThemeDB = new ThemeDB;
if(is_numeric($user_id))
{
$query = "
SELECT users_role
FROM ".$ThemeDB->tablePrefix()."users
WHERE user_id = ".$user_id."
";
$data = $ThemeDB->query($query);
if($data)
{
// reset users_group session for on the fly changes
$_SESSION['users_group'] = $data[0]['users_role'];
if($data[0]['users_role']=='admin')
{
return true;
}
}
}
return false;
}
private function getOGPServers($all = false)
{
// load ThemeDB class
require_once("./db.class.php");
$ThemeDB = new ThemeDB;
// list all ogp servers
if($all)
{
$query = "
SELECT *
FROM ".$ThemeDB->tablePrefix()."remote_servers
";
}else
{
$query = "
SELECT *
FROM ".$ThemeDB->tablePrefix()."remote_servers
ORDER BY 'remote_server_id' ASC
LIMIT 1
";
}
$data = $ThemeDB->query($query);
if($data)
{
return $data;
}
return false;
}
private function getAllCrons()
{
return $this->OGPCronjob('get');
}
private function OGPCronjob($type, $id = false, $url = false)
{
// load ogp lib_remote
require_once($this->absolutePath."/includes/lib_remote.php");
$firstRemoteServer = $this->getOGPServers();
if($firstRemoteServer)
{
$remote = new OGPRemoteLibrary($firstRemoteServer[0]['agent_ip'], $firstRemoteServer[0]['agent_port'], $firstRemoteServer[0]['encryption_key'], $firstRemoteServer[0]['timeout']);
if($remote->status_chk() != 1)
{
return false;
}
}else
{
// no server available
return false;
}
if($type=="get")
{
return $remote->scheduler_list_tasks();
}
elseif($type=="add" && $url)
{
return $remote->scheduler_add_task($url);
}
elseif($type=="edit" && $id && $url)
{
return $remote->scheduler_edit_task($id, $url);
}
elseif($type=="del")
{
return $remote->scheduler_del_task($id);
}
}
public function checkForCronjob($remove = false)
{
// load ThemeDB class
require_once("./db.class.php");
$ThemeDB = new ThemeDB;
$checkURL = $this->getOGPPublicPath().'themes/AdminLTE/dist/php/settings.php?m=global&p=check&v=updateserverstats';
$updateToken = $ThemeDB->getSetting('updateToken', -1);
$foundCron = false;
$validCron = false;
$allCrons = $this->OGPCronjob('get');
foreach($allCrons AS $cronNum => $cronVal)
{
// check if current cron is updateserverstats
if(strpos($cronVal, 'settings.php?m=global&p=check&v=updateserverstats') !== false)
{
if($remove)
{
// remove cron
$this->OGPCronjob('del', $cronNum);
}else
{
if($foundCron)
{
// possible duplicates, remove them all
$this->OGPCronjob('del', $cronNum);
continue;
}
else
{
$foundCron = $cronNum;
preg_match('/"(.*)"/', $cronVal, $cronURL);
$cronComponents = parse_url(end($cronURL));
parse_str($cronComponents['query'], $cronParams);
if($updateToken==$cronParams['token'])
{
$validCron = true;
}
}
}
}
}
if(!$remove && ($foundCron || !$validCron))
{
// specify cron url
$goodCronEntry = '*/5 * * * * wget -qO- "'.$checkURL.'&token='.$updateToken.'" --no-check-certificate';
if($foundCron && !$validCron)
{
// cron existent but invalid - update entry
$this->OGPCronjob('edit', $foundCron, $goodCronEntry);
return 'updated cronjob';
}
elseif(!$foundCron)
{
// cron not existent - create entry
$this->OGPCronjob('add', false, $goodCronEntry);
return 'created cronjob';
}
}
return false;
}
public function getGameServer($user_id = false)
{
// load ThemeDB class
require_once("./db.class.php");
$ThemeDB = new ThemeDB;
// load ogp server_config_parser to get SERVER_CONFIG_LOCATION variable
require_once($this->absolutePath."/modules/config_games/server_config_parser.php");
// load ogp lib_remote
require_once($this->absolutePath."/includes/lib_remote.php");
// first get all server homes, specific configs and ip/port config
$query = "
SELECT *
FROM ".$ThemeDB->tablePrefix()."home_ip_ports
NATURAL JOIN ".$ThemeDB->tablePrefix()."remote_servers
NATURAL JOIN ".$ThemeDB->tablePrefix()."server_homes
NATURAL JOIN ".$ThemeDB->tablePrefix()."config_homes
NATURAL JOIN ".$ThemeDB->tablePrefix()."remote_server_ips
NATURAL JOIN ".$ThemeDB->tablePrefix()."config_mods
NATURAL JOIN ".$ThemeDB->tablePrefix()."game_mods
";
if($user_id !== false)
{
$query .= "
NATURAL JOIN
(
SELECT home_id
FROM ".$ThemeDB->tablePrefix()."user_homes
WHERE user_id = ".$user_id."
UNION
SELECT home_id
FROM ".$ThemeDB->tablePrefix()."user_groups
NATURAL JOIN ".$ThemeDB->tablePrefix()."user_group_homes
WHERE user_id = ".$user_id."
) temp
";
}
$query .= "
WHERE force_mod_id IN
(
SELECT force_mod_id
FROM ".$ThemeDB->tablePrefix()."home_ip_ports
WHERE force_mod_id = ".$ThemeDB->tablePrefix()."game_mods.mod_id OR force_mod_id = 0
) ORDER BY home_user_order ASC, ".$ThemeDB->tablePrefix()."server_homes.home_id ASC
";
$serverHomes = $ThemeDB->query($query);
if($serverHomes)
{
foreach($serverHomes AS $key => $shData)
{
// check if the screen running the server is running.
$remote = new OGPRemoteLibrary($shData['agent_ip'], $shData['agent_port'], $shData['encryption_key'], $shData['timeout']);
if( $remote->is_screen_running(OGP_SCREEN_TYPE_HOME, $shData['home_id']))
{
$queryData = $this->getProtocolAndQuery($serverHomes[$key]);
$serverHomes[$key]['qProtocol'] = $queryData['qProtocol'];
$serverHomes[$key]['qName'] = $queryData['qName'];
$serverHomes[$key]['qMod'] = $queryData['qMod'];
}
else
{
// server screen stopped - remove server from array
unset($serverHomes[$key]);
}
}
return $serverHomes;
}
else
{
return false;
}
}
private function gameServerQuery($serverObject)
{
// declarations
$timeout = 5;
// default output
$gsq = array(
'online' => 0,
'max' => 0,
'serverOnline' => false,
'map' => false,
);
// change serverIP to agent ip if server is behind nat
$serverIP = ($serverObject['use_nat']==0) ? $serverObject['ip'] : $serverObject['agent_ip'];
// gameq
if($serverObject['qProtocol']=='gameq')
{
// load gameq class
require_once($this->absolutePath."/protocol/GameQ/Autoloader.php");
// ogp lgsl_port_conversion
require_once($this->absolutePath."/protocol/lgsl/lgsl_protocol.php");
$portConversion = lgsl_port_conversion($serverObject['qName'], $serverObject['port'], "", "");
$c_port = $portConversion['0']; // conn port
$q_port = $portConversion['1']; // query port
$s_port = $portConversion['2']; // software port
$gq = new \GameQ\GameQ();
$gq->addServer(array(
'id' => 'server',
'type' => $serverObject['qName'],
'host' => $serverIP.':'.$serverObject['port'],
'options' => [
'query_port' => $q_port,
],
));
$gq->setOption('timeout', $timeout);
// process gameq request
$data = $gq->process();
// only update if server is running
if(!empty($data['gq_online']) && $data['gq_online'])
{
$gsq['online'] = $data['gq_numplayers'];
$gsq['max'] = $data['gq_maxplayers'];
$gsq['serverOnline'] = true;
}else
{
$gsq['serverOnline'] = false;
}
}
// lgsl
elseif($serverObject['qProtocol']=='lgsl')
{
// ogp lgsl_port_conversion
require_once($this->absolutePath."/protocol/lgsl/lgsl_protocol.php");
$portConversion = lgsl_port_conversion($serverObject['qName'], $serverObject['port'], "", "");
$c_port = $portConversion['0']; // conn port
$q_port = $portConversion['1']; // query port
$s_port = $portConversion['2']; // software port
// get live data
$data = lgsl_query_live($serverObject['qName'], $serverIP, $c_port, $q_port, $s_port, "sa");
// only update if server is running
if($data['b']['status'])
{
$gsq['online'] = $data['s']['players'];
$gsq['max'] = $data['s']['playersmax'];
$gsq['serverOnline'] = true;
$gsq['map'] = $data['s']['map'];
}else
{
$gsq['serverOnline'] = false;
}
}
// ts3
elseif($serverObject['qProtocol']=='teamspeak3')
{
require_once($this->absolutePath."/protocol/TeamSpeak3/TeamSpeak3.php");
try
{
$ts3_VirtualServer = TeamSpeak3::factory('serverquery://'.$serverIP.':'.($serverObject['port'] + 24).'/?server_port='.$serverObject['port'].'&timeout='.$timeout);
$ts3_VirtualServer->setExcludeQueryClients(true);
$gsq['online'] = $ts3_VirtualServer->virtualserver_clientsonline-$ts3_VirtualServer->virtualserver_queryclientsonline;
$gsq['max'] = $ts3_VirtualServer->virtualserver_maxclients;
$gsq['serverOnline'] = true;
$gsq['map'] = 'teamspeak3';
}
catch(Exception $e)
{
$gsq['serverOnline'] = false;
}
}
return $gsq;
}
public function updateGameserverStats($token = false)
{
// load ThemeDB class
require_once("./db.class.php");
$ThemeDB = new ThemeDB;
// check token
if($token)
{
$checkToken = $ThemeDB->getSetting('updateToken', -1);
if($token==$checkToken)
{
// get all GameServers
$getGameServer = $this->getGameServer();
if($getGameServer)
{
foreach($getGameServer AS $key => $gameServer)
{
$gsq = $this->gameServerQuery($gameServer);
// write player stats into db
$ThemeDB->query("
INSERT INTO ".$ThemeDB->serverStatsTable." (home_id, users_online)
VALUES('".$gameServer['home_id']."', '".$gsq['online']."')
");
}
// delete old stats (keep only entries from last 1 day)
$ThemeDB->query("
DELETE FROM ogp_adminlte_serverstats WHERE current_stamp < DATE_ADD(NOW(), INTERVAL -1 DAY)
");
return "successfully updated";
}else
{
return "no running gameserver found";
}
}else
{
return "invalid token";
}
}
return "no token";
}
public function listServersFromDB()
{
$allServers = '';
$filterUserId = $_SESSION['user_id'];
if(isset($_SESSION['users_group']) && $_SESSION['users_group']=='admin')
{
// user is admin, so display all servers
$filterUserId = false;
}
// get all servers from db
$getGameServer = $this->getGameServer($filterUserId);
if($getGameServer)
{
foreach($getGameServer as $key => $val)
{
$allServers .= $this->buildServerBox($val);
}
}
return $allServers;
}
private function buildServerBox($serverObject)
{
$gameName = (strtolower($serverObject['mod_name'])=='none') ? $serverObject['game_name'] : $serverObject['game_name'].' ('.$serverObject['mod_name'].')';
$gameMonitorLink = 'home.php?m=gamemanager&p=game_monitor&home_id-mod_id-ip-port='.$serverObject['home_id'].'-'.$serverObject['mod_id'].'-'.$serverObject['ip'].'-'.$serverObject['port'];
// call game config file to get protocol, query and mod values
$queryData = $this->getProtocolAndQuery($serverObject);
$serverObject['qProtocol'] = $queryData['qProtocol'];
$serverObject['qName'] = $queryData['qName'];
$serverObject['qMod'] = $queryData['qMod'];
// start server query to get online/unknown status and map parameter
$gsq = $this->gameServerQuery($serverObject);
$serverOnline = ($gsq['serverOnline']) ? 'online' : 'unknown';
$serverObject['qMap'] = $gsq['map'];
// small map fix for special servers
$serverObject['qMap'] = ($serverObject['qMap']=='-') ? '_' : $serverObject['qMap'];
// declare icon box
$iconBox = '
<span class="info-box-icon">
<i class="fas fa-gamepad"></i>
</span>
';
if($gsq['serverOnline'])
{
// check if a map image exists
$mapImage = $this->getServerImage($serverObject);
if($mapImage!=$this->getOGPPublicPath().'images/online_big.png')
{
$iconBox = '
<span class="info-box-icon" style="
background-image: url(\''.$mapImage.'\');
background-size: cover;
background-repeat: no-repeat;
">
</span>
';
}
}
$serverBox = '
<div class="info-box serverstatus mb-2" data-id="'.$serverObject['home_id'].'" data-status="'.$serverOnline.'">
'.$iconBox.'
<div class="info-box-content d-flex flex-row justify-content-between pr-0">
<span class="server-infos mr-2">
<div class="server-name text-truncate">
<a href="'.$gameMonitorLink.'" class="text-dark" data-toggle="tooltip" title="'.$serverObject['home_name'].'">'.$serverObject['home_name'].'</a>
</div>
<div class="server-ipport">'.$serverObject['ip'].':'.$serverObject['port'].'</div>
<div class="server-gamename text-nowrap text-muted text-sm">'.$gameName.'</div>
</span>
<span class="player-infos ml-auto w-100">
<h5 class="server-player text-right ml-2">
<span class="server-current-player">'.$gsq['online'].'</span>/<span class="server-max-player">'.$gsq['max'].'</span>
</h5>
'.$this->buildPlayerChart($serverObject).'
</span>
</div>
</div>
';
return $serverBox;
}
private function buildPlayerChart($serverObject)
{
// load ThemeDB class
require_once("./db.class.php");
$ThemeDB = new ThemeDB;
$showElements = $ThemeDB->getSetting('themeServerstatsNum', -1);
if(empty($showElements))
{
$showElements = 10;
}
$onlineStatsQuery = $ThemeDB->query("
SELECT users_online
FROM ".$ThemeDB->serverStatsTable."
WHERE home_id = ".$serverObject['home_id']."
ORDER BY current_stamp DESC
LIMIT ".$showElements."
");
$labels = array();
$onlineStats = array();
foreach($onlineStatsQuery AS $osq)
{
$labels[] = '';
$onlineStats[] = $osq['users_online'];
}
$chart = '
<div class="playerChart">
<div class="chart-container ml-auto" style="position: relative; height:35px; width:90%">
<canvas id="playerChart-'.$serverObject['home_id'].'"></canvas>
</div>
<script>
var onlineUsersText = langConsts[langConstPrefix + "online"];
var lineChartCanvas = $("#playerChart-'.$serverObject['home_id'].'").get(0).getContext("2d");
var lineChart = new Chart(lineChartCanvas, {
type: "line",
data: {
labels: ["'.implode('","', $labels).'"],
datasets: [{
label: onlineUsersText,
backgroundColor: "rgba(108,117,125,0.9)",
borderColor: "rgba(108,117,125,0.9)",
data: ["'.implode('","', array_reverse($onlineStats)).'"],
borderWidth: 0
}]
},
options: {
"title": {
"display": false,
},
"legend": {
"display": false,
},
"responsive": true,
"maintainAspectRatio": false,
"scales": {
"yAxes": [
{
"display": false,
"ticks": {
"beginAtZero": true
}
}
],
"xAxes": [
{
"display": false
}
],
},
"layout": {
"padding": {
"top": 3,
"bottom": 3
}
},
"tooltips": {
intersect: false,
enabled: false,
custom: function(tooltipModel)
{
var tooltipEl = document.getElementById("chartjs-tooltip");
// Create element on first render
if(!tooltipEl)
{
tooltipEl = document.createElement("div");
tooltipEl.id = "chartjs-tooltip";
tooltipEl.innerHTML = tooltipModel.body[0].lines[0];
document.body.appendChild(tooltipEl);
}else
{
// hide if mouse got away from dot
if(typeof(tooltipModel.body)=="undefined")
{
tooltipEl.style.opacity = 0;
return;
}
// update innerHTML
tooltipEl.innerHTML = tooltipModel.body[0].lines[0];
}
// Hide if no tooltip
if(tooltipModel.opacity === 0)
{
tooltipEl.style.opacity = 0;
return;
}
// Set caret Position
tooltipEl.classList.remove("above", "below", "no-transform");
if(tooltipModel.yAlign)
{
tooltipEl.classList.add(tooltipModel.yAlign);
}
else
{
tooltipEl.classList.add("no-transform");
}
var position = this._chart.canvas.getBoundingClientRect();
// Display, position, and set styles for font
tooltipEl.style.opacity = 1;
tooltipEl.style.position = "absolute";
tooltipEl.style.left = position.left + window.pageXOffset + tooltipModel.caretX + "px";
tooltipEl.style.top = position.top + window.pageYOffset + tooltipModel.caretY + "px";
tooltipEl.style.pointerEvents = "none";
},
},
},
});
</script>
</div>
';
return $chart;
}
private function getProtocolAndQuery($serverObject)
{
// load ogp server_config_parser to get SERVER_CONFIG_LOCATION variable
require_once($this->absolutePath."/modules/config_games/server_config_parser.php");
// load home config file
$serverConfig = simplexml_load_file($this->absolutePath."/".SERVER_CONFIG_LOCATION.$serverObject['home_cfg_file']);
if($serverConfig)
{
// get protocol query name
if($serverConfig->{'protocol'}=='gameq')
{
$queryName = (string)$serverConfig->gameq_query_name;
}
elseif($serverConfig->{'protocol'}=='lgsl')
{
$queryName = (string)$serverConfig->lgsl_query_name;
}
else
{
$queryName = (string)$serverConfig->{'protocol'};
}
return array(
'qName' => $queryName,
'qProtocol' => (string)$serverConfig->{'protocol'},
'qMod' => (string)$serverConfig->{'mods'}->{'mod'}['key'],
);
}
return false;
}
private function getServerImage($serverObject)
{
// load ogp helpers
require_once($this->absolutePath."/includes/helpers.php");
$query_name = strtolower($serverObject['qName']);
$mod = strtolower($serverObject['qMod']);
$map = str_replace("-", "_", strtolower($serverObject['qMap']));
// adapting get_map_path() from OGP
$mod_gt = $mod;
if($mod == "cstrike")
{
if ($query_name == "halflife")
$mod_gt = "cs";
elseif($query_name == "source")
$mod_gt = "css";
}
if($mod == "tf")
{
if ($query_name == "halflife")
$mod_gt = "tf";
elseif($query_name == "source")
$mod_gt = "tf2";
}
// ts3 fix
$query_name = ($query_name == "teamspeak3") ? "ts3" : $query_name;
$mod_gt = $mod == "fof" ? "hl2dm" : $mod_gt;
$mod_gt = $mod == "insurgency" ? "ins" : $mod_gt;
$mod_gt = $mod == "redorchestra2" ? "ro2" : $mod_gt;
$mod_gt = $mod == "risingstorm2" ? "ro2" : $mod_gt;
$mod_gt = $mod == "killingfloor2" ? "kf2" : $mod_gt;
$mod_gt = $query_name == "7dtd" ? "7daystodie" : $mod_gt;
$mod_gt = $query_name == "callofduty" ? "cod" : $mod_gt;
$mod_gt = $query_name == "callofdutyuo" ? "uo" : $mod_gt;
$mod_gt = $query_name == "callofduty2" ? "cod2" : $mod_gt;
$mod_gt = $query_name == "callofduty4mw" ? "cod4" : $mod_gt;
$mod_gt = $query_name == "callofdutywaw" ? "codww" : $mod_gt;
$mod_gt = $query_name == "callofdutymw3" ? "mw3" : $mod_gt;
$mod_gt = $query_name == "conanexiles" ? "conan" : $mod_gt;
$map_paths = array(
$this->getOGPPublicPath()."protocol/lgsl/maps/$query_name/$mod/$map.jpg",
$this->getOGPPublicPath()."protocol/lgsl/maps/$query_name/$mod/$map.gif",
$this->getOGPPublicPath()."protocol/lgsl/maps/$query_name/$mod/$map.png",
$this->getOGPPublicPath()."protocol/lgsl/maps/$query_name/$map.jpg",
$this->getOGPPublicPath()."protocol/lgsl/maps/$query_name/$map.gif",
$this->getOGPPublicPath()."protocol/lgsl/maps/$query_name/$map.png",
"https://image.gametracker.com/images/maps/160x120/$mod_gt/$map.jpg",
"https://image.gametracker.com/images/maps/160x120/$query_name/$map.jpg",
$this->getOGPPublicPath()."images/online_big.png"
);
return get_first_existing_file($map_paths, 'https://gametracker.com', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0');
}
}
?>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

View file

@ -1,153 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
<title>%title%</title>
<script src="themes/AdminLTE/plugins/jquery/jquery.min.js"></script>
<script src="themes/AdminLTE/plugins/jquery-ui/jquery-ui.min.js"></script>
<!-- Bootstrap 4 -->
<script src="themes/AdminLTE/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
%header_code%
<!-- Font Awesome -->
<link rel="stylesheet" href="themes/AdminLTE/plugins/fontawesome-free/css/all.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="themes/AdminLTE/dist/css/adminlte.css">
<!-- overlayScrollbars -->
<link rel="stylesheet" href="themes/AdminLTE/plugins/overlayScrollbars/css/OverlayScrollbars.min.css">
<!-- Daterange picker -->
<link rel="stylesheet" href="themes/AdminLTE/plugins/daterangepicker/daterangepicker.css">
<!-- summernote -->
<link rel="stylesheet" href="themes/AdminLTE/plugins/summernote/summernote-bs4.min.css">
<!-- toastr -->
<link rel="stylesheet" href="themes/AdminLTE/plugins/toastr/toastr.min.css">
<!-- pace -->
<link rel="stylesheet" href="themes/AdminLTE/plugins/pace-progress/themes/blue/pace-theme-flash.css">
<!-- Main CSS -->
<link rel="stylesheet" href="themes/AdminLTE/dist/css/main.css">
<link rel="shortcut icon" href="themes/AdminLTE/dist/img/favicon.ico">
</head>
<body class="dark-mode hold-transition sidebar-mini layout-fixed layout-navbar-fixed layout-md-footer-fixed">
%meta%
<div class="wrapper">
<!-- Navbar -->
<nav class="main-header navbar navbar-expand navbar-dark">
<!-- Left navbar links -->
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>
</li>
</ul>
<!-- Right navbar links -->
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" data-widget="fullscreen" href="#" role="button">
<i class="fas fa-expand-arrows-alt"></i>
</a>
</li>
<li class="nav-item">
<a class="nav-link" data-widget="control-sidebar" data-controlsidebar-slide="true" href="#" role="button">
<i class="fas fa-cog"></i>
</a>
</li>
<li class="nav-item" role="list">
<a class="nav-link" href="?logout=true" role="button">
<i class="fas fa-power-off text-danger"></i>
</a>
</li>
</ul>
</nav>
<!-- /.navbar -->
<!-- Main Sidebar Container -->
<aside class="main-sidebar sidebar-dark-primary elevation-4">
<!-- Brand Logo -->
<a class="brand-link text-center">
<img src="themes/AdminLTE/dist/img/ogp_logo_dark.svg" class="brand-image">
</a>
<!-- Sidebar -->
<div class="sidebar">
<!-- Sidebar user panel (optional) -->
<div class="user-panel mt-3 pb-3 mb-3 d-flex">
<div class="image">
<img src="themes/AdminLTE/dist/img/default-avatar.png" class="img-circle elevation-2" alt="User Image">
</div>
<div class="info">
<a href="#" class="d-block">Username</a>
</div>
</div>
<!-- Sidebar Menu -->
<nav class="mt-2 pb-5">
<ul class="nav nav-pills nav-child-indent nav-sidebar flex-column text-sm" data-widget="treeview" role="menu" data-accordion="false">
%body%
<!-- Control Sidebar -->
<aside class="control-sidebar control-sidebar-dark">
<div class="p-4">
<h5 class="mb-0">Theme Settings</h5>
<hr class="m-1">
<select class="form-control mb-2" id="themeChanger">
</select>
<h5 class="mb-0 mt-4">User Settings</h5>
<hr class="m-1">
<div class="mb-2">
<div class="input-group">
<div class="custom-file">
<input type="file" class="custom-file-input" name="userAvatar" id="userAvatar">
<label class="custom-file-label" for="userAvatar">User Avatar</label>
</div>
</div>
</div>
</div>
</aside>
<!-- /.control-sidebar -->
</div>
<!-- ./wrapper -->
<!-- jQuery -->
<script>
$.widget.bridge('uibutton', $.ui.button);
$('script[src="js/jquery/jquery.min.js"]').remove();
$('script[src="js/jquery/ui/jquery-ui.min.js"]').remove();
</script>
<!-- daterangepicker -->
<script src="themes/AdminLTE/plugins/moment/moment.min.js"></script>
<script src="themes/AdminLTE/plugins/daterangepicker/daterangepicker.js"></script>
<!-- Summernote -->
<script src="themes/AdminLTE/plugins/summernote/summernote-bs4.min.js"></script>
<!-- overlayScrollbars -->
<script src="themes/AdminLTE/plugins/overlayScrollbars/js/jquery.overlayScrollbars.min.js"></script>
<!-- toastr -->
<script src="themes/AdminLTE/plugins/toastr/toastr.min.js"></script>
<!-- jQuery Knob -->
<script src="themes/AdminLTE/plugins/jquery-knob/jquery.knob.min.js"></script>
<!-- simpleUpload -->
<script src="themes/AdminLTE/plugins/simpleupload/simpleUpload.min.js"></script>
<!-- BS Custom File Input -->
<script src="themes/AdminLTE/plugins/bs-custom-file-input/bs-custom-file-input.min.js"></script>
<!-- ChartJS -->
<script src="themes/AdminLTE/plugins/chart.js/Chart.min.js"></script>
<!-- AdminLTE App -->
<script src="themes/AdminLTE/dist/js/adminlte.min.js"></script>
<!-- Main JS -->
<script src="themes/AdminLTE/dist/js/main.js"></script>
<!-- Hidden Element to prevent jQuery errors due old, previous loaded Scripts -->
<div class="tickets d-none"></div>
</body>
</html>

View file

@ -1,4 +0,0 @@
#clearLink,
img[src$="spacer.png"] {
display: none;
}

View file

@ -1,51 +0,0 @@
$(document).ready(function()
{
$('link[href="modules/TS3Admin/webinterface.css"]').remove();
$('#loadingImage').remove();
$('.main a[href$="changevServer"]').prepend('<i class="fas fa-exchange-alt mr-1"></i>').addClass('btn-secondary mb-2 ');
$('.main > form > br').remove();
$('.main span').each(function()
{
if($(this).attr('style'))
{
$(this).removeAttr('style');
}
});
$('.main [name="startvServer"]').addClass('btn-success');
$('.main [name="stopvServer"]').addClass('btn-danger');
$('.main #clearLink').parent('div').addClass('text-muted mb-1');
$('.main > .infoBox').wrapAll('<div class="row"></div>');
$('.main > .row > .infoBox').each(function()
{
$(this).wrapAll('<div class="col-12 col-md-6"><div class="card"><div class="card-body"></div></div></div>');
});
$('.edit').each(function()
{
var imgURL = $(this).find('img').attr('src');
$(this).addClass('btn btn-sm btn-primary').find('img').remove();
if (imgURL.toLowerCase().indexOf("edit.png") >= 0)
{
$(this).addClass('btn-secondary').html('<i class="fas fa-edit"></i>');
}
else if (imgURL.toLowerCase().indexOf("refresh.png") >= 0)
{
$(this).html('<i class="fas fa-sync"></i>');
}
});
$('#serverstatus.online').addClass('badge bg-success');
$('#serverstatus.offline').addClass('badge bg-danger');
$('#jsMsg + div a').each(function()
{
});
});

View file

@ -1,5 +0,0 @@
$(document).ready(function()
{
$('.main').addClass('main-content').parent().attr('id', 'content');
$('.main [type="submit"]').last().removeClass('btn-primary').addClass('btn-secondary');
});

View file

@ -1,5 +0,0 @@
$(document).ready(function()
{
$('.main input[name="remove"]').removeClass('btn-primary').addClass('btn-danger');
$('.main input[name="show_all"]').removeClass('btn-primary').addClass('btn-warning float-right');
});

View file

@ -1,50 +0,0 @@
.main [href*="&addon_type="]
{
width: 150px;
height: 110px;
border-radius: 4px;
}
.main [href*="&addon_type="] span {
line-height: 14px;
max-height: 28px;
}
.main .addons {
display: inline-block;
width: 100%;
}
.main .addons a {
position: relative;
}
.main .addons a + a {
margin-left: 0.5rem;
}
.main .addons a > .badge {
position: absolute;
top: -5px;
right: -5px;
width: 25px;
font-size: 0.8rem;
font-weight: 400;
}
.main .addons a[href*="&addon_type="]:before
{
display: block;
font-size: 40px;
font-family: 'Font Awesome 5 Free';
font-weight: 900;
content: "\f1b2";
}
.main .addons a[href*="&addon_type=plugin"]:before {
content: "\f12e";
}
.main .addons a[href*="&addon_type=config"]:before {
content: "\f11b";
}
.main .addons a[href*="&addon_type=mappack"]:before {
content: "\f279";
}

View file

@ -1,20 +0,0 @@
$(document).ready(function()
{
$('.main > table').before('<div class="addons d-flex mb-1"></div>');
$('.main td').contents().appendTo('.addons');
$('.main > table').remove();
$('.main [type="submit"]').removeClass('btn-primary').addClass('btn-secondary');
$('.main [href*="&addon_type="]').each(function()
{
$(this).addClass('btn btn-primary d-flex flex-column justify-content-center align-items-center').wrapInner('<span>');
var btnTextSplit = $(this).find('span').text().split('(');
var btnText = btnTextSplit[0];
var btnMods = btnTextSplit[1].split(')')[0];
$(this).find('span').text(btnText);
$(this).prepend('<span class="badge bg-secondary">' + btnMods + '</span>');
});
});

View file

@ -1,29 +0,0 @@
.admin-buttons {
width: 150px;
height: 110px;
margin: 0px 5px 5px 0px !important;
}
.admin-buttons > span {
font-size: 0.9rem;
display: block;
}
.admin-buttons:before {
font-size: 40px;
line-height: 40px;
display: block;
font-family: "Font Awesome 5 Free";
font-weight: 900;
margin-bottom: 5px;
}
.admin-buttons > img,
.admin-buttons > br {
display: none;
}
.table tr:first-of-type td {
border-top: none;
}
.main > h2 {
margin-top: 2rem;
}

View file

@ -1,57 +0,0 @@
$(document).ready(function()
{
var adminButtonTable = $('.main table.administration-table').first();
$('<div class="administration-table d-flex flex-wrap justify-content-start"></div>').insertAfter(adminButtonTable);
$(adminButtonTable).parent('.card-body').addClass('pb-3');
$(adminButtonTable).find('a.administration-buttons').each(function()
{
$('div.administration-table').append('<a class="admin-buttons btn btn-primary d-flex flex-column justify-content-center align-items-center" href="' + $(this).attr('href') + '"><span>' + $(this).find('div').text() + '</span></a>');
});
$(adminButtonTable).remove();
// better remove link buttons
$('.remove-button').each(function()
{
$(this).replaceWith('<button class="btn btn-sm btn-danger"><i class="fas fa-trash mr-1"></i>'+langConsts['OGP_LANG_delete']+'</button>')
});
});
$(window).load(function()
{
$('.main [name="download"]').prepend('<i class="fas fa-download mr-1"></i>').addClass('btn-secondary');
$('.main [name="restore"]').prepend('<i class="fas fa-upload mr-1"></i>').addClass('btn-warning');
$('.main .custom-file').removeAttr('style');
// better links
if($('img[src$="link.png"]').length>0)
{
var parentTable = $('img[src$="link.png"]').closest('.table-responsive');
$(parentTable).after('<div class="administration-table externalLinks d-flex flex-wrap justify-content-start p-1"></div>');
$(parentTable).find('td').each(function()
{
$('.externalLinks').append('<div class="elink">'+$(this).html()+'</div>');
});
$(parentTable).remove();
$('.main .elink > a').each(function()
{
$(this).addClass('admin-buttons btn btn-primary d-flex flex-column justify-content-center align-items-center');
// since that iframe shizzle isnt modern conform, i reset all links to external links
$(this).attr('href', $(this).attr('href').replace('?m=administration&p=iframe&external_link=', '')).attr('target', '_blank');
});
}
// remove empty tables
$('.main table').each(function()
{
if($(this).text().trim().length==0)
{
$(this).parent('.table-responsive').remove();
}
});
});

View file

@ -1,49 +0,0 @@
.ql-editor,
.ql-toolbar.ql-snow,
.ql-snow .ql-picker,
.ql-formats,
.ql-picker-options {
color: #fff !important;
background-color: rgba(26, 28, 34, 0.4);
}
.ql-picker-options {
background-color: rgba(26, 28, 34, 0.8) !important;
}
.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label:hover,
.ql-snow.ql-toolbar button:hover,
.ql-snow .ql-toolbar button:hover {
border: 1px solid rgba(255, 255, 255, 0.6) !important;
}
.ql-snow .ql-stroke {
stroke: rgba(255, 255, 255, 1) !important;
}
.ql-snow.ql-toolbar button:hover,
.ql-snow .ql-toolbar button:hover,
.ql-snow.ql-toolbar button:focus,
.ql-snow .ql-toolbar button:focus,
.ql-snow.ql-toolbar button.ql-active,
.ql-snow .ql-toolbar button.ql-active,
.ql-snow.ql-toolbar .ql-picker-label:hover,
.ql-snow .ql-toolbar .ql-picker-label:hover,
.ql-snow.ql-toolbar .ql-picker-label.ql-active,
.ql-snow .ql-toolbar .ql-picker-label.ql-active,
.ql-snow.ql-toolbar .ql-picker-item:hover,
.ql-snow .ql-toolbar .ql-picker-item:hover,
.ql-snow.ql-toolbar .ql-picker-item.ql-selected,
.ql-snow .ql-toolbar .ql-picker-item.ql-selected {
color: #fff !important;
}
.ql-editor h1,
.ql-editor h2,
.ql-editor h3 {
border-bottom: none;
}
.ql-toolbar.ql-snow,
.ql-container.ql-snow {
border: 1px solid #22252f !important;
}

View file

@ -1,31 +0,0 @@
$(document).ready(function()
{
// $('.main table').wrap('<div class="table-responsive"></div>');
$('[href$="&delete"]').addClass('btn btn-sm btn-danger');
if(window.location.href.indexOf("home.php?m=config_games&xml_config_creator=Create+XML+Configs") != -1 )
{
$('iframe').attr('id', 'xcc_iframe');
$('iframe').load(function()
{
$(this).contents().find("body").addClass('xcc_iframe');
var main_css = '<link rel="stylesheet" type="text/css" href="../../themes/SimpleBootstrap/css/main.css">';
var bs = '<link rel="stylesheet" href="../../themes/SimpleBootstrap/css/bootstrap.min.css">';
var bs_t = '<link rel="stylesheet" href="../../themes/SimpleBootstrap/css/bootstrap-theme.min.css">';
var js = '<link rel="stylesheet" href="../../themes/SimpleBootstrap/js/main.js">';
var xml_css = '<link rel="stylesheet" type="text/css" href="../../themes/SimpleBootstrap/modules/config_games/main.css">';
$(this).contents().find("head").append(bs);
$(this).contents().find("head").append(bs_t);
$(this).contents().find("head").append(js);
$(this).contents().find("head").append(main_css);
$(this).contents().find("head").append(xml_css);
$(this).contents().find("table").removeAttr("style").removeAttr("colspan").addClass('table table-sm table-striped');
$(this).contents().find('button, input[type=button], [type=submit], input[type=reset], .swfuploadbtn').addClass('btn btn-sm btn-primary');
$(this).contents().find('textarea, select, input[type=text]').addClass('form-control').removeAttr('style');
$(this).contents().find('form').addClass('form-group');
});
}
});

View file

@ -1,9 +0,0 @@
html,
body {
background: transparent !important;
color: #fff;
}
td {
font-size: 14px;
}

View file

@ -1,47 +0,0 @@
.content-wrapper .log .table:first-of-type {
margin-bottom: 0px;
}
.content-wrapper .log b table {
width: 100%;
}
.content-wrapper .log b table td:not(:last-of-type){
width: 60px !important;
text-align: center;
}
.content-wrapper input.form-control:not([name="command"]) {
width: 46px;
min-width: 46px;
}
.content-wrapper [id^="refreshed"] td:not(:last-of-type) {
width: 58px;
min-width: 58px;
}
.content-wrapper select[name="action"] {
width: auto;
}
.content-wrapper .log {
padding: 0px;
}
.content-wrapper .center td:not(:nth-last-child(1)):not(:nth-last-child(2)) {
width: 1px;
}
/* table responsive */
.content-wrapper [id^="refreshed"] {
display: block;
width: 100%;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
.content-wrapper select[name="homeid_ip_port"],
.content-wrapper input[name="command"] {
min-width: 200px;
}

View file

@ -1,49 +0,0 @@
$(document).ready(function()
{
$('.content-wrapper [href="?m=administration&p=main"], .main [href="javascript:history.go(-1)"], .main [href="home.php?m=cron&p=cron"], .main a[href="home.php?m=cron&p=user_cron"]').addClass('btn btn-sm btn-primary');
$('.content-wrapper input[name="removeJob"]').removeClass('btn-primary').addClass('btn-danger');
$('.content-wrapper a[href="home.php?m=cron&p=user_cron"]').removeClass('btn-primary').addClass('btn-secondary').prepend('<i class="fas fa-angle-double-left mr-1"></i>');
$('.content-wrapper .hundred td[colspan="6"]').attr('colspan',8);
$('.content-wrapper th:last-child').attr('colspan', 2);
});
$(window).load(function()
{
// check if cron is the updateserverstats cron
$('.content-wrapper input[name="command"]').each(function()
{
if($(this).val().toLowerCase().indexOf('adminlte/dist/php/settings.php')>=0)
{
// wrap theme cron input into input-group
$(this).wrap('\
<div class="input-group mb-2 mr-sm-2">\
<div class="input-group-prepend">\
<div class="input-group-text border-danger">Theme Cron</div>\
</div>\
</div>\
');
// colorize all fields
$(this).closest('tr').find('.form-control').addClass('border-danger');
}
});
// wrap scheduled jobs into separate card
var doWrap = false;
$('.main > *').each(function(index)
{
if($(this).is('h2'))
{
doWrap = true;
$('.content .row > div').append('<div class="card"><div class="card-header"><h3 class="card-title">'+$(this).text()+'</h3></div><div class="card-body"></div></div>');
$(this).remove();
}else
{
if(doWrap)
{
$('.content .card-body:not(.main)').append($(this));
}
}
});
});

View file

@ -1,47 +0,0 @@
.content-wrapper .log .table:first-of-type {
margin-bottom: 0px;
}
.content-wrapper .log b table {
width: 100%;
}
.content-wrapper .log b table td:not(:last-of-type){
width: 60px !important;
text-align: center;
}
.content-wrapper input.form-control:not([name="command"]) {
width: 46px;
min-width: 46px;
}
.content-wrapper [id^="refreshed"] td:not(:last-of-type) {
width: 58px;
min-width: 58px;
}
.content-wrapper select[name="action"] {
width: auto;
}
.content-wrapper .log {
padding: 0px;
}
.content-wrapper .center td:not(:nth-last-child(1)):not(:nth-last-child(2)) {
width: 1px;
}
/* table responsive */
.content-wrapper [id^="refreshed"] {
display: block;
width: 100%;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
.content-wrapper select[name="homeid_ip_port"],
.content-wrapper input[name="command"] {
min-width: 200px;
}

View file

@ -1,28 +0,0 @@
$(document).ready(function()
{
$('.content-wrapper [href="home.php?m=cron&p=cron"]').addClass('btn btn-sm btn-warning').prepend('<i class="fas fa-crown mr-1"></i>');
$('.content-wrapper [href="?m=administration&p=main"], .main [href="javascript:history.go(-1)"]').addClass('btn btn-sm btn-primary');
$('.content-wrapper input[name="removeJob"]').removeClass('btn-primary').addClass('btn-danger');
$('.content-wrapper th:last-child').attr('colspan', 2);
});
$(window).load(function()
{
var doWrap = false;
$('.main > *').each(function(index)
{
if($(this).is('h2'))
{
doWrap = true;
$('.content .row > div').append('<div class="card"><div class="card-header"><h3 class="card-title">'+$(this).text()+'</h3></div><div class="card-body"></div></div>');
$(this).remove();
}else
{
if(doWrap)
{
$('.content .card-body:not(.main)').append($(this));
}
}
});
});

View file

@ -1,95 +0,0 @@
[id^=refreshed] br {
display: none;
}
.vertical-progress {
transform: rotate(-90deg);
max-width: 100px;
}
.online_servers {
width: 100%;
}
.online_servers .name img {
margin-right: 4px;
}
.online_servers td {
padding: 3px 10px !important;
}
.online_servers a
{
color: #fff;
}
.online_servers a:hover
{
color: rgba(255, 255, 255, 0.6);
}
.online_servers [id^=refreshed]
{
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.online_servers [id^=refreshed] div
{
display: inline-block;
white-space: nowrap;
}
.online_servers .name,
.online_servers #gamelink {
display: inline-block;
}
@media (max-width: 500px) {
.serverstatus .info-box-icon,
.serverstatus .playerChart {
display: none !important;
}
}
.serverstatus .server-infos > div {
line-height: 1.2rem;
}
.serverstatus .server-name {
font-weight: bold;
margin-bottom: 0.3rem;
max-width: 260px;
}
.serverstatus[data-status="online"] {
border-left: 4px solid;
border-color: var(--success);
}
.serverstatus[data-status="unknown"] {
border-left: 4px solid;
border-color: var(--warning);
}
.serverstatus:last-of-type {
margin-bottom: 0px !important;
}
.serverstatus .playerChart {
position: relative;
}
.serverstatus .chart-container {
margin-left: auto;
margin-right: 0;
max-width: 320px;
}
#chartjs-tooltip {
background-color: rgb(18 19 20 / 80%);
border-radius: 4px;
color: #fff;
padding: 2px 10px;
font-size: 0.7rem;
}
#chartjs-tooltip {
transition: opacity 200ms linear;
}

View file

@ -1,646 +0,0 @@
$(document).ready(function()
{
// remove old js
$('script[src="js/modules/dashboard.js"]').remove();
// image replacements
$('img[src$="game_monitor.png"]').replaceWith('<h2 class="d-inline float-right m-2"><i class="fas fa-desktop"></i></h2>');
$('img[src$="support.png"]').replaceWith('<h2 class="d-inline float-right m-2"><i class="fas fa-hands-helping"></i></h2>');
// head sections
$('.column').each(function()
{
if(!$(this).parent('div').hasClass('row'))
{
$(this).parent('div').addClass('row').removeAttr('style');
}
var columnContent = $(this).html();
if($(this).hasClass('one_two'))
{
$(this).replaceWith("<section class='col-12 col-md-6 connectedSortable' id='"+$(this).attr('id')+"'>" + columnContent + "</section>");
}
else if($(this).hasClass('one_fourth'))
{
$(this).replaceWith("<section class='col-12 col-md-6 col-lg-3 connectedSortable' id='"+$(this).attr('id')+"'>" + columnContent + "</section>");
}
else
{
$(this).replaceWith("<section class='col-12 connectedSortable' id='"+$(this).attr('id')+"'>" + columnContent + "</section>");
}
});
// dragbox / bloc to card conversion
$('.dragbox, .bloc').each(function()
{
var isCollapsed = false
var collapseBtn = 'fa-minus';
var thisContent = $(this).find('.dragbox-content');
if($(thisContent).length > 0)
{
// check if dragbox has attribute "style"
if(typeof $(thisContent).attr('style') !== 'undefined' && $(thisContent).attr('style') !== false)
{
// check if dragbox has style "display:none"
if($(thisContent).attr('style').indexOf("display:none") >= 0)
{
isCollapsed = true
var collapseBtn = 'fa-plus';
}
}
$(thisContent).removeClass('dragbox-content').addClass('card-body').removeAttr('style');
// check if dragbox is a link
if(typeof $(thisContent).attr('onclick') !== 'undefined' && $(thisContent).attr('onclick') !== false)
{
// add cursor pointer style
$(thisContent).css('cursor', 'pointer');
// check if link is external to change event to window.open (new window)
var thisURL = $(thisContent).attr('onclick').replace("location.href='", "").replace("'", "");
if(thisURL.includes("://"))
{
$(thisContent).attr("onclick", "window.open('"+thisURL+"')");
}
}
}
if(isCollapsed)
{
$(this).attr('class', '').addClass('card collapsed-card');
}else
{
$(this).attr('class', '').addClass('card');
}
var boxTitle = $(this).find('h4').text();
$(this).find('h4').replaceWith("\
<div class='card-header ui-sortable-handle' style='cursor: move;'>\
<h3 class='card-title'>" + boxTitle + "</h3>\
<div class='card-tools'>\
<button type='button' class='btn btn-tool' data-card-widget='collapse'>\
<i class='fas " + collapseBtn + "'></i>\
</button>\
</div>\
</div>");
});
// padding fix
$('.online_servers').parent('.card-body').addClass('p-2');
// remove old refresh elements
$('.row > [id^="refreshed-"]').remove();
// hide elements before data refresh mod
$('.main > .row > h0, .main > .row > br, .main > .row > #column4').addClass('d-none');
/* *** Data Refresh Mod *** */
if($('.container-fluid h0').last().length)
{
// get columnsettings
$.get('themes/AdminLTE/dist/php/settings.php?m=dashboard&p=columnsettings',
function(columnsettings){
// build server status card
var serverStatusTitle = $('.container-fluid h0').last().text();
var serverSelectTitle = $('.container-fluid #column4 h3').text();
var serverSelectForm = $('.container-fluid #column4 center').html();
$('.container-fluid h0').last().remove();
$('.container-fluid #column4').remove();
// add new sections
$('.content > .container-fluid').append("\
<div class='row'>\
<section class='col-12 col-md-6 connectedSortable' id='column4'></section>\
<section class='col-12 col-md-6 connectedSortable' id='column5'></section>\
</div>\
<div class='row'>\
<section class='col-12 connectedSortable' id='column6'></section>\
</div>");
// add cards to new sections
// console.log(columnsettings);
Object.keys(columnsettings).forEach(function(key)
{
item = columnsettings[key]['item']
section = columnsettings[key]['section']
collapsed = columnsettings[key]['collapsed']
if(item=='item6')
{
$('#' + section).append(createCard(item, serverSelectTitle, serverSelectForm, collapsed));
}
else if(item=='item7')
{
$('#' + section).append(createCard(item, serverStatusTitle, '', true, collapsed));
}
else
{
$('#' + section).append(createCard(item, '', '', true, collapsed));
}
})
// define regexes
var axrgx = /jQuery\.ajax\(\{(.*?)\}\)\;(.*?)\}\)\;/sg; // get all ajax definitions
var urlrgx = /url\: \"(.*?)\"/m; // get url from ajax object
var destrgx = /\$\(\'(.*?)\'\)\.html/; // get destination from ajax object
// get complete js content
var embjs = $('.main > script:not([src])').html();
$('.main > script:not([src])').remove();
var refreshDashboardServerInterval;
var aradded = [];
if(axrgx.test(embjs))
{
embjs.match(axrgx).forEach((element, index) => {
var url = element.match(urlrgx)[1];
var dest = element.match(destrgx)[1];
if(!aradded.includes(url))
{
if(url.toLowerCase().indexOf("remote_server_id") >= 0)
{
aradded.push(url);
function refreshDashboardServerStats()
{
jQuery.ajax({
url: url,
cache: false,
// beforeSend: function(xhr)
// {
// $('a').click(function()
// {
// xhr.abort();
// enableCallbacks = false;
// });
// },
success: function(data, textStatus)
{
// if (!enableCallbacks) return;
updateServerStats(data);
}
});
}
if (!refreshDashboardServerInterval)
{
refreshDashboardServerStats();
var refreshDashboardServerInterval = setInterval(function()
{
refreshDashboardServerStats();
}, 10000);
}
}
}
});
}
// clear intervals on link follow
$('a:not([data-widget="control-sidebar"]):not([data-widget="pushmenu"])').click(function()
{
if(typeof refreshServerInterval !== 'undefined')
{
clearInterval(refreshServerInterval);
refreshServerInterval = null;
}
});
// Make the dashboard widgets sortable Using jquery UI
var topItems = ['item1','item2','item3','item4','item5'];
$('.connectedSortable').sortable(
{
placeholder: 'sort-highlight',
connectWith: '.connectedSortable',
handle: '.card-header',
forcePlaceholderSize: true,
zIndex: 999999,
stop: function(event, ui){
// check if element is on a valid location
if(topItems.includes($(ui['item'][0]).attr('id')))
{
// item is in top row - check if its in .main card
if($(ui['item'][0]).parents('.main').length==1)
{
updateNewWidgetData();
}else
{
toastr.warning('Top Elements only in Top Region allowed', 'Warning');
event.preventDefault();
}
}else
{
if($(ui['item'][0]).parents('.main').length==0)
{
updateNewWidgetData();
}else
{
toastr.warning('Bottom Elements only in Bottom Region allowed', 'Warning');
event.preventDefault();
}
}
}
});
$('.connectedSortable .card-header').css('cursor', 'move');
// update widget data when collapsing card
$('[data-card-widget="collapse"]').click(function()
{
setTimeout(function()
{
updateNewWidgetData();
}, 1000);
})
// loading
var loading = '\
<div class="d-flex justify-content-center w-100 m-1">\
<div class="spinner-grow spinner-grow-sm" role="status">\
<span class="sr-only">Loading...</span>\
</div>\
</div>';
$('[id^=refreshed]').html(loading);
}
);
}
// initial load (load faster on startup)
animateProgressBars();
});
$(window).load(function ()
{
//welcome title
if($(".main > div:not(.row)").length)
{
$(".main > div:not(.row)").addClass('card-body').wrap('<div class="card welcome-card"></div>');
$(".main .welcome-card").prependTo('section.content > .container-fluid');
}
});
// $.fn.inlineStyle = function(prop)
// {
// var thisProb = this.prop("style")[$.camelCase(prop)];
// if(thisProb !== undefined || thisProb!='')
// {
// return thisProb;
// }
// else
// {
// return false;
// }
// };
function updateNewWidgetData()
{
var items = [];
$('section.connectedSortable').each(function()
{
var columnId = $(this).attr('id');
$(this).find('.card').each(function(order)
{
var collapsed = 0;
if($(this).hasClass('collapsed-card'))
{
collapsed = 1;
}
//Create Item object for current panel
var item = {
id: $(this).attr('id'),
collapsed: collapsed,
order : order,
column: columnId
};
//Push item object into items array
items.push(item);
});
});
//Assign items array to sortorder JSON variable
var sortorder = {items: items};
var successOrderChange = true;
//Pass sortorder variable to server using ajax to save state (OGP sections)
$.post('home.php?m=dashboard&p=updateWidgets', 'data='+$.toJSON(sortorder), function(response)
{
var checkRespone = $(response).filter('section.content');
if(response.indexOf("success") < 0)
{
successOrderChange = false;
// toastr.error('Failed to update widget order');
}else
{
// toastr.success('Successfully update widget order');
}
});
//Pass sortorder variable to server using ajax to save state (Theme sections)
$.post('themes/AdminLTE/dist/php/settings.php?m=dashboard&p=updatecolumnsettings', 'data='+$.toJSON(sortorder), function(response)
{
var checkRespone = $(response).filter('section.content');
if(response.indexOf("success") < 0)
{
successOrderChange = false;
// toastr.error('Failed to update widget order');
}else
{
// toastr.success('Successfully update widget order');
}
});
if(successOrderChange)
{
toastr.success('Successfully update widget order');
}else
{
toastr.error('Failed to update widget order');
}
}
function createCard(id, title, body, refresh = false, collapsed = 0)
{
var addBody = ''
var collapsedClass = ''
var maximize = ''
if(refresh)
{
addBody = " id='refreshed'"
}
if(collapsed==1)
{
collapsedClass = ' collapsed-card'
}
//add maximize button
if(id=='item8')
{
maximize = '<button type="button" class="btn btn-tool" data-card-widget="maximize"><i class="fas fa-expand"></i></button>';
}
return "\
<div class='card " + collapsedClass + "' id='" + id + "'>\
<div class='card-header'>\
<h3 class='card-title'>" + title + "</h3>\
<div class='card-tools'>\
" + maximize + "\
<button type='button' class='btn btn-tool' data-card-widget='collapse'>\
<i class='fas fa-minus'></i>\
</button>\
</div>\
</div>\
<div class='card-body'" + addBody + ">\
" + body + "\
</div>\
</div>\
";
}
function updateServerStats(html)
{
var dataOut = '';
var brExp = /<br\s*\/?>/i;
// System Uptime
var data = clone(html);
var sysUptime = $(data).filter('#column4:nth-child(1)');
if($(sysUptime).length > 0)
{
var sysUptimeTitle = $(sysUptime).find('h4').html();
var sysUptimeContent = '';
var sysUptimeSplit = $(sysUptime).find('b').html().split(brExp);
$.each(sysUptimeSplit, function(i, element)
{
sysUptimeContent += '<p class="mb-0">'+element.trim()+'</p>';
});
$('#item9 .card-title').text(sysUptimeTitle);
$('#item9 .card-body').html(sysUptimeContent);
}
// CPU Usage
var data = clone(html);
var cpu = $(data).filter('#column4:nth-child(2)');
if($(cpu).length > 0)
{
var progressCPU = '';
var cpuTitle = $(cpu).find('h4').text();
$(cpu).find('.dragbox-content').children('b').each(function()
{
var cpuName = $(this).text().split(':')[0].trim();
var cpuLoad = $(this).text().split(':')[1].trim().split(' ')[0].trim();
var cpuLoad = $(this).text().split(':')[1].trim().split(' ')[0].trim();
progressCPU += '\
<div class="progress-group">\
'+cpuName+'\
<span class="float-right"><b>'+cpuLoad+' %</b> / 100 %</span>\
<div class="progress progress-sm">\
<div class="progress-bar bg-primary" style="width: '+cpuLoad+'%"></div>\
</div>\
</div>\
';
});
dataOut += progressCPU
}
// RAM Usage
var data = clone(html);
var ram = $(data).filter('#column4:nth-child(3)');
if($(ram).length > 0)
{
var ramTitle = $(ram).find('h4').text();
var ram = $(ram).find('.dragbox-content').html();
var ramUsageSplit = ram.split(':')[1].split(' ');
var ramUsage = ramUsageSplit[1] + ' ' + ramUsageSplit[2];
var ramTotal = ramUsageSplit[4] + ' ' + ramUsageSplit[5].split('<')[0];
var ramPerc = $(ram).find('.progress-bar').attr('data');
var progressRam = '\
<div class="progress-group">\
'+ramTitle+'\
<span class="float-right"><b>'+ramUsage+'</b> / '+ramTotal+'</span>\
<div class="progress progress-sm">\
<div class="progress-bar bg-primary" style="width: '+ramPerc+'%"></div>\
</div>\
</div>\
';
dataOut += progressRam
}
// Storage Space
var data = clone(html);
var storage = $(data).filter('#column4:nth-child(4)');
if($(storage).length > 0)
{
var spaceTitle = $(storage).find('h4').text();
var storage = $(storage).find('.dragbox-content').html();
var storagelines = storage.split(brExp);
var spaceTotal = storagelines[0].split(':')[1].trim();
var spaceUsed = storagelines[1].split(':')[1].trim().split('(')[0].trim();
var spaceUsedPerc = storagelines[1].match(/\((.*?)\)/)[1];
var spaceFree = storagelines[2].split(':')[2].trim().split('<')[0].trim();
var progressStorage = '\
<div class="progress-group">\
'+spaceTitle+'\
<span class="float-right"><b>'+spaceUsed+'</b> / '+spaceTotal+'</span>\
<div class="progress progress-sm">\
<div class="progress-bar bg-primary" style="width: '+spaceUsedPerc+'"></div>\
</div>\
</div>\
';
dataOut += progressStorage
}
// put all informations into card
$('#item7 .card-body').html(dataOut);
// Process Monitor
var procMonTitle = $(data).filter('#column4:nth-child(5)').find('h4').text();
var procMonContent = $(data).filter('#column4:nth-child(5)').find('.dragbox-content').html();
$('#item8 .card-title').text(procMonTitle);
$('#item8 .card-body').html(procMonContent);
}
function clone(obj)
{
if (null == obj || "object" != typeof obj) return obj;
var copy = obj.constructor();
for (var attr in obj)
{
if (obj.hasOwnProperty(attr)) copy[attr] = obj[attr];
}
return copy;
}
function animateProgressBars()
{
// image replacement
$('img[src$="magnifglass.png"]').replaceWith('<i class="fas fa-search mr-2"></i>');
// online servers
$('#item2 .card-body > br').remove();
$('#item2 .card-body > center br').replaceWith(' ');
$('.currently-online').addClass('table table-striped table-sm');
$('.currently-online td').removeAttr('style');
$('.currently-online > tbody > tr:first-of-type > td').replaceWith('<th>'+$('.currently-online > tbody > tr:first-of-type td').text()+'</th>');
if(localStorage.getItem('themeServerstats')=='remove')
{
$('.online_servers [id^=refreshed]').each(function()
{
var thisLink = $(this).find('.name').find('a').attr('href');
$(this).addClass('btn btn-sm btn-primary').attr('onclick', 'location.href=\''+thisLink+'\'');
});
}else
{
if($('#item2 .card-body').length>0)
{
if(!$('#item2 .card-body').hasClass('onlineServers'))
{
$('#item2 .card-body').addClass('onlineServers p-2');
}
// get server satistics, update title and remove statistics
if($('#item2 .card-body').find('center').length>0)
{
var serverStats = $('#item2 .card-body').find('center').text();
const serversRegex = / (\d*?)\/(\d*?) /m;
if(serversRegex.test(serverStats))
{
$('#item2 .card-title').append(' (' + serverStats.match(serversRegex)[1] + '/' + serverStats.match(serversRegex)[2] + ' ' + langConsts['OGP_LANG_server'] + ')');
$('#item2 .card-body').find('center').remove();
}
}
if($('.onlineServers').data('init')===undefined)
{
$('.onlineServers').attr('data-init', 'load');
if($('#item2 .onlineServers > p').length>0)
{
$('#item2 .onlineServers > p').addClass('px-2');
}
var loading = '\
<div class="listServers">\
<div class="d-flex justify-content-center w-100 m-1 serverLoading">\
<div class="spinner-grow spinner-grow-sm" role="status">\
<span class="sr-only">Loading...</span>\
</div>\
</div>\
</div>';
// add loader
if($('#item2 .onlineServers > b').length>0)
{
$('#item2 .onlineServers > b').replaceWith(loading);
}else
{
$('.onlineServers').prepend(loading);
}
if(localStorage.getItem('themeServerstats')=='activate')
{
// initial load serverlist
loadServerList();
// setInterval for ServerList Refresh
setInterval(function()
{
loadServerList();
}, 60000);
}
}
}
if($('table.online_servers').length>0)
{
// remove old table
$('table.online_servers').remove();
}
}
}
function loadServerList()
{
// initial load serverlist
$.ajax({
cache: false,
async: true,
type: 'GET',
url: 'themes/AdminLTE/dist/php/settings.php?m=dashboard&p=listservers',
success: function(html)
{
// update server boxes
$('.listServers').html(html);
// init tooltips
$('[data-toggle="tooltip"]').tooltip();
}
});
}

View file

@ -1,16 +0,0 @@
$(document).ready(function()
{
$('p[style^="color:"]').each(function()
{
var thisClass = '';
if($(this).css('color')=='rgb(0, 128, 0)')
{
thisClass = 'success';
}
else
{
thisClass = 'error';
}
$(this).replaceWith('<div class="callout callout-'+thisClass+' mt-2"><p>'+$(this).html()+'</p></div>');
});
});

View file

@ -1,13 +0,0 @@
td {
padding: 5px !important;
}
button {
margin-bottom: 0.1rem;
}
input.form-control {
display: inline-block;
width: auto;
margin-bottom: 0.1rem;
}

View file

@ -1,7 +0,0 @@
$(document).ready(function()
{
$('.main br').remove();
$('.main input:not([type="SUBMIT"]), .main select').addClass('form-control');
$('.main button, .main [type="SUBMIT"]').addClass('btn btn-sm btn-primary');
$('.main table').addClass('table table-striped table-sm');
});

View file

@ -1,3 +0,0 @@
$(document).ready(function(){
$('.main [href^="?m=gamemanager&p=game_monitor"], .main [href^="?m=editconfigfiles"]').addClass('btn').addClass('btn-primary').addClass('btn-xs');
});

View file

@ -1,4 +0,0 @@
$(document).ready(function(){
$('.main [href^="?m=editconfigfiles"]').addClass('btn').addClass('btn-primary').addClass('btn-xs');
});

View file

@ -1,31 +0,0 @@
.main .btn:not([name="update"]),
.main .loading {
float: right;
}
.main .btn,
.main .badge {
margin: 0px 5px !important;
text-wrap: nowrap !important;
}
.main .uninstall,
.main .install,
.main .remove,
.main .badge {
min-width: 75px;
}
.main .badge {
font-weight: normal !important;
}
.main .card.extra .table {
min-width: 500px;
}
.main .card.extra label {
font-size: 0.8rem;
line-height: 1.4rem;
font-weight: 400;
}

View file

@ -1,121 +0,0 @@
$(document).ready(function()
{
//remove main card
$('.main').removeClass('card-body').parent('.card').removeClass('card');
// add new row
$('.main').append('<div class="row"></div>');
// remove all minus
$('.main .dragbox-content').html(function(index, text)
{
return text.replace(/\ - /g, '');
});
$('.main [href^="#uninstall_"]').addClass('btn btn-danger btn-xs order-9').removeAttr('style').prepend('<i class="fas fa-upload mr-1"></i>');
$('.main [href^="#remove_"]').addClass('btn btn-danger btn-xs order-9').removeAttr('style').prepend('<i class="fas fa-trash-alt mr-1"></i>');
$('.main [href^="#install_"]').addClass('btn btn-success btn-xs order-9').removeAttr('style').removeAttr('href').prepend('<i class="fas fa-download mr-1"></i>');
$('.main [href^="?m=extras&searchForUpdates="]').addClass('btn btn-primary btn-xs order-9').removeAttr('style').prepend('<i class="fas fa-search mr-1"></i>');
$('.main .dragbox-content').each(function()
{
var form_selector = $(this);
$(form_selector).prepend('<br>');
$(form_selector.find('br')).each(function()
{
var $set = $();
var nxt = this.nextSibling;
while(nxt) {
if(!$(nxt).is('br')) {
$set.push(nxt);
nxt = nxt.nextSibling;
} else break;
}
$set.wrapAll('<tr><td class="d-flex"></td></tr>');
});
$(form_selector.find('br')).remove();
$(form_selector.find('tr')).wrapAll('<table class="table table-sm table-striped mb-1" />');
});
$('.main b[style*="green"]').addClass('badge badge-success').prepend('<i class="fas fa-check-circle mr-1"></i>');
$('.main b[style*="red"]').addClass('badge badge-secondary');
$('.main b[style*="orange"]').addClass('badge badge-warning').prepend('<i class="fas fa-exclamation-circle mr-1"></i>');
$('.main b[style]').removeAttr('style').wrap('<span class="order-1" />');
$('.main .search').click(function(){
$(this).replaceWith('<a class="search btn btn-primary btn-xs" href="'+$(this).attr('href')+'" disabled>'+$(this).text()+' <i class="fa fa-refresh fa-spin fa-fw" aria-hidden="true"></i></a>');
});
$('.main .dragbox').each(function()
{
var boxTitle = $(this).find('h4').text();
var boxContent = $(this).find('.dragbox-content').html();
$('.main > .row').append("\
<div class='col-md-6 col-12'>\
<div class='card extra'>\
<div class='card-header'>\
<h3 class='card-title'>" + boxTitle + "</h3>\
</div>\
<div class='card-body p-0'>\
" + boxContent + "\
</div>\
</div>\
</div>\
");
});
// add buttons below each table
var btnText = $('button[name="update"]').text();
$('.main .card-body').each(function()
{
$(this).append("\
<div id='updateButton' class='ml-3 mb-3 mt-1'>\
<button name='update' class='btn btn-sm btn-primary'><i class='fas fa-download mr-1'></i>" + btnText + "</button>\
</div>\
");
});
$('.main > table').remove();
// replace checkboxes
$('.main [type="checkbox"]').each(function()
{
var checkboxName = $(this).attr('name');
var checkboxValue = $(this).attr('value');
var checkboxDisabled = $(this).attr('disabled');
var checkboxText = $(this).next('b').text();
// remove old text
$(this).next('b').remove();
var disabledAttr = '';
if($(this).is(':disabled'))
{
disabledAttr = ' disabled="disabled"'
}
$(this).replaceWith('\
<div class="custom-control custom-checkbox d-inline-block mr-auto">\
<input class="custom-control-input" type="checkbox" id="' + checkboxName + '_' + checkboxValue + '" name="' + checkboxName + '" value="' + checkboxValue + '"' + disabledAttr + '>\
<label for="' + checkboxName + '_' + checkboxValue + '" class="custom-control-label">' + checkboxText + '</label>\
</div>\
');
});
// wrap all links/buttons
$('.main .extra a').each(function()
{
$(this).wrap('<span class="order-2" />');
});
});
$(window).load(function()
{
$('[name="update"]').click(function()
{
$('body').append('<div class="loading-overlay"><img src="themes/AdminLTE/dist/img/dual_ring.svg"></div>');
});
});

View file

@ -1,43 +0,0 @@
.main li.faqblock {
list-style: none;
display: inline-block;
}
.main #count + #count {
display: none;
}
.main .maincategory,
.main .category {
font-size: 1.4rem;
}
.main .category {
margin-top: 2rem;
}
.main #accordion > .card {
margin-left: 1rem;
}
.main #accordion > .card > a {
color: inherit !important;
}
.main input#search {
max-width: 250px;
display: inline-block;
}
.main .footer {
margin-top: 3rem;
font-size: 0.8rem;
color: var(--secondary);
}
.main .faqanswer > br:last-of-type,
.main .faqanswer > br:first-of-type {
display: none;
}
.main .faqanswer > .table-responsive {
margin-top: 0.5rem;
}

View file

@ -1,68 +0,0 @@
$(document).ready(function()
{
//icon replacement
$('img[src="modules/faq/faq.png"]').replaceWith('<small><i class="fas fa-list-alt mr-1"></i></small>');
$('img[src="modules/faq/faqlower.png"]').replaceWith('<small><i class="fas fa-question-circle mr-1"></i></small>');
$('li.faqblock > a').addClass('btn btn-sm btn-primary mr-1');
//accordions
var allAccs = 1
$('.accordion-toggle').each(function()
{
var accTitle = $(this).html();
var accContent = $(this).next('.accordion-content').html();
$(this).next('.accordion-content').remove();
var newAcc = '\
<div class="card card-faq">\
<a class="d-block w-100 collapsed" data-toggle="collapse" href="#faqacc'+allAccs+'" aria-expanded="false">\
<div class="card-header">\
<h4 class="card-title">'+accTitle+'</h4>\
<div class="card-tools">\
<button type="button" class="btn btn-tool" data-card-widget="collapse"> \
<i class="fas fa-plus"></i>\
</button>\
</div>\
</div>\
</a>\
<div id="faqacc'+allAccs+'" class="collapse" data-parent="#accordion" style="">\
<div class="card-body">'+accContent+'</div>\
</div>\
</div>\
';
$(this).replaceWith(newAcc);
allAccs++;
});
//new search
$('#search').jcOnPageFilter({
animateHideNShow: false,
focusOnLoad: true,
highlightColor: "yellow",
textColorForHighlights: "#000000",
caseSensitive: false,
hideNegatives: true,
parentLookupClass: "card-faq",
childBlockClass: "collapse"
});
// show all elements if search is empty
$('#search').on("keyup input", function()
{
var inputVal = $(this).val();
if(inputVal.length==0)
{
$('.card-faq').removeAttr('style');
}
});
// pull footer to right
$('.main .footer').addClass('text-right');
// search num badge
$('.main #count').addClass('badge badge-secondary font-weight-normal');
});

View file

@ -1,23 +0,0 @@
$(document).ready(function() {
$('.main [href^="?m=fast_download"]').addClass('btn').addClass('btn-sm').addClass('btn-primary');
$('input[name="delete"], input[name="stop_fastdl"]').removeClass('btn-primary').addClass('btn-danger');
var form_selector = $('.main > form:nth-child(5)');
$(form_selector).prepend('<br>');
$(form_selector.find('br')).each(function(){
var $set = $();
var nxt = this.nextSibling;
while(nxt) {
if(!$(nxt).is('br')) {
$set.push(nxt);
nxt = nxt.nextSibling;
} else break;
}
$set.wrapAll('<tr><td></td></tr>');
});
$(form_selector.find('br')).remove();
$(form_selector.find('tr')).wrapAll('<table class="table table-sm table-striped" />');
});

View file

@ -1,11 +0,0 @@
form > b
{
padding: 2px 10px !important;
margin-bottom: 5px;
display: inline-block;
background-color: rgba(67, 72, 87, 0.5) !important;
color: #fff !important;
border-radius: 3px;
border: none !important;
font-weight: normal;
}

View file

@ -1,4 +0,0 @@
$(document).ready(function() {
$('b').removeAttr('style');
$('input[name="delete"]').removeClass('btn-primary').addClass('btn-danger');
});

View file

@ -1,54 +0,0 @@
iframe {
border: none !important;
background: transparent !important;
}
.ftp_iframe {
background: transparent !important;
}
.ftp_iframe #LoginForm div {
display: block !important;
}
.ftp_iframe #LoginForm > div > div:first-child {
padding: 6px 10px 0px;
color: #fff;
margin: 0 auto;
height: 31px;
background: #4875B3;
padding-top: 10px;
text-align: center;
font-family: Roboto;
font-weight: 300;
font-size: 15px;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.ftp_iframe #LoginForm > div > div:nth-child(2) {
padding: 6px 6px 0px;
}
.ftp_iframe .page table {
width: 100%;
text-align: center;
}
.ftp_iframe .page table table {
width: 400px;
margin: auto;
}
.ftp_iframe #wrapper {
border-left: none;
padding: 20px;
}
.ftp_iframe #header,
.ftp_iframe #page-title
{
text-align: center;
}
select[name="home_id"] {
margin-bottom: 20px;
}

View file

@ -1,68 +0,0 @@
$(document).ready(function()
{
if(window.location.href.indexOf("home.php?m=ftp") != -1 )
{
$('iframe').attr('id', 'ftp_iframe').css('background-color', '');
$('iframe').load(function()
{
$(this).contents().find("tr").removeAttr("onmouseover").removeAttr("onmouseout");
$(this).contents().find("body").addClass('ftp_iframe dark-mode');
$(this).contents().find("div, input").removeAttr("style");
$(this).contents().find("table").removeAttr("style").removeAttr("colspan").addClass('table table-sm table-striped');
$(this).contents().find(".page > table > tbody > tr:nth-child(3)").remove();
$(this).contents().find('b[style="color:red;"]').removeAttr('style').addClass('alert alert-danger');
$(this).contents().find('.table .table').addClass('inner-table');
$(this).contents().find('link').remove();
var main_css = '<link rel="stylesheet" type="text/css" href="../../themes/AdminLTE/dist/css/main.css">';
var ftp_css = '<link rel="stylesheet" type="text/css" href="../../themes/AdminLTE/modules/ftp/main.css">';
var fa_css = '<link rel="stylesheet" type="text/css" href="../../themes/AdminLTE/plugins/fontawesome-free/css/all.min.css">';
var bs = '<link rel="stylesheet" href="../../themes/AdminLTE/dist/css/adminlte.css">';
var js = '<link rel="stylesheet" href="../../themes/AdminLTE/dist/js/main.js">';
$(this).contents().find("head").append(bs);
$(this).contents().find("head").append(js);
$(this).contents().find("head").append(main_css);
$(this).contents().find("head").append(ftp_css);
$(this).contents().find("head").append(fa_css);
$(this).contents().find('button, input[type=button], [type=submit], input[type=reset], .swfuploadbtn').addClass('btn btn-sm btn-primary mb-1');
$(this).contents().find('textarea, select, input[type=text]').addClass('form-control').removeAttr('style');
$(this).contents().find('form').addClass('form-group');
$(this).contents().find('.browse_rows_heading a').removeAttr('style').addClass('btn btn-xs btn-primary');
$(this).contents().find('[href^="javascript:submitBrowseForm(\'%2F\'"]').addClass('btn btn-xs btn-primary').prepend('<i class="fa fa-arrow-up"></i>&nbsp;');
$(this).contents().find('[href^="javascript:submitBrowseForm"]:not(.btn)').addClass('badge badge-default');
$(this).contents().find('[onclick*="view"] > a').addClass('btn btn-xs btn-success');
$(this).contents().find('[onclick*="edit"] > a').addClass('btn btn-xs btn-warning');
$(this).contents().find('[href^="javascript:toggleElement(\'upload\')"]').addClass('btn btn-xs btn-danger');
$(this).contents().find('img[src$="folder.png"]').replaceWith('<i class="fa fa-folder-open"></i>');
$(this).contents().find('img[src$="txt.png"]').replaceWith('<i class="fa fa-pencil-square"></i>');
$(this).contents().find('img[src$="mime.png"], img[src$="exec.png"]').replaceWith('<i class="fa fa-cog"></i>');
$(this).contents().find('img[src$="bookmark.png"]').replaceWith('<i class="fa fa-bookmark"></i>');
$(this).contents().find('img[src$="info.png"]').replaceWith('<i class="fa fa-info-circle"></i>');
$(this).contents().find('img[src$="exit.png"]').replaceWith('<i class="fas fa-sign-out-alt"></i>');
$(this).contents().find('img[src$="view_tree.png"]').replaceWith('<i class="fa fa-list-alt"></i>');
$(this).contents().find('img[src$="mime.png"]').replaceWith('<i class="fas fa-file"></i>');
$(this).contents().find('img[src$="tgz.png"]').replaceWith('<i class="fas fa-file-archive"></i>');
$(this).contents().find('img[src$="document.png"]').replaceWith('<i class="fas fa-file-alt"></i>');
$(this).contents().find('img[src$="terminal.png"]').replaceWith('<i class="fa fa-terminal"></i>');
$(this).contents().find('img[src$="colors.png"]').replaceWith('<i class="fa fa-file-image"></i>');
$(this).contents().find('img[src$="misc.png"]').remove();
$(this).contents().find('img[src$="back.png"]').replaceWith('<i class="fa fa-arrow-circle-left"></i>');
$(this).contents().find('[accesskey="h"]').addClass('btn btn-warning');
$(this).contents().find('[accesskey="i"]:not(input)').addClass('btn btn-info');
$(this).contents().find('[accesskey="l"]').addClass('btn btn-danger');
$(this).contents().find('[accesskey="b"]').addClass('btn btn-primary');
$('iframe').contents().find('table h1').each(function(){
$(this).parent('td').replaceWith('<th>'+$(this).parent('td').html()+'</th>');
});
$('iframe').contents().find("body").css('display', 'block');
});
}
});

View file

@ -1,29 +0,0 @@
$(document).ready(function()
{
// ftp account table to div conversion
$('.main > form').prepend('<div class="row addacc mb-2"></div>');
$('.main > form > table tr:first-child > td').each(function()
{
$('.main .addacc').append('<div class="col-12 col-lg-3 col-md-6">'+$(this).html()+'</div>');
});
$('.main .addacc').append('<div class="col-12 mt-1">'+$('.main > form > table tr:last-child > td').html()+'</div>');
$('.main > form > table').remove();
$('.main b').removeAttr('style');
});
$(window).load(function()
{
$('.tablesorter-hasChildRow td.collapsed').html('<i class="fa fa-plus-square"</i>');
$('.tablesorter-hasChildRow td.collapsible').click(function()
{
if($(this).hasClass('collapsed'))
{
$(this).html('<i class="fa fa-plus-square"></i>');
}else
{
$(this).html('<i class="fa fa-minus-square"</i>');
}
});
});

View file

@ -1,18 +0,0 @@
html,
body,
.dark-mode {
background: transparent !important;
}
#StatusbarForm {
margin-top: 10px;
margin-bottom: 20px;
}
i.fa.fa-folder-open {
color: #ffe699;
}
h1 {
font-size: 1.8rem;
}

View file

@ -1,281 +0,0 @@
@media only screen and (min-width: 500px) {
.main > form[action="home.php"] {
float: right;
}
.main > form[action="home.php"] .form-control {
display: inline-block;
}
.main select.form-control {
width: auto;
display: inline;
}
.main > form[action="home.php"] .form-control,
.main > form[method="GET"] .form-control {
width: auto !important;
}
}
@media only screen and (max-width: 499px) {
.main > form[method="GET"]:not(form[method="GET"]:last-of-type) {
overflow: auto;
}
.main > form:last-of-type,
.main > form .btn,
.serverIdToggle {
display: block;
width: 100%;
}
.serverIdToggle,
.main > form[action="home.php"] {
margin-bottom: 0.5rem !important;
}
}
.form-control {
margin-bottom: 4px;
}
.monitorbutton,
#server_icon
{
width: 150px;
border-radius: 4px;
margin: 2px;
font-size: 12px;
float: left;
}
.expand-child #server_icon {
width: auto;
}
.monitorbutton {
height: 90px;
text-align: center;
}
.monitorbutton:before {
display: block;
font-size: 36px;
line-height: 40px;
}
.monitorbutton > span {
font-size: 0.8rem;
line-height: 1rem;
display: block;
}
.monitorbutton:last-of-type {
margin-bottom: 20px !important;
}
.monitorbutton.size {
font-size: 0.8rem !important;
}
.monitorbutton:hover,
#server_icon:hover
{
cursor: pointer !important;
}
.monitorbutton:hover {
background-position: 0 -90px !important;
}
.monitorbutton img {
display: none;
}
.monitorButtonContainer form {
clear: both;
}
#server_icon {
line-height: 22px;
padding: 0px 5px;
}
#server_icon div {
display: inline-block;
}
#server_icon input {
vertical-align: middle;
margin-top: 0px;
margin-right: 2px;
margin-top: -4px;
}
#server_icon img {
display: none;
}
.dark-mode table.srvctrl {
background-color: var(--gray-dark);
}
.dark-mode #servermonitor .monitor-2 .srvctrl a {
color: #fff;
}
.light-mode table.srvctrl {
background-color: var(--light);
}
.light-mode #servermonitor .monitor-2 .srvctrl a {
color: var(--gray-dark);
}
.srvctrl td {
padding: 5px 0px;
}
.srvctrl a:before {
display: block;
font-size: 64px;
margin-bottom: -10px;
margin-top: -10px;
}
.srvctrl b {
font-weight: normal !important;
}
.map-icon {
margin-right: 0.5rem;
}
.server-info {
width: 100%;
}
#servermonitor .monitor-2 .srvctrl {
width: auto;
border-radius: 5px;
}
#servermonitor .monitor-2 .srvctrl td:first-of-type {
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
}
#servermonitor .monitor-2 .srvctrl td:last-of-type {
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
}
#servermonitor .monitor-3 table {
width: 100%;
}
#servermonitor .monitor-3 {
width: 100%;
margin-top: 0.5rem;
margin-bottom: 0.5rem;
}
#servermonitor .monitor-3 > div {
padding: 10px 0px;
border: 1px solid var(--grey) !important;
}
.dark-mode #servermonitor .monitor-3 > div {
background-color: var(--dark-1) !important;
}
.light-mode #servermonitor .monitor-3 > div {
background-color: var(--light) !important;
}
.mapicon {
border-radius: 4px;
margin-bottom: 5px;
padding: 0px;
}
.upload-image {
white-space: nowrap;
}
.owner .form-control {
width: auto !important;
}
#servermonitor .monitor-2 .srvctrl img,
#servermonitor .monitor-2 .srvctrl br {
display: none;
}
#servermonitor .monitor-2 .srvctrl a {
display: inline-block;
}
#servermonitor .monitor-2 .srvctrl tr,
.ts3_viewer tr {
background-color: transparent !important;
}
#servermonitor .monitor-2 .srvctrl td {
width: 100px;
}
#servermonitor .monitor-2 .srvctrl td:first-of-type a:before {
content: "\f144";
}
#servermonitor .monitor-2 .srvctrl td:last-of-type a:before {
content: "\f28d";
}
#servermonitor .monitor-2 .srvctrl td:first-of-type a:hover:before {
color: var(--success);
}
#servermonitor .monitor-2 .srvctrl td:last-of-type a:hover:before {
color: var(--danger);
}
.ts3_viewer b {
font-weight: normal;
}
.ts3_viewer {
border: 0px !important;
background: transparent;
margin: 0px 10px !important;
width: auto !important;
}
tr.maintr td:last-child {
padding: 3px 8px 3px;
}
@media screen and (min-width: 767px){
tr.maintr td:last-child {
width: 330px;
}
}
@media screen and (max-width: 766px){
.table-responsive>.table {
max-width: 800px;
}
}
.header > #action-start {
color: #5cb85c;
}
.header > #action-stop {
color: #d9534f;
}
.header > #action-restart {
color: #f0ad4e;
}
.header > .fa:hover {
color: #fff !important;
}
.table-responsive {
clear: both;
}
@media (max-width: 992px) {
#servermonitor .monitor-1,
#servermonitor .monitor-1 > div,
#servermonitor .monitor-2
{
float: none !important;
}
#servermonitor td:nth-child(4) b {
word-break: break-all;
}
}
.ts3_viewer img {
width: 16px;
height: 16px;
margin-left: 2px;
}
.ts3_viewer td, .ts3_viewer th {
border: none !important;
padding: 0px !important;
font-size: 0.9rem !important;
}
[id^="ui-id"] [class^="status"] {
display: none;
}

View file

@ -1,152 +0,0 @@
$(document).ready(function()
{
// add additional classes to main for ogp scripts
$('.main').addClass('main-content game-monitor');
// responsive table
$('#servermonitor').wrap('<div class="table-responsive"></div>');
// add loading class on size click
$('.monitorbutton.size').click(function()
{
$(this).addClass('loading');
$(this).bind("DOMSubtreeModified",function()
{
$(this).removeClass('loading');
});
});
// table header icons
$('img[id="action-stop"]').replaceWith('<i class="fas fa-stop-circle text-danger text-sm" id="action-stop"></i>');
$('img[id="action-restart"]').replaceWith('<i class="fas fa-arrow-alt-circle-left text-warning text-sm" id="action-restart"></i>');
$('img[id="action-start"]').replaceWith('<i class="fas fa-play-circle text-success text-sm" id="action-start"></i>');
// bulk update buttons
$('#server_icon[class^="action-start"]').addClass('btn btn-sm btn-success');
$('#server_icon[class^="action-stop"]').addClass('btn btn-sm btn-danger');
$('#server_icon[class^="action-restart"]').addClass('btn btn-sm btn-warning');
$('.main .tablesorter-header-inner > [id^="action-"]').click(function()
{
$('div[class^="' + $(this).attr('id') + '"]').trigger('click');
});
// style monitorbuttons
$('.main .monitorbutton').addClass('btn btn-primary d-flex flex-column justify-content-center align-items-center');
// ip's add badge
$('.main .serverIPAddress[data-status="online"] > a').addClass('badge badge-success');
$('.main .serverIPAddress[data-status="offline"]').each(function()
{
$(this).html('<span class="badge badge-danger">' + $(this).text() + '</span>');
});
$('[id^="refreshed"]').addClass('row');
$('[id^="refreshed"] .monitor-1').addClass('col-md-10 d-flex');
$('[id^="refreshed"] .monitor-2').addClass('col-md-2');
$('.main form > input[value="'+langConsts['OGP_LANG_show_all']+'"]').parent('form').addClass('d-inline-block my-2');
// all server images
$('[id^="refreshed"]').each(function()
{
var thisRefresh = $(this);
let thisVar = document.getElementById($(thisRefresh).attr('id'))
observerMapIcon = new MutationObserver(mCallback);
function mCallback(mutations)
{
for (let mutation of mutations)
{
if (mutation.type === 'childList')
{
// add timestamp to image for reload
var timestamp = new Date().getTime();
$('img.mapicon').each(function()
{
$(this).attr('src', $(this).attr('src') + '?t=' + timestamp);
});
$('.upload-image').addClass('btn btn-sm btn-primary');
$('#' + $(thisRefresh).attr('id') + ' .monitor-1').addClass('col-md-10 d-flex');
$('#' + $(thisRefresh).attr('id') + ' .monitor-2').addClass('col-md-2');
}
}
}
observerMapIcon.observe(thisVar, { childList: true });
});
// server image upload form
const observerUploadForm = new MutationObserver(function(mutations_list)
{
mutations_list.forEach(function(mutation)
{
mutation.addedNodes.forEach(function(node)
{
// check if modified node has classes
if(node.classList)
{
var nodeClasses = node.classList.value;
if(nodeClasses.startsWith('status'))
{
var statusText = $('.'+nodeClasses).text();$
if(statusText.length > 0)
{
if(statusText.toLowerCase().indexOf("success") >= 0)
{
toastr.success(statusText);
// add timestamp to image for reload
var timestamp = new Date().getTime();
$('img.mapicon').attr('src', $('img.mapicon').attr('src') + '?t=' + timestamp);
// close all ui dialogs
$('[class^="dialog-form"]').dialog("close");
// reload page after 2 seconds
setTimeout(function () {
location.reload(true);
}, 2000);
}
else
{
toastr.warning(statusText);
}
}
}
}
});
});
});
observerUploadForm.observe(document.querySelector('body'), { subtree: true, childList: true });
});
$(window).load(function()
{
// add loader icon to collapsed servers
$('.main .serverIPAddress[data-status="online"]').parent('tr').next('.expand-child').find('td').each(function()
{
if($(this).css('display')=='none')
{
$(this).find('[id^="refreshed-"]').html('\
<div class="spinner-grow spinner-grow-sm m-3" role="status">\
<span class="sr-only">Loading...</span>\
</div>\
');
}
});
// loading fix when click on ServerID (nothing is loading then)
$('.serverId').click(function()
{
$(this).parent('tr').find('.serverName').trigger('click');
});
// global buttons radio fix
$('#server_icon.btn').click(function()
{
$(this).find('[type="radio"]').prop("checked", true);
});
// remvoe foot style
$('tfoot').removeAttr('style');
});

View file

@ -1,11 +0,0 @@
.main td {
vertical-align: middle !important;
}
.main .form-group {
margin-bottom: 0px !important;
}
.main .form-control:not(.rcon) {
display: inline-block;
width: auto;
}

View file

@ -1,10 +0,0 @@
$(document).ready(function()
{
$('.main [href^="?m=gamemanager&p=game_monitor&home_id-mod_id-ip-port="]').addClass('btn btn-sm btn-primary');
$('.main [name="size"]').addClass('float-right');
});
$(window).load(function()
{
$('.main [name="remote_send_rcon_command"]').removeClass('btn-sm');
});

View file

@ -1,5 +0,0 @@
$(document).ready(function()
{
$('.main [href^="?m=gamemanager&p=game_monitor&home_id="]').addClass('btn btn-sm btn-primary');
$('[name="del_rcon_preset"]').removeClass('btn-primary').addClass('btn-danger');
});

View file

@ -1,17 +0,0 @@
$(document).ready(function()
{
$('.main [href="http://www.greycube.com"], .main [href="http://cgx24.com/"]').attr('target', '_blank').addClass('mt-2 d-inline-block');
$('.main br').remove();
$('.main [href="?m=lgsl_with_img_mod&p=lgsl"]').addClass('btn btn-sm btn-primary');
$('.main img[src$="icon_details.gif"]').replaceWith('<i class="fas fa-search"></i>');
$('.main [href^="?m=lgsl_with_img_mod&p=lgsl&s="]').addClass('btn btn-xs btn-primary');
$('.main [title="GAME LINK"] > a').addClass('badge badge-primary badge-size');
});
$(window).load(function()
{
$('.main input').addClass('form-control');
$('.main table').addClass('table table-striped table-sm');
});

View file

@ -1,11 +0,0 @@
$(document).ready(function() {
$('.main [href="http://www.greycube.com/help/readme/lgsl/"]').attr('target', '_blank').addClass('btn').addClass('btn-sm').addClass('btn-primary');
$('.main [href^="?m=lgsl_with_img_mod&p=lgsl&s="]').addClass('btn').addClass('btn-xs').addClass('btn-warning');
var first_table = $('.main > form > div > table:nth-child(1)');
$(first_table).prepend('<thead>').find('tr:first-of-type').appendTo($(first_table).find('thead'));
$(first_table).find('thead td').each(function(){
$(this).html($(this).html().replace('[ ','').replace(' ]','')).replaceWith('<th>'+$(this).html()+'</th>');
});
});

View file

@ -1,6 +0,0 @@
a:before {
display: none;
}
.form-group {
width: 100%;
}

View file

@ -1,105 +0,0 @@
.viewitem {
width: 16px;
height: 16px;
}
.file-operations {
display: inline-block;
margin-bottom: 10px;
}
.operations-button
{
display: inline-block;
margin-right: 5px;
}
.operations-button:before {
font-family: "Font Awesome 5 Free";
font-weight: 900;
display: inline-block;
margin-right: 2px;
}
.operations-button img {
display: none;
}
.operations-button div {
display: inline-block;
}
a[href^="?m=litefm&home_id="] {
margin-right: 5px;
}
i.fas.fa-folder-open {
color: #ffe699;
}
/* .light-mode table i.fas:not(.fa-folder-open) { */
/* color: var(--dark); */
/* } */
#remove:before {
content: "\f2ed";
}
#rename:before {
content: "\f044";
}
#move:before {
content: "\f31e";
}
#copy:before {
content: "\f0c5";
}
#compress:before {
content: "\f1c6";
}
#uncompress:before {
content: "\f1c6";
}
#create_file:before {
content: "\f044";
}
#create_folder:before {
content: "\f07b";
}
#upload:not(form):before {
content: "\f574";
}
.progress {
height: auto !important;
}
#upload [name="upload"] {
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
border: 1px solid transparent;
background-image: -webkit-linear-gradient(top, #1997c6 0, #126e90 100%);
background-image: -o-linear-gradient(top, #1997c6 0, #126e90 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #1997c6), to(#126e90));
background-image: linear-gradient(to bottom, #1997c6 0, #126e90 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff1997c6', endColorstr='#ff126e90', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
background-repeat: repeat-x;
border-color: #116787;
margin-top: 10px;
}
.ui-dialog-titlebar-close {
border-radius: 3px;
border: none;
}
[id^="fileid"] {
position: relative;
}
[id^="progress"] {
height: 5px !important;
border: none !important;
border-radius: 2px;
width: 96% !important;
}
[id^="progress"] > div {
background: #1997c6 !important;
height: 5px !important;
border-radius: 2px !important;
-webkit-transition: width 0.2s ease-in-out;
-moz-transition: width 0.2s ease-in-out;
-o-transition: width 0.2s ease-in-out;
transition: width 0.2s ease-in-out;
}

View file

@ -1,32 +0,0 @@
$(document).ready(function()
{
$('.main .operations-button').addClass('btn btn-xs btn-primary');
$('.main .operations-button#remove').addClass('btn-danger');
$('.main [href^="?m=gamemanager&p=game_monitor&home_id="]').addClass('btn btn-primary btn-sm');
$('.main img[src="images/folder.png"]').replaceWith('<i class="fas fa-folder-open"></i>');
$('.main img[src="images/txt.png"]').remove();
$('.main img[src="images/exec.png"]').replaceWith('<i class="fas fa-cogs"></i>');
$('.main .unlocked').children('span').addClass('btn btn-xs btn-danger').css('min-width','90px').prepend('<i class="fas fa-lock text-light mr-1"></i>');
$('.main .locked').children('span').addClass('btn btn-xs btn-success').css('min-width','90px').prepend('<i class="fas fa-unlock text-light mr-1"></i>');
$('.main a[href^="javascript:downloadFile"], a[href$="&type=directory"]').addClass('text-dark');
$('.main a[href*="&p=read_file"]').addClass('btn btn-xs btn-primary').prepend('<i class="fas fa-edit text-light mr-1"></i>');
$('.main [href*="&item="], [href^="javascript:downloadFile"]').addClass('badge badge-default');
$('.main [href$="&p=read_file"]').removeClass('badge').removeClass('badge-default').addClass('btn btn-primary btn-xs');
$('.main a[href$="&back"]').each(function()
{
$(this).addClass('btn btn-xs btn-secondary').text('.. ' + langConsts['OGP_LANG_level_up'].replace(/\^/g, '')).prepend('<i class="fas fa-level-up-alt mr-1"></i>');
});
/* *** Long Name Fix *** */
$('.main td > h3').each(function()
{
$(this).parent('td').attr('style', 'max-width:400px');
$(this).attr('title', $(this).text()).attr('style', 'overflow:hidden;text-overflow:ellipsis;display:inline-block;white-space:nowrap;max-width:100%;');
});
});

View file

@ -1,3 +0,0 @@
.card-body > h3 {
margin-top: 20px;
}

View file

@ -1,5 +0,0 @@
$(document).ready(function()
{
$('[href^="?m=modulemanager&p=del"]').addClass('btn btn-danger btn-xs').prepend('<i class="fas fa-trash-alt mr-1"></i>');
$('[href^="?m=modulemanager&p=add"]').addClass('btn btn-success btn-xs').prepend('<i class="fas fa-plus mr-1"></i>');
});

View file

@ -1,14 +0,0 @@
$(document).ready(function()
{
$('.main [href="?m=mysql&p=mysql_admin"]').addClass('btn btn-sm btn-primary');
$('.main [id="mysql_root_passwd"], .main [id="db_passwd"]').attr('type', 'password');
// reveal pass on focus, hide on leave
$('.main [id="mysql_root_passwd"], .main [id="db_passwd"]').on("focus", function()
{
$(this).attr('type', 'text');
}).on("focusout", function()
{
$(this).attr('type', 'password');
});
});

View file

@ -1,17 +0,0 @@
.main .pass {
transition: all 0.3s ease-in-out;
color: transparent;
}
.dark-mode .main .pass {
text-shadow: 0 0 8px var(--white);
}
.light-mode .main .pass {
text-shadow: 0 0 8px var(--dark);
}
.main .pass:hover {
text-shadow: none;
color: inherit;
}

View file

@ -1,40 +0,0 @@
$(document).ready(function()
{
$('#servermonitor [href$="&delete"], #servermonitor [href$="&remove_db').addClass('btn btn-xs btn-danger').prepend('<i class="fas fa-trash-alt mr-1"></i>');;
$('#servermonitor [href$="&edit"], #servermonitor [href$="&edit_db_settings"]').addClass('btn btn-xs btn-primary');
$('#servermonitor [href$="&edit"], #servermonitor [href$="&edit_db_settings"]').prepend('<i class="fas fa-cogs mr-1"></i>');
$('#servermonitor [href$="&assign"]').addClass('btn btn-xs btn-success').prepend('<i class="fas fa-user-check mr-1"></i>');
$('#servermonitor .success').addClass('badge badge-success').removeClass('success');
$('#servermonitor .failure').addClass('badge badge-danger').removeClass('failure');
$('.main [id="mysql_root_passwd"]').attr('type', 'password');
// reveal pass on focus, hide on leave
$('.main [id="mysql_root_passwd"]').on("focus", function()
{
$(this).attr('type', 'text');
}).on("focusout", function()
{
$(this).attr('type', 'password');
});
// hide plaintext passwords
$('#servermonitor .expand-child').each(function()
{
var regex = new RegExp(`(\s*)<b>${langConsts['OGP_LANG_mysql_root_passwd']}:<\/b> (.*?)<br>`, "m");
var dbInfos = $(this).find('td:first-of-type');
var pass = dbInfos.html().match(regex)[2];
if(pass)
{
$(dbInfos).html(function(index,html)
{
return html.replace(regex, '<b>' + langConsts['OGP_LANG_mysql_root_passwd'] + '</b>: <span class="pass">'+pass+'</span><br>');
});
}
});
});

View file

@ -1,44 +0,0 @@
.pull-right {
float: right;
}
.pull-left {
float: left;
}
.fixed-height {
display: inline-block;
width: 100%;
}
.news-row {
margin-bottom: 0.1rem;
display: inline-block;
width: 100%;
}
.eight-tenth {
width: 83%;
}
.one-quarter {
width: 25%;
margin-left:10px;
}
.one-sixth {
width: 16%;
}
.news-form-control-mce {
min-height: 250px;
}
input[type="file"]:hover {
cursor: pointer;
}
.admin-preview-thumbnail {
max-width: 50px;
max-height: 50px;
}
.mce-content-body {
overflow: scroll;
}

View file

@ -1,49 +0,0 @@
$(document).ready(function() {
$('.table-wrap').removeClass('table-wrap');
$('.news-btn, [href="?m=news&p=admin_news&page=permissions"], .underline-link').addClass('btn btn-primary btn-sm');
$('#description').addClass('form-control');
$(window).load(function () {
$('.nicEdit-main').css('outline', 'none').parent('div').addClass('form-control autoheight').css('padding', '2px');
});
create_button('.news-row [href$="&page=permissions"]', 'btn-danger');
create_button('.news-row [href$="&page=settings"]', 'btn-warning');
create_button('.news-row [href$="&page=add"]', 'btn-success');
/* *** Replace UL / LI with Table *** */
var ul = $(".main ol");
$(ul).each(function(){
var li = $(this).find("li");
var tul = $(this);
$(li).each(function(){
$(this).replaceWith('<tr><td>'+$(this).html()+'</td></tr>');
});
$(tul).replaceWith('<table>'+$(tul).html()+'</table>');
});
$('[href^="home.php?m=news&p=admin_news&page=edit&id="]').each(function(){
$(this).replaceWith('<a href="'+$(this).attr('href')+'"><i class="fas fa-edit"></i></a>');
});
$('img[src="modules/news/images/cancel.gif"]').parent('a').each(function(){
$(this).replaceWith('<a href="'+$(this).attr('href')+'" class="btn btn-sm btn-danger pull-right">'+$(this).find('img').attr('alt')+'</a>');
});
$('.success').removeClass('success').addClass('label').addClass('label-success');
$('.failure').removeClass('failure').addClass('label').addClass('label-danger');
$('.nicEdit-main').addClass('form-control');
$('.main [href^="home.php?m=news&p=admin_news&page=edit&id="]').addClass('btn').addClass('btn-sm').addClass('btn-primary');
});
function create_button(elem, clss)
{
$(elem).each(function()
{
$(this).replaceWith('<a href="'+$(this).attr('href')+'" class="btn btn-sm '+clss+' pull-right ml-1">'+$(this).text()+'</a>');
});
}

View file

@ -1,25 +0,0 @@
.card-body p:last-of-type
{
margin-bottom: 0px;
}
.pull-right {
float: right;
}
.pull-left {
float: left;
}
.news-img {
margin: 0px 10px 10px;
}
.news-img img,
[rel="prettyPhoto[ad_gal]"] img {
max-width: 75px;
max-height: 75px;
}
.card-title a {
color: inherit;
}

View file

@ -1,64 +0,0 @@
$(document).ready(function() {
$('.news-btn').addClass('btn btn-primary btn-sm');
$('.pagination b').parent('a').parent('li').addClass('active');
$('h3 > .failure').parent('h3').each(function(){
var thtml = $(this).html();
$(thtml).appendTo('.main');
$(this).remove();
});
//remove main card
$('.main').removeClass('card-body').parent('.card').removeClass('card');
$('.main > br, .main > .clearfix').remove();
$('.news-half > br').first().remove();
$('.news-half').first().attr('class', 'ml-auto');
$('.news-half').last().attr('class', 'mr-auto');
// news list
if($('.main > .news-container').length > 0)
{
$('.news-container > .panel').each(function()
{
$(this).addClass('card');
$(this).find('.panel-heading').addClass('card-header');
$(this).find('.panel-heading').addClass('card-header');
$(this).find('.panel-title').addClass('card-title');
$(this).find('.news-auto').replaceWith($(this).find('.news-auto').html());
var newsBody = $(this).find('.panel-body').find('.news-row').first().html();
var newsFooter = $(this).find('.panel-body').find('.news-row').last().html();
$(this).find('.panel-body').addClass('card-body').html(newsBody);
$(this).append('<div class="card-footer d-flex flex-row-reverse">' + newsFooter + '</div>');
});
}
// single news
if($('.main > .news-row').length > 0)
{
$('.main > .news-row > .news-row > br').first().remove();
var newsContent = $('.main > .news-row > .news-row').html();
var newsFooter = $('.main > .news-row').last().html();
$('.main').append('\
<div class="card">\
<div class="card-body">\
' + newsContent + '\
</div>\
<div class="card-footer d-flex flex-row-reverse">\
' + newsFooter + '\
</div>\
</div>\
');
$('.main > .news-row').remove();
$('#go_back_button').prepend('<i class="fas fa-angle-double-left mr-1"></i>');
}
});

View file

@ -1,4 +0,0 @@
.main > form > table:first-of-type {
margin-bottom: 0px;
margin-top: 5px;
}

View file

@ -1,4 +0,0 @@
$(document).ready(function()
{
$('.main [href="?m=server"]').replaceWith('<button onclick="history.back()" class="btn btn-sm btn-primary"><i class="fas fa-angle-double-left mr-1"></i>' + langConsts['OGP_LANG_back'] + '</button>');
});

View file

@ -1,3 +0,0 @@
[name="home_cfg_id"] {
margin-top: 20px;
}

View file

@ -1,5 +0,0 @@
$(document).ready(function() {
$('.card-body [href^="?m=server&p=edit&rhost_id"]').addClass('btn btn-sm btn-primary');
$('[name="delete_range"]').removeClass('btn-primary').addClass('btn-danger');
});

View file

@ -1,16 +0,0 @@
$(document).ready(function() {
$('.main [href="?m=server"]').addClass('btn btn-sm btn-primary');
$('.main [href$="&delete&y=y"]').addClass('btn btn-sm btn-danger');
$('.main input[name="ip"]').addClass('mb-1');
$('.main [name="remove_ip"]').removeClass('btn-primary').addClass('btn-danger');
$('.main .info').each(function()
{
$(this).replaceWith('\
<div class="callout callout-info">\
<p class="mb-0">' + $(this).html() + '</p>\
</div>\
');
});
});

View file

@ -1,8 +0,0 @@
$(document).ready(function()
{
$('.main [href="?m=server"]').addClass('btn btn-sm btn-primary');
$('.main input[name="reset_firewall"]').removeClass('btn-primary').addClass('btn-danger');
$('.main [href$="ch_fw_status=disable"]').addClass('btn btn-sm btn-danger my-2').prepend('<i class="fas fa-stop-circle mr-1"></i>');
$('.main [href$="ch_fw_status=enable"]').addClass('btn btn-sm btn-success my-2').prepend('<i class="fas fa-play-circle mr-1"></i>');
});

View file

@ -1,6 +0,0 @@
$(document).ready(function()
{
$('.main textarea[name="file_content"]').addClass('mb-2');
$('.main input[name="save_file"]').addClass('btn-secondary');
$('.main [href="?m=server"]').addClass('btn btn-sm btn-primary');
});

View file

@ -1,17 +0,0 @@
$(document).ready(function()
{
$('#servermonitor [href$="&delete"]').addClass('btn btn-xs btn-danger').prepend('<i class="fas fa-trash-alt mr-1"></i>');
$('#servermonitor [href$="&edit"]').addClass('btn btn-xs btn-primary').prepend('<i class="fas fa-cogs mr-1"></i>');
$('#servermonitor [href^="?m=server&p=reboot"]').addClass('btn btn-xs btn-warning').prepend('<i class="fas fa-sync-alt mr-1"></i>');
$('#servermonitor [href^="?m=server&p=restart"]').addClass('btn btn-xs btn-warning').prepend('<i class="fas fa-user-astronaut mr-1"></i>');
$('#servermonitor [href^="?m=server&p=log"]').addClass('btn btn-xs btn-primary').prepend('<i class="fas fa-search mr-1"></i>');
$('#servermonitor [href^="?m=server&p=firewall"]').addClass('btn btn-xs btn-primary').prepend('<i class="fas fa-shield-alt mr-1"></i>');
$('#servermonitor .success').addClass('badge badge-success').removeClass('success');
$('#servermonitor .failure').addClass('badge badge-danger').removeClass('failure');
$('#servermonitor img[src="images/magnifglass.png"]').each(function(){
$(this).replaceWith('<span data-toggle="tooltip" class="image-tooltip" title="<img src=\''+$(this).attr('data-url')+'\' />"><i class="fa fa-search" aria-hidden="true"></i></span>');
});
});

View file

@ -1,4 +0,0 @@
$(document).ready(function()
{
});

View file

@ -1,354 +0,0 @@
$(document).ready(function()
{
$('.main > br').remove();
// remove original logo link
$('#logo_link').parents('tr').remove();
// remove original background wrapper
$('#bg_wrapper').parents('tr').remove();
// add multiform attribute for image upload
$('form[action="?m=settings&p=themes"]').attr('enctype','multipart/form-data');
// add theme width option
$('.main #theme').parents('tr').after('\
<tr>\
<td align="right">\
<label for="themeNavWidth" class="mb-0">'+langConsts['OGP_LANG_theme']+' Nav Width:</label>\
<small class="currentNavWidth text-muted d-block"></small>\
</td>\
<td align="left">\
<div class="form-group mb-0">\
<input type="range" class="form-control-range" min="250" max="350" value="'+localStorage.getItem('themeNavWidth')+'" id="themeNavWidth" name="themeNavWidth">\
</div>\
</td>\
<td>\
<div class="image-tip" data-toggle="tooltip" data-html="true" title="Sets '+langConsts['OGP_LANG_theme']+' Navigation Width for all Users"><i class="far fa-question-circle"></i></div>\
</td>\
</tr>\
');
// add logo upload form
$('.main #theme').parents('tr').after('\
<tr>\
<td align="right">\
<label for="themeLogo">'+langConsts['OGP_LANG_theme']+' Logo:</label>\
</td>\
<td align="left">\
<div class="form-group mb-0">\
<div class="input-group">\
<div class="custom-file">\
<input type="file" class="custom-file-input" name="themeLogo" id="themeLogo">\
<label class="custom-file-label" for="themeLogo">Choose Image</label>\
</div>\
</div>\
</div>\
</td>\
<td>\
<div class="image-tip" data-toggle="tooltip" data-html="true" title="'+langConsts['OGP_LANG_theme']+' Logo - Max Size: '+(localStorage.getItem('themeNavWidth')-32)+'x50px"><i class="far fa-question-circle"></i></div>\
</td>\
</tr>\
');
// add themeLogo removal if set
$.ajax({
cache: false,
async: true,
type: 'GET',
url: 'themes/AdminLTE/dist/php/settings.php?m=global&p=themeLogo',
dataType: 'json',
success: function(themeLogo)
{
if(themeLogo)
{
// add themeRemoval
addThemeRemoval(themeLogo);
}
}
});
// add theme serverstats option
var themeServerstatsOptions = {'remove' : langConsts['OGP_LANG_off'], 'activate' : langConsts['OGP_LANG_on']}
var themeServerstatsOptionsOut = ''
for(var key in themeServerstatsOptions)
{
if(key==localStorage.getItem('themeServerstats'))
{
themeServerstatsOptionsOut += '<option value="'+key+'" selected>'+themeServerstatsOptions[key]+'</option>';
}else
{
themeServerstatsOptionsOut += '<option value="'+key+'">'+themeServerstatsOptions[key]+'</option>';
}
}
if(localStorage.getItem('themeServerstats')=='activate')
{
// load themeServerstatsNum settings from db
var themeServerstatsNum = 10;
$.ajax({
cache: false,
async: false,
type: 'GET',
url: 'themes/AdminLTE/dist/php/settings.php?m=global&p=themeServerstats&v=displayNum',
success: function(data)
{
themeServerstatsNum = data;
}
});
var themeServerstatsDisplayNum = '\
<tr>\
<td align="right">\
<label for="themeServerstatsNum" class="mb-0">Server Player Stats Num:</label>\
<small class="text-muted d-block">Displays last <span id="themeServerstatsNumber">'+themeServerstatsNum+'</span> measurements</small>\
</td>\
<td align="left">\
<div class="form-group mb-0">\
<input type="range" class="form-control-range" min="1" max="20" value="'+themeServerstatsNum+'" id="themeServerstatsNum" name="themeServerstatsNum">\
</div>\
</td>\
<td>\
<div class="image-tip" data-toggle="tooltip" data-html="true" title="Displays last n measurements in Playercharts on Dashboard"><i class="far fa-question-circle"></i></div>\
</td>\
</tr>\
'
}
$('.main #theme').parents('tr').after('\
<tr>\
<td align="right">\
<label for="themeServerstats" class="mb-0">Server Player Stats:</label>\
<small class="text-muted d-block">Displays custom Server Boxes on Dashboard</small>\
</td>\
<td align="left">\
<div class="form-group mb-0">\
<select id="themeServerstats" name="themeServerstats" class="form-control">\
' + themeServerstatsOptionsOut + '\
</select>\
</div>\
</td>\
<td>\
<div class="image-tip" data-toggle="tooltip" data-html="true" title="Activates user stats for each server, also installs a running cronjob on first server (1/5min check each server)"><i class="far fa-question-circle"></i></div>\
</td>\
</tr>\
' + themeServerstatsDisplayNum + '\
');
// display current themeNavWidth
$('.currentNavWidth').text('Current Width: '+localStorage.getItem('themeNavWidth')+'px');
// themeNavWidth slide
$(document).on('input', '#themeNavWidth', function()
{
// call setNavWidth function from main.js
setNavWidth($(this).val());
// change currentNavWidth text
$('.currentNavWidth').text('Current Width: ' + $(this).val() + 'px');
});
// themeNavWidth change
$('#themeNavWidth').change(function()
{
$.ajax({
cache: false,
async: true,
type: 'GET',
url: 'themes/AdminLTE/dist/php/settings.php?m=settings&p=themeNavWidth&v='+$(this).val(),
start: function()
{
toastr.info(langConsts['OGP_LANG_theme']+' Nav Width change initiated');
},
success: function(themeNavWidth)
{
// reseset themeNavWidth cache
localStorage.setItem('themeNavWidth', themeNavWidth);
// call setNavWidth function from main.js
setNavWidth(themeNavWidth);
// display current themeNavWidth
$('.currentNavWidth').text('Current Width: '+themeNavWidth+'px');
// reset themeLogo tooltip message
$('#themeLogo').closest('tr').find('.image-tip').attr('title', langConsts['OGP_LANG_theme']+' Logo - Max Size: '+(themeNavWidth-32)+' x 33px');
toastr.success('Successfully changed '+langConsts['OGP_LANG_theme']+' Nav Width to ' + themeNavWidth + 'px');
}
});
});
// themeServerstats change
$('#themeServerstats').change(function()
{
// disable form button
$('[name="update_settings"]').attr('disabled', 'disabled');
// message
toastr.info('themeServerstats change initiated');
var themeServerstatsVal = $(this).val();
$.ajax({
cache: false,
async: true,
type: 'GET',
url: 'themes/AdminLTE/dist/php/settings.php?m=settings&p=themeServerstats&v=' + themeServerstatsVal,
success: function(html)
{
// message
toastr.success('Successfully ' + themeServerstatsVal + 'd themeServerstats');
// set localStorage cache
localStorage.setItem('themeServerstats', themeServerstatsVal);
},
error: function(error)
{
toastr.error('Error: ' + error);
}
}).done(function()
{
// enable form button
$('[name="update_settings"]').removeAttr('disabled');
});
});
// themeServerstatsNum slide
$(document).on('input', '#themeServerstatsNum', function()
{
// change themeServerstatsNumber text
$('#themeServerstatsNumber').text($(this).val());
});
// themeServerstatsNum change
$('#themeServerstatsNum').change(function()
{
// disable form button
$('[name="update_settings"]').attr('disabled', 'disabled');
// message
toastr.info('themeServerstatsNum change initiated');
var themeServerstatsNumVal = $(this).val();
$.ajax({
cache: false,
async: true,
type: 'GET',
url: 'themes/AdminLTE/dist/php/settings.php?m=settings&p=themeServerstats&v=setNum&num=' + themeServerstatsNumVal,
success: function(html)
{
// message
toastr.success('Successfully set themeServerstatsNum');
},
error: function(error)
{
toastr.error('Error: ' + error);
}
}).done(function()
{
// enable form button
$('[name="update_settings"]').removeAttr('disabled');
});
});
});
$(window).load(function()
{
// themeLogo upload
$('input[type=file]#themeLogo').change(function()
{
$(this).simpleUpload('themes/AdminLTE/dist/php/settings.php?m=settings&p=fileUpload', {
allowedExts: ["jpg", "jpeg", "jpe", "jif", "jfif", "jfi", "png", "gif", "svg"],
allowedTypes: ["image/pjpeg", "image/jpeg", "image/png", "image/x-png", "image/gif", "image/x-gif", "image/svg", "image/svg+xml"],
maxFileSize: 5242880, // 5mb in bytes
limit: 1,
start: function()
{
toastr.info(langConsts['OGP_LANG_theme']+' Logo Upload initiated');
},
success: function(data)
{
var jsonData = $.parseJSON(data);
if(jsonData['code']=="success")
{
$.ajax({
url: jsonData['data'],
type: 'HEAD',
error: function()
{
toastr.error('Error: Uploaded File not found');
},
success: function()
{
var d = new Date();
// overwrite themeLogo cache
localStorage.setItem('themeLogo', jsonData['data']);
// set themeLogo
$('img.brand-image').attr('src', jsonData['data'] + "?t=" + d.getTime());
if($('.themeLogoRemoval').length==0)
{
// add themeRemoval
addThemeRemoval(jsonData['data']);
}
toastr.success('Successfully uploaded new '+langConsts['OGP_LANG_theme']+' Logo');
}
});
}else
{
toastr.error(jsonData['data']);
}
},
error: function(error)
{
toastr.error('Error: ' + error);
}
});
});
});
function addThemeRemoval(themeLogo)
{
var d = new Date();
$('.main #themeLogo').parents('.form-group').after('\
<div class="themeLogoRemoval my-2">\
<img src="' + themeLogo + '?t=' + d.getTime() + '" class="brand-image">\
<a class="btn btn-xs btn-danger m-1" id="removeThemeLogo">\
<i class="fas fa-trash-alt mr-1"></i>Remove ' + langConsts['OGP_LANG_theme'] + ' Logo\
</a>\
</div>\
');
$('#removeThemeLogo').click(function()
{
$.ajax({
async: true,
type: 'GET',
url: 'themes/AdminLTE/dist/php/settings.php?m=settings&p=themeLogo&v=remove',
success: function(data)
{
// remove themeLogoRemoval div
$('.themeLogoRemoval').remove();
// remove themeLogo from localStorage
localStorage.removeItem('themeLogo');
// change theme for image updates
themeChanger(localStorage.getItem('theme'));
toastr.success('Successfully removed '+langConsts['OGP_LANG_theme']+' Logo');
}
});
});
}

View file

@ -1,4 +0,0 @@
.main .img-circle {
width: 2.1rem;
height: 2.1rem;
}

View file

@ -1,57 +0,0 @@
$(document).ready(function()
{
var d = new Date();
$('.main').addClass('simple-billing');
$('.main > style').remove();
$('.main > h4').each(function()
{
$(this).replaceWith('<div class="callout callout-info">'+$(this).text()+'</div>');
});
$('input[name="remove"]').addClass('btn-danger');
$('.main table').removeAttr('style');
$('.main [href^="?m=user_admin"]').each(function()
{
var thisUserProfileLink = $(this).attr('href');
var thisUserId = new URLSearchParams(thisUserProfileLink).get('user_id');
var setThisUserAvatar = 'themes/AdminLTE/dist/img/default-avatar.png';
$(this).parent('td').prepend('<img src="'+setThisUserAvatar+'" class="img-circle elevation-2 mr-2" alt="User Image">');
var thisUserImage = $(this).parent('td').find('img');
if(thisUserId)
{
if(!localStorage.getItem('avatar_' + thisUserId))
{
// set loading avatar
$(thisUserImage).attr('src', 'themes/AdminLTE/dist/img/spinner.gif?'+ d.getTime()).removeClass('elevation-2');
// load avatar from db
$.ajax({
cache: false,
async: true,
type: 'GET',
url: 'themes/AdminLTE/dist/php/settings.php?m=user&p=getavatar&userid=' + thisUserId,
success: function(avatar)
{
// set avatar cache
localStorage.setItem('avatar_' + thisUserId, avatar);
// set user avatar
$(thisUserImage).attr('src', avatar + "?" + d.getTime()).addClass('elevation-2');
}
});
}else
{
// set user avatar variable
setThisUserAvatar = localStorage.getItem('avatar_' + thisUserId);
}
}
$(thisUserImage).attr('src', setThisUserAvatar + "?" + d.getTime());
});
});

View file

@ -1,5 +0,0 @@
select[name="service_id"] {
display: inline-block;
width: auto;
margin-right: 0.25rem;
}

View file

@ -1,5 +0,0 @@
$(document).ready(function()
{
$('.main').addClass('services');
$('.main input[value="'+langConsts['OGP_LANG_remove_service']+'"]').removeClass('btn-primary').addClass('btn-danger');
});

View file

@ -1,38 +0,0 @@
.main [href="?m=simple-billing&p=cart"] > img {
display: none;
}
.main [href="?m=simple-billing&p=cart"] .fa {
margin-right: 5px;
}
.shop-item:hover {
cursor: pointer;
}
.widget-user .widget-user-image {
position: absolute;
top: 25% !important;
margin-left: auto !important;
margin-right: auto !important;
left: 0 !important;
right: 0 !important;
text-align: center !important;
}
.widget-user .widget-user-image > img {
width: 200px !important;
-webkit-transition: all 0.4s;
transition: all 0.4s;
}
.shop-item:hover .widget-user-image img {
width: 210px !important;
}
.widget-user .widget-user-username {
line-height: 0.9;
}
.main > div:not(.shop-items) > div {
text-align: center;
}

View file

@ -1,68 +0,0 @@
$(document).ready(function()
{
$('.main [href="?m=simple-billing&p=cart"]').addClass('btn btn-sm btn-primary').prepend('<i class="fa fa-shopping-cart" aria-hidden="true"></i>');
$('.main > table').addClass('mb-2');
$('.main').append('<div class="shop-items d-flex flex-wrap"></div>');
if($('form[action^="?m=simple-billing&p=add_to_cart"]').length==0)
{
$('.main > div:not(.shop-items) > div').each(function()
{
if($(this).find('[type="image"]').length > 0)
{
var serviceImage = $(this).find('[type="image"]');
}else
{
var serviceImage = $(this).find('img');
}
var serviceId = $(this).find('[name="service_id"]').val();
var serviceTitle = $(this).find('center').first().text();
var serviceCost = $(this).find('center').last().find('em').html();
var serviceImageSrc = $(serviceImage).attr('src');
var serviceImageAlt = $(serviceImage).attr('alt');
var serviceImageVal = $(serviceImage).val();
var newItem = '\
<div class="col-xl-3 col-lg-4 col-md-6 col-sm-6 col-12">\
<form action="" method="POST">\
<input name="service_id" type="hidden" value="'+serviceId+'" class="form-control">\
<div class="card card-widget widget-user shadow shop-item">\
<div class="widget-user-header bg-secondary">\
<h3 class="widget-user-username">'+serviceTitle+'</h3>\
</div>\
<div class="widget-user-image">\
<img class="elevation-2" src="'+serviceImageSrc+'" alt="'+serviceImageAlt+'">\
</div>\
<div class="card-footer">\
<div class="d-flex justify-content-around flex-row flex-wrap">\
<div class="description-block d-inline-block mx-2">\
<h5 class="description-header">'+langConsts['OGP_LANG_starting_on']+'</h5>\
<span class="description-text">'+serviceCost.split(' ')[2]+'</span>\
</div>\
<div class="description-block d-inline-block mx-2">\
<h5 class="description-header">'+serviceCost.split('(')[1].split(')')[0].split(' ')[0]+'</h5>\
<span class="description-text">'+serviceCost.split('(')[1].split(')')[0].split(' ')[1]+'</span>\
</div>\
</div>\
</div>\
</div>\
</form>\
</div>\
';
$('.main .shop-items').append(newItem);
});
$('.main > div:not(.shop-items)').remove();
}
});
$(window).load(function()
{
$('.shop-items form').click(function()
{
$(this).submit();
});
});

View file

@ -1,30 +0,0 @@
.main [href="?m=simple-billing&p=cart"] > img {
display: none;
}
.main [href="?m=simple-billing&p=cart"] .fa {
margin-right: 5px;
}
.widget-user .widget-user-image {
position: absolute;
top: 25% !important;
margin-left: auto !important;
margin-right: auto !important;
left: 0 !important;
right: 0 !important;
text-align: center !important;
}
.widget-user .widget-user-image > img {
width: 200px !important;
-webkit-transition: all 0.4s;
transition: all 0.4s;
}
.shop-item:hover .widget-user-image img {
width: 210px !important;
}
.widget-user .widget-user-username {
line-height: 0.9;
}

View file

@ -1,71 +0,0 @@
$(document).ready(function()
{
/* *** Invalid Image replacement *** */
$('.main img, .main input[type="image"]').error(function()
{
$(this).unbind("error").attr("src", "themes/AdminLTE/dist/img/image_not_found.png").attr("style", "max-width:250px;").removeAttr('height');
});
$('.main > p:first-of-type').css("background-color", "").css("color", "");
$('p > [href="?m=register&p=form"], p > [href="index.php"]').addClass('btn').addClass('btn-xs').addClass('btn-primary');
});
$(window).load(function()
{
$('.main [href="?m=simple-billing&p=cart"]').addClass('btn btn-sm btn-primary').prepend('<i class="fa fa-shopping-cart" aria-hidden="true"></i>');
$('.main > table').addClass('mb-2');
$('.main .card-body').append('<div class="shop-items row d-flex flex-wrap"></div>');
$('.main .card-body > div > div').each(function()
{
if($(this).find('[type="image"]').length > 0)
{
var serviceImage = $(this).find('[type="image"]');
}else
{
var serviceImage = $(this).find('img');
}
var serviceId = $(this).find('[name="service_id"]').val();
var serviceTitle = $(this).find('center').first().text();
var serviceCost = $(this).find('center').last().find('em').html();
var serviceImageSrc = $(serviceImage).attr('src');
var serviceImageAlt = $(serviceImage).attr('alt');
var serviceImageVal = $(serviceImage).val();
var newItem = '\
<div class="col-xl-4 col-lg-6 col-md-6 col-sm-6 col-12">\
<div class="card card-widget widget-user shadow shop-item">\
<div class="widget-user-header bg-secondary">\
<h3 class="widget-user-username">'+serviceTitle+'</h3>\
</div>\
<div class="widget-user-image">\
<img class="elevation-2" src="'+serviceImageSrc+'" alt="'+serviceImageAlt+'">\
</div>\
<div class="card-footer">\
<div class="d-flex justify-content-around flex-row flex-wrap">\
<div class="description-block d-inline-block mx-2">\
<h5 class="description-header">'+langConsts['OGP_LANG_starting_on']+'</h5>\
<span class="description-text">'+serviceCost.split(' ')[2]+'</span>\
</div>\
<div class="description-block d-inline-block mx-2">\
<h5 class="description-header">'+serviceCost.split('(')[1].split(')')[0].split(' ')[0]+'</h5>\
<span class="description-text">'+serviceCost.split('(')[1].split(')')[0].split(' ')[1]+'</span>\
</div>\
</div>\
</div>\
</div>\
</div>\
';
$('.main .card-body .shop-items').append(newItem);
});
$('.main .card-body > div:not(.shop-items)').remove();
$('.shop-item form').click(function()
{
$(this).submit();
});
});

View file

@ -1,4 +0,0 @@
$(document).ready(function() {
$('.main > style:nth-child(2)').remove();
});

View file

@ -1,12 +0,0 @@
#scrolling_checkbox,
#uninstall_scrolling_checkbox
{
min-height: 120px;
overflow-y: scroll;
text-align:left;
}
ul {
list-style: none;
padding: 0px;
}

View file

@ -1,24 +0,0 @@
$(document).ready(function()
{
$('.main [href^="?m=steam_workshop&p=uninstall"]').addClass('btn btn-sm btn-danger').prepend('<i class="fas fa-puzzle-piece mr-1"></i>');
$('.main [href="?m=steam_workshop&p=main"]').addClass('btn btn-sm btn-success');
$('.main [name="install"]').removeClass('btn-primary').addClass('btn-success');
$('.main [name="remove_mods"], .main [name="uninstall"]').removeClass('btn-primary').addClass('btn-danger').prepend('<i class="fas fa-trash-alt mr-1"></i>');
$('.main [href^="?m=steam_workshop&p=main&home_id-mod_id-ip-port="]').addClass('btn btn-sm btn-primary').prepend('<i class="fas fa-puzzle-piece mr-1"></i>');
$('.main [href^="?m=gamemanager"]').each(function()
{
if($(this).text()==langConsts['OGP_LANG_back'])
{
$(this).addClass('btn btn-sm btn-primary mt-1').prepend('<i class="fas fa-angle-double-left mr-1"></i>');
}
});
$('.main [href^="?m=steam_workshop"]').each(function()
{
if($(this).text()==langConsts['OGP_LANG_install_mod'])
{
$(this).addClass('btn-sm').prepend('<i class="fas fa-puzzle-piece mr-1"></i>');
}
});
});

View file

@ -1,5 +0,0 @@
$(document).ready(function() {
$('.main [href="?m=subusers&p=add"]').addClass('btn').addClass('btn-sm').addClass('btn-primary');
$('.main [href="?m=subusers&p=del"]').addClass('btn').addClass('btn-sm').addClass('btn-danger');
});

View file

@ -1,48 +0,0 @@
$(document).ready(function()
{
// content to table translation
$('.main .contactForm').each(function()
{
var form_selector = $(this);
$(form_selector).prepend('<br>');
$(form_selector.find('br')).each(function()
{
// skip if this br is in head paragraph
if($(this).parent('p').length==0)
{
var $set = $();
var nxt = this.nextSibling;
while(nxt) {
if(!$(nxt).is('br'))
{
$set.push(nxt);
nxt = nxt.nextSibling;
} else break;
}
$set.wrapAll('<tr><td></td></tr>');
// remove this br after wrap
$(this).remove();
}
});
$(form_selector.find('tr')).wrapAll('<table class="table table-sm table-striped" />');
});
// remove main br
$('.main > br').remove();
// remove empty rows
$('.main .contactForm td').each(function()
{
if($(this).html().trim()=="")
{
$(this).parent('tr').remove();
}
});
// remove style attr from submit button
$('.main .contactForm input[type="submit"]').removeAttr('style');
// remove style attribute from paragraphs
$('.main p').removeAttr('style');
});

View file

@ -1,11 +0,0 @@
.attachment_add {
margin-bottom: 1rem;
}
.attachment_inputs > .custom-file {
margin-right: 0.4rem;
}
.attachment_info {
padding: 1rem 0;
}

View file

@ -1,5 +0,0 @@
$(document).ready(function()
{
$('#add_file_attachment').addClass('btn-secondary').prepend('<i class="fas fa-plus-circle mr-1"></i>');
// $('#submit').addClass('mt-2');
});

Some files were not shown because too many files have changed in this diff Show more