Reciprocal controls links, dead chip links, and a resumable legacy import
The machine page now shows the PC that controls it. The endpoint was correct all along and returned both directions; AssetTriageBand discarded every peer whose type was not 'machine' and was mounted only on the PC page. The counterpart type, label and relationship types are now props. Fixed while adopting it more widely: every band chip linked to /assets/<id>, and there is no such route. The resolver that AssetRelationships.vue kept privately is now frontend/src/utils/assetRoute.js, used by both - and its type lookup is case-insensitive, because seed data capitalises the type names while this site's database does not. The legacy import is now safe to resume. The 409-resolve asked for per_page=10000 against a server that clamps to 100, so it silently searched the first 100 rows and dropped links past that on every re-run. The crosswalk is now bound to the database it describes, so one carried across a rebuild is refused rather than attaching rows to the wrong assets. Source database names are resolved from the environment, so the loader can be aimed without editing it. Full suite 2178 passed, frontend 280 passed.
This commit is contained in:
@@ -70,6 +70,17 @@
|
||||
<span class="hero-detail-value">{{ machine.locationname }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- The 6am band, machine side: which PCs drive this machine. The
|
||||
same fact as a PC's "Serves machine", read from the other end -
|
||||
and the end somebody is standing at when the machine has
|
||||
stopped. It lived only in the relationships card near the
|
||||
bottom of the page. -->
|
||||
<AssetTriageBand
|
||||
:assetid="machine.assetid"
|
||||
counterparttype="computer"
|
||||
counterpartlabel="Controlled by"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -253,6 +264,7 @@ import { useRoute, useRouter } from 'vue-router'
|
||||
import { machinesApi } from '@/api'
|
||||
import { withBase } from '@/utils/basePath'
|
||||
import LocationMapTooltip from '@/components/LocationMapTooltip.vue'
|
||||
import AssetTriageBand from '@/components/AssetTriageBand.vue'
|
||||
import CustomFieldsSection from '@/components/CustomFieldsSection.vue'
|
||||
import PluginAssetPanels from '@/components/PluginAssetPanels.vue'
|
||||
import AssetRelationships from '@/components/AssetRelationships.vue'
|
||||
|
||||
@@ -46,6 +46,15 @@
|
||||
<span class="hero-detail-value">{{ tool.locationname }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- The 6am band. A gage usually has no controls edge at all,
|
||||
and the band renders nothing when it has nothing to say - it is
|
||||
here so the five asset pages stay one shape rather than five. -->
|
||||
<AssetTriageBand
|
||||
:assetid="tool.assetid"
|
||||
counterparttype="machine"
|
||||
counterpartlabel="Used on"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -169,6 +178,7 @@ import { ref, onMounted } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { colorStyle } from '@/utils/colorStyle'
|
||||
import { measuringtoolsApi } from '@/api'
|
||||
import AssetTriageBand from '@/components/AssetTriageBand.vue'
|
||||
import CustomFieldsSection from '@/components/CustomFieldsSection.vue'
|
||||
import PluginAssetPanels from '@/components/PluginAssetPanels.vue'
|
||||
import AssetRelationships from '@/components/AssetRelationships.vue'
|
||||
|
||||
@@ -68,6 +68,14 @@
|
||||
<span class="hero-detail-value">{{ device.businessunitname }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- The 6am band: what stops if this switch or AP goes down. A network
|
||||
device is rarely interesting in itself; it matters because of what
|
||||
sits behind it. -->
|
||||
<AssetTriageBand
|
||||
:assetid="device.assetid"
|
||||
counterparttype="machine"
|
||||
/>
|
||||
<div class="hero-features" v-if="device.networkdevice">
|
||||
<span v-if="device.networkdevice.ispoe" class="feature-badge poe">PoE</span>
|
||||
<span v-if="device.networkdevice.ismanaged" class="feature-badge managed">Managed</span>
|
||||
@@ -227,6 +235,7 @@ import { useAuthStore } from '@/stores/auth'
|
||||
import { networkApi } from '@/api'
|
||||
import { withBase } from '@/utils/basePath'
|
||||
import AssetRelationships from '@/components/AssetRelationships.vue'
|
||||
import AssetTriageBand from '@/components/AssetTriageBand.vue'
|
||||
import CustomFieldsSection from '@/components/CustomFieldsSection.vue'
|
||||
import PluginAssetPanels from '@/components/PluginAssetPanels.vue'
|
||||
import { useWarrantyBadge } from '@/composables/warrantyBadge'
|
||||
|
||||
@@ -66,6 +66,16 @@
|
||||
<span class="hero-detail-value mono">{{ ipAddress }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- The 6am band: which machine stops if this printer is down.
|
||||
A shop-floor printer is often a label or tag printer feeding one
|
||||
machine, and that link was only visible in the relationships
|
||||
card near the bottom of the page. -->
|
||||
<AssetTriageBand
|
||||
:assetid="printer.assetid"
|
||||
counterparttype="machine"
|
||||
:relationshiptypes="['usesprinter', 'defaultprinter']"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -301,6 +311,7 @@ import { useRoute, useRouter } from 'vue-router'
|
||||
import { printersApi } from '@/api'
|
||||
import { withBase } from '@/utils/basePath'
|
||||
import LocationMapTooltip from '@/components/LocationMapTooltip.vue'
|
||||
import AssetTriageBand from '@/components/AssetTriageBand.vue'
|
||||
import CustomFieldsSection from '@/components/CustomFieldsSection.vue'
|
||||
import PluginAssetPanels from '@/components/PluginAssetPanels.vue'
|
||||
import AssetRelationships from '@/components/AssetRelationships.vue'
|
||||
|
||||
Reference in New Issue
Block a user