Move relationship types + dashboard recent off the machines blueprint

- Add /api/assets/relationshiptypes (GET/POST) serving RelationshipType; point
  relationshipTypesApi at it instead of the legacy /api/machines blueprint.
- Dashboard recent-devices widget reads assetsApi.list (asset shape) instead
  of machinesApi.

No frontend code references machinesApi anymore.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
cproudlock
2026-06-26 09:29:30 -04:00
parent b68b0895ee
commit 167a9514cf
3 changed files with 56 additions and 11 deletions

View File

@@ -65,18 +65,18 @@
<table>
<thead>
<tr>
<th>Name</th>
<th>Category</th>
<th>Asset #</th>
<th>Type</th>
<th>Status</th>
<th>Business Unit</th>
</tr>
</thead>
<tbody>
<tr v-for="machine in recentMachines" :key="machine.machineid">
<td>{{ machine.machinenumber || machine.hostname || machine.alias || '-' }}</td>
<td>{{ machine.category || '-' }}</td>
<td>{{ machine.machinetype || '-' }}</td>
<td>{{ machine.businessunit || '-' }}</td>
<tr v-for="machine in recentMachines" :key="machine.assetid">
<td>{{ machine.assetnumber || machine.name || '-' }}</td>
<td>{{ machine.assettypename || '-' }}</td>
<td>{{ machine.statusname || '-' }}</td>
<td>{{ machine.businessunitname || '-' }}</td>
</tr>
<tr v-if="recentMachines.length === 0">
<td colspan="4" style="text-align: center; color: var(--text-light);">
@@ -93,7 +93,7 @@
<script setup>
import { ref, onMounted } from 'vue'
import { dashboardApi, machinesApi, printersApi } from '../api'
import { dashboardApi, assetsApi, printersApi } from '../api'
const loading = ref(true)
const stats = ref({})
@@ -104,7 +104,7 @@ onMounted(async () => {
try {
const [dashRes, machinesRes, printersRes] = await Promise.all([
dashboardApi.summary().catch(() => ({ data: { data: {} } })),
machinesApi.list({ perpage: 5 }).catch(() => ({ data: { data: [] } })),
assetsApi.list({ perpage: 5 }).catch(() => ({ data: { data: [] } })),
printersApi.dashboardSummary().catch(() => ({ data: { data: {} } }))
])