add new lights, add login and role to it, add services page
This commit is contained in:
@@ -5,14 +5,14 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import DBMTree from 'src/vueLib/dbm/DBMTree.vue';
|
||||
import { api } from 'src/boot/axios';
|
||||
import { dbmApi } from 'src/boot/axios';
|
||||
import { useNotify } from 'src/vueLib/general/useNotify';
|
||||
import { catchError } from 'src/vueLib/models/error';
|
||||
|
||||
const { NotifyResponse } = useNotify();
|
||||
|
||||
function saveDBM() {
|
||||
api
|
||||
dbmApi
|
||||
.get('saveData')
|
||||
.then((resp) => NotifyResponse(resp.data))
|
||||
.catch((err) => NotifyResponse(catchError(err), 'error'));
|
||||
|
@@ -1,16 +1,24 @@
|
||||
<template>
|
||||
<q-page>
|
||||
<q-tabs v-model="tab">
|
||||
<q-tab name="movingHead" label="Moving Head" />
|
||||
<q-tab name="lightBar" label="Light Bar" />
|
||||
<q-tab no-caps name="stageLights" label="Stage Lights" />
|
||||
<q-tab no-caps name="movingHead" label="Moving Head" />
|
||||
<q-tab no-caps name="lightBar" label="Light Bar" />
|
||||
<q-tab no-caps name="floodPanels" label="Flood Panels" />
|
||||
</q-tabs>
|
||||
<q-tab-panels v-model="tab" animated class="text-white">
|
||||
<q-tab-panel name="movingHead">
|
||||
<moving-head />
|
||||
<q-tab-panel name="stageLights">
|
||||
<stage-lights />
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="lightBar">
|
||||
<LightBar />
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="floodPanels">
|
||||
<FloodPanels />
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="movingHead">
|
||||
<moving-head />
|
||||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
</q-page>
|
||||
</template>
|
||||
@@ -18,6 +26,8 @@
|
||||
<script setup lang="ts">
|
||||
import MovingHead from 'src/components/lights/MovingHead.vue';
|
||||
import LightBar from 'src/components/lights/LightBarCBL.vue';
|
||||
import FloodPanels from 'src/components/lights/FloodPanels.vue';
|
||||
import StageLights from 'src/components/lights/StageLights.vue';
|
||||
import { ref, onMounted, watch } from 'vue';
|
||||
const tab = ref('movingHead');
|
||||
const STORAGE_KEY = 'lastTabUsed';
|
||||
|
60
src/pages/ServicesPage.vue
Normal file
60
src/pages/ServicesPage.vue
Normal file
@@ -0,0 +1,60 @@
|
||||
<template>
|
||||
<q-card>
|
||||
<q-card-section>
|
||||
<div class="text-bold text-primary">Services</div>
|
||||
</q-card-section>
|
||||
<q-card-section>
|
||||
<q-table v-if="driverRows?.length > 0" :rows="driverRows" :columns="columns"> </q-table>
|
||||
<div v-else class="q-pa-md text-grey text-center">
|
||||
<div>No services available</div>
|
||||
<q-btn
|
||||
no-caps
|
||||
rounded
|
||||
color="primary"
|
||||
:class="['q-ma-md', 'text-bold', 'text-white']"
|
||||
:disable="userStore.user?.role !== 'admin'"
|
||||
@click="addNewDriver"
|
||||
>Add First Service</q-btn
|
||||
>
|
||||
</div>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
<service-dialog ref="refServiceDialog"></service-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { reactive, ref } from 'vue';
|
||||
import type { QTableProps } from 'quasar';
|
||||
import { useUserStore } from 'src/vueLib/login/userStore';
|
||||
import ServiceDialog from 'src/vueLib/services/dialog/ServiceDialog.vue';
|
||||
|
||||
const userStore = useUserStore();
|
||||
const refServiceDialog = ref();
|
||||
const driverRows = reactive([]);
|
||||
|
||||
const columns = [
|
||||
{ name: 'path', label: 'Path', field: 'path', align: 'left' },
|
||||
{
|
||||
name: 'type',
|
||||
label: 'Type',
|
||||
field: 'type',
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'value',
|
||||
label: 'Value',
|
||||
field: 'value',
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'drivers',
|
||||
label: 'Drivers',
|
||||
field: 'drivers',
|
||||
align: 'center',
|
||||
},
|
||||
] as QTableProps['columns'];
|
||||
|
||||
function addNewDriver() {
|
||||
refServiceDialog.value.open();
|
||||
}
|
||||
</script>
|
Reference in New Issue
Block a user