2022-01-13 15:08:55 +00:00
|
|
|
{% extends "ereuse_devicehub/base_site.html" %}
|
|
|
|
{% block main %}
|
|
|
|
|
|
|
|
<div class="pagetitle">
|
|
|
|
<h1>Inventory</h1>
|
|
|
|
<nav>
|
|
|
|
<ol class="breadcrumb">
|
2022-03-15 13:33:27 +00:00
|
|
|
<li class="breadcrumb-item"><a href="{{ url_for('inventory.devicelist')}}">Inventory</a></li>
|
2022-02-02 11:21:30 +00:00
|
|
|
<li class="breadcrumb-item active">{{ page_title }}</li>
|
2022-01-13 15:08:55 +00:00
|
|
|
</ol>
|
|
|
|
</nav>
|
|
|
|
</div><!-- End Page Title -->
|
|
|
|
|
|
|
|
<section class="section profile">
|
|
|
|
<div class="row">
|
|
|
|
|
|
|
|
<div class="col-xl-12">
|
|
|
|
|
|
|
|
<div class="card">
|
|
|
|
<div class="card-body pt-3">
|
|
|
|
<h3>{{ device.devicehub_id }}</h3>
|
|
|
|
<!-- Bordered Tabs -->
|
|
|
|
<ul class="nav nav-tabs nav-tabs-bordered">
|
|
|
|
|
2022-07-18 10:56:33 +00:00
|
|
|
{% if placeholder %}
|
2022-01-13 15:08:55 +00:00
|
|
|
<li class="nav-item">
|
2022-07-15 14:47:39 +00:00
|
|
|
<a class="nav-link" href="{{ url_for('inventory.device_details', id=placeholder.device.devicehub_id) }}">Placeholder device</a>
|
2022-01-13 15:08:55 +00:00
|
|
|
</li>
|
2022-07-18 10:56:33 +00:00
|
|
|
{% else %}
|
|
|
|
<li class="nav-item">
|
|
|
|
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#type">General details</button>
|
|
|
|
</li>
|
|
|
|
{% endif %}
|
2022-01-13 15:08:55 +00:00
|
|
|
|
2022-07-15 14:47:39 +00:00
|
|
|
{% if placeholder.binding %}
|
|
|
|
<li class="nav-item">
|
2022-08-10 16:05:18 +00:00
|
|
|
<a class="nav-link" href="{# url_for('inventory.device_details', id=placeholder.binding.devicehub_id) #}">Workbench device</a>
|
2022-07-15 14:47:39 +00:00
|
|
|
</li>
|
|
|
|
{% endif %}
|
|
|
|
|
2022-05-05 10:00:40 +00:00
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link" href="{{ device.public_link }}" target="_blank">Web</a>
|
|
|
|
</li>
|
|
|
|
|
2022-05-05 10:31:29 +00:00
|
|
|
<li class="nav-item">
|
|
|
|
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#lots">Lots</button>
|
|
|
|
</li>
|
|
|
|
|
2022-01-13 15:08:55 +00:00
|
|
|
<li class="nav-item">
|
|
|
|
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#status">Status</button>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li class="nav-item">
|
|
|
|
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#rate">Rate</button>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li class="nav-item">
|
|
|
|
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#traceability">Traceability log</button>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li class="nav-item">
|
|
|
|
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#components">Components</button>
|
|
|
|
</li>
|
|
|
|
|
2022-08-09 08:49:56 +00:00
|
|
|
{% if device.is_abstract() == 'Abstract' %}
|
2022-07-28 15:48:14 +00:00
|
|
|
<li class="nav-item">
|
|
|
|
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#binding">Binding</button>
|
|
|
|
</li>
|
|
|
|
{% endif %}
|
|
|
|
|
2022-08-09 08:49:56 +00:00
|
|
|
{% if device.is_abstract() == 'Twin' %}
|
2022-07-29 15:02:27 +00:00
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link" href="{{ url_for('inventory.unbinding', phid=placeholder.phid) }}">Unbinding</a>
|
|
|
|
</li>
|
|
|
|
{% endif %}
|
|
|
|
|
2022-01-13 15:08:55 +00:00
|
|
|
</ul>
|
|
|
|
<div class="tab-content pt-2">
|
|
|
|
|
2022-07-28 15:48:14 +00:00
|
|
|
<div class="tab-pane fade {% if active_binding %}profile-overview{% else %}show active{% endif %}" id="type">
|
2022-07-05 16:09:47 +00:00
|
|
|
<h5 class="card-title">Details</h5>
|
2022-08-08 16:09:25 +00:00
|
|
|
{% if device.placeholder %}
|
|
|
|
<div class="row mb-3">
|
|
|
|
<div class="col-lg-3 col-md-4 label ">
|
|
|
|
(<a href="{{ url_for('inventory.device_edit', id=device.devicehub_id)}}">Edit Device</a>)
|
|
|
|
</div>
|
|
|
|
<div class="col-lg-9 col-md-8">{{ device.is_abstract() }}</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if device.placeholder %}
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-3 col-md-4 label ">Phid</div>
|
|
|
|
<div class="col-lg-9 col-md-8">{{ device.placeholder.phid }}</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2022-01-13 15:08:55 +00:00
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-3 col-md-4 label ">Type</div>
|
|
|
|
<div class="col-lg-9 col-md-8">{{ device.type }}</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-3 col-md-4 label">Manufacturer</div>
|
2022-08-09 08:49:56 +00:00
|
|
|
<div class="col-lg-9 col-md-8">{{ device.manufacturer or ''}}</div>
|
2022-01-13 15:08:55 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-3 col-md-4 label">Model</div>
|
2022-08-09 08:49:56 +00:00
|
|
|
<div class="col-lg-9 col-md-8">{{ device.model or ''}}</div>
|
2022-01-13 15:08:55 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-3 col-md-4 label">Serial Number</div>
|
2022-08-09 08:49:56 +00:00
|
|
|
<div class="col-lg-9 col-md-8">{{ device.serial_number or ''}}</div>
|
2022-01-13 15:08:55 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-05-05 10:31:29 +00:00
|
|
|
<div class="tab-pane fade profile-overview" id="lots">
|
|
|
|
<h5 class="card-title">Incoming Lots</h5>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
{% for lot in device.lots %}
|
|
|
|
{% if lot.is_incoming %}
|
|
|
|
<div class="col">
|
|
|
|
<a class="ms-3" href="{{ url_for('inventory.lotdevicelist', lot_id=lot.id) }}">
|
|
|
|
<span>{{ lot.name }}</span>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<h5 class="card-title">Outgoing Lots</h5>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
{% for lot in device.lots %}
|
|
|
|
{% if lot.is_outgoing %}
|
|
|
|
<div class="col">
|
|
|
|
<a class="ms-3" href="{{ url_for('inventory.lotdevicelist', lot_id=lot.id) }}">
|
|
|
|
<span>{{ lot.name }}</span>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<h5 class="card-title">Temporary Lots</h5>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
{% for lot in device.lots %}
|
|
|
|
{% if lot.is_temporary %}
|
|
|
|
<div class="col">
|
|
|
|
<a class="ms-3" href="{{ url_for('inventory.lotdevicelist', lot_id=lot.id) }}">
|
|
|
|
<span>{{ lot.name }}</span>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-01-13 15:08:55 +00:00
|
|
|
<div class="tab-pane fade profile-overview" id="status">
|
|
|
|
<h5 class="card-title">Status Details</h5>
|
|
|
|
<div class="row">
|
2022-05-13 11:06:04 +00:00
|
|
|
<div class="col-lg-3 col-md-4 label">Physical State</div>
|
2022-05-13 11:11:00 +00:00
|
|
|
<div class="col-lg-9 col-md-8">
|
|
|
|
{% if device.physical_status %}
|
|
|
|
{{ device.physical_status.type }}
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
2022-01-13 15:08:55 +00:00
|
|
|
</div>
|
|
|
|
<div class="row">
|
2022-05-13 15:16:08 +00:00
|
|
|
<div class="col-lg-3 col-md-4 label">Lifecycle State</div>
|
2022-05-13 11:11:00 +00:00
|
|
|
<div class="col-lg-9 col-md-8">
|
|
|
|
{% if device.status %}
|
|
|
|
{{ device.status.type }}
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
2022-01-13 15:08:55 +00:00
|
|
|
</div>
|
|
|
|
<div class="row">
|
2022-05-13 15:16:08 +00:00
|
|
|
<div class="col-lg-3 col-md-4 label">Allocated State</div>
|
2022-05-13 11:11:00 +00:00
|
|
|
<div class="col-lg-9 col-md-8">
|
|
|
|
{% if device.allocated_status %}
|
|
|
|
{{ device.allocated_status.type }}
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
2022-01-13 15:08:55 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="tab-pane fade profile-overview" id="rate">
|
|
|
|
<h5 class="card-title">Rate Details</h5>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-3 col-md-4 label">Rating</div>
|
|
|
|
<div class="col-lg-9 col-md-8">{{ device.rate or '' }}</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-3 col-md-4 label">Processor</div>
|
|
|
|
<div class="col-lg-9 col-md-8">{{ device.rate.processor or '' }}</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-3 col-md-4 label">RAM</div>
|
|
|
|
<div class="col-lg-9 col-md-8">{{ device.rate.ram or '' }}</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-3 col-md-4 label">Data storage</div>
|
|
|
|
<div class="col-lg-9 col-md-8">{{ device.rate.data_storage or '' }}</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="tab-pane fade profile-overview" id="traceability">
|
|
|
|
<h5 class="card-title">Traceability log Details</h5>
|
|
|
|
<div class="list-group col-6">
|
2022-02-02 12:27:53 +00:00
|
|
|
{% for action in device.reverse_actions %}
|
2022-01-13 15:08:55 +00:00
|
|
|
<div class="list-group-item d-flex justify-content-between align-items-center">
|
|
|
|
{{ action.type }} {{ action.severity }}
|
|
|
|
<small class="text-muted">{{ action.created.strftime('%H:%M %d-%m-%Y') }}</small>
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="tab-pane fade profile-overview" id="components">
|
|
|
|
<h5 class="card-title">Components Details</h5>
|
2022-08-09 08:49:56 +00:00
|
|
|
{% if device.binding %}
|
2022-01-13 15:08:55 +00:00
|
|
|
<div class="list-group col-6">
|
|
|
|
{% for component in device.components|sort(attribute='type') %}
|
|
|
|
<div class="list-group-item">
|
|
|
|
<div class="d-flex w-100 justify-content-between">
|
|
|
|
<h5 class="mb-1">{{ component.type }}</h5>
|
|
|
|
<small class="text-muted">{{ component.created.strftime('%H:%M %d-%m-%Y') }}</small>
|
|
|
|
</div>
|
|
|
|
<p class="mb-1">
|
|
|
|
{{ component.manufacturer }}<br />
|
|
|
|
{{ component.model }}<br />
|
|
|
|
</p>
|
|
|
|
<small class="text-muted">
|
|
|
|
{% if component.type in ['RamModule', 'HardDrive', 'SolidStateDrive'] %}
|
|
|
|
{{ component.size }}MB
|
|
|
|
{% endif %}
|
|
|
|
</small>
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
2022-08-09 08:49:56 +00:00
|
|
|
{% else %}
|
|
|
|
<div class="col-6">
|
|
|
|
{{ device.placeholder.components or '' }}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2022-01-13 15:08:55 +00:00
|
|
|
</div>
|
2022-08-09 08:49:56 +00:00
|
|
|
{% if device.is_abstract() %}
|
2022-07-28 15:48:14 +00:00
|
|
|
<div class="tab-pane fade {% if active_binding %}show active{% else %}profile-overview{% endif %}" id="binding">
|
|
|
|
<h5 class="card-title">Binding</h5>
|
|
|
|
<div class="list-group col-6">
|
|
|
|
<p>
|
|
|
|
Be careful, binding implies changes in the data of a device that affect its
|
|
|
|
traceability.
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<div class="list-group col-6">
|
2022-08-09 08:49:56 +00:00
|
|
|
<form action="{{ url_for('inventory.device_details', id=device.devicehub_id) }}" method="post">
|
2022-07-28 15:48:14 +00:00
|
|
|
{{ form_binding.csrf_token }}
|
|
|
|
{% for field in form_binding %}
|
|
|
|
{% if field != form_binding.csrf_token %}
|
|
|
|
|
|
|
|
<div class="col-12">
|
|
|
|
{{ field.label(class_="form-label") }}:
|
|
|
|
{{ field }}
|
|
|
|
{% if field.errors %}
|
|
|
|
<p class="text-danger">
|
|
|
|
{% for error in field.errors %}
|
|
|
|
{{ error }}<br/>
|
|
|
|
{% endfor %}
|
|
|
|
</p>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
<div class="col-12 mt-2">
|
|
|
|
<input type="submit" class="btn btn-primary" value="Search" />
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2022-01-13 15:08:55 +00:00
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
{% endblock main %}
|