zterton-status/src/hooks/useState.ts

47 lines
1.0 KiB
TypeScript
Raw Normal View History

2021-10-14 14:42:52 +00:00
import { ref, computed } from 'vue'
// import type { ListCloudBoxesType } from '~/typs/clouds'
// import type { SideMenuItemType } from '~/typs/cmpnts'
const reqError = ref({ defs: '', lang: '', data: '', gql: '', api: '' })
const currentMapKey = ref('')
const isSidebarOpen = ref(false)
const toggleSidebar = () => {
isSidebarOpen.value = !isSidebarOpen.value
}
const bcPath = ref('')
const tsksrvcs = 'tsksrvcs'
const appsrvcs = 'appsrvcs'
const srvcstatus = 'srvcstatus'
const menu_items = ref([
{ id: tsksrvcs, title: 'Tasks', active: false, link: '#' },
{ id: appsrvcs, title: 'Applications', active: false, link: '#' },
{ id: srvcstatus, title: 'Services Status', active: false, link: '#' },
])
const showModal = ref(false)
const checkin = ref(false)
const connection = ref({
state: '',
})
export default function useState() {
return {
tsksrvcs,
appsrvcs,
srvcstatus,
menu_items,
reqError,
currentMapKey,
isSidebarOpen,
toggleSidebar,
bcPath,
showModal,
checkin,
connection,
}
}