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

@@ -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>