Reworked Pop Table View
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
Vue.component('Pop', {
|
||||
//language=Vue
|
||||
template: `
|
||||
<tt-card>
|
||||
|
||||
<tt-table :data="window['TT_CONFIG']['POPS']" :config="PopTableConfig" excel-export>
|
||||
|
||||
<template v-slot:top-buttons>
|
||||
<button type="button" class="btn btn-primary" @click="window.location = window['TT_CONFIG']['BASE_URL'] + '/Pop/add'">
|
||||
<i class="fas fa-plus"></i>
|
||||
Pop hinzufügen
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<template v-slot:name="{ row }">
|
||||
<a target="_blank" :href="window['TT_CONFIG']['BASE_URL'] +'/Pop/Detail?id=' + row.id">{{row.name}}</a>
|
||||
</template>
|
||||
|
||||
<template v-slot:vlan="{ row }">
|
||||
<span v-if="row.vlan.public" class="order-date-pill text-nowrap active mb-1">Public: <span class="font-weight-bold">{{row.vlan.public}}</span></span>
|
||||
<span v-if="row.vlan.nat" class="order-date-pill text-nowrap active mb-1">Nat: <span class="font-weight-bold">{{row.vlan.nat}}</span></span>
|
||||
<span v-if="row.vlan.ipv6" class="order-date-pill text-nowrap active mb-0">IPv6: <span class="font-weight-bold">{{row.vlan.ipv6}}</span></span>
|
||||
</template>
|
||||
|
||||
<template v-slot:gps="{ row }">
|
||||
<a
|
||||
v-if="row.gps"
|
||||
:title="'Google Maps: ' + row.gps"
|
||||
class="mapsLink"
|
||||
:href="'http://maps.google.com/?q=' + row.gps"
|
||||
v-text="row.gps"
|
||||
target="_blank"></a>
|
||||
</template>
|
||||
|
||||
<template v-slot:actions="{ row }">
|
||||
<a :href="window['TT_CONFIG']['BASE_URL'] +'/Pop/edit/?id=' + row.id"><i class="far fa-edit" title="Bearbeiten"></i></a>
|
||||
<a :href="window['TT_CONFIG']['BASE_URL'] +'/Pop/delete/?id=' + row.id" onclick="if(!confirm('Device wirklich löschen?')) return false;" class="text-danger" title="Löschen"><i class="fas fa-trash "></i></a>
|
||||
</template>
|
||||
|
||||
</tt-table>
|
||||
|
||||
</tt-card>
|
||||
`,
|
||||
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},
|
||||
],
|
||||
},
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user