{% extends "base.html" %}{% from "_inventory_forms.html" import field, interface_form, remove, device_kind %} {% block title %}{{ asset.name if asset else 'Add infrastructure' }} · Keywright{% endblock %}{% block body %} {% include "_infrastructure_nav.html" %}

{{ asset.name if asset else 'Add device or workload' }}

Back to inventory

{{ 'Manage hosting, interfaces, addresses, and linked resources.' if asset else 'Create the host or workload first, then add its interfaces and IP allocations.' }}

{% if asset %}
Maintenance Reviewed inventoryReachability Unknown · not monitoredUpdated {{ asset.updated_at.strftime('%Y-%m-%d %H:%M') }} UTC
{% if discovery_sources.get(asset.id) %}

Discovery sources

{% for source in discovery_sources[asset.id] %}

{{ source.resource.name }} · {{ source.observation.data.name }} · observed {{ source.observation.last_seen.strftime('%Y-%m-%d %H:%M') }} UTC · reviewed {{ source.link.reviewed_at.strftime('%Y-%m-%d %H:%M') }} UTC{% if source.link.reviewed_data != source.observation.data %}Needs review{% endif %}

{% endfor %}
{% endif %}{% endif %}
{% if values.get('resource_id') %}

The selected resource will be linked when this record is created.

{% endif %} {{ field('name','Name',values,asset.name if asset else '',required=true) }} {{ device_kind('asset-kind',kinds,values.get('kind',asset.kind if asset else 'physical'),'Device / workload type') }}
The physical host, VM, or container running this workload.
{{ field('site','Site / location',values,asset.site if asset else '') }}
{{ field('tags','Tags (comma separated)',values,asset.tags if asset else '',maxlength=500) }}
{% if asset %} {% set back='/ui/inventory/assets/' ~ asset.id %} {% if children %}

Hosted workloads

{% for child in children %}{{ child.name }}{% endfor %}View topology
{% endif %}

Network interfaces

{% for iface in asset_interfaces %}
{{ iface.name }} · {{ media[iface.medium] }}{% if iface.attached_to_id %} · {{ asset_map[iface.attached_to_id].name }}{% endif %}{% if iface.port %} · {{ iface.port }}{% endif %} {{ interface_form(asset,iface,interface_values if interface_values and interface_values.get('id')==iface.id else {},assets,media) }}
{{ remove('interface',iface.id,back,'Remove interface') }}
{% else %}

No interfaces recorded. Add one to assign this device an IP address.

{% endfor %}
Add interface{{ interface_form(asset,none,interface_values if interface_values and not interface_values.get('id') else {},assets,media) }}

IP allocations

Manage subnets & allocations
{% if asset_allocations %} {% for allocation in asset_allocations %}{% endfor %}
AddressNetworkInterfaceAllocation
{{ allocation.address }}{{ subnet_map[allocation.subnet_id].name }}{{ interface_map[allocation.interface_id].name }}{{ states[allocation.state] }}
{% else %}

No addresses recorded. Open a subnet to reserve or assign an IP to an interface.

{% endif %}

Linked resources

{% for resource in asset_resources %}
{{ resource.name }}{{ resource.kind|upper }}{{ remove('link',resource.id,back,'Unlink') }}
{% else %}

No resources linked. Inventory records do not grant agent access.

{% endfor %} {% if unlinked_resources %}
{% endif %}
{{ remove('asset',asset.id,back,'Remove from inventory') }}

Remove or reassign interfaces, child workloads, and resource links first. This does not delete the actual device.

{% endif %} {% endblock %} {% block scripts %}{% include "_device_kind_picker.html" %}{% endblock %}