Progress towards autofix working

This commit is contained in:
Michał Gdula 2022-11-03 18:00:05 +00:00
parent 2ef5b6d54a
commit 86bba69f81
11 changed files with 438 additions and 174 deletions

View file

@ -192,7 +192,7 @@
</div>
<?php
// Reading images from table
$logs_request = mysqli_query($conn, "SELECT * FROM logs ORDER BY id DESC");
$logs_request = mysqli_query($conn, "SELECT * FROM logs ORDER BY id DESC LIMIT 100");
while ($log = mysqli_fetch_array($logs_request)) {
?>
@ -208,6 +208,9 @@
<?php
}
?>
<div>
<button class="btn btn-neutral" onclick="loadMore()" disabled>Load More</button>
</div>
</div>
<div id="bans" class="bans tabcontent">
@ -262,11 +265,7 @@
echo "<p>".$user_time->format('Y-m-d H:i:s T')." (".$diff->time($user['last_modified']).")</p>";
if ($user['id'] == 1) {
?>
<button class="btn btn-bad" disabled>Reset Password</button>
<button class="btn btn-bad" disabled>Delete user</button>
<button class="btn btn-bad" disabled>Toggle admin</button>
<?php
echo "<p></p><p></p><p></p>";
} else {
?>
<button id="userResetPassword" class="btn btn-bad" onclick="userResetPassword('<?php echo $user['id']; ?>', '<?php echo $user['username']; ?>')">Reset Password</button>
@ -369,6 +368,7 @@
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.height = "0";
tabcontent[i].style.overflow = "hidden";
tabcontent[i].style.transform = "scale(0.9)";
}
tablinks = document.getElementsByClassName("tablinks");
@ -378,6 +378,7 @@
document.getElementById(tabName).style.height = "21rem";
document.getElementById(tabName).style.overflow = "scroll";
document.getElementById(tabName).style.transform = "scale(1)";
evt.currentTarget.className += " active-tab";
}
</script>
@ -398,48 +399,49 @@
<?php
foreach ($check_sanity as $result) {
if ($result['type'] == 'critical') {
echo "<p class='alert alert-bad'>";
echo "<span class='badge badge-critical'>Critical</span> ";
if ($result['fix'] == 'auto') {
echo "<span class='badge badge-primary'>Auto fix available</span> ";
} elseif ($result['fix'] == 'manual') {
echo "<span class='badge badge-critical'>Manual fix required</span> ";
}
if (isset($result['link'])) {
echo "<a class='link badge badge-primary' href='".$result['link']."'>Recources</a> ";
}
echo $result['message'];
echo "</p>";
} else {
echo "<p class='alert alert-warning'>";
echo "<span class='badge badge-warning'>Warning</span> ";
if ($result['fix'] == 'auto') {
echo "<span class='badge badge-primary'>Auto fix available</span> ";
} elseif ($result['fix'] == 'manual') {
echo "<span class='badge badge-critical'>Manual fix required</span> ";
}
if (isset($result['link'])) {
echo "<a class='link badge badge-primary' href='".$result['link']."'>Recources</a> ";
}
echo $result['message'];
echo "</p>";
echo "<p class='alert alert-bad'>
<span class='badge badge-critical'>Critical</span> ";
} elseif ($result['type'] == 'warning') {
echo "<p class='alert alert-warning'>
<span class='badge badge-warning'>Warning</span> ";
}
if ($result['fix'] == 'auto') {
echo "<span class='badge badge-primary'>Auto fix available</span> ";
} elseif ($result['fix'] == 'manual') {
echo "<span class='badge badge-critical'>Manual fix required</span> ";
}
if (isset($result['link'])) {
echo "<a class='link badge badge-primary' href='".$result['link']."'>Recources</a> ";
}
echo $result['message']."</p>";
}
echo "<button class='btn btn-bad' disabled>
<img class='svg' src='assets/icons/wrench.svg'>
Attempt Autofix
</button>";
?>
<button class='btn btn-bad' onclick="runAutofix()"><img class='svg' src='assets/icons/wrench.svg'>Attempt Autofix</button>
<div id="autofix">
<button onclick='closeAutofix()'><img src='assets/icons/cross.svg'></button>
<div id="autofix-log"></div>
</div>
<script>
function runAutofix() {
document.getElementById('autofix').style.display = "block";
document.getElementById('autofix-log').innerHTML = "<p><span style='color: var(--accent);'>[INFO]</span> Starting autofix</p>";
setTimeout(function() {
$("#autofix-log").load("app/sanity/sanity.php", {autofix: "true"});
}, 1000);
}
function closeAutofix() {
document.getElementById('autofix').style.display = "none";
}
</script>
<?php
}
?>
</div>

View file

@ -324,109 +324,6 @@ class Diff {
}
}
class Setup {
function create_tables($conn, $sql): bool
{
/*
$sql = "CREATE TABLE IF NOT EXISTS users (
id INT(11) AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(255) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
pfp_path VARCHAR(255) NOT NULL,
admin BOOLEAN NOT NULL DEFAULT FALSE,
last_modified TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)";
if ($conn->query($sql) === TRUE) {
echo "Table users created successfully";
}
$sql = "CREATE TABLE IF NOT EXISTS images (
id INT(11) AUTO_INCREMENT PRIMARY KEY,
imagename VARCHAR(255) NOT NULL,
alt VARCHAR(text) NOT NULL,
tags VARCHAR(text) NOT NULL,
author INT(11) NOT NULL,
last_modified TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
upload_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)";
if ($conn->query($sql) === TRUE) {
echo "Table images created successfully";
}
$sql = "CREATE TABLE IF NOT EXISTS groups (
id INT(11) AUTO_INCREMENT PRIMARY KEY,
group_name VARCHAR(255) NOT NULL,
image_list VARCHAR(text) NOT NULL,
last_modified TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)";
if ($conn->query($sql) === TRUE) {
echo "Table groups created successfully";
}
$sql = "CREATE TABLE IF NOT EXISTS logs (
id INT(11) AUTO_INCREMENT PRIMARY KEY,
ipaddress VARCHAR(16) NOT NULL,
action VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)";
if ($conn->query($sql) === TRUE) {
echo "Table logs created successfully";
}
$sql = "CREATE TABLE IF NOT EXISTS bans (
id INT(11) AUTO_INCREMENT PRIMARY KEY,
ipaddress VARCHAR(16) NOT NULL,
reason VARCHAR(255) NOT NULL,
time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
length VARCHAR(255) NOT NULL,
permanent BOOLEAN NOT NULL DEFAULT FALSE
)";
if ($conn->query($sql) === TRUE) {
echo "Table bans created successfully";
}
$sql = "CREATE TABLE IF NOT EXISTS tokens (
id INT(11) AUTO_INCREMENT PRIMARY KEY,
code VARCHAR(59) NOT NULL,
used BOOLEAN NOT NULL DEFAULT FALSE,
timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)";
if ($conn->query($sql) === TRUE) {
echo "Table tokens created successfully";
}
*/
return True;
}
function create_usr() {
if (!is_dir(__DIR__."/../usr")) {
mkdir("usr");
}
if (!is_dir(__DIR__."/../usr/images")) {
mkdir("usr/images");
}
if (!is_dir(__DIR__."/../usr/images/thumbnails")) {
mkdir("usr/images/thumbnails");
}
if (!is_dir(__DIR__."/../usr/images/previews")) {
mkdir("usr/images/previews");
}
if (!is_dir(__DIR__."/../usr/conf")) {
mkdir("usr/conf");
}
if (!is_file(__DIR__."/../usr/conf/conf.json")) {
$manifest = file_get_contents(__DIR__."/../usr/conf.default.json");
file_put_contents(__DIR__."/../usr/conf/conf.json", $manifest);
}
}
}
class Sanity {
function check_json(): array
{

View file

@ -1,5 +1,5 @@
{
"license": "GPL 3.0",
"version": "22.11.02",
"version": "22.11.03",
"branch": "main"
}

134
app/sanity/database.php Normal file
View file

@ -0,0 +1,134 @@
<?php
if (defined('ROOT')) {
function check_database($conn, $database) {
try {
$check = $conn->query("SELECT 1 FROM $database LIMIT 1");
if ($check) {
return true;
} else {
return false;
}
} catch (Exception $e) {
return false;
}
}
/*if (check_database($conn, 'images')) {
echo "<p><span style='color: var(--accent);'>[INFO]</span> Found images table</p>";
} else {
echo "<p><span style='color: var(--warning);'>[INFO]</span> Could not find images table</p>";
echo "<p><span style='color: var(--alert);'>[INFO]</span> Creating test table...</p>";
$sql = "CREATE TABLE IF NOT EXISTS images (
id INT(11) AUTO_INCREMENT PRIMARY KEY,
imagename VARCHAR(255) NOT NULL,
alt VARCHAR(text) NOT NULL,
tags VARCHAR(text) NOT NULL,
author INT(11) NOT NULL,
last_modified TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
upload_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)";
if ($conn->query($sql) === TRUE) {
echo "<p><span style='color: var(--accent);'>[INFO]</span> Table images made!</p>";
}
}
if (check_database($conn, 'users')) {
echo "<p><span style='color: var(--accent);'>[INFO]</span> Found users table</p>";
} else {
echo "<p><span style='color: var(--warning);'>[INFO]</span> Could not find users table</p>";
echo "<p><span style='color: var(--alert);'>[INFO]</span> Creating test table...</p>";
$sql = "CREATE TABLE IF NOT EXISTS users (
id INT(11) AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(255) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
pfp_path VARCHAR(255) NOT NULL,
admin BOOLEAN NOT NULL DEFAULT FALSE,
last_modified TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)";
if ($conn->query($sql) === TRUE) {
echo "<p><span style='color: var(--accent);'>[INFO]</span> Table users made!</p>";
}
}
if (check_database($conn, 'groups')) {
echo "<p><span style='color: var(--accent);'>[INFO]</span> Found groups table</p>";
} else {
echo "<p><span style='color: var(--warning);'>[INFO]</span> Could not find groups table</p>";
echo "<p><span style='color: var(--alert);'>[INFO]</span> Creating test table...</p>";
$sql = "CREATE TABLE IF NOT EXISTS groups (
id INT(11) AUTO_INCREMENT PRIMARY KEY,
group_name VARCHAR(255) NOT NULL,
image_list VARCHAR(text) NOT NULL,
last_modified TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)";
if ($conn->query($sql) === TRUE) {
echo "<p><span style='color: var(--accent);'>[INFO]</span> Table groups made!</p>";
}
}
if (check_database($conn, 'logs')) {
echo "<p><span style='color: var(--accent);'>[INFO]</span> Found logs table</p>";
} else {
echo "<p><span style='color: var(--warning);'>[INFO]</span> Could not find logs table</p>";
echo "<p><span style='color: var(--alert);'>[INFO]</span> Creating test table...</p>";
$sql = "CREATE TABLE IF NOT EXISTS logs (
id INT(11) AUTO_INCREMENT PRIMARY KEY,
ipaddress VARCHAR(16) NOT NULL,
action VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)";
if ($conn->query($sql) === TRUE) {
echo "<p><span style='color: var(--accent);'>[INFO]</span> Table logs made!</p>";
}
}
if (check_database($conn, 'bans')) {
echo "<p><span style='color: var(--accent);'>[INFO]</span> Found bans table</p>";
} else {
echo "<p><span style='color: var(--warning);'>[INFO]</span> Could not find bans table</p>";
echo "<p><span style='color: var(--alert);'>[INFO]</span> Creating test table...</p>";
$sql = "CREATE TABLE IF NOT EXISTS bans (
id INT(11) AUTO_INCREMENT PRIMARY KEY,
ipaddress VARCHAR(16) NOT NULL,
reason VARCHAR(255) NOT NULL,
time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
length VARCHAR(255) NOT NULL,
permanent BOOLEAN NOT NULL DEFAULT FALSE
)";
if ($conn->query($sql) === TRUE) {
echo "<p><span style='color: var(--accent);'>[INFO]</span> Table bans made!</p>";
}
}
if (check_database($conn, 'tokens')) {
echo "<p><span style='color: var(--accent);'>[INFO]</span> Found tokens table</p>";
} else {
echo "<p><span style='color: var(--warning);'>[INFO]</span> Could not find tokens table</p>";
echo "<p><span style='color: var(--alert);'>[INFO]</span> Creating test table...</p>";
$sql = "CREATE TABLE IF NOT EXISTS tokens (
id INT(11) AUTO_INCREMENT PRIMARY KEY,
code VARCHAR(59) NOT NULL,
used BOOLEAN NOT NULL DEFAULT FALSE,
timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)";
if ($conn->query($sql) === TRUE) {
echo "<p><span style='color: var(--accent);'>[INFO]</span> Table tokens made!</p>";
}
}*/
if (check_database($conn, 'test')) {
echo "<p><span style='color: var(--accent);'>[INFO]</span> Found test table</p>";
} else {
echo "<p><span style='color: var(--warning);'>[ERRO]</span> Could not find test table</p>";
echo "<p><span style='color: var(--alert);'>[INFO]</span> Creating test table...</p>";
}
}

58
app/sanity/folders.php Normal file
View file

@ -0,0 +1,58 @@
<?php
if (defined('ROOT')) {
if (is_dir(__DIR__."/../../usr")) {
echo "<p><span style='color: var(--accent);'>[INFO]</span> Found usr/ folder!</p>";
} else {
echo "<p><span style='color: var(--warning);'>[ERRO]</span> usr/ folder not found</p>";
echo "<p><span style='color: var(--accent);'>[INFO]</span> Creating usr/ folder...</p>";
mkdir("usr");
}
if (is_dir(__DIR__."/../../usr/images")) {
echo "<p><span style='color: var(--accent);'>[INFO]</span> Found usr/images/ folder!</p>";
} else {
echo "<p><span style='color: var(--warning);'>[ERRO]</span> usr/images/ folder not found</p>";
echo "<p><span style='color: var(--accent);'>[INFO]</span> Creating usr/images/ folder...</p>";
mkdir("usr/images");
}
if (!is_dir(__DIR__."/../../usr/images/thumbnails")) {
echo "<p><span style='color: var(--warning);'>[ERRO]</span> usr/images/thumbnails/ folder not found</p>";
echo "<p><span style='color: var(--accent);'>[INFO]</span> Creating usr/images/thumbnails/ folder...</p>";
mkdir("usr/images/thumbnails");
}
if (!is_dir(__DIR__."/../../usr/images/previews")) {
echo "<p><span style='color: var(--warning);'>[ERRO]</span> usr/images/previews/ folder not found</p>";
echo "<p><span style='color: var(--accent);'>[INFO]</span> Creating usr/images/previews/ folder...</p>";
mkdir("usr/images/previews");
}
if (!is_dir(__DIR__."/../../usr/conf")) {
echo "<p><span style='color: var(--warning);'>[ERRO]</span> usr/conf/ folder not found</p>";
echo "<p><span style='color: var(--accent);'>[INFO]</span> Creating usr/conf/ folder...</p>";
mkdir("usr/conf");
}
if (is_file(__DIR__."/../../usr/conf/conf.json")) {
echo "<p><span style='color: var(--accent);'>[INFO]</span> Found usr/conf/conf.json file!</p>";
} else {
echo "<p><span style='color: var(--warning);'>[ERRO]</span> usr/conf/conf.json file not found</p>";
echo "<p><span style='color: var(--accent);'>[INFO]</span> Creating usr/conf/conf.json file...</p>";
try {
$conf = file_get_contents(__DIR__."/../../usr/conf.default.json");
if (file_put_contents(__DIR__."/../../usr/conf/conf.json", $conf)) {
echo "<p><span style='color: var(--accent);'>[INFO]</span> usr/conf/conf.json file created!</p>";
} else {
echo "<p><span style='color: var(--warning);'>[ERRO]</span> Failed to create usr/conf/conf.json file</p>";
}
} catch (Exception $e) {
echo "<p><span style='color: var(--warning);'>[ERRO]</span> Could not read usr/conf.default.json file</p>";
}
}
}

42
app/sanity/sanity.php Normal file
View file

@ -0,0 +1,42 @@
<?php
session_start();
include dirname(__DIR__) . "/conn.php";
include dirname(__DIR__) . "/app.php";
use App\Sanity;
$sanity = new Sanity();
if (isset($_POST['autofix'])) {
$autofix_start = microtime(true);
echo "<p><span style='color: var(--accent);'>[INFO]</span> Starting autofix</p>";
if ($_SESSION['id'] != 1) {
echo "<p><span style='color: var(--warning);'>[ERRO]</span> You cannot use Autofix as an Admin currently.</p>";
exit();
}
$check_sanity = $sanity->get_results();
if (empty($check_sanity)) {
echo "<p><span style='color: var(--accent);'>[INFO]</span> Sanity check passed. No errors found.</p>";
exit();
} else {
//echo "<p><span style='color: var(--alert);'>[WARN]</span> Sanity check failed</p>";
}
define('ROOT', true); // Only run scripts from this file
echo "<p>==== Databases ====</p>";
include_once "database.php";
echo "<p>==== Folders ====</p>";
include_once "folders.php";
$autofix_end = microtime(true);
$autofix_time = ($autofix_end - $autofix_start);
$autofix_time = round($autofix_time, 6) * 1000;
echo "<p><span style='color: var(--accent);'>[INFO]</span> Autofix complete in $autofix_time ms</p>";
}

View file

@ -8,10 +8,16 @@
}
?>
<!-- Auto generated header tags -->
<title><?php echo $user_settings['website_name']; ?></title>
<meta name="description" content="<?php echo $user_settings['website_description']; ?>"/>
<?php
if (isset($user_settings['logo']) && $user_settings['logo'] != "") {
echo "<link rel='icon' href='usr/".$user_settings['logo']."'>";
}
echo "<title>".$user_settings['website_name']."</title>
<meta name='description' content='".$user_settings['website_description']."'/>
<meta name='author' content='".$user_settings['user_name']."'/>";
?>
<meta name="keywords" content="Image, Gallery"/>
<meta name="author" content="<?php echo $user_settings['user_name']; ?>"/>
<!-- OG -->
<meta property="og:title" content="<?php echo $user_settings['website_name']; ?>"/>
<meta property="og:description" content="<?php echo $user_settings['website_description']; ?>"/>
@ -30,6 +36,7 @@
<!-- Google Fonts -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lexend+Deca:wght@600">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Secular+One&display=swap">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@600">
<!-- JQuery -->
<script

View file

@ -284,7 +284,7 @@ nav .btn {
}
.nsfw-blur {
filter: blur(8px);
filter: blur(15px);
}
.nsfw-warning {
@ -335,8 +335,8 @@ nav .btn {
left: 50%;
transform: translateX(-50%) translateY(-50%);
background-color: rgba(21, 21, 21, 0.7333333333);
-webkit-backdrop-filter: blur(15px);
backdrop-filter: blur(15px);
-webkit-backdrop-filter: blur(20px);
backdrop-filter: blur(20px);
z-index: 999;
transition: opacity 0.5s cubic-bezier(0.075, 0.82, 0.165, 1);
display: none;
@ -362,7 +362,7 @@ nav .btn {
display: block;
box-sizing: border-box;
border: none;
border-radius: 0.4rem;
border-radius: 3px;
transition: outline 0.1s cubic-bezier(0.19, 1, 0.22, 1);
background-color: #121212;
z-index: 2;
@ -786,7 +786,7 @@ nav .btn {
flex-direction: column;
background-color: #151515;
border-radius: 3px;
transition: height 0.3s cubic-bezier(0.19, 1, 0.22, 1);
transition: height 0.3s cubic-bezier(0.19, 1, 0.22, 1), transform 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}
.log {
@ -835,7 +835,7 @@ nav .btn {
flex-direction: column;
background-color: #151515;
border-radius: 3px;
transition: height 0.3s cubic-bezier(0.19, 1, 0.22, 1);
transition: height 0.3s cubic-bezier(0.19, 1, 0.22, 1), transform 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}
.ban {
@ -891,7 +891,7 @@ nav .btn {
flex-direction: column;
background-color: #151515;
border-radius: 3px;
transition: height 0.3s cubic-bezier(0.19, 1, 0.22, 1);
transition: height 0.3s cubic-bezier(0.19, 1, 0.22, 1), transform 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}
.user {
@ -960,6 +960,51 @@ nav .btn {
content: "";
}
#autofix {
padding: 0;
display: none;
background-color: #121212;
position: relative;
border-radius: 3px;
}
#autofix button {
padding: 0.25rem;
width: 1.5rem;
height: 1.5rem;
position: absolute;
top: 0.25rem;
right: 0.25rem;
display: block;
box-sizing: border-box;
border: none;
border-radius: 3px;
transition: outline 0.1s cubic-bezier(0.19, 1, 0.22, 1);
background-color: rgba(21, 21, 21, 0.7333333333);
z-index: 2;
}
#autofix button img {
width: 1rem;
display: block;
}
#autofix button:hover {
outline: #E8E3E3 0.2rem solid;
color: #E8E3E3;
cursor: pointer;
}
#autofix-log {
padding: 0.5rem 0.5rem 0 0.5rem;
display: flex;
flex-direction: column;
border-radius: 3px;
}
#autofix-log > * {
font-family: "JetBrains Mono", monospace;
font-size: 0.9rem;
line-height: 1.1rem;
margin: 0 0 0.5rem 0;
}
/*
|-------------------------------------------------------------
| FOOTER

View file

@ -121,7 +121,7 @@
}
.nsfw-blur {
filter: blur(8px);
filter: blur(15px);
}
.nsfw-warning {
@ -181,10 +181,10 @@
position: fixed;
top: 50%;
left: 50%;
transform: translateX(-050%) translateY(-50%);
transform: translateX(-50%) translateY(-50%);
background-color: $bg-alt;
backdrop-filter: blur(15px);
backdrop-filter: blur(20px);
z-index: 999;
@ -219,7 +219,11 @@
box-sizing: border-box;
border: none;
border-radius: $rad;
@if calc($rad - 0.5rem) > 0 {
border-radius: calc($rad - 0.5rem);
} @else {
border-radius: 3px;
}
transition: outline 0.1s cubic-bezier(.19, 1, .22, 1);
@ -789,7 +793,7 @@
border-radius: 3px;
}
transition: height 0.3s cubic-bezier(.19, 1, .22, 1);
transition: height 0.3s cubic-bezier(.19, 1, .22, 1), transform 0.3s cubic-bezier(.19, 1, .22, 1);
}
.log {
min-width: 850px;
@ -849,7 +853,7 @@
border-radius: 3px;
}
transition: height 0.3s cubic-bezier(.19, 1, .22, 1);
transition: height 0.3s cubic-bezier(.19, 1, .22, 1), transform 0.3s cubic-bezier(.19, 1, .22, 1);
}
.ban {
min-width: 900px;
@ -915,7 +919,7 @@
border-radius: 3px;
}
transition: height 0.3s cubic-bezier(.19, 1, .22, 1);
transition: height 0.3s cubic-bezier(.19, 1, .22, 1), transform 0.3s cubic-bezier(.19, 1, .22, 1);
}
.user {
min-width: 950px;
@ -989,3 +993,80 @@
}
}
}
#autofix {
padding: 0;
display: none;
//border-left: $border;
background-color: #121212;
position: relative;
@if calc($rad - 0.5rem) > 0 {
border-radius: calc($rad - 0.5rem);
} @else {
border-radius: 3px;
}
button {
padding: 0.25rem;
width: 1.5rem; height: 1.5rem;
position: absolute;
top: 0.25rem;
right: 0.25rem;
display: block;
box-sizing: border-box;
border: none;
@if calc($rad - 0.5rem) > 0 {
border-radius: calc($rad - 0.5rem);
} @else {
border-radius: 3px;
}
transition: outline 0.1s cubic-bezier(.19, 1, .22, 1);
background-color: $bg-alt;
z-index: +2;
img {
width: 1rem;
display: block;
}
&:hover {
outline: $white 0.2rem solid;
color: $fg;
cursor: pointer;
}
}
}
#autofix-log {
padding: 0.5rem 0.5rem 0 0.5rem;
display: flex; flex-direction: column;
@if calc($rad - 0.5rem) > 0 {
border-radius: calc($rad - 0.5rem);
} @else {
border-radius: 3px;
}
> * {
font-family: $font-code;
font-size: 0.9rem;
line-height: 1.1rem;
margin: 0 0 0.5rem 0;
}
}

View file

@ -33,6 +33,8 @@ $font-header: 'Lexend Deca',
sans-serif;
$font-body: 'Secular One',
sans-serif;
$font-code: 'JetBrains Mono',
monospace;
// Fallback for items that do not yet support the new sass stylesheet system
:root {

View file

@ -134,16 +134,12 @@
echo "<p>ID: ".$image['id']."</p>";
}
$upload_time = new DateTime();
echo "<p id='updateTime'>Uploaded at: ".$upload_time->format('d/m/Y H:i:s T')."</p>";
$upload_date = new DateTime($image['upload_date']);
echo "<p id='updateTime'>Uploaded at: ".$upload_date->format('d/m/Y H:i:s T')."</p>";
?>
<script>
// Updating time to Viewers local
var updateDate = new Date('<?php echo $upload_time->format('m/d/Y H:i:s T'); ?>');
var format = {year: 'numeric', month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit'};
updateDate = updateDate.toLocaleDateString('en-GB', format);
var updateDate = new Date('<?php echo $upload_date->format('m/d/Y H:i:s T'); ?>');
updateDate = updateDate.toLocaleDateString('en-GB', {year: 'numeric', month: 'short', day: 'numeric'});
$("#updateTime").html("Uploaded at: "+updateDate);
</script>