button generator

This commit is contained in:
toto 2023-02-19 18:00:03 +01:00
parent fd41c2ead2
commit e10e8f8897
10 changed files with 10729 additions and 146 deletions

BIN
images/favicon-cockpit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
images/favicon_emby.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 721 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
images/favicon_omv.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
images/favicon_proxmox.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@ -0,0 +1,11 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="9.14 141.8 573.65 573.65">
<style>
.st0,.st3{fill-rule:evenodd;clip-rule:evenodd;fill:#404f54}.st3{fill:#37beff}
</style>
<path class="st3" d="M582.79 549.77L295.96 384.1V207.27l286.83 165.68z"/>
<path class="st0" d="M9.14 549.77L295.96 384.1V207.27L9.14 372.95z"/>
<path d="M295.96 141.8c109.56 0 198.41 88.85 198.41 198.41s-88.85 198.41-198.41 198.41S97.55 449.77 97.55 340.21 186.4 141.8 295.96 141.8" fill-rule="evenodd" clip-rule="evenodd" fill="#ccc"/>
<path d="M295.96 141.8c109.6 0 198.48 88.85 198.48 198.41s-88.88 198.41-198.48 198.41c-62.91-42.34-88.94-127.64-88.94-198.3s26.03-156.1 88.94-198.52" fill-rule="evenodd" clip-rule="evenodd" fill="#e5e5e5"/>
<path class="st3" d="M582.79 372.95L295.96 538.62v176.83l286.83-165.68z"/>
<path class="st0" d="M9.14 372.95l286.82 165.67v176.83L9.14 549.77z"/>
</svg>

After

Width:  |  Height:  |  Size: 888 B

View File

@ -0,0 +1,16 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024">
<title>
qbittorrent-new-light
</title>
<defs>
<linearGradient x1="34.012%" y1="0%" x2="76.373%" y2="76.805%" id="a">
<stop stop-color="#72B4F5" offset="0%"/>
<stop stop-color="#356EBF" offset="100%"/>
</linearGradient>
</defs>
<g fill="none" fill-rule="evenodd">
<circle stroke="#DAEFFF" stroke-width="32" fill="url(#a)" cx="512" cy="512" r="496"/>
<path d="M712.898 332.399q66.657 0 103.38 45.671 37.03 45.364 37.03 128.684t-37.34 129.61q-37.03 45.98-103.07 45.98-33.02 0-60.484-12.035-27.156-12.344-45.672-37.649h-3.703l-10.8 43.512h-36.724V196h51.227v116.65q0 39.191-2.469 70.359h2.47q35.796-50.61 106.155-50.61zm-7.406 42.894q-52.46 0-75.605 30.242-23.145 29.934-23.145 101.219t23.762 102.145q23.761 30.55 76.222 30.55 47.215 0 70.36-34.254 23.144-34.562 23.144-99.058 0-66.04-23.144-98.442-23.145-32.402-71.594-32.402z" fill="#fff"/>
<path d="M317.273 639.45q51.227 0 74.68-27.466 23.453-27.464 24.996-92.578v-11.418q0-70.976-24.07-102.144-24.07-31.168-76.223-31.168-45.055 0-69.125 35.18-23.762 34.87-23.762 98.75 0 63.879 23.454 97.515 23.761 33.328 70.05 33.328zm-7.715 42.894q-65.421 0-102.144-45.98-36.723-45.981-36.723-128.376 0-83.011 37.032-129.609 37.03-46.598 103.07-46.598 69.433 0 106.773 52.461h2.778l7.406-46.289h40.426V828h-51.227V683.27q0-30.86 3.395-52.461h-4.012q-35.488 51.535-106.774 51.535z" fill="#c8e8ff"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
images/qbittorrent32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

238
index.php
View File

@ -6,39 +6,72 @@ ini_set('display_startup_errors', TRUE);
$domaines = array(
array(
'id' => 'ORION',
'protocol' => 'https',
'proxy' => 'orion.netdldata.net/',
'name' => 'orion.lan',
'port' => 5001
'name' => 'Local Transfer',
'url' => '/transfer/',
'img' => 'favicon_transfer.png'
),
array(
'id' => 'Nextcloud',
'protocol' => 'http',
'proxy' => 'cloud.netdldata.net/',
'name' => 'nextcloud.lan',
'port' => 80
'name' => 'Emby',
'url' => 'https://emby.netdldata.net/',
'real' => 'emby.lan',
'port' => 8096,
'img' => 'favicon_emby.png'
),
array(
'id' => 'Gitea',
'protocol' => 'http',
'proxy' => 'git.netdldata.net',
'name' => '192.168.110.1',
'port' => 3000
'name' => 'Nextcloud',
'url' => 'https://cloud.netdldata.net/',
'real' => 'nextcloud.lan',
'port' => 443,
'img' => 'favicon_Nextcloud.svg'
),
array(
'id' => 'Transmission',
'protocol' => 'http',
'proxy' => 'torrent.netdldata.net',
'name' => '192.168.110.1',
'port' => 9091
'name' => 'Orion',
'url' => 'https://orion.netdldata.net/',
'real' => 'orion.lan',
'port' => 80,
'img' => 'favicon_omv.png'
),
array(
'id' => 'Webmin',
'protocol' => 'https',
'proxy' => 'webmin.netdldata.net',
'name' => '192.168.110.53',
'port' => 10000
'name' => 'Gitea',
'url' => 'https://git.netdldata.net',
'real' => 'git.lan',
'port' => 3000,
'img' => 'favicon-gitea.png'
),
array(
'name' => 'qBittorrent',
'url' => 'https://torrent.netdldata.net',
'real' => 'torrent.lan',
'port' => 8080,
'img' => 'qbittorrent-tray.svg'
),
array(
'name' => 'Webmin',
'url' => 'https://webmin.netdldata.net',
'real' => '192.168.110.74',
'port' => 10000,
'img' => 'favicon_webmin.png'
),
array(
'name' => 'Proxmox',
'url' => 'https://proxmox.netdldata.net',
'real' => 'proxmox.lan',
'port' => 8006,
'img' => 'favicon_proxmox.png'
),
array(
'name' => 'Guacamole',
'url' => 'https://guacamole.netdldata.net',
'real' => 'guacamole.lan',
'port' => 8080,
'img' => 'favicon_guacamole.png'
),
array(
'name' => 'Mail',
'url' => 'https://mail.netdldata.net',
'real' => 'mail.lan',
'port' => 80,
'img' => 'favicon_roundcube.svg'
),
);
if (isset($_COOKIE['socket'])) {
@ -46,8 +79,9 @@ if (isset($_COOKIE['socket'])) {
}
else {
for ($i = 0; $i < sizeof($domaines); $i ++) {
$domaines[$i]['host'] = gethostbyname($domaines[$i]['name']);
$fp = @fsockopen($domaines[$i]['name'], $domaines[$i]['port'], $errno, $errstr, 0.1);
if(array_key_exists('real', $domaines[$i])){
#$domaines[$i]['host'] = gethostbyname($domaines[$i]['real']);
$fp = @fsockopen($domaines[$i]['real'], $domaines[$i]['port'], $errno, $errstr, 0.1);
if ($fp) {
$domaines[$i]['running'] = true;
}
@ -56,13 +90,12 @@ else {
}
}
}
}
$cookie = serialize($domaines);
$temps = 60*60*2; //2 heures
setcookie ("socket", $cookie, time() + $temps);
$browser = get_browser(null, true);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
@ -72,11 +105,7 @@ $browser = get_browser(null, true);
<link rel="stylesheet" type="text/css" href="styles/Style.css">
<link rel="icon" href="images/majalis.png" />
<!--
<script src="js/jquery-3.3.1.min.js"></script>
<script src="js/angular-1.6.10.min.js"></script>
<script type="text/javascript" src="js/script.js"></script>
-->
<script src="js/jquery-3.4.1.js"></script>
<head>
<title>NetDLData</title>
@ -91,73 +120,18 @@ $browser = get_browser(null, true);
<button class="reload" id="reload" type="button" onclick="cookies()"><img src="images/cloud-reload.png"></button>
</div>
<div class="button left">
<button id="Project" class="server allumer" type="button" onclick="document.location.href='/projects/'">
<img class="favicon" src="images/favicon_apache.ico">
<div class="description">Projects</div>
</button>
</div>
<div class="button right">
<button id="Transfer" class="server allumer" type="button" onclick="document.location.href='/transfer/'">
<img class="favicon" src="images/favicon_transfer.png">
<div class="description">Local Transfer</div>
</button>
</div>
<div class="button left">
<button id="Nextcloud" class="server" type="button" onclick="site(this.id)" disabled>
<img class="favicon" src="images/favicon_Nextcloud.png">
<div class="description">Nextcloud</div>
</button>
</div>
<div class="button right">
<button id="ORION" class="server" type="button" onclick="site(this.id)" disabled>
<img class="favicon" src="images/favicon_DSM.ico">
<div class="description">Orion</div>
</button>
</div>
<div class="button left">
<button id="Gitea" class="server" type="button" onclick="site(this.id)" disabled>
<img class="favicon" src="images/favicon-gitea.png">
<div class="description">Gitea</div>
</button>
</div>
<div class="button right">
<button id="Transmission" class="server" type="button" onclick="site(this.id)" disabled="true">
<img class="favicon" src="images/favicon_transmission.png">
<div class="description">Transmission</div>
</button>
</div>
<div class="button left">
<button id="Webmin" class="server" type="button" onclick="site(this.id)" disabled>
<img class="favicon" src="images/favicon_webmin.png">
<div class="description">Webmin</div>
</button>
</div>
<div class="button right">
<button id="RAS" class="server" type="button" onclick="site(this.id)" disabled>
<img class="favicon" src="images/raspberry-pilogo.png">
<div class="description">Raspberry</div>
</button>
</div>
<a download="" href="NetDLData.crt">Télécharger le Certificat SSL NetDLData</a>
<div id="buttons"></div>
<?php
echo "<br><br>".$_SERVER['HTTP_USER_AGENT'];
echo "<br><br>You use navigator ".$browser["browser"];
echo "<br>By ".$browser["browser_maker"];
echo "<br>In Version ".$browser["version"];
echo "<br>On system ".$browser["platform"];
echo "<br>Your IP is ".$_SERVER['REMOTE_ADDR'];
#$browser = get_browser(null, true);
#echo "<br><br>You use navigator ".$browser["browser"];
#echo "<br>By ".$browser["browser_maker"];
#echo "<br>In Version ".$browser["version"];
#echo "<br>On system ".$browser["platform"];
#echo "<br>Your IP is ".$_SERVER['REMOTE_ADDR'];
?>
@ -167,32 +141,32 @@ var servers = <?php echo json_encode($domaines); ?>;
console.log(servers);
var host = document.location.hostname;
var domaine;
if(host.includes("netdldata")) {
domaine = "LOCAL_NAME";
}
if(host.includes("192.168.110.")) {
domaine = "LOCAL_IP";
}
if(host.includes("192.168.1.")) {
domaine = "LIVEBOX_IP";
}
if(host.includes("liolo70.ddns.net")) {
domaine = "INTERNET";
}
console.log(domaine);
var orientation_etat = true;
for (var key in servers) {
orientation_etat = !orientation_etat;
var server = servers[key];
var button = document.getElementById(server.id);
var div = $('<div />', {
class: 'button ' + orientation(orientation_etat)
});
var button = $('<button />', {
class: 'server',
type: 'button',
onclick: 'site("' + server.url + '")',
html: '<img class="favicon" src="images/' + server.img + '"><div class="description">' + server.name + '</div>'
});
div.append(button);
$("#buttons").append(div);
if (server.hasOwnProperty('running')){
if (server.running) {
button.disabled = false;
button.className += " allumer";
button.addClass('allumer');
}
else
button.prop("disabled",true);
}
else
button.addClass('allumer');
}
function cookies() {
@ -204,34 +178,18 @@ function cookies() {
}
function site(button) {
for (var key in servers) {
var server = servers[key];
if(button == server.id) {
switch(domaine) {
case "LOCAL_NAME":
if (typeof server.proxy != "undefined")
url=server.protocol+"://"+server.proxy;
else
url=server.protocol+"://"+server.name+":"+server.port;
break;
case "LOCAL_IP":
url=server.protocol+"://"+server.host+":"+server.port;
break;
case "LIVEBOX_IP":
break;
case "INTERNET":
break;
default:
console.log("erreur");
}
}
}
function site(url) {
console.log(url);
document.location.href=url;
}
function orientation (status) {
if (status == false)
return "left";
else
return "right";
};
</script>
</body>

10598
js/jquery-3.4.1.js vendored Normal file

File diff suppressed because it is too large Load Diff