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:
@@ -176,10 +176,10 @@ export const computersApi = {
|
||||
// Relationship Types API
|
||||
export const relationshipTypesApi = {
|
||||
list() {
|
||||
return api.get('/machines/relationshiptypes')
|
||||
return api.get('/assets/relationshiptypes')
|
||||
},
|
||||
create(data) {
|
||||
return api.post('/machines/relationshiptypes', data)
|
||||
return api.post('/assets/relationshiptypes', data)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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: {} } }))
|
||||
])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user