Devices Update

* Berechtigungen devices für Netzgebietzuordnungen
This commit is contained in:
Daniel Spitzer
2025-02-04 16:35:19 +01:00
parent 5f32c9fc14
commit b202e3a57f
4 changed files with 77 additions and 59 deletions

View File

@@ -275,7 +275,7 @@ foreach ($devicesall as $deviceall) {
}
?>
<div class="col-12 col-lg-4 card-border">
<div class="col-12 <?= ($me->is('Admin')) ? 'col-lg-4' : 'col-lg-7' ?> card-border">
<div>
<h4><?= $StdHeader ?></h4>
</div>
@@ -338,70 +338,75 @@ foreach ($devicesall as $deviceall) {
}
?>
</div>
<div class="col-12 col-lg-3 card-border">
<div class="overflow-auto">
<h4 class="float-left">Config Backups</h4>
<?php if ($devices->devicetype->devicemanufactor->config_backup > count()): ?>
<span><i title="Switch config" class="fa-light fa-rectangle-code code-ico"
data-toggle="modal" data-target="#configCode"></i></span>
<?php endif;
if ($me->is('Admin')):
<?php if ($me->is('Admin')) : ?>
<div class="col-12 col-lg-3 card-border">
<div class="overflow-auto">
<h4 class="float-left">Config Backups</h4>
<?php if ($devices->devicetype->devicemanufactor->config_backup > count()): ?>
<span><i title="Switch config" class="fa-light fa-rectangle-code code-ico"
data-toggle="modal" data-target="#configCode"></i></span>
<?php endif;
if ($me->is('Admin')):
?>
<div class="float-right">
<a id="create-backup-href"
href="<?= self::getUrl("Device", "api", ['do' => 'createconfig', 'ip' => $devices->ip, 'id' => $devices->id]) ?>"
<button class="btn btn-primary "><span id="create-backup-button-text">Backup erstellen</span>
<span id="create-backup-load"></i></span></button>
</a></div>
<?php endif; ?>
</div>
<?php
if ($devicesconfig->success == "true" && $devicesconfig->data > count()) {
?>
<div class="float-right">
<a id="create-backup-href"
href="<?= self::getUrl("Device", "api", ['do' => 'createconfig', 'ip' => $devices->ip, 'id' => $devices->id]) ?>"
<button class="btn btn-primary "><span id="create-backup-button-text">Backup erstellen</span>
<span id="create-backup-load"></i></span></button>
</a></div>
<?php endif; ?>
</div>
<?php
if ($devicesconfig->success == "true" && $devicesconfig->data > count()) {
?>
<div>
<table class="table table-sm">
<thead>
<tr>
<th>Datum/Uhrzeit</th>
<th></th>
</tr>
</thead>
<tbody>
<?php foreach ($devicesconfig->data as $config) :
$configfileCleartext = trim($config->config_cleartext);
$configfileCompressed = trim($config->config_compressed);
$configid = $config->id;
if ($configfileCleartext && $configfileCompressed) :
<div>
<table class="table table-sm">
<thead>
<tr>
<th>Datum/Uhrzeit</th>
<th></th>
</tr>
</thead>
<tbody>
<?php foreach ($devicesconfig->data as $config) :
$configfileCleartext = trim($config->config_cleartext);
$configfileCompressed = trim($config->config_compressed);
$configid = $config->id;
if ($configfileCleartext && $configfileCompressed) :
$configLinks = '<a href="' . self::getUrl("Device", "api", ['do' => 'getconfig', 'id' => $configid, 'format' => 'txt', 'filename' => $configfileCleartext]) . '">
$configLinks = '<a href="' . self::getUrl("Device", "api", ['do' => 'getconfig', 'id' => $configid, 'format' => 'txt', 'filename' => $configfileCleartext]) . '">
TXT</a> / <a href="' . self::getUrl("Device", "api", ['do' => 'getconfig', 'id' => $configid, 'format' => 'xml', 'filename' => $configfileCompressed]) . '">
XML</a>';
elseif ($configfileCleartext || $configfileCompressed) :
$configLinks = '<a href="' . self::getUrl("Device", "api", ['do' => 'getconfig', 'id' => $configid, 'format' => 'txt', 'filename' => $configfileCleartext . $configfileCompressed]) . '">
elseif ($configfileCleartext || $configfileCompressed) :
$configLinks = '<a href="' . self::getUrl("Device", "api", ['do' => 'getconfig', 'id' => $configid, 'format' => 'txt', 'filename' => $configfileCleartext . $configfileCompressed]) . '">
TXT</a>';
endif;
?>
<tr>
<td><?= date("d.m.Y/H:i", $config->config_timestamp); ?></td>
<td><?= $configLinks; ?></td>
endif;
?>
<tr>
<td><?= date("d.m.Y/H:i", $config->config_timestamp); ?></td>
<td><?= $configLinks; ?></td>
</tr>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php
} else {
</tbody>
</table>
</div>
<?php
} else {
?>
<div class="mt-1">
<h5 class="text-center">Keine Configs vorhanden</h5>
</div>
<?php
}
?>
<div class="mt-1">
<h5 class="text-center">Keine Configs vorhanden</h5>
</div>
<?php
}
?>
</div>
</div>
<?php
endif
?>
</div>
<?php
if ($devices->devicetype->olt && TT_MBI_API_ENABLE) :