Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

MADSci Dashboard Components

Vue template files in this folder are automatically imported and provide the core UI functionality for laboratory monitoring and control.

Auto-Import System

Components are automatically imported via unplugin-vue-components. No manual imports required.

Component Categories

Core Dashboard Components

Laboratory Management Panels

Interactive Modals

Administrative Controls (AdminButtons/)

Emergency and operational control components:

Resource Management (ResourceComponents/)

Specialized resource display components:

Workflow Components

Data Display Components

Usage Patterns

Panel Components

<template>
  <v-card>
    <v-card-title>{{ title }}</v-card-title>
    <v-card-text>
      <!-- Content with real-time data binding -->
      <DataTable :items="reactiveData" />
    </v-card-text>
    <v-card-actions>
      <AddButton @click="openModal" />
    </v-card-actions>
  </v-card>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import { workcell_state, resources } from '@/store'

// Direct reactive binding to global state
const reactiveData = ref(resources)
</script>
<template>
  <v-dialog v-model="dialog" max-width="600px">
    <v-card>
      <v-card-title>Resource Details</v-card-title>
      <v-card-text>
        <v-form @submit="handleSubmit">
          <!-- Form fields with validation -->
        </v-form>
      </v-card-text>
      <v-card-actions>
        <v-btn @click="dialog = false">Cancel</v-btn>
        <v-btn @click="handleSubmit" color="primary">Save</v-btn>
      </v-card-actions>
    </v-card>
  </v-dialog>
</template>

<script lang="ts" setup>
import { ref } from 'vue'

const dialog = ref(false)
const emit = defineEmits(['submit', 'cancel'])

const handleSubmit = () => {
  // API call and emit result
  emit('submit', formData.value)
  dialog.value = false
}
</script>

Admin Button Components

<template>
  <v-btn
    :color="buttonColor"
    :disabled="!canPerformAction"
    @click="performAction"
  >
    <v-icon>{{ icon }}</v-icon>
    {{ label }}
  </v-btn>
</template>

<script lang="ts" setup>
import { computed } from 'vue'

const props = defineProps<{
  target: Node | Workcell
  action: string
}>()

const canPerformAction = computed(() => {
  // Real-time validation based on target state
  return props.target.status === 'ready'
})

const performAction = async () => {
  // Direct API call to MADSci services
  await fetch(`${urls.value.node_server_url}/action`, {
    method: 'POST',
    body: JSON.stringify({ action: props.action })
  })
}
</script>

State Integration

All components connect to global state via imports from @/store:

import {
  workcell_state,
  active_workflows,
  resources,
  locations,
  labContext
} from '@/store'

// Reactive data binding - updates automatically
const currentStatus = computed(() => workcell_state.value?.status)

Vuetify Integration

Components use Vuetify 3 Material Design components:

Error Handling

All components implement graceful error handling:

<template>
  <v-alert v-if="error" type="error">
    {{ error.message }}
  </v-alert>
  <v-progress-circular v-else-if="loading" />
  <MainContent v-else :data="data" />
</template>