24 Commits

Author SHA1 Message Date
Yiğit Kerem Oktay 85dfce55c8 Remove old version server checks 2020-11-12 22:06:55 +03:00
Yiğit Kerem Oktay 75bdde26b3 Update main.css 2020-11-12 11:20:35 +03:00
Yiğit Kerem Oktay 3939fca1f7 Update main.css 2020-11-12 11:16:16 +03:00
Yigit Kerem Oktay 96f79ee725 Revert "Merge pull request #135 from server-status-project/master"
This reverts commit 8d571547f5, reversing
changes made to e96df7015e.
2020-11-05 16:54:04 +03:00
Yiğit Kerem Oktay 8d571547f5 Merge pull request #135 from server-status-project/master
Merge new updates
2020-11-05 16:52:24 +03:00
Yigit Kerem Oktay 46c0b55779 Revert "Merge branch 'dev' into master"
This reverts commit 18b89e8c35, reversing
changes made to 81132e9ccf.
2020-11-05 16:51:43 +03:00
Yiğit Kerem Oktay 18b89e8c35 Merge branch 'dev' into master 2020-11-05 16:50:05 +03:00
Yiğit Kerem Oktay e96df7015e Merge pull request #131 from thnilsen/dev
Initial code for front-end categorization status view
2020-10-14 23:06:53 +03:00
Thomas Nilsen 505d802c2e Merge pull request #4 from yigitkeremoktay/patch-1
Fix a UI bug
2020-10-14 21:40:14 +02:00
Yiğit Kerem Oktay 3edfd9dbe2 Fix a UI bug 2020-10-14 22:30:12 +03:00
thnilsen 887a197033 Initial code for front-end categorization status view 2020-10-14 19:54:32 +02:00
Vojtěch Sajdl 81132e9ccf Merge pull request #129 from kim3-sudo/patch-1
Fix PHP syntax error
2020-10-05 23:55:36 +02:00
Sejin Kim af62f9f49d Fix PHP syntax error
Added a semicolon that allows fresh installations on *NIX to work properly with PHP 7.2+
2020-10-05 17:34:27 -04:00
Yiğit Kerem Oktay e2b331a039 Fixback 2020-10-02 08:58:07 +03:00
Yiğit Kerem Oktay 671004579c Update incident.php 2020-10-01 16:35:32 +03:00
Yiğit Kerem Oktay 38fcabdbb4 Update stale.yml 2020-09-12 16:41:36 +03:00
Vojtěch Sajdl f7ad9ac6b1 Create stale.yml 2020-09-09 13:20:05 +02:00
Vojtěch Sajdl 9963e1f834 Merge pull request #126 from Nothing4You/fix-head.php
fix head.php: comment wasn't part of of a php block
2020-09-01 09:39:18 +02:00
Richard Schwab ff06a320b0 fix head.php: comment wasn't part of of a php block 2020-09-01 08:28:31 +02:00
Yiğit Kerem Oktay 3c540496d4 Update template.php 2020-08-30 22:03:42 +03:00
Yiğit Kerem Oktay e09d02cf2e Update and rename head.txt to head.php 2020-08-30 22:03:09 +03:00
Vojtěch Sajdl 14015d4666 Update README.md 2020-08-30 09:19:46 +02:00
Yiğit Kerem Oktay b3a1bfeb0e Update issue templates 2020-08-24 23:04:14 +03:00
Yiğit Kerem Oktay 1573b062b5 Update README.md 2020-08-24 22:46:31 +03:00
4 changed files with 89 additions and 20 deletions
+22 -5
View File
@@ -72,7 +72,8 @@ class Constellation
public function render_status($admin = false, $heading = true){ public function render_status($admin = false, $heading = true){
global $mysqli; global $mysqli;
$query = $mysqli->query("SELECT id, name FROM services"); //$query = $mysqli->query("SELECT id, name, description FROM services");
$query = $mysqli->query("SELECT services.id, services.name, services.description, services_groups.name as group_name FROM services LEFT JOIN services_groups ON services.group_id=services_groups.id ORDER BY services_groups.name ");
$array = array(); $array = array();
if ($query->num_rows){ if ($query->num_rows){
$timestamp = time(); $timestamp = time();
@@ -87,10 +88,10 @@ class Constellation
$tmp = $sql->get_result(); $tmp = $sql->get_result();
if ($tmp->num_rows) if ($tmp->num_rows)
{ {
$array[] = new Service($result['id'], $result['name'], $tmp->fetch_assoc()['type']); $array[] = new Service($result['id'], $result['name'], $result['description'], $result['group_name'], $tmp->fetch_assoc()['type']);
} }
else{ else{
$array[] = new Service($result['id'], $result['name']); $array[] = new Service($result['id'], $result['name'], $result['description'], $result['group_name']);
} }
} }
if ($heading) if ($heading)
@@ -103,11 +104,27 @@ class Constellation
} }
if (!$admin) if (!$admin)
{ {
echo '<div id="status-container" class="clearfix">'; ?>
<script>
$(document).ready(function(){
$('[data-toggle="tooltip"]').tooltip();
});
</script>
<?php
//echo '<div id="status-container" class="clearfix">';
//$arrCompletedGroups = array();
foreach($array as $service){ foreach($array as $service){
//print_r($service);
//if ( !empty($service->group_name) && !in_array($service->group_name, $arrCompletedGroups)) {
//print $service->name;
// $arrCompletedGroups[] = $service['group_name'];
// $service->render(true);
//} else {
$service->render(); $service->render();
//}
} }
echo '</div>'; echo '</ul>';
//echo '</div>';
} }
else{ else{
return $array; return $array;
+60 -6
View File
@@ -6,19 +6,24 @@ class Service implements JsonSerializable
{ {
private $id; private $id;
private $name; private $name;
private $description;
private $group_name;
private $status; private $status;
/** /**
* Constructs service from its data. * Constructs service from its data.
* @param int $id service ID * @param int $id service ID
* @param String $name service name * @param String $name service name
* @param String $descriotion service description for tooltip
* @param int $status current service status * @param int $status current service status
*/ */
function __construct($id, $name, $status=3) function __construct($id, $name, $description=null, $group_name='', $status=3)
{ {
//TODO: Maybe get data from ID? //TODO: Maybe get data from ID?
$this->id = $id; $this->id = $id;
$this->name = $name; $this->name = $name;
$this->description = $description;
$this->group_name = $group_name;
$this->status = $status; $this->status = $status;
} }
@@ -49,6 +54,15 @@ class Service implements JsonSerializable
return $this->name; return $this->name;
} }
/**
* Returns description of this service
* @return String description
*/
public function get_description()
{
return $this->description;
}
/** /**
* Processes submitted form and adds service unless problem is encountered, * Processes submitted form and adds service unless problem is encountered,
* calling this is possible only for admin or higher rank. Also checks requirements * calling this is possible only for admin or higher rank. Also checks requirements
@@ -192,24 +206,64 @@ class Service implements JsonSerializable
/** /**
* Renders this service. * Renders this service.
* @param $boolGroup set to true if the groups name is to be rendered
* @return void * @return void
*/ */
public function render(){ public function render(){
global $statuses; global $statuses;
global $classes; global $classes;
?> static $arrCompletedGroups = array();
<div class="item clearfix"> //static $boolClosed;
<div class="service"><?php echo $this->name; ?></div> static $boolOpened;
<?php if ($this->status!=-1){?><div class="status <?php echo $classes[$this->status];?>"><?php echo _($statuses[$this->status]);?></div><?php }?>
</div> // Check if previous ul has been opened, and if a empty/new group is being
// render_header, close the UL first.
if ( $boolOpened ) {
if ( empty($this->group_name) || !in_array($this->group_name, $arrCompletedGroups) ) {
echo '</ul>';
$boolOpened = false;
}
}
// If no group exist or group is new, start a new UL
if ( !empty($this->group_name) && !in_array($this->group_name, $arrCompletedGroups)) {
echo '<ul class="list-group components">';
//echo '<ul class="platforms list-group mb-2">';
// Render the group status if it exists
echo '<li class="list-group-item list-group-item-success group-name"><span><i class="glyphicon glyphicon-plus"></i></span>&nbsp;' . $this->group_name .'<div class="status '. $classes[$this->status] .'">'. _($statuses[$this->status]).'</div></li>';
//echo '<li class="cist-group-item d-flex flex-row justify-content-between platform list-group-item-action py-0 expanded" role="button">' . $this->group_name .'<div class="status '. $classes[$this->status] .'"'. _($statuses[$this->status]).'</div></li>';
$arrCompletedGroups[] = $this->group_name;
$boolOpened = true;
}
if ( empty($this->group_name)) {
echo '<ul class="list-group components">';
// echo '<ul class="platforms list-group mb-2">';
$boolFinish = true;
}
// Render the service status
echo '<li class="list-group-item sub-component"><strong>' . $this->name .'</strong>';
//echo '<li class="list-group-item d-flex flex-columns justify-content-between><span>+</span><h3 class="py-2 my-0 flex-fill expanded">' . $this->name . '</h3>';
if(!empty($this->description)) {
echo '<a class="desc-tool-tip" data-toggle="tooltip" data-placement="top" title="'.$this->description.'"> <span><i class="glyphicon glyphicon-question-sign"></i></span></a>';
}
if ($this->status!=-1){?><div class="status pull-right <?php echo $classes[$this->status];?>"><?php echo _($statuses[$this->status]);?></div>
<?php <?php
} }
echo '</li>';
if ( isset($boolFinish) && $boolFinish) {
echo '</ul>';
}
}
public function jsonSerialize() { public function jsonSerialize() {
global $statuses; global $statuses;
return [ return [
"id" => $this->id, "id" => $this->id,
"name" => $this->name, "name" => $this->name,
"description" => $this->description,
"status" => $this->status, "status" => $this->status,
"status_string" => $statuses[$this->status] "status_string" => $statuses[$this->status]
]; ];
+4 -8
View File
@@ -27,6 +27,10 @@ a:focus {
color:#f5f4f4; color:#f5f4f4;
} }
a.desc-tool-tip, a.desc-tool-tip:hover, a.desc-tool-tip:visited {
color: grey;
}
.centered { .centered {
text-align: center text-align: center
} }
@@ -69,13 +73,6 @@ a:focus {
top: 0; top: 0;
width: 100%; width: 100%;
} }
body {
min-height: 100vh;
height: 100vh;
}
.admins_color h4 { .admins_color h4 {
color: #3a72bd; color: #3a72bd;
font-weight: bold; font-weight: bold;
@@ -686,4 +683,3 @@ input:checked + .slider:before {
.slider.round:before { .slider.round:before {
border-radius: 50%; border-radius: 50%;
} }
+2
View File
@@ -68,6 +68,7 @@ if (isset($_GET['subscriber_logout'])){
unset($_SESSION['subscriber_id']); unset($_SESSION['subscriber_id']);
header('Location: index.php'); header('Location: index.php');
} }
/*
$versionfile = fopen("versionfile", "r") or die("Unable to open version file!"); $versionfile = fopen("versionfile", "r") or die("Unable to open version file!");
$appversion = fread($versionfile,filesize("versionfile")); $appversion = fread($versionfile,filesize("versionfile"));
fclose($versionfile); fclose($versionfile);
@@ -90,6 +91,7 @@ if($db->getSetting($mysqli,"notifyUpdates") == "yes"){
die("Your installation is not upp to date! Download the new update from: '".$remotedl."' Your version is:'".$appversion."' Remote Authority Version is:'".$remoteversion."' Your Update Seed is:'".$useed."' Remote Package Authority is Skyfallen. <br>If you cannot access Remote Authority, please check status.theskyfallen.com and skyfallenhosted.ml manually."); die("Your installation is not upp to date! Download the new update from: '".$remotedl."' Your version is:'".$appversion."' Remote Authority Version is:'".$remoteversion."' Your Update Seed is:'".$useed."' Remote Package Authority is Skyfallen. <br>If you cannot access Remote Authority, please check status.theskyfallen.com and skyfallenhosted.ml manually.");
} }
} }
*/
Template::render_header("Status"); Template::render_header("Status");
?> ?>
<div class="text-center"> <div class="text-center">