new design first version
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
2025-05-13 07:10:42 +00:00
parent 4fb0051f95
commit 2b0415fcb1
4 changed files with 212 additions and 29 deletions

View File

@@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Control Panel</title>
<title>Safebox</title>
<style>
:root {
--bg-color: #ffffff;
@@ -32,6 +32,13 @@
justify-content: space-between;
padding: 10px 20px;
}
table {border: 1px solid orange; width:100%;}
table th {padding-left: 20px; text-align: left; color: orange; width: 25%;}
table td {padding-left: 20px; text-align:left; width: 25%;}
label {text-align: left !important;}
a, a:hover, a:visited {color: orange}
.profile {
display: flex;
flex-direction: column;
@@ -46,6 +53,13 @@
object-fit: cover;
border-radius: 50%;
}
.settings {
display: flex;
flex-direction: column;
align-items: center;
font-weight: bold;
gap: 5px;
}
.logo {
display: flex;
flex-direction: column;
@@ -63,6 +77,7 @@
margin: 0;
padding: 0;
font-size: 24px;
color: var(--text-color);
}
.toggle {
cursor: pointer;
@@ -101,6 +116,22 @@
cursor: pointer;
color: var(--text-color);
}
.buttons button.active, .buttons button:hover {
color: orange;
border: 1px solid orange;
}
.container {
clear:both;
float:none;
}
.leftside {
float:left;
width:20%;
}
.rightside {
float:right;
width:80%;
}
.my-apps {
flex: 1;
background-color: var(--app-bg);
@@ -197,7 +228,7 @@
padding: 30px;
border-radius: 15px;
width: 80%;
text-align: center;
text-align: left;
position: relative;
animation: fadeIn 0.3s ease;
}
@@ -234,7 +265,9 @@
}
.input-group input {
padding: 10px;
margin-top: 5px;
margin-bottom: 5px;
padding: 5px;
border: 1px solid var(--button-border);
border-radius: 10px;
background: none;
@@ -386,38 +419,64 @@
}
}
</style>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.2.1/dist/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<!-- Custom styles for this template -->
<link href="installer.css?t=5" rel="stylesheet">
</head>
<body>
<header>
<div class="profile" id="profileSection">
<img src="image.png" alt="Profilkép">
<div>Pro</div>
</div>
<div class="container">
<div class="leftside">
<div class="logo">
<img src="image.png" alt="Logo">
<div><h1>Control Panel</h1></div>
<div>
<h1>Safebox</h1>
</div>
</div>
<div class="toggle" id="themeToggle"></div>
</header>
<div class="buttons">
<button id="myAppsBtn">My Apps</button>
<button id="installAppsBtn">Install Apps</button>
<button id="backupBtn">Backup</button>
<button id="diskBtn">Disk Management</button>
<button id="monitorBtn">Monitor</button>
<div class="profile" id="profileSection">
<!--<img src="image.png" alt="Profilkép">-->
<div id="vpnBtn">Pro</div>
</div>
<div class="buttons">
<button id="servicesBtn">Services</button>
</div>
<div class="settings">Settings</div>
<div class="buttons">
<button id="updatesBtn">Updates</button>
</div>
<div class="buttons">
<button id="repositoriesBtn">Repositories</button>
</div>
<div class="buttons">
<button id="systemservicesBtn">System services</button>
</div>
<br>
<br>
<div style="text-align:center;">
<a href="manage2.html" id="refresh_btn">REFRESH</a>
<br>
<br>
<a href="manage.html" id="old_btn">OLD DESIGN</a>
</div>
</div>
<div class="rightside">
<div class="buttons">
<button id="myAppsBtn">My Apps</button>
<button id="installAppsBtn">Install Apps</button>
<button id="backupBtn">Backup</button>
<button id="diskBtn">Disk Management</button>
<button id="monitorBtn">Monitor</button>
<div class="toggle" id="themeToggle"></div>
</div>
<div class="my-apps" id="myAppsContainer"></div>
</div>
</div>
<div class="my-apps" id="myAppsContainer"></div>
<div id="popup" class="popup hidden">
<div class="popup-content">
<span class="close">&times;</span>
<div class="input-group">
<div id="popupText" class="deployment">Load app template here</div>
</div>
</div>
</div>
<footer>
@@ -433,7 +492,7 @@
</div>
<div class="footer-social">
<a href="#">GitHub</a>
<a href="#">Discord</a>
<a href="#">X</a>
</div>
</footer>
@@ -449,6 +508,8 @@
}
toggle.classList.toggle('active');
});
// default dark
document.documentElement.setAttribute('data-theme', 'dark');
</script>
<script>
@@ -463,6 +524,12 @@
const diskBtn = document.getElementById('diskBtn');
const monitorBtn = document.getElementById('monitorBtn');
const vpnBtn = document.getElementById('vpnBtn');
const servicesBtn = document.getElementById('servicesBtn');
const updatesBtn = document.getElementById('updatesBtn');
const repositoriesBtn = document.getElementById('repositoriesBtn');
const systemservicesBtn = document.getElementById('systemservicesBtn');
const myAppsContainer = document.getElementById('myAppsContainer');
const popup = document.getElementById('popup');
const popupText = document.getElementById('popupText');
@@ -530,12 +597,126 @@
}
}
myAppsBtn.addEventListener('click', () => renderApps(false));
installAppsBtn.addEventListener('click', () => renderApps(true));
function renderVPN() {
myAppsContainer.innerHTML = `
<fieldset>
<legend>Enable proxy</legend>
<form class="form-install" action="#" method="post" id="save_vpn">
<div class="row">
<div class="mb-3">
<label for="vpn_domain">Please add domain url to download the VPN hash from (default: https://portal.safebox.network):</label>
<input type="text" class="form-control" name="VPN_DOMAIN" id="vpn_domain" value="https://portal.safebox.network">
<div class="invalid-feedback">
Please enter a valid domain.
</div>
</div>
</div>
<div class="row">
<div class="mb-3">
<label for="vpn_pass">Please type in the generated VPN passkey (8 digits):</label>
<input type="text" class="form-control" name="VPN_PASS" id="vpn_pass" value="" maxlength="8" size="10">
</div>
</div>
<div class="row">
<div class="mb-3">
<label for="letsencrypt_mail">Please add the letsencrypt mail address:</label>
<input type="email" class="form-control" name="LETSENCRYPT_MAIL" id="letsencrypt_mail" value="">
<div class="invalid-feedback">
Please enter a valid email.
</div>
</div>
</div>
<div class="row">
<div class="mb-3">
<label for="letsencrypt_servername">Please add letsencrypt server name (default is letsencrypt but you can add zerossl too):</label>
<input type="text" class="form-control" name="LETSENCRYPT_SERVERNAME" id="letsencrypt_servername" value="letsencrypt">
</div>
</div>
<div class="row">
<div class="mb-3">
<button class="btn btn-lg btn-primary btn-block" type="submit" id="vpn_save_btn"> Save </button> &nbsp;
<button class="btn btn-lg btn-primary btn-block" type="button" id="vpn_cancel_btn"> Cancel </button>
</div>
</div>
</form>
</fieldset>
`;
}
function renderServices() {
myAppsContainer.innerHTML = `
<div id="services">
Loading...
</div>
`;
get_services();
}
function renderUpdates() {
myAppsContainer.innerHTML = `
<div id="updates">
Looking for updates... Please wait...
</div>
`;
get_updates();
}
function renderRepositories() {
myAppsContainer.innerHTML = `
<div class="input-group">
<fieldset>
<legend>Repositories</legend>
<div id="repositories" style="text-align:left">Loading...</div>
<hr>
<form class="form-install" action="#" method="post" id="add_repo">
<div class="row">
<div class="mb-3" style="text-align:left">
<label for="registry">Please add a new GIT repository URL: </label>
<input type="registry" class="form-control" name="repository" id="repository" size="100" value="" required>
<div class="invalid-feedback">
Please enter a valid repository url.
</div>
</div>
</div>
<div class="row">
<div class="mb-3">
<button class="btn btn-lg btn-primary btn-block" type="submit" id="repo_add_btn"> Add </button>
</div>
</div>
</form>
</fieldset>
</div>
`;
}
function renderSystemServices() {
myAppsContainer.innerHTML = `
<div id="system">
Loading...
</div>
`;
get_system();
}
function activate(btn) {
myAppsBtn.classList.remove('active');
installAppsBtn.classList.remove('active');
btn.classList.add('active');
}
myAppsBtn.addEventListener('click', () => {renderApps(false); activate(myAppsBtn);});
installAppsBtn.addEventListener('click', () => {renderApps(true); activate(installAppsBtn);});
backupBtn.addEventListener('click', () => renderText('Backup'));
diskBtn.addEventListener('click', () => renderText('Disk Management'));
monitorBtn.addEventListener('click', () => renderText('Monitor'));
vpnBtn.addEventListener('click', () => renderVPN());
servicesBtn.addEventListener('click', () => renderServices());
updatesBtn.addEventListener('click', () => renderUpdates());
repositoriesBtn.addEventListener('click', () => renderRepositories());
systemservicesBtn.addEventListener('click', () => renderSystemServices());
closeBtn.addEventListener('click', () => {
popup.classList.add('hidden');
});