fix: #804 - cssClass on dashboard components

This commit is contained in:
jamesread 2026-01-08 23:49:01 +00:00
parent e96270046e
commit 2569343a31
6 changed files with 21 additions and 7 deletions

View File

@ -1,7 +1,7 @@
<template> <template>
<div :id="`actionButton-${actionId}`" role="none" class="action-button"> <div :id="`actionButton-${actionId}`" role="none" class="action-button">
<button :id="`actionButtonInner-${actionId}`" :title="title" :disabled="!canExec || isDisabled" <button :id="`actionButtonInner-${actionId}`" :title="title" :disabled="!canExec || isDisabled"
:class="buttonClasses" @click="handleClick"> :class="combinedClasses" @click="handleClick">
<div class="navigate-on-start-container"> <div class="navigate-on-start-container">
<div v-if="navigateOnStart == 'pop'" class="navigate-on-start" title="Opens a popup dialog on start"> <div v-if="navigateOnStart == 'pop'" class="navigate-on-start" title="Opens a popup dialog on start">
@ -29,7 +29,7 @@ import { useRouter } from 'vue-router'
import { HugeiconsIcon } from '@hugeicons/vue' import { HugeiconsIcon } from '@hugeicons/vue'
import { WorkoutRunIcon, TypeCursorIcon, ComputerTerminal01Icon } from '@hugeicons/core-free-icons' import { WorkoutRunIcon, TypeCursorIcon, ComputerTerminal01Icon } from '@hugeicons/core-free-icons'
import { ref, watch, onMounted, inject } from 'vue' import { ref, watch, onMounted, inject, computed } from 'vue'
const router = useRouter() const router = useRouter()
const navigateOnStart = ref('') const navigateOnStart = ref('')
@ -38,6 +38,11 @@ const props = defineProps({
actionData: { actionData: {
type: Object, type: Object,
required: true required: true
},
cssClass: {
type: String,
required: false,
default: ''
} }
}) })
@ -57,6 +62,15 @@ const showArgumentForm = ref(false)
// Animation classes // Animation classes
const buttonClasses = ref([]) const buttonClasses = ref([])
// Combined classes including custom cssClass
const combinedClasses = computed(() => {
const classes = [...buttonClasses.value]
if (props.cssClass) {
classes.push(props.cssClass)
}
return classes
})
// Timestamps // Timestamps
const updateIterationTimestamp = ref(0) const updateIterationTimestamp = ref(0)

View File

@ -45,7 +45,7 @@
<span v-else>{{ component.title }}</span> <span v-else>{{ component.title }}</span>
</h2> </h2>
<fieldset> <fieldset :class="component.cssClass">
<template v-for="subcomponent in component.contents"> <template v-for="subcomponent in component.contents">
<DashboardComponent :component="subcomponent" /> <DashboardComponent :component="subcomponent" />
</template> </template>

View File

@ -1,5 +1,5 @@
<template> <template>
<ActionButton v-if="component.type == 'link'" :actionData="component.action" :key="component.title" /> <ActionButton v-if="component.type == 'link'" :actionData="component.action" :cssClass="component.cssClass" :key="component.title" />
<DashboardComponentDirectory v-else-if="component.type == 'directory'" :component="component" /> <DashboardComponentDirectory v-else-if="component.type == 'directory'" :component="component" />

View File

@ -1,5 +1,5 @@
<template> <template>
<button @click="navigateToDirectory"> <button @click="navigateToDirectory" :class="component.cssClass">
<span class="icon" v-html="unicodeIcon"></span> <span class="icon" v-html="unicodeIcon"></span>
<span class="title">{{ component.title }}</span> <span class="title">{{ component.title }}</span>
</button> </button>

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="display"> <div class="display" :class="component.cssClass">
<div v-html="component.title" /> <div v-html="component.title" />
</div> </div>
</template> </template>

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="mre-container"> <div class="mre-container" :class="component.cssClass">
<router-link <router-link
v-if="executionTrackingId" v-if="executionTrackingId"
:to="`/logs/${executionTrackingId}`" :to="`/logs/${executionTrackingId}`"