Merge branch 'spidev' into 'master'
Spidev See merge request fronk/thetool!1698
This commit is contained in:
@@ -2,6 +2,12 @@
|
|||||||
<link href="<?=self::getResourcePath()?>assets/css/select2-cstm.css?<?=date('U')?>" rel="stylesheet" type="text/css" />
|
<link href="<?=self::getResourcePath()?>assets/css/select2-cstm.css?<?=date('U')?>" rel="stylesheet" type="text/css" />
|
||||||
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= date('U') ?>" rel="stylesheet" type="text/css"/>
|
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= date('U') ?>" rel="stylesheet" type="text/css"/>
|
||||||
<!-- start page title -->
|
<!-- start page title -->
|
||||||
|
<style type="text/css">
|
||||||
|
.tool-border-spacer
|
||||||
|
{
|
||||||
|
border-right: 2px solid #868686;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="page-title-box">
|
<div class="page-title-box">
|
||||||
@@ -78,7 +84,18 @@
|
|||||||
value="<?= $devicetypes->power ?>">
|
value="<?= $devicetypes->power ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group row">
|
||||||
|
<label class="col-lg-2 col-form-label" for="price">Temperatur Warnung | Kritisch</label>
|
||||||
|
<div class="col-lg-2 tool-border-spacer">
|
||||||
|
<input type="number" min="0" step="1" class="form-control" name="temp_warning" id="temp_warning" placeholder="80"
|
||||||
|
value="<?= $devicetypes->temp_warning ?>" >
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-2">
|
||||||
|
<input type="number" min="0" step="1" class="form-control" name="temp_critical" id="temp_critical" placeholder="90"
|
||||||
|
value="<?= $devicetypes->temp_critical ?>" >
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ class DeviceController extends mfBaseController
|
|||||||
"manufacturer" => $deviceType->devicemanufactor->name,
|
"manufacturer" => $deviceType->devicemanufactor->name,
|
||||||
"price" => $deviceType->price,
|
"price" => $deviceType->price,
|
||||||
"power" => $deviceType->power,
|
"power" => $deviceType->power,
|
||||||
|
"temp_warning" => $deviceType->temp_warning,
|
||||||
|
"temp_critical" => $deviceType->temp_critical,
|
||||||
"creator" => $deviceType->creator->name,
|
"creator" => $deviceType->creator->name,
|
||||||
"created" => $deviceType->create,
|
"created" => $deviceType->create,
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -76,6 +76,17 @@ class DevicetypeController extends mfBaseController
|
|||||||
} else {
|
} else {
|
||||||
$power = $r->power;
|
$power = $r->power;
|
||||||
}
|
}
|
||||||
|
if (!$r->temp_warning) {
|
||||||
|
$temp_warning = "80";
|
||||||
|
} else {
|
||||||
|
$temp_warning = $r->temp_warning;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$r->temp_critical) {
|
||||||
|
$temp_critical = "90";
|
||||||
|
} else {
|
||||||
|
$temp_critical = $r->temp_critical;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($r->olt) {
|
if ($r->olt) {
|
||||||
@@ -88,6 +99,8 @@ class DevicetypeController extends mfBaseController
|
|||||||
$data['price'] = $price;
|
$data['price'] = $price;
|
||||||
$data['power'] = $power;
|
$data['power'] = $power;
|
||||||
$data['olt'] = $olt;
|
$data['olt'] = $olt;
|
||||||
|
$data['temp_warning'] = $temp_warning;
|
||||||
|
$data['temp_critical'] = $temp_critical;
|
||||||
|
|
||||||
if (!$data['name']) {
|
if (!$data['name']) {
|
||||||
$this->layout()->setFlash("Name darf nicht leer sein", "error");
|
$this->layout()->setFlash("Name darf nicht leer sein", "error");
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ class DevicetypeModel
|
|||||||
public $price = null;
|
public $price = null;
|
||||||
public $olt = null;
|
public $olt = null;
|
||||||
public $devicemanufactor_id = null;
|
public $devicemanufactor_id = null;
|
||||||
|
public $temp_warning = 80;
|
||||||
|
public $temp_critical = 90;
|
||||||
|
|
||||||
|
|
||||||
public $create_by = null;
|
public $create_by = null;
|
||||||
|
|||||||
33
db/migrations/20250902070036_devicetype_add_temperature.php
Normal file
33
db/migrations/20250902070036_devicetype_add_temperature.php
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
use Phinx\Migration\AbstractMigration;
|
||||||
|
|
||||||
|
final class DevicetypeAddTemperature extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
if($this->getEnvironment() == "thetool") {
|
||||||
|
$table = $this->table("Devicetype");
|
||||||
|
$table->addColumn("temp_warning", "integer", ['null' => false,'default' => '80', "after" => "power"]);
|
||||||
|
$table->addColumn("temp_critical", "integer", ['null' => false,'default' => '90', "after" => "temp_warning"]);
|
||||||
|
$table->update();
|
||||||
|
}
|
||||||
|
|
||||||
|
if($this->getEnvironment() == "addressdb") {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
if($this->getEnvironment() == "thetool") {
|
||||||
|
$this->table("Devicetype")->removeColumn("temp_warning")->save();
|
||||||
|
$this->table("Devicetype")->removeColumn("temp_critical")->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
if($this->getEnvironment() == "addressdb") {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,38 +11,38 @@ const deviceTypeFilterOptions = window?.TT_CONFIG?.DEVICE_TYPES.map(type => ({
|
|||||||
Vue.component('device-view-switch', {
|
Vue.component('device-view-switch', {
|
||||||
//language=Vue
|
//language=Vue
|
||||||
template: `
|
template: `
|
||||||
<div class="device-view-switch" style="margin-bottom: 10px">
|
<div class="device-view-switch" style="margin-bottom: 10px">
|
||||||
<div v-if="!isOverflowing"
|
<div v-if="!isOverflowing"
|
||||||
class="button-group"
|
class="button-group"
|
||||||
style="display:grid; grid-template-columns: repeat(3, 1fr); gap: 10px; justify-content: center; align-items: center; text-align: center; width: 100%;">
|
style="display:grid; grid-template-columns: repeat(3, 1fr); gap: 10px; justify-content: center; align-items: center; text-align: center; width: 100%;">
|
||||||
<button @click="$emit('input', 'DeviceTable')" :class="{ 'active': value === 'DeviceTable' }" class="btn btn-primary">Devices</button>
|
<button @click="$emit('input', 'DeviceTable')" :class="{ 'active': value === 'DeviceTable' }" class="btn btn-primary">Devices</button>
|
||||||
<button @click="$emit('input', 'DeviceManufacturer')"
|
<button @click="$emit('input', 'DeviceManufacturer')"
|
||||||
:class="{ 'active': value === 'DeviceManufacturer' }"
|
:class="{ 'active': value === 'DeviceManufacturer' }"
|
||||||
class="btn btn-primary">Hersteller
|
class="btn btn-primary">Hersteller
|
||||||
</button>
|
</button>
|
||||||
<button @click="$emit('input', 'DeviceType')"
|
<button @click="$emit('input', 'DeviceType')"
|
||||||
:class="{ 'active': value === 'DeviceType' }"
|
:class="{ 'active': value === 'DeviceType' }"
|
||||||
class="btn btn-primary">Geräte Typen
|
class="btn btn-primary">Geräte Typen
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
<button @click="showDropdown = !showDropdown"
|
<button @click="showDropdown = !showDropdown"
|
||||||
class="btn btn-primary dropdown-toggle">Ansicht
|
class="btn btn-primary dropdown-toggle">Ansicht
|
||||||
</button>
|
</button>
|
||||||
<div v-show="showDropdown" class="dropdown-menu show">
|
<div v-show="showDropdown" class="dropdown-menu show">
|
||||||
<a href="#" @click="$emit('input', 'DeviceTable'); showDropdown = false" class="dropdown-item">Devices</a>
|
<a href="#" @click="$emit('input', 'DeviceTable'); showDropdown = false" class="dropdown-item">Devices</a>
|
||||||
<a href="#"
|
<a href="#"
|
||||||
@click="$emit('input', 'DeviceManufacturer'); showDropdown = false"
|
@click="$emit('input', 'DeviceManufacturer'); showDropdown = false"
|
||||||
class="dropdown-item">Hersteller</a>
|
class="dropdown-item">Hersteller</a>
|
||||||
<a href="#"
|
<a href="#"
|
||||||
@click="$emit('input', 'DeviceType'); showDropdown = false"
|
@click="$emit('input', 'DeviceType'); showDropdown = false"
|
||||||
class="dropdown-item">Geräte Typen</a>
|
class="dropdown-item">Geräte Typen</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
props: ['value'],
|
props: ['value'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -172,24 +172,24 @@ Vue.component('DeviceTable', {
|
|||||||
Vue.component('DeviceManufacturer', {
|
Vue.component('DeviceManufacturer', {
|
||||||
//language=Vue
|
//language=Vue
|
||||||
template: `
|
template: `
|
||||||
<tt-table :data="window['TT_CONFIG']['DEVICE_MANUFACTURERS']" :config="DeviceManufacturerConfig" excel-export>
|
<tt-table :data="window['TT_CONFIG']['DEVICE_MANUFACTURERS']" :config="DeviceManufacturerConfig" excel-export>
|
||||||
|
|
||||||
<template v-slot:top-buttons>
|
<template v-slot:top-buttons>
|
||||||
<button type="button" class="btn btn-primary" @click="window.location = window['TT_CONFIG']['BASE_URL'] + '/Devicemanufactor/add'">
|
<button type="button" class="btn btn-primary" @click="window.location = window['TT_CONFIG']['BASE_URL'] + '/Devicemanufactor/add'">
|
||||||
<i class="fas fa-plus"></i>Hersteller hinzufügen
|
<i class="fas fa-plus"></i>Hersteller hinzufügen
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-slot:actions="{ row }">
|
<template v-slot:actions="{ row }">
|
||||||
<a :href="window['TT_CONFIG']['BASE_URL'] +'/Devicemanufactor/edit/?id=' + row.id"><i class="far fa-edit" title="Bearbeiten"></i></a>
|
<a :href="window['TT_CONFIG']['BASE_URL'] +'/Devicemanufactor/edit/?id=' + row.id"><i class="far fa-edit" title="Bearbeiten"></i></a>
|
||||||
<a :href="window['TT_CONFIG']['BASE_URL'] +'/Devicemanufactor/delete/?id=' + row.id"
|
<a :href="window['TT_CONFIG']['BASE_URL'] +'/Devicemanufactor/delete/?id=' + row.id"
|
||||||
onclick="if(!confirm('Hersteller wirklich löschen?')) return false;"
|
onclick="if(!confirm('Hersteller wirklich löschen?')) return false;"
|
||||||
class="text-danger"
|
class="text-danger"
|
||||||
title="Löschen"><i class="fas fa-trash "></i></a>
|
title="Löschen"><i class="fas fa-trash "></i></a>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</tt-table>
|
</tt-table>
|
||||||
`,
|
`,
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
window: window,
|
window: window,
|
||||||
@@ -211,24 +211,24 @@ Vue.component('DeviceManufacturer', {
|
|||||||
Vue.component('DeviceType', {
|
Vue.component('DeviceType', {
|
||||||
//language=Vue
|
//language=Vue
|
||||||
template: `
|
template: `
|
||||||
<tt-table :data="window['TT_CONFIG']['DEVICE_TYPES']" :config="DeviceTypeConfig" excel-export>
|
<tt-table :data="window['TT_CONFIG']['DEVICE_TYPES']" :config="DeviceTypeConfig" excel-export>
|
||||||
|
|
||||||
<template v-slot:top-buttons>
|
<template v-slot:top-buttons>
|
||||||
<button type="button" class="btn btn-primary" @click="window.location = window['TT_CONFIG']['BASE_URL'] + '/Devicetype/add'">
|
<button type="button" class="btn btn-primary" @click="window.location = window['TT_CONFIG']['BASE_URL'] + '/Devicetype/add'">
|
||||||
<i class="fas fa-plus"></i>Device Type hinzufügen
|
<i class="fas fa-plus"></i>Device Type hinzufügen
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-slot:actions="{ row }">
|
<template v-slot:actions="{ row }">
|
||||||
<a :href="window['TT_CONFIG']['BASE_URL'] +'/Devicetype/edit/?id=' + row.id"><i class="far fa-edit" title="Bearbeiten"></i></a>
|
<a :href="window['TT_CONFIG']['BASE_URL'] +'/Devicetype/edit/?id=' + row.id"><i class="far fa-edit" title="Bearbeiten"></i></a>
|
||||||
<a :href="window['TT_CONFIG']['BASE_URL'] +'/Devicetype/delete/?id=' + row.id"
|
<a :href="window['TT_CONFIG']['BASE_URL'] +'/Devicetype/delete/?id=' + row.id"
|
||||||
onclick="if(!confirm('Gerätetyp wirklich löschen?')) return false;"
|
onclick="if(!confirm('Gerätetyp wirklich löschen?')) return false;"
|
||||||
class="text-danger"
|
class="text-danger"
|
||||||
title="Löschen"><i class="fas fa-trash "></i></a>
|
title="Löschen"><i class="fas fa-trash "></i></a>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</tt-table>
|
</tt-table>
|
||||||
`,
|
`,
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
window: window,
|
window: window,
|
||||||
@@ -241,6 +241,8 @@ Vue.component('DeviceType', {
|
|||||||
{text: 'Hersteller', key: 'manufacturer', filter: 'search', class: 'text-center'},
|
{text: 'Hersteller', key: 'manufacturer', filter: 'search', class: 'text-center'},
|
||||||
{text: 'Preis', key: 'price', filter: 'numberRange', class: 'text-center', suffix: ' €'},
|
{text: 'Preis', key: 'price', filter: 'numberRange', class: 'text-center', suffix: ' €'},
|
||||||
{text: 'max. Leistung', key: 'power', filter: 'numberRange', class: 'text-center', suffix: ' W'},
|
{text: 'max. Leistung', key: 'power', filter: 'numberRange', class: 'text-center', suffix: ' W'},
|
||||||
|
{text: 'Temp. Warnung', key: 'temp_warning', filter: 'numberRange', class: 'text-center', suffix: ' °C'},
|
||||||
|
{text: 'Temp. Kritisch', key: 'temp_critical', filter: 'numberRange', class: 'text-center', suffix: ' °C'},
|
||||||
{text: 'Erstellungsdatum', key: 'created', filter: 'date', class: 'text-center'},
|
{text: 'Erstellungsdatum', key: 'created', filter: 'date', class: 'text-center'},
|
||||||
{text: 'Erstellt von', key: 'creator', filter: 'search', class: 'text-center'},
|
{text: 'Erstellt von', key: 'creator', filter: 'search', class: 'text-center'},
|
||||||
{text: 'Aktionen', key: 'actions', class: 'text-center', sortable: false, filter: false, priority: 9},
|
{text: 'Aktionen', key: 'actions', class: 'text-center', sortable: false, filter: false, priority: 9},
|
||||||
|
|||||||
Reference in New Issue
Block a user