Features Netzbau-> Dateiablage und Stammdaten->Pops hinzugefügt
This commit is contained in:
182
Layout/default/Device/Detail.php
Normal file
182
Layout/default/Device/Detail.php
Normal file
@@ -0,0 +1,182 @@
|
||||
<?php
|
||||
|
||||
?>
|
||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php"); ?>
|
||||
|
||||
<style>
|
||||
.card-border {
|
||||
|
||||
border-left: 1px solid #428bca;
|
||||
border-left-width: 5px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
</style>
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="<?= self::getUrl("Dashboard") ?>"><?= MFAPPNAME_SLUG ?></a>
|
||||
</li>
|
||||
<li class="breadcrumb-item"><a href="<?= self::getUrl("Device") ?>">Devices</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active">Devices Detail</li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title">Device <?= $devices->data->name ?> <span class="ml-2">
|
||||
<a href="<?= self::getUrl("Device", "edit", ["id" => $devices->id]) ?>">
|
||||
<button class="btn btn-primary">Bearbeiten</button>
|
||||
</a>
|
||||
</span></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<?php
|
||||
|
||||
if (!empty($devices->price)) {
|
||||
$price = $devices->price;
|
||||
} else {
|
||||
$price = $devices->devicetype->price;
|
||||
}
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-5 card-border">
|
||||
<div>
|
||||
<h4>Allgemeine Informationen </h4>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<table class="table table-sm">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Device Name</th>
|
||||
<td><?= $devices->name ?> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>IP-Adresse</th>
|
||||
<td><?= $devices->ip ?> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Geräte Typ</th>
|
||||
<td><?= $devices->devicetype->name ?> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Geräte Hersteller</th>
|
||||
<td><?= $devices->devicetype->devicemanufactor->name ?> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Mac Adresse</th>
|
||||
<td><?= $devices->mac ?> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Seriennummer</th>
|
||||
<td><?= $devices->serial ?> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Preis</th>
|
||||
<td><?= $price ?> €</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Bemerkung</th>
|
||||
<td><?= nl2br($devices->comment) ?> </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-4 card-border">
|
||||
<div>
|
||||
<h4>Standort Informationen</h4>
|
||||
</div>
|
||||
<?php
|
||||
if (!empty(trim($devices->pop->name))) {
|
||||
?>
|
||||
<div>
|
||||
<table class="table table-sm">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Pop Name</th>
|
||||
<td><?= $devices->pop->name ?> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Adresse</th>
|
||||
<td>
|
||||
<a title="Google-Maps: <?= rtrim($devices->pop->gps_lat, '0') ?> , <?= $devices->pop->gps_long ?>"
|
||||
class="mapsLink"
|
||||
href="http://maps.google.com/?q=<?= $devices->pop->gps_lat ?> , <?= $devices->pop->gps_long ?>"
|
||||
target="_blank"><?= rtrim($devices->pop->gps_lat, '0') ?>
|
||||
, <?= rtrim($devices->pop->gps_long, 0) ?></a></td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<h5 class="text-center">Keine Standort Informationen vorhanden</h5>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-3 card-border">
|
||||
<div>
|
||||
<h4>Config Backups</h4>
|
||||
</div>
|
||||
<?php
|
||||
if (!empty($configs)) {
|
||||
?>
|
||||
<div>
|
||||
<table class="table table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Datum/Uhrzeit</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<h5 class="text-center">Keine Configs vorhanden</h5>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>
|
||||
133
Layout/default/Device/Form.php
Normal file
133
Layout/default/Device/Form.php
Normal file
@@ -0,0 +1,133 @@
|
||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php"); ?>
|
||||
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="<?= self::getUrl("Dashboard") ?>"><?= MFAPPNAME_SLUG ?></a>
|
||||
</li>
|
||||
<li class="breadcrumb-item"><a
|
||||
href="<?= self::getUrl("Device") ?>">Devices</a></li>
|
||||
<li class="breadcrumb-item active"><?= ($device->id) ? "bearbeiten" : "Neu" ?></li>
|
||||
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title">Geräte</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="header-title mb-2"><?= ($device->id) ? "Device bearbeiten" : "Neues Gerät" ?></h4>
|
||||
|
||||
<form class="form-horizontal" method="post"
|
||||
action="<?= self::getUrl("Device", "save") ?>">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
<input type="hidden" name="id" value="<?= $device->id ?>"/>
|
||||
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="name">Name *</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="name" id="name"
|
||||
value="<?= $device->name ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="devicetype_id">Gerätetyp *</label>
|
||||
<div class="col-lg-10">
|
||||
<select class="select2 form-control " name="devicetype_id" id="devicetype_id">
|
||||
<option></option>
|
||||
<?php foreach ($devicetypes as $devicetype): ?>
|
||||
<option value="<?= $devicetype->id ?>" <?= ($device->devicetype_id == $devicetype->id) ? "selected='selected'" : "" ?>><?= ($devicetype->devicemanufactor->name . " " . $devicetype->name) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="pop_id">Pop</label>
|
||||
<div class="col-lg-10">
|
||||
<select class="select2 form-control " name="pop_id" id="pop_id">
|
||||
<option></option>
|
||||
<?php foreach ($pops as $pop): ?>
|
||||
<option value="<?= $pop->id ?>" <?= ($device->pop_id == $pop->id) ? "selected='selected'" : "" ?>><?= ($pop->devicemanufactor->name . " " . $pop->name) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="ip">IP-Adresse *</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="ip" id="ip" placeholder="10.0.0.1"
|
||||
value="<?= $device->ip ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="mac">MAC-Adresse</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="mac" id="mac" placeholder=""
|
||||
value="<?= $device->mac ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="serial">Seriennummer</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="serial" id="serial" placeholder=""
|
||||
value="<?= $device->serial ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="comment">Bemerkung</label>
|
||||
<div class="col-lg-10">
|
||||
<textarea class="form-control" id="comment" name="comment"
|
||||
rows="3"><?= $device->comment ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2"></label>
|
||||
<div class="col-lg-10">
|
||||
<button type="submit" class="btn btn-primary">Speichern</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$("#devicemanufactor_id").select2({
|
||||
allowClear: true,
|
||||
placeholder: ""
|
||||
});
|
||||
$("#addresstypes").select2();
|
||||
|
||||
// disable mousewheel on a input number field when in focus
|
||||
$('form').on('focus', 'input[type=number]', function (e) {
|
||||
$(this).on('wheel.disableScroll', function (e) {
|
||||
e.preventDefault()
|
||||
})
|
||||
});
|
||||
$('form').on('blur', 'input[type=number]', function (e) {
|
||||
$(this).off('wheel.disableScroll')
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>
|
||||
220
Layout/default/Device/Index.php
Normal file
220
Layout/default/Device/Index.php
Normal file
@@ -0,0 +1,220 @@
|
||||
<?php
|
||||
$pagination_baseurl = $this->getUrl($Mod, "Index");
|
||||
$pagination_baseurl_params = ["filter" => $filter];
|
||||
$pagination_entity_name = "Device";
|
||||
?>
|
||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php"); ?>
|
||||
|
||||
<style>
|
||||
#filterrow input {
|
||||
width: 100%;
|
||||
padding: 3px;
|
||||
box-sizing: border-box;
|
||||
display: table-header-group;
|
||||
height: unset;
|
||||
}
|
||||
|
||||
.dataTables_wrapper .dataTables_filter {
|
||||
float: left;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.dataTables_wrapper .dataTables_length {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.clear-fa {
|
||||
margin-left: 5px;
|
||||
font-size: 23px;
|
||||
vertical-align: middle;
|
||||
color: #cb2929;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.margina {
|
||||
margin-left: 30px !important;
|
||||
margin-top: -5px;
|
||||
}
|
||||
</style>
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="<?= self::getUrl("Dashboard") ?>"><?= MFAPPNAME_SLUG ?></a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active">Devices</li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title">Devices</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body mb-3">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="float-left">
|
||||
<h4 class="header-title">Liste aller Devices</h4>
|
||||
</div>
|
||||
<div class="float-right">
|
||||
<a class="btn btn-primary mb-2" href="<?= self::getUrl("Device", "add") ?>"><i
|
||||
class="fas fa-plus"></i> Neues Device anlegen</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- --><?php //include(realpath(dirname(__FILE__) . "/../") . "/tpl/pagination.php"); ?>
|
||||
<!-- --><?php //include(realpath(dirname(__FILE__) . "/../") . "/tpl/pagination-summary.php"); ?>
|
||||
|
||||
<table id="datatable" class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Geräte Name</th>
|
||||
<th class="text-center">Geräte Typ</th>
|
||||
<th class="text-center">Hersteller</th>
|
||||
<th class="text-center">Pop</th>
|
||||
<th class="text-center">IP-Adresse</th>
|
||||
<th class="text-center">Mac-Adresse</th>
|
||||
<th class="text-center">Seriennummer</th>
|
||||
<th class="text-center">Preis</th>
|
||||
<th class="text-center">max. Leistung</th>
|
||||
<th class="w15"></th>
|
||||
</tr>
|
||||
<tr id="filterrow">
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
foreach ($devices as $device):
|
||||
if (!empty($device->price)) {
|
||||
$price = $device->price;
|
||||
} else {
|
||||
$price = $device->devicetype->price;
|
||||
}
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<a href="<?= self::getUrl("Device", "detail", ["id" => $device->id]) ?>"><?= $device->name ?></a>
|
||||
</td>
|
||||
<td class="text-center"><?= $device->devicetype->name ?></td>
|
||||
<td class="text-center"><?= $device->devicetype->devicemanufactor->name ?></td>
|
||||
<td class="text-center"><?= $device->pop->name ?></td>
|
||||
|
||||
|
||||
<td class="text-center"><?= $device->ip ?></td>
|
||||
<td class="text-center"><?= $device->mac ?></td>
|
||||
<td class="text-center"><?= $device->serial ?></td>
|
||||
<td class="text-right"><?= $price ?> €</td>
|
||||
<td class="text-right"><?= $device->devicetype->power ?> Watt</td>
|
||||
|
||||
|
||||
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em; width: 80px">
|
||||
<a href="<?= self::getUrl("Device", "edit", ["id" => $device->id]) ?>"><i
|
||||
class="far fa-edit" title="Bearbeiten"></i></a>
|
||||
<a href="<?= self::getUrl("Device", "delete", ["id" => $device->id]) ?>"
|
||||
onclick="if(!confirm('Device wirklich löschen?')) return false;" class="text-danger"
|
||||
title="Löschen"><i class="fas fa-trash "></i></a>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- --><?php //include(realpath(dirname(__FILE__) . "/../") . "/tpl/pagination-summary.php"); ?>
|
||||
<!-- --><?php //include(realpath(dirname(__FILE__) . "/../") . "/tpl/pagination.php"); ?>
|
||||
<!---->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
let table;
|
||||
$('#filterrow th').each(function (i) {
|
||||
let title = $('#datatable thead th').eq($(this).index()).text();
|
||||
|
||||
if ($(this).index() == "9") {
|
||||
|
||||
} else {
|
||||
$(this).html('<input type="text" placeholder="' + title + '" class="form-control" data-index="' + i + '" value="" />');
|
||||
}
|
||||
});
|
||||
|
||||
table = $('#datatable').DataTable({
|
||||
buttons: [
|
||||
{
|
||||
extend: 'excelHtml5',
|
||||
text: 'XLSX Export',
|
||||
className: 'btn-success margina'
|
||||
|
||||
}
|
||||
],
|
||||
orderCellsTop: true,
|
||||
stateSave: true,
|
||||
"initComplete": function () {
|
||||
$('#datatable_filter').append('<i id="clear_cookie" class="fas fa-times clear-fa" title="Filter löschen" aria-hidden="true" ></i>');
|
||||
$('#clear_cookie').click(function () {
|
||||
$('input').val('');
|
||||
|
||||
table.search('').columns().search('').draw();
|
||||
});
|
||||
},
|
||||
"dom": 'flBrtip'
|
||||
|
||||
});
|
||||
|
||||
$('#filterrow').on('keyup', 'input', function () {
|
||||
|
||||
table
|
||||
.column($(this).data('index'))
|
||||
.search(this.value)
|
||||
.draw();
|
||||
|
||||
|
||||
});
|
||||
var state = table.state.loaded();
|
||||
if (state) {
|
||||
table.columns().eq(0).each(function (colIdx) {
|
||||
var colSearch = state.columns[colIdx].search;
|
||||
|
||||
if (colSearch.search) {
|
||||
|
||||
|
||||
$('#filterrow').find("[data-index='" + colIdx + "']").val(colSearch.search);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
table.draw();
|
||||
}
|
||||
$(document).ready(function () {
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>
|
||||
Reference in New Issue
Block a user