Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement new UI to Configurations - Telemetry #1038

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/GlassModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const modalPositionStyle = computed(() => {
return {
top: '50%',
left: interfaceStore.isOnSmallScreen
? `${interfaceStore.mainMenuWidth - 20}px`
? `${interfaceStore.mainMenuWidth - 30}px`
: `${interfaceStore.mainMenuWidth + 30}px`,
transform: 'translateY(-50%)',
}
Expand Down
76 changes: 52 additions & 24 deletions src/views/ConfigurationDevelopmentView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,48 @@
<BaseConfigurationView>
<template #title>Development configuration</template>
<template #content>
<v-switch v-model="devStore.developmentMode" label="Development mode" class="ma-2" color="rgb(0, 20, 80)" />
<v-switch
v-model="devStore.enableSystemLogging"
label="Enable system logging"
class="m-2"
color="rgb(0, 20, 80)"
@update:model-value="reloadCockpit"
/>
<v-slider
v-model="devStore.widgetDevInfoBlurLevel"
label="Dev info blur level"
min="0"
max="10"
class="ma-2 w-25"
color="rgb(0, 20, 80)"
step="1"
thumb-label="always"
/>
<v-data-table :items="systemLogsData" :headers="headers" class="max-w-[80%] max-h-[60%]">
<template #item.actions="{ item }">
<div class="text-center cursor-pointer icon-btn mdi mdi-download" @click="downloadLog(item.name)" />
</template>
</v-data-table>
<div class="max-w-[87vw] max-h-[80vh] overflow-y-auto">
<div
class="flex flex-col justify-between items-center w-full"
:class="interfaceStore.isOnPhoneScreen ? 'scale-[80%] mt-0 -mb-3' : 'scale-100 mt-4'"
>
<div class="flex flex-row gap-x-[50px]">
<v-switch v-model="devStore.developmentMode" label="Development mode" color="white" />
<v-switch
v-model="devStore.enableSystemLogging"
label="Enable system logging"
color="white"
@update:model-value="reloadCockpit"
/>
</div>
<v-slider
v-model="devStore.widgetDevInfoBlurLevel"
label="Dev info blur level"
min="0"
max="10"
class="w-[350px]"
color="white"
step="1"
thumb-label="hover"
/>
</div>
<ExpansiblePanel no-bottom-divider :is-expanded="!interfaceStore.isOnPhoneScreen">
<template #title>System logs</template>
<template #content>
<v-data-table
:items="systemLogsData"
density="compact"
theme="dark"
:headers="headers"
class="w-full max-h-[60%] rounded-md bg-[#FFFFFF11]"
>
<template #item.actions="{ item }">
<div class="text-center cursor-pointer icon-btn mdi mdi-download" @click="downloadLog(item.name)" />
</template>
</v-data-table>
</template>
</ExpansiblePanel>
</div>
</template>
</BaseConfigurationView>
</template>
Expand All @@ -37,11 +56,14 @@ import { saveAs } from 'file-saver'
import { onBeforeMount } from 'vue'
import { ref } from 'vue'

import ExpansiblePanel from '@/components/ExpansiblePanel.vue'
import { type SystemLog, cockpitSytemLogsDB } from '@/libs/system-logging'
import { useAppInterfaceStore } from '@/stores/appInterface'
import { useDevelopmentStore } from '@/stores/development'

import BaseConfigurationView from './BaseConfigurationView.vue'
const devStore = useDevelopmentStore()
const interfaceStore = useAppInterfaceStore()

/* eslint-disable jsdoc/require-jsdoc */
interface SystemLogsData {
Expand All @@ -58,7 +80,7 @@ const headers = [
{ title: 'Name', value: 'name' },
{ title: 'Time (initial)', value: 'initialTime' },
{ title: 'Date (initial)', value: 'initialDate' },
{ title: 'N. events', value: 'nEvents' },
{ title: 'events', value: 'nEvents' },
{ title: 'Download', value: 'actions' },
]

Expand All @@ -82,3 +104,9 @@ const downloadLog = async (logName: string): Promise<void> => {

const reloadCockpit = (): void => location.reload()
</script>
<style scoped>
.custom-header {
background-color: #333 !important;
color: #fff;
}
</style>
Loading