diff --git a/Layout/default/Pop/Index.php b/Layout/default/Pop/Index.php deleted file mode 100644 index 6c8f3ed88..000000000 --- a/Layout/default/Pop/Index.php +++ /dev/null @@ -1,278 +0,0 @@ -getUrl($Mod, "Index"); -$pagination_baseurl_params = ["filter" => $filter]; -$pagination_entity_name = "Pops"; -?> - - - -
-
-
-
- -
-

Pops

-
-
-
- - - -
-
-
-
-
-

Liste aller Pops

-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - vlan_public))) - $vlans .= ' Public: ' . $pop->vlan_public . ''; - if (!empty(trim($pop->vlan_nat))) - $vlans .= ' Nat: ' . $pop->vlan_nat . ''; - if (!empty(trim($pop->vlan_ipv6))) - $vlans .= ' IPv6: ' . $pop->vlan_ipv6 . ''; - ?> - - - - - - - - - - - - - -
NameNetzgebietZutrittVlan Public/Nat/IPv6Koordinaten
$pop->id]) ?>">name ?> - networks ?>location ?>gps_lat, '0') ?> - , gps_long, 0) ?> - $pop->id, 'returnto' => "pop"]) ?>"> - " class="text-danger" title="Löschen"> -
- - - - - -
-
- - - - - - - - - \ No newline at end of file diff --git a/application/Pop/PopController.php b/application/Pop/PopController.php index 9f29cfc91..f76f86236 100644 --- a/application/Pop/PopController.php +++ b/application/Pop/PopController.php @@ -19,11 +19,43 @@ class PopController extends mfBaseController protected function indexAction() { + $networks = array_map(function($network) { + return [ + "text" => $network->name, + "value" => $network->name + ]; + }, NetworkModel::getAll()); - $this->layout()->setTemplate("Pop/Index"); - $pops = PopModel::getAlladv(); + $pops = array_map(function($pop) { + return [ + "id" => $pop->id, + "name" => $pop->name, + "networkArea" => $pop->network->name, + "location" => $pop->location, + "vlan" => [ + "public" => $pop->vlan_public, + "nat" => $pop->vlan_nat, + "ipv6" => $pop->vlan_ipv6 + ], + "gps" => $pop->gps_lat . ", " . $pop->gps_long + ]; + }, PopModel::getAlladv()); - $this->layout()->set("pops", $pops); + $JSGlobals = ["BASE_URL" => self::getUrl(""), + "DASHBOARD_URL" => self::getUrl("Dashboard"), + "MFAPPNAME" => MFAPPNAME_SLUG, + "PAGE_TITLE" => "Pops", + "PATH" => [ + ["text" => MFAPPNAME_SLUG, "href" => self::getUrl("Dashboard")], + ["text" => "Devices", "href" => self::getUrl("Pop")] + ], + "NETWORKS" => $networks, + "POPS" => $pops, + ]; + + $this->layout()->set("vueViewName", "Pop"); + $this->layout()->set("JSGlobals", $JSGlobals); + $this->layout()->setTemplate("VueViews/Vue"); } @@ -81,7 +113,7 @@ class PopController extends mfBaseController $popnetwork = PopNetworkModel::getbyPopid($id); $this->layout()->set("popnetwork", $popnetwork['network_id']); $this->layout()->set("pop", $pop); - return $this->addAction(); + $this->addAction(); } protected function saveAction() @@ -136,8 +168,8 @@ class PopController extends mfBaseController if (!$new_id) { $this->layout()->setFlash("Fehler beim Speichern", "error"); - $this->layout()->set("network", $network); - return $this->addAction(); + if (isset($network)) $this->layout()->set("network", $network); + $this->addAction(); } if ($r->network_id) { @@ -188,8 +220,6 @@ class PopController extends mfBaseController $this->layout()->setFlash("Pop erfolgreich gespeichert.", "success"); $this->redirect($this->returUrl, $returnAction, $returnVariables, $returnAnker); - - } protected function apiAction() diff --git a/public/js/pages/Pop/Pop.js b/public/js/pages/Pop/Pop.js new file mode 100644 index 000000000..abe006daf --- /dev/null +++ b/public/js/pages/Pop/Pop.js @@ -0,0 +1,64 @@ +Vue.component('Pop', { + //language=Vue + template: ` + + + + + + + + + + + + + + + + + + `, + data() { + return { + window: window, + PopTableConfig: { + key: 'PopTable', + tableHeader: 'Pops', + defaultPageSize: 25, + headers: [ + {text: 'Name', key: 'name', priority: 10}, + {text: 'Netzgebiet', key: 'networkArea', class: 'text-center', filter: 'autocomplete', + filterOptions: window['TT_CONFIG']['NETWORKS'], + priority: 8}, + {text: 'Zutritt', key: 'location', class: 'text-center', priority: 1}, + {text: 'Standort', key: 'gps', class: 'text-center', priority: 2}, + {text: 'Vlan Public/Nat/ipv6', key: 'vlan', class: 'text-center', priority: 7}, + {text: 'Aktionen', key: 'actions', class: 'text-center', sortable: false, filter: false, priority: 9}, + ], + }, + } + } +}); diff --git a/public/plugins/vue/tt-components/css/tt-table.css b/public/plugins/vue/tt-components/css/tt-table.css index 36c332ee0..7d47be8b9 100644 --- a/public/plugins/vue/tt-components/css/tt-table.css +++ b/public/plugins/vue/tt-components/css/tt-table.css @@ -79,7 +79,7 @@ } .tt-table.table-sm > tbody > tr > td * { - font-size: 13px !important; + font-size: 13px; } .tt-table.table-sm > tbody > tr { @@ -139,4 +139,16 @@ input[type=number]::-webkit-outer-spin-button { margin-top: 8px; margin-bottom: 8px; } + + .fa-circle-xmark, .fa-ban, .fa-trash, .fa-edit, .fa-square-check, .fa-arrows-up-down-left-right, .fa-chevron-right { + font-size: 20px !important + } + + .tt-table.table-sm > tbody > tr > td * { + font-size: 16px !important; + } +} + +td { + vertical-align: middle !important; } \ No newline at end of file diff --git a/public/plugins/vue/tt-components/tt-table.js b/public/plugins/vue/tt-components/tt-table.js index 62ff35600..4b719ce67 100644 --- a/public/plugins/vue/tt-components/tt-table.js +++ b/public/plugins/vue/tt-components/tt-table.js @@ -109,135 +109,137 @@ Vue.component('tt-table-pagination', { Vue.component('tt-table', { template: ` -
- -
- -
- -