Add remote access feature and UI improvements

- Implement `remoteAccess` functionality in `ApiCLI` for Veyon integration.
- Create `selectIP.php` view and associated form for remote access inputs.
- Add JSON configuration for lab setups (`labList.json`).
- Introduce reusable `home-button` web component.
- Update project router and controller to support new `/remoteAccess` and `/conn` routes.
- Add custom styles and icons to enhance UI.
This commit is contained in:
Sapoleone
2025-09-25 00:26:42 +02:00
parent cfaafcffa6
commit 93dd389437
17 changed files with 432 additions and 8 deletions

View File

@@ -2,6 +2,7 @@
<dictionary name="project">
<words>
<w>Veyon</w>
<w>veyon</w>
</words>
</dictionary>
</component>

5
.idea/icon.svg generated Normal file
View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill="#ffffff" fill-rule="evenodd" clip-rule="evenodd" d="M12 8.25C9.92893 8.25 8.25 9.92893 8.25 12C8.25 14.0711 9.92893 15.75 12 15.75C14.0711 15.75 15.75 14.0711 15.75 12C15.75 9.92893 14.0711 8.25 12 8.25ZM9.75 12C9.75 10.7574 10.7574 9.75 12 9.75C13.2426 9.75 14.25 10.7574 14.25 12C14.25 13.2426 13.2426 14.25 12 14.25C10.7574 14.25 9.75 13.2426 9.75 12Z"/>
<path fill="#ffffff" fill-rule="evenodd" clip-rule="evenodd" d="M12 3.25C7.48587 3.25 4.44529 5.9542 2.68057 8.24686L2.64874 8.2882C2.24964 8.80653 1.88206 9.28392 1.63269 9.8484C1.36564 10.4529 1.25 11.1117 1.25 12C1.25 12.8883 1.36564 13.5471 1.63269 14.1516C1.88206 14.7161 2.24964 15.1935 2.64875 15.7118L2.68057 15.7531C4.44529 18.0458 7.48587 20.75 12 20.75C16.5141 20.75 19.5547 18.0458 21.3194 15.7531L21.3512 15.7118C21.7504 15.1935 22.1179 14.7161 22.3673 14.1516C22.6344 13.5471 22.75 12.8883 22.75 12C22.75 11.1117 22.6344 10.4529 22.3673 9.8484C22.1179 9.28391 21.7504 8.80652 21.3512 8.28818L21.3194 8.24686C19.5547 5.9542 16.5141 3.25 12 3.25ZM3.86922 9.1618C5.49864 7.04492 8.15036 4.75 12 4.75C15.8496 4.75 18.5014 7.04492 20.1308 9.1618C20.5694 9.73159 20.8263 10.0721 20.9952 10.4545C21.1532 10.812 21.25 11.2489 21.25 12C21.25 12.7511 21.1532 13.188 20.9952 13.5455C20.8263 13.9279 20.5694 14.2684 20.1308 14.8382C18.5014 16.9551 15.8496 19.25 12 19.25C8.15036 19.25 5.49864 16.9551 3.86922 14.8382C3.43064 14.2684 3.17374 13.9279 3.00476 13.5455C2.84684 13.188 2.75 12.7511 2.75 12C2.75 11.2489 2.84684 10.812 3.00476 10.4545C3.17374 10.0721 3.43063 9.73159 3.86922 9.1618Z"/>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -5,7 +5,7 @@
<inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true">
<option name="myValues">
<value>
<list size="8">
<list size="10">
<item index="0" class="java.lang.String" itemvalue="nobr" />
<item index="1" class="java.lang.String" itemvalue="noembed" />
<item index="2" class="java.lang.String" itemvalue="comment" />
@@ -14,6 +14,8 @@
<item index="5" class="java.lang.String" itemvalue="script" />
<item index="6" class="java.lang.String" itemvalue="Subject" />
<item index="7" class="java.lang.String" itemvalue="Grade" />
<item index="8" class="java.lang.String" itemvalue="veyon-button" />
<item index="9" class="java.lang.String" itemvalue="home-button" />
</list>
</value>
</option>

1
.idea/project16.iml generated
View File

@@ -2,6 +2,7 @@
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/public" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/refs" />
</content>
<orderEntry type="inheritedJdk" />

14
.idea/webResources.xml generated Normal file
View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="WebResourcesPaths">
<contentEntries>
<entry url="file://$PROJECT_DIR$">
<entryData>
<resourceRoots>
<path value="file://$PROJECT_DIR$/public" />
</resourceRoots>
</entryData>
</entry>
</contentEntries>
</component>
</project>

View File

@@ -3,7 +3,15 @@
class Controller {
public function index(): void {
require_once '../views/home.php';
require_once BASE_PATH.'/app/views/home.php';
}
public function remoteAccess() {
require_once BASE_PATH.'/app/views/selectIP.php';
}
public function cli() {
ApiCLI::testConnection();
}
}

View File

@@ -6,5 +6,32 @@
*/
class ApiCLI {
static $SET_WD = "cd 'C:\\Program Files\\Veyon' 2>&1 &&";
public static function testConnection() {
$cmd = "curl -I 127.0.0.1 && cd";
$response = shell_exec($cmd." 2>&1");
echo "<pre>"; echo $response; echo "</pre>";
}
// Veyon Modules
// [N] 1. authkeys - Commands for managing authentication keys
// [N] 2. config - Commands for managing the configuration of Veyon
// [?] 3. ldap - Commands for configuring and testing LDAP/AD integration
// [?] 4. networkobjects - Commands for managing the builtin network object directory
// [Y] 5. power - Commands for controlling power status of computers
// [Y] 6. remoteaccess - Remote view or control a computer
// [N] 7. service - Commands for configuring and controlling Veyon Service
// [N] 8. shell - Commands for shell functionalities
// [Y] 9. functions - Commands for managing functions
public static function remoteAccess($ip, $connectionType='view') {
global $SET_WD;
echo "Executing: ".EXE_NAME." remoteaccess ".$connectionType." ".$ip;
echo "<br>";
$response = shell_exec($SET_WD . " ". EXE_NAME ." remoteaccess ".$connectionType." ".$ip." 2>&1");
if ($response != "[OK]") {
echo "<pre>"; echo $response; echo "</pre>";
}
}
}

View File

@@ -0,0 +1,54 @@
<?php
$name = '';
if(isset($_GET['name']) && $_GET['name']) {
$name = " " . $_GET['name'];
}
?>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Project 16 - Dashboard</title>
<?php include COMMON_HTML_HEAD; ?>
<script src="<?=URL_PATH?>/commons/components/button.js"></script>
</head>
<style>
.title-bar {
font-size: 50px;
font-weight: bold;
padding: 10px 10px 10px 20px;
background-color: var(--kashmir);
color: var(--gray);
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
& a {
border-radius: 1em;
padding: 10px;
& > img {
width: 30px;
height: 30px;
}
}
}
</style>
<body>
<div class="title-bar">
<div><?=PROJECT_NAME?></div>
<div>
<a href="" class="btn btn-light">
<img src="<?=URL_PATH?>/assets/icons/hamburger.svg" alt="">
</a>
</div>
</div>
<div class="container">
<home-button main-href="remoteAccess" icon-src="<?=URL_PATH?>/assets/icons/placeholder.svg" text="Accesso Remoto"></home-button>
<home-button main-href="a" icon-src="<?=URL_PATH?>/assets/icons/placeholder.svg" text="Features" ></home-button>
<home-button main-href="a" icon-src="<?=URL_PATH?>/assets/icons/placeholder.svg" text="Get Token" ></home-button>
</div>
</body>
</html>

66
app/views/selectIP.php Normal file
View File

@@ -0,0 +1,66 @@
<?php
/*
* Copyright (c) 2025. Brusegan Samuele, Davanzo Andrea
* Questo file fa parte di VeyonCtrl ed è rilasciato
* sotto la licenza MIT. Vedere il file LICENSE per i dettagli.
*/
if(isset($_POST['submit'])) {
$ip = $_POST['ip'];
$type = $_POST['veyon-remoteaccess-type'];
ApiCLI::remoteAccess($ip, $type);
}
?>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Project 16</title>
<?php include COMMON_HTML_HEAD; ?>
</head>
<body data-bs-theme="dark">
<div>
<!-- Lista dei laboratori -->
<?php
/*$labList = json_decode(file_get_contents(URL_PATH.'/configs/labList.json'));
foreach ($labList as $lab) {
?>
<div class="btn btn-primary" data-ip="<?=$lab->netIP?>" data-lab="<?=$lab->name?>" data-mask="<?=$lab->subnetMask?>">
<?=$lab->name?>
</div>
<?php
}*/
?>
<!-- Lista dei computer -->
<!-- Cerca e usa una utility per trovare tutti i pc in rete -->
<!-- Lancia connessione a `EXE_NAME` -->
</div>
<div class="container">
<div class="d-flex flex-column align-items-center">
<h3 class="pb-5 pt-2">Inserisci le informazioni per la connessione</h3>
<form action="<?=URL_PATH?>/remoteAccess" method="post" class="col-3" style="background: #333; border-radius: 10px; padding: 10px;" >
<label class="form-label" for="ip">Inserisci l'ip:</label>
<input class="form-control" type="text" name="ip" id="ip">
<br>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="veyon-remoteaccess-type" id="veyon-remoteaccess-view" value="view">
<label class="form-check-label" for="veyon-remoteaccess-view">View</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="veyon-remoteaccess-type" id="veyon-remoteaccess-control" value="control">
<label class="form-check-label" for="veyon-remoteaccess-control">Control</label>
</div>
<input type="hidden" name="submit" value="submit">
<hr>
<button type="submit" class="w-100 btn btn-primary">Connetti</button>
</form>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,9 @@
<!--
- Copyright (c) 2025. Brusegan Samuele, Davanzo Andrea
- Questo file fa parte di VeyonCtrl ed è rilasciato
- sotto la licenza MIT. Vedere il file LICENSE per i dettagli.
-->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
<path d="M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"/>
</svg>

After

Width:  |  Height:  |  Size: 572 B

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<svg width="128" height="128" viewBox="0 0 70 70" fill="none" xmlns="http://www.w3.org/2000/svg">
<!-- <defs>-->
<!-- <filter color-interpolation-filters="sRGB" x="-38" y="-34" width="40" height="36" id="filter_1">-->
<!-- <feFlood flood-opacity="0" result="BackgroundImageFix_1" />-->
<!-- <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0" in="SourceAlpha" />-->
<!-- <feOffset dx="-3" dy="2" />-->
<!-- <feGaussianBlur stdDeviation="2.5" />-->
<!-- <feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.251 0" />-->
<!-- <feBlend mode="normal" in2="BackgroundImageFix_1" result="Shadow_2" />-->
<!-- <feBlend mode="normal" in="SourceGraphic" in2="Shadow_2" result="Shape_3" />-->
<!-- </filter>-->
<!-- </defs>-->
<g>
<path d="M60 0C65.5236 0 70 4.4764 70 10L70 60C70 65.5236 65.5236 70 60 70L10 70C4.4764 70 0 65.5236 0 60L0 10C0 4.4764 4.4764 0 10 0L60 0Z" fill="#FFFFFF" />
<path d="M23.9886 6.97723L38.1777 35.3553Q38.2331 35.4662 38.2814 35.5805Q38.3297 35.6947 38.3707 35.8118Q38.4116 35.9288 38.4451 36.0483Q38.4785 36.1677 38.5043 36.289Q38.5301 36.4104 38.5481 36.5331Q38.5661 36.6558 38.5763 36.7794Q38.5864 36.903 38.5888 37.027Q38.5911 37.151 38.5855 37.2749Q38.5799 37.3988 38.5665 37.5221Q38.553 37.6454 38.5318 37.7676Q38.5106 37.8898 38.4816 38.0104Q38.4526 38.131 38.4161 38.2495Q38.3795 38.368 38.3355 38.484Q38.2915 38.6 38.2402 38.7129Q38.1889 38.8258 38.1305 38.9352Q38.0721 39.0447 38.0069 39.1502Q37.9417 39.2557 37.8699 39.3568Q37.7981 39.458 37.7201 39.5544Q37.642 39.6507 37.558 39.742Q37.474 39.8332 37.3843 39.9189Q37.2947 40.0046 37.1998 40.0845Q37.1049 40.1643 37.0051 40.2379Q36.9053 40.3116 36.801 40.3787Q36.6967 40.4459 36.5884 40.5063Q36.4801 40.5667 36.3681 40.6201Q36.2562 40.6735 36.141 40.7197Q36.0259 40.7658 35.9081 40.8046Q35.7903 40.8434 35.6703 40.8746Q35.5502 40.9058 35.4284 40.9293Q35.3067 40.9528 35.1836 40.9685Q35.0606 40.9842 34.9368 40.9921Q34.8131 41 34.689 41L6.31096 41Q6.18694 41 6.06316 40.9921Q5.93938 40.9842 5.81635 40.9685Q5.69333 40.9528 5.57155 40.9293Q5.44977 40.9058 5.32973 40.8746Q5.20969 40.8434 5.09188 40.8046Q4.97406 40.7658 4.85895 40.7197Q4.74384 40.6735 4.63189 40.6201Q4.51994 40.5667 4.41161 40.5063Q4.30328 40.4459 4.19901 40.3787Q4.09474 40.3116 3.99494 40.2379Q3.89515 40.1643 3.80023 40.0845Q3.70532 40.0046 3.61567 39.9189Q3.52602 39.8332 3.44199 39.742Q3.35797 39.6507 3.27991 39.5544Q3.20185 39.458 3.13008 39.3568Q3.0583 39.2557 2.99309 39.1502Q2.92789 39.0447 2.86952 38.9352Q2.81115 38.8258 2.75985 38.7129Q2.70855 38.6 2.66453 38.484Q2.6205 38.368 2.58394 38.2495Q2.54737 38.131 2.51841 38.0104Q2.48945 37.8898 2.4682 37.7676Q2.44696 37.6454 2.43353 37.5221Q2.42009 37.3988 2.41452 37.2749Q2.40894 37.151 2.41125 37.027Q2.41356 36.903 2.42374 36.7794Q2.43392 36.6558 2.45194 36.5331Q2.46995 36.4104 2.49573 36.289Q2.5215 36.1677 2.55493 36.0483Q2.58836 35.9288 2.62932 35.8118Q2.67027 35.6947 2.71858 35.5805Q2.76688 35.4662 2.82235 35.3553L17.0114 6.97723Q17.0718 6.85648 17.1403 6.7402Q17.2089 6.62391 17.2854 6.51265Q17.3618 6.40138 17.4458 6.29567Q17.5298 6.18995 17.6208 6.0903Q17.7119 5.99065 17.8096 5.89753Q17.9074 5.80441 18.0113 5.71827Q18.1153 5.63213 18.2249 5.55339Q18.3346 5.47464 18.4494 5.40367Q18.5643 5.33269 18.6838 5.26983Q18.8032 5.20697 18.9268 5.15251Q19.0503 5.09806 19.1773 5.05228Q19.3043 5.00649 19.4342 4.9696Q19.564 4.93271 19.6961 4.90489Q19.8282 4.87706 19.9619 4.85844Q20.0956 4.83982 20.2303 4.83048Q20.365 4.82115 20.5 4.82115Q20.635 4.82115 20.7697 4.83048Q20.9044 4.83982 21.0381 4.85844Q21.1718 4.87706 21.3039 4.90489Q21.436 4.93271 21.5658 4.9696Q21.6957 5.00649 21.8227 5.05228Q21.9497 5.09806 22.0732 5.15251Q22.1968 5.20697 22.3162 5.26983Q22.4357 5.33269 22.5506 5.40367Q22.6654 5.47464 22.7751 5.55339Q22.8847 5.63213 22.9887 5.71827Q23.0926 5.80441 23.1904 5.89753Q23.2881 5.99065 23.3792 6.0903Q23.4702 6.18995 23.5542 6.29567Q23.6382 6.40138 23.7146 6.51265Q23.7911 6.62391 23.8597 6.7402Q23.9282 6.85648 23.9886 6.97723Z" fill="#bebebe" fill-rule="evenodd" transform="translate(4 15)" />
<path d="M0 9.5C0 4.25329 4.2533 0 9.5 0C14.7467 0 19 4.25329 19 9.5C19 14.7467 14.7467 19 9.5 19C4.2533 19 0 14.7467 0 9.5Z" fill="#F8E42F" fill-rule="evenodd" transform="translate(32 13)" />
<path d="M23.4096 6.1372L36.7808 30.2054Q36.8423 30.3162 36.8965 30.4306Q36.9507 30.5451 36.9974 30.6629Q37.044 30.7807 37.083 30.9012Q37.1219 31.0218 37.1529 31.1446Q37.1839 31.2674 37.2069 31.392Q37.2299 31.5166 37.2447 31.6424Q37.2596 31.7682 37.2662 31.8947Q37.2729 32.0212 37.2713 32.1479Q37.2698 32.2745 37.26 32.4008Q37.2502 32.5271 37.2322 32.6525Q37.2143 32.7779 37.1882 32.9019Q37.1622 33.0259 37.1281 33.1479Q37.0941 33.2699 37.0522 33.3895Q37.0103 33.509 36.9607 33.6256Q36.9112 33.7422 36.8541 33.8553Q36.7971 33.9684 36.7329 34.0776Q36.6686 34.1868 36.5974 34.2916Q36.5262 34.3964 36.4484 34.4963Q36.3706 34.5962 36.2864 34.6909Q36.2022 34.7856 36.1121 34.8746Q36.022 34.9636 35.9263 35.0466Q35.8306 35.1296 35.7297 35.2062Q35.6288 35.2828 35.5231 35.3527Q35.4174 35.4226 35.3075 35.4855Q35.1975 35.5483 35.0837 35.604Q34.9699 35.6596 34.8527 35.7077Q34.7355 35.7558 34.6154 35.7962Q34.4954 35.8366 34.373 35.8692Q34.2505 35.9017 34.1262 35.9262Q34.002 35.9508 33.8763 35.9672Q33.7507 35.9836 33.6243 35.9918Q33.4979 36 33.3712 36L6.62877 36Q6.50209 36 6.37568 35.9918Q6.24927 35.9836 6.12365 35.9672Q5.99804 35.9508 5.87376 35.9262Q5.74948 35.9017 5.62705 35.8692Q5.50462 35.8366 5.38456 35.7962Q5.2645 35.7558 5.14731 35.7077Q5.03012 35.6596 4.91631 35.604Q4.80249 35.5483 4.69252 35.4855Q4.58256 35.4226 4.4769 35.3527Q4.37125 35.2828 4.27035 35.2062Q4.16945 35.1296 4.07374 35.0466Q3.97802 34.9636 3.8879 34.8746Q3.79777 34.7856 3.71361 34.6909Q3.62944 34.5962 3.5516 34.4963Q3.47376 34.3964 3.40257 34.2916Q3.33138 34.1868 3.26714 34.0776Q3.20289 33.9684 3.14587 33.8553Q3.08885 33.7422 3.03929 33.6256Q2.98973 33.509 2.94783 33.3895Q2.90594 33.2699 2.87189 33.1479Q2.83785 33.0259 2.81179 32.9019Q2.78573 32.7779 2.76777 32.6525Q2.74981 32.5271 2.74003 32.4008Q2.73025 32.2745 2.72868 32.1479Q2.72711 32.0212 2.73377 31.8947Q2.74042 31.7682 2.75527 31.6424Q2.77012 31.5166 2.7931 31.392Q2.81608 31.2674 2.8471 31.1446Q2.87812 31.0218 2.91704 30.9012Q2.95596 30.7807 3.00262 30.6629Q3.04928 30.5451 3.10349 30.4306Q3.15769 30.3162 3.21922 30.2054L16.5904 6.1372Q16.6534 6.02382 16.7238 5.91488Q16.7942 5.80594 16.8717 5.70191Q16.9491 5.59789 17.0333 5.49923Q17.1175 5.40058 17.2081 5.30774Q17.2987 5.21491 17.3952 5.12829Q17.4917 5.04167 17.5938 4.96166Q17.6959 4.88165 17.8031 4.80859Q17.9102 4.73554 18.022 4.66976Q18.1338 4.60399 18.2497 4.54579Q18.3656 4.48758 18.4851 4.43721Q18.6046 4.38684 18.7272 4.34451Q18.8498 4.30219 18.975 4.2681Q19.1001 4.23402 19.2272 4.20832Q19.3544 4.18263 19.4829 4.16543Q19.6115 4.14824 19.7409 4.13962Q19.8703 4.13101 20 4.13101Q20.1297 4.13101 20.2591 4.13962Q20.3885 4.14824 20.5171 4.16543Q20.6456 4.18263 20.7728 4.20832Q20.8999 4.23402 21.025 4.2681Q21.1502 4.30219 21.2728 4.34451Q21.3954 4.38684 21.5149 4.43721Q21.6344 4.48758 21.7503 4.54579Q21.8662 4.60399 21.978 4.66976Q22.0898 4.73554 22.1969 4.80859Q22.3041 4.88165 22.4062 4.96166Q22.5083 5.04167 22.6048 5.12829Q22.7013 5.21491 22.7919 5.30774Q22.8825 5.40058 22.9667 5.49923Q23.0509 5.59788 23.1283 5.70191Q23.2058 5.80594 23.2762 5.91488Q23.3466 6.02382 23.4096 6.1372Z" fill="#AFAFAF" fill-rule="evenodd" filter="url(#filter_1)" transform="translate(26 20)" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

@@ -0,0 +1,119 @@
/*
* Copyright (c) 2025. Brusegan Samuele, Davanzo Andrea
* Questo file fa parte di VeyonCtrl ed è rilasciato
* sotto la licenza MIT. Vedere il file LICENSE per i dettagli.
*/
class HomeButton extends HTMLElement {
static watchedList = [
{
attribute: "icon-src",
htmlElement: "img",
tagName: "src",
},
{
attribute: "text",
htmlElement: "span",
tagName: "",
},
{
attribute: "main-href",
htmlElement: "div",
tagName: "data-href",
}
];
constructor() {
super();
/*
// 0. Richiedo le variabili globali da sessionStorage
let URL_PATH = sessionStorage.getItem("url");
let THEME = sessionStorage.getItem("theme");
*/
// 1. Crea lo Shadow DOM
const shadow = this.attachShadow({mode: 'open'});
// 2. Definisci la struttura interna (HTML) e lo stile (CSS)
const template = document.createElement('template');
template.innerHTML = `
<style>
.btn-home {
display: flex;
align-items: center;
justify-content: start;
gap: 20px;
background: var(--kashmir);
margin: 2rem;
border-radius: 1.5rem;
font-size: 45px;
padding: 18px;
color: var(--gray);
font-weight: 500;
& img {
width: 2em;
height: 2em;
}
}
</style>
<div class="btn btn-home" data-href="">
<img src="" alt="">
<span></span>
<p id="debug"></p>
</div>
`;
// 3. Clona il contenuto del template e aggiungilo allo Shadow DOM
shadow.appendChild(template.content.cloneNode(true));
}
// Passaggio 2: Gestisci gli attributi e i callback
static get observedAttributes() {
let array = [];
HomeButton.watchedList.forEach(element => {
array.push(element.attribute);
})
return array;
}
attributeChangedCallback(name, oldValue, newValue) {
HomeButton.watchedList.forEach(element => {
if (element.attribute === name) {
let domElement = this.shadowRoot.querySelector(element.htmlElement);
/*console.log(name, element, oldValue, newValue)
console.log()*/
if (domElement) {
if (element.tagName !== "") {
// console.log(domElement)
domElement[element.tagName] = newValue;
// console.log(domElement)
// console.log("------------")
} else {
domElement.textContent = newValue;
}
}
}
})
}
connectedCallback() {
let btn = this.shadowRoot.querySelector(".btn-home");
// console.log(btn)
if (btn) {
btn.addEventListener("click", () => {
console.log(btn[ "data-href"])
window.location.href = btn.dataset.href;
})
}
}
}
// Passaggio 3: Registra il tuo elemento personalizzato
customElements.define('home-button', HomeButton);

View File

@@ -0,0 +1,42 @@
:root {
/* STD */
/* Palette */
--error: #E12D39;
--accent: #FF5252;
--bg: #F0ECD4;
--divider: #BDBDBD;
--primary: #FFE3BD;
--primary-light: #F1DC7E;
--primary-dark: #00796B;
--secondary-light: #00967D;
--secondary: #006E59;
--secondary-dark: #004D3E;
--teal-blue: #16425B;
--kashmir: #2F6690;
--allports: #3A7CA5;
--text-primary: #000000;
--text-secondary: #757575;
--text-tertiary: #BDBDBD;
--background: #FFFFFF;
--gray: #F7F7F7;
--quill: #D9DCD6;
--disabled: #D0D0D0;
--default: #BDBDBD;
--hover: #999999;
--storm-dust: #656565;
--focus: #000000;
}
body {
/*background-color: var(--bg);*/
/*color: var(--text-primary);*/
background: #111;
color: #fff;
}

View File

@@ -0,0 +1,12 @@
<?php
/*
* Copyright (c) 2025. Brusegan Samuele, Davanzo Andrea
* Questo file fa parte di VeyonCtrl ed è rilasciato
* sotto la licenza MIT. Vedere il file LICENSE per i dettagli.
*/
?>
<link integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
<script integrity="sha384-I7E8VVD/ismYTF4hNIPjVp/Zjvgyol6VFvRkX/vR+Vc4jQkC+hVqc2pM8ODewa9r" crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.8/dist/umd/popper.min.js"></script>
<script integrity="sha384-RuyvpeZCxMJCqVUGFI0Do1mQrods/hhxYlcVfGPOfQtPJh0JCw12tUAZ/Mv10S7D" crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.6/dist/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="<?=URL_PATH?>/commons/css/style.css">

View File

@@ -0,0 +1,40 @@
[
{
"name": "LASA",
"netIP": "192.168.2.0",
"subnetMask": 24
},
{
"name": "LMM",
"netIP": "192.168.9.0",
"subnetMask": 24
},
{
"name": "LAM",
"netIP": "192.168.10.0",
"subnetMask": 24
},
{
"name": "LAPs",
"netIP": "192.168.4.0",
"subnetMask": 24
},
{
"name": "Classi",
"netIP": "192.168.12.0",
"subnetMask": 24
}
]

View File

@@ -9,9 +9,12 @@
define( 'BASE_PATH', dirname( __DIR__ ) );
session_start();
const URL_PATH = "https://project16.test";
const COMMON_HTML_HEAD = BASE_PATH . '/public/commons/head.php';
const COMMON_HTML_FOOT = BASE_PATH . '/public/commons/bottom_navigation.php';
const URL_PATH = "http://project16.test";
const COMMON_HTML_HEAD = BASE_PATH . '/public/commons/php/head.php';
const COMMON_HTML_FOOT = BASE_PATH . '/public/commons/php/bottom_navigation.php';
const PROJECT_NAME = "Project 16";
const EXE_NAME = "veyon-cli";
const THEME = ( 0 ) ? 'light' : 'dark';
@@ -20,6 +23,7 @@ require_once BASE_PATH . '/Router.php';
require_once BASE_PATH . '/public/functions.php';
// require_once BASE_PATH . '/public/commons/php/session_wall.php';
require_once BASE_PATH . '/app/controllers/Controller.php';
require_once BASE_PATH . '/app/models/ApiCLI.php';
// checkSessionExpiration();

View File

@@ -12,8 +12,8 @@ $router->add('/login' , 'ApiController', 'login');
// === Pagine ===
$router->add('/' , 'Controller', 'index');
$router->add('/grades' , 'Controller', 'grades');
$router->add('/settings' , 'Controller', 'settings');
$router->add('/remoteAccess', 'Controller', 'remoteAccess');
$router->add('/conn' , 'Controller', 'cli');
$router->add('/account' , 'Controller', 'account');
$router->add('/subjects' , 'Controller', 'subjects');
$router->add('/agenda' , 'Controller', 'agenda');