Only Admins can see different Tabs in Device
This commit is contained in:
@@ -49,6 +49,7 @@ class DeviceController extends mfBaseController
|
|||||||
"DEVICE_MANUFACTURERS" => $deviceManufacturers,
|
"DEVICE_MANUFACTURERS" => $deviceManufacturers,
|
||||||
"DEVICE_TYPES" => $deviceTypes,
|
"DEVICE_TYPES" => $deviceTypes,
|
||||||
"DEVICES" => $this->getDevices(),
|
"DEVICES" => $this->getDevices(),
|
||||||
|
"IS_ADMIN" => $this->me->is(["Admin"]),
|
||||||
"ZABBIX_URL" => (defined("ZABBIX_URL")) ? ZABBIX_URL : "",
|
"ZABBIX_URL" => (defined("ZABBIX_URL")) ? ZABBIX_URL : "",
|
||||||
"GRAFANA_URL" => (defined("GRAFANA_URL")) ? GRAFANA_URL : "",
|
"GRAFANA_URL" => (defined("GRAFANA_URL")) ? GRAFANA_URL : "",
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ Vue.component('device-view-switch', {
|
|||||||
<div class="device-view-switch" style="margin-bottom: 10px">
|
<div class="device-view-switch" style="margin-bottom: 10px">
|
||||||
<div v-if="!isOverflowing" 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%;">
|
<div v-if="!isOverflowing" 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%;">
|
||||||
<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')" :class="{ 'active': value === 'DeviceManufacturer' }" class="btn btn-primary">Hersteller</button>
|
<button v-show="window.TT_CONFIG['IS_ADMIN'] === '1'" @click="$emit('input', 'DeviceManufacturer')" :class="{ 'active': value === 'DeviceManufacturer' }" class="btn btn-primary">Hersteller</button>
|
||||||
<button @click="$emit('input', 'DeviceType')" :class="{ 'active': value === 'DeviceType' }" class="btn btn-primary">Geräte Typen</button>
|
<button v-show="window.TT_CONFIG['IS_ADMIN'] === '1'" @click="$emit('input', 'DeviceType')" :class="{ 'active': value === 'DeviceType' }" class="btn btn-primary">Geräte Typen</button>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
@@ -23,8 +23,8 @@ Vue.component('device-view-switch', {
|
|||||||
class="btn btn-primary dropdown-toggle">Ansicht</button>
|
class="btn btn-primary dropdown-toggle">Ansicht</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="#" @click="$emit('input', 'DeviceManufacturer'); showDropdown = false" class="dropdown-item">Hersteller</a>
|
<a v-show="window.TT_CONFIG['IS_ADMIN'] === '1'" href="#" @click="$emit('input', 'DeviceManufacturer'); showDropdown = false" class="dropdown-item">Hersteller</a>
|
||||||
<a href="#" @click="$emit('input', 'DeviceType'); showDropdown = false" class="dropdown-item">Geräte Typen</a>
|
<a v-show="window.TT_CONFIG['IS_ADMIN'] === '1'" href="#" @click="$emit('input', 'DeviceType'); showDropdown = false" class="dropdown-item">Geräte Typen</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -33,6 +33,7 @@ Vue.component('device-view-switch', {
|
|||||||
props: ['value'],
|
props: ['value'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
window: window,
|
||||||
isOverflowing: false,
|
isOverflowing: false,
|
||||||
showDropdown: false,
|
showDropdown: false,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user