2021-12-28 11:36:02 +00:00
|
|
|
{% extends "ereuse_devicehub/base_site.html" %}
|
|
|
|
{% block main %}
|
2021-12-29 09:57:39 +00:00
|
|
|
<link href="https://cdn.jsdelivr.net/npm/simple-datatables@latest/dist/style.css" rel="stylesheet" type="text/css">
|
2021-12-28 11:36:02 +00:00
|
|
|
|
|
|
|
<div class="pagetitle">
|
|
|
|
<h1>Inventory</h1>
|
|
|
|
<nav>
|
|
|
|
<ol class="breadcrumb">
|
2022-01-13 15:08:55 +00:00
|
|
|
<li class="breadcrumb-item"><a href="{{ url_for('inventory.devices.devicelist')}}">Inventory</a></li>
|
2021-12-30 21:39:56 +00:00
|
|
|
{% if not lot %}
|
2021-12-28 11:36:02 +00:00
|
|
|
<li class="breadcrumb-item active">Unassgined</li>
|
2021-12-30 21:39:56 +00:00
|
|
|
{% elif lot.is_temporary %}
|
2022-01-12 15:52:55 +00:00
|
|
|
<li class="breadcrumb-item active">Temporary Lot</li>
|
2021-12-30 21:39:56 +00:00
|
|
|
<li class="breadcrumb-item active">{{ lot.name }}</li>
|
2022-01-26 10:31:00 +00:00
|
|
|
{% elif lot.is_incoming %}
|
2021-12-30 21:39:56 +00:00
|
|
|
<li class="breadcrumb-item active">Incoming Lot</li>
|
|
|
|
<li class="breadcrumb-item active">{{ lot.name }}</li>
|
|
|
|
{% elif lot.is_outgoing %}
|
|
|
|
<li class="breadcrumb-item active">Outgoing Lot</li>
|
|
|
|
<li class="breadcrumb-item active">{{ lot.name }}</li>
|
|
|
|
{% endif %}
|
2021-12-28 11:36:02 +00:00
|
|
|
</ol>
|
|
|
|
</nav>
|
|
|
|
</div><!-- End Page Title -->
|
|
|
|
|
|
|
|
<section class="section profile">
|
|
|
|
<div class="row">
|
|
|
|
|
|
|
|
<div class="col-xl-12">
|
|
|
|
|
2022-01-05 10:10:32 +00:00
|
|
|
{% if lot %}
|
|
|
|
<div class="card">
|
|
|
|
<div class="card-body pt-3">
|
|
|
|
<!-- Bordered Tabs -->
|
|
|
|
|
|
|
|
<div class="col-12">
|
|
|
|
<h3><a href="{{ url_for('inventory.devices.lot_edit', id=lot.id) }}">{{ lot.name }}</a></h3>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2021-12-28 11:36:02 +00:00
|
|
|
<div class="card">
|
2022-02-03 09:28:15 +00:00
|
|
|
<div class="card-body pt-3" style="min-height: 650px;">
|
2021-12-28 11:36:02 +00:00
|
|
|
<!-- Bordered Tabs -->
|
|
|
|
|
2021-12-29 11:14:29 +00:00
|
|
|
<div class="btn-group dropdown ml-1">
|
2022-01-03 11:28:42 +00:00
|
|
|
{% if lot and lot.is_temporary and not lot.devices %}
|
2022-01-12 19:26:14 +00:00
|
|
|
<button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="modal" data-bs-target="#btnRemoveLots">
|
2022-01-03 11:28:42 +00:00
|
|
|
<i class="bi bi-trash"></i>
|
|
|
|
Remove Lot
|
|
|
|
<span class="caret"></span>
|
2022-01-12 19:26:14 +00:00
|
|
|
</button>
|
2022-01-03 11:28:42 +00:00
|
|
|
{% else %}
|
2021-12-29 11:14:29 +00:00
|
|
|
<button id="btnLots" type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
|
|
|
|
<i class="bi bi-folder2"></i>
|
|
|
|
Lots
|
|
|
|
<span class="caret"></span>
|
|
|
|
</button>
|
2022-01-03 11:28:42 +00:00
|
|
|
{% endif %}
|
2022-02-01 12:40:06 +00:00
|
|
|
<ul class="dropdown-menu" aria-labelledby="btnLots">
|
2021-12-29 11:14:29 +00:00
|
|
|
<li>
|
2021-12-29 12:02:39 +00:00
|
|
|
<a href="javascript:void()" class="dropdown-item" data-bs-toggle="modal" data-bs-target="#addingLotModal">
|
2021-12-29 11:14:29 +00:00
|
|
|
<i class="bi bi-plus"></i>
|
2022-02-02 11:21:30 +00:00
|
|
|
Add selected Devices to a lot
|
2021-12-29 11:14:29 +00:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
2021-12-29 12:02:39 +00:00
|
|
|
<a href="javascript:void()" class="dropdown-item" data-bs-toggle="modal" data-bs-target="#removeLotModal">
|
2021-12-29 11:14:29 +00:00
|
|
|
<i class="bi bi-x"></i>
|
2022-02-02 11:21:30 +00:00
|
|
|
Remove selected devices from a lot
|
2021-12-29 11:14:29 +00:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2021-12-28 11:36:02 +00:00
|
|
|
|
2021-12-29 11:14:29 +00:00
|
|
|
<div class="btn-group dropdown ml-1" uib-dropdown="">
|
|
|
|
<button id="btnActions" type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
|
|
|
|
<i class="bi bi-plus"></i>
|
|
|
|
New Actions
|
|
|
|
</button>
|
2022-01-10 09:33:41 +00:00
|
|
|
<span class="d-none" id="activeActionModal" data-bs-toggle="modal" data-bs-target="#actionModal"></span>
|
2022-01-10 14:53:11 +00:00
|
|
|
<span class="d-none" id="activeAllocateModal" data-bs-toggle="modal" data-bs-target="#allocateModal"></span>
|
2022-02-01 12:40:06 +00:00
|
|
|
<ul class="dropdown-menu" aria-labelledby="btnActions">
|
2021-12-29 11:14:29 +00:00
|
|
|
<li>
|
2022-01-03 12:25:35 +00:00
|
|
|
Status actions
|
|
|
|
</li>
|
|
|
|
<li>
|
2022-01-05 15:00:13 +00:00
|
|
|
<a href="javascript:newAction('Recycling')" class="dropdown-item">
|
2022-01-03 12:25:35 +00:00
|
|
|
<i class="bi bi-recycle"></i>
|
|
|
|
Recycling
|
2021-12-29 11:14:29 +00:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
2022-01-03 12:40:30 +00:00
|
|
|
<a href="javascript:newAction('Use')" class="dropdown-item">
|
2022-01-03 12:25:35 +00:00
|
|
|
<i class="bi bi-play-circle-fill"></i>
|
|
|
|
Use
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
2022-01-03 12:40:30 +00:00
|
|
|
<a href="javascript:newAction('Refurbish')" class="dropdown-item">
|
2022-01-03 12:25:35 +00:00
|
|
|
<i class="bi bi-tools"></i>
|
|
|
|
Refurbish
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
2022-01-03 12:40:30 +00:00
|
|
|
<a href="javascript:newAction('Management')" class="dropdown-item">
|
2022-01-03 12:25:35 +00:00
|
|
|
<i class="bi bi-mastodon"></i>
|
|
|
|
Management
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
Allocation
|
|
|
|
</li>
|
|
|
|
<li>
|
2022-01-10 14:53:11 +00:00
|
|
|
<a href="javascript:newAllocate('Allocate')" class="dropdown-item">
|
2022-01-03 12:25:35 +00:00
|
|
|
<i class="bi bi-house-fill"></i>
|
|
|
|
Allocate
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
2022-01-10 14:53:11 +00:00
|
|
|
<a href="javascript:newAllocate('Deallocate')" class="dropdown-item">
|
2022-01-03 12:25:35 +00:00
|
|
|
<i class="bi bi-house"></i>
|
|
|
|
Deallocate
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
Physical actions
|
|
|
|
</li>
|
|
|
|
<li>
|
2022-01-03 12:40:30 +00:00
|
|
|
<a href="javascript:newAction('ToPrepare')" class="dropdown-item">
|
2022-01-03 12:25:35 +00:00
|
|
|
<i class="bi bi-tools"></i>
|
|
|
|
ToPrepare
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
2022-01-03 12:40:30 +00:00
|
|
|
<a href="javascript:newAction('Prepare')" class="dropdown-item">
|
2022-01-03 12:25:35 +00:00
|
|
|
<i class="bi bi-egg"></i>
|
|
|
|
Prepare
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
2022-02-03 09:51:48 +00:00
|
|
|
<a href="javascript:void()" class="dropdown-item">
|
2022-01-03 12:25:35 +00:00
|
|
|
<i class="bi bi-eraser-fill"></i>
|
|
|
|
DataWipe
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
2022-01-03 12:40:30 +00:00
|
|
|
<a href="javascript:newAction('ToRepair')" class="dropdown-item">
|
2022-01-03 12:25:35 +00:00
|
|
|
<i class="bi bi-screwdriver"></i>
|
|
|
|
ToRepair
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
2022-01-03 12:40:30 +00:00
|
|
|
<a href="javascript:newAction('Ready')" class="dropdown-item">
|
2022-01-03 12:25:35 +00:00
|
|
|
<i class="bi bi-check2-all"></i>
|
|
|
|
Ready
|
2021-12-29 11:14:29 +00:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2021-12-28 11:36:02 +00:00
|
|
|
|
2021-12-29 11:14:29 +00:00
|
|
|
<div class="btn-group dropdown ml-1" uib-dropdown="">
|
|
|
|
<button id="btnExport" type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
|
|
|
|
<i class="bi bi-reply"></i>
|
|
|
|
Exports
|
|
|
|
</button>
|
2022-01-18 12:47:17 +00:00
|
|
|
<ul class="dropdown-menu" aria-labelledby="btnExport">
|
2021-12-29 11:14:29 +00:00
|
|
|
<li>
|
2022-02-02 11:21:30 +00:00
|
|
|
<a href="#" class="dropdown-item">
|
|
|
|
TODO: Not implemented
|
2021-12-29 11:14:29 +00:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2021-12-28 11:36:02 +00:00
|
|
|
|
2021-12-29 11:14:29 +00:00
|
|
|
<div class="btn-group dropdown ml-1" uib-dropdown="">
|
|
|
|
<button id="btnTags" type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
|
|
|
|
<i class="bi bi-tag"></i>
|
|
|
|
Tags
|
|
|
|
</button>
|
2022-01-18 12:47:17 +00:00
|
|
|
<ul class="dropdown-menu" aria-labelledby="btnTags">
|
2021-12-29 11:14:29 +00:00
|
|
|
<li>
|
2022-01-25 11:53:36 +00:00
|
|
|
<a href="javascript:void()" class="dropdown-item" data-bs-toggle="modal" data-bs-target="#addingTagModal">
|
2021-12-29 11:14:29 +00:00
|
|
|
<i class="bi bi-plus"></i>
|
2022-02-02 11:21:30 +00:00
|
|
|
Add Tag to selected Devices
|
2021-12-29 11:14:29 +00:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
2022-01-25 13:39:15 +00:00
|
|
|
<a href="javascript:removeTag()" class="dropdown-item">
|
2021-12-29 11:14:29 +00:00
|
|
|
<i class="bi bi-x"></i>
|
2022-02-02 11:21:30 +00:00
|
|
|
Remove Tag from selected Devices
|
2021-12-29 11:14:29 +00:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2021-12-28 11:36:02 +00:00
|
|
|
|
2022-01-18 12:47:17 +00:00
|
|
|
<div class="btn-group dropdown ml-1" uib-dropdown="">
|
|
|
|
<button id="btnSnapshot" type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
|
|
|
|
<i class="bi bi-tag"></i>
|
|
|
|
New Device
|
|
|
|
</button>
|
|
|
|
<ul class="dropdown-menu" aria-labelledby="btnSnapshot">
|
|
|
|
<li>
|
|
|
|
<a href="{{ url_for('inventory.devices.upload_snapshot') }}" class="dropdown-item">
|
|
|
|
<i class="bi bi-plus"></i>
|
|
|
|
Upload a new Snapshot
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
2022-01-19 12:40:40 +00:00
|
|
|
<a href="{{ url_for('inventory.devices.device_add') }}" class="dropdown-item">
|
2022-01-18 12:47:17 +00:00
|
|
|
<i class="bi bi-plus"></i>
|
|
|
|
Create a new Device
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
|
2021-12-28 11:36:02 +00:00
|
|
|
<div class="tab-content pt-2">
|
|
|
|
|
|
|
|
<div class="tab-pane fade show active profile-overview" id="profile-overview">
|
|
|
|
|
|
|
|
<h5 class="card-title">Computers</h5>
|
2021-12-29 09:57:39 +00:00
|
|
|
<table class="table">
|
2021-12-28 13:14:02 +00:00
|
|
|
<thead>
|
|
|
|
<tr>
|
2021-12-29 09:13:03 +00:00
|
|
|
<th scope="col">Select all</th>
|
2021-12-28 13:14:02 +00:00
|
|
|
<th scope="col">Title</th>
|
|
|
|
<th scope="col">DHID</th>
|
|
|
|
<th scope="col">Tags</th>
|
|
|
|
<th scope="col">Status</th>
|
2021-12-29 09:57:39 +00:00
|
|
|
<th scope="col" data-type="date" data-format="DD-MM-YYYY">Update</th>
|
2021-12-28 13:14:02 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for dev in devices %}
|
|
|
|
<tr>
|
2022-02-04 10:30:29 +00:00
|
|
|
<td>
|
|
|
|
<input type="checkbox" class="deviceSelect" data="{{ dev.id }}"
|
|
|
|
data-device-type="{{ dev.type }}" data-device-manufacturer="{{ dev.manufacturer }}"
|
2022-02-04 12:16:27 +00:00
|
|
|
data-device-dhid="{{ dev.devicehub_id }}"
|
|
|
|
{% if form_new_allocate.type.data and dev.id in list_devices %}
|
|
|
|
checked="checked"
|
|
|
|
{% endif %}
|
|
|
|
/>
|
2022-02-04 10:30:29 +00:00
|
|
|
</td>
|
2022-01-27 13:13:20 +00:00
|
|
|
<td>
|
|
|
|
<a href="{{ url_for('inventory.devices.device_details', id=dev.devicehub_id)}}">
|
|
|
|
{{ dev.type }} {{ dev.manufacturer }} {{ dev.model }}
|
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<a href="{{ url_for('inventory.devices.device_details', id=dev.devicehub_id)}}">
|
|
|
|
{{ dev.devicehub_id }}
|
|
|
|
</a>
|
|
|
|
</td>
|
2021-12-28 13:14:02 +00:00
|
|
|
<td>
|
2022-01-12 19:45:49 +00:00
|
|
|
{% for t in dev.tags | sort(attribute="id") %}
|
2022-01-27 13:13:20 +00:00
|
|
|
<a href="{{ url_for('inventory.devices.tag_details', id=t.id)}}">{{ t.id }}</a>
|
|
|
|
{% if not loop.last %},{% endif %}
|
2021-12-28 13:14:02 +00:00
|
|
|
{% endfor %}
|
|
|
|
</td>
|
|
|
|
<td>{% if dev.status %}{{ dev.status }}{% endif %}</td>
|
|
|
|
<td>{{ dev.updated.strftime('%H:%M %d-%m-%Y') }}</td>
|
|
|
|
</tr>
|
2021-12-28 12:55:56 +00:00
|
|
|
{% endfor %}
|
2021-12-28 13:14:02 +00:00
|
|
|
</tbody>
|
2021-12-29 09:57:39 +00:00
|
|
|
</table>
|
2021-12-28 11:36:02 +00:00
|
|
|
|
|
|
|
</div><!-- End Bordered Tabs -->
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|
2022-01-12 19:26:14 +00:00
|
|
|
{% include "inventory/addDeviceslot.html" %}
|
2022-01-25 11:53:36 +00:00
|
|
|
{% include "inventory/addDevicestag.html" %}
|
2022-01-12 19:26:14 +00:00
|
|
|
{% include "inventory/removeDeviceslot.html" %}
|
|
|
|
{% include "inventory/removelot.html" %}
|
2022-01-04 11:56:28 +00:00
|
|
|
{% include "inventory/actions.html" %}
|
2022-01-10 14:53:11 +00:00
|
|
|
{% include "inventory/allocate.html" %}
|
2021-12-29 12:02:39 +00:00
|
|
|
|
2021-12-29 09:57:39 +00:00
|
|
|
<!-- CDN -->
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/simple-datatables@latest"></script>
|
|
|
|
<!-- Custom Code -->
|
|
|
|
<script>
|
|
|
|
const table = new simpleDatatables.DataTable("table")
|
|
|
|
</script>
|
2021-12-30 11:41:37 +00:00
|
|
|
<script>
|
|
|
|
|
|
|
|
</script>
|
|
|
|
<script src="{{ url_for('static', filename='js/jquery-3.6.0.min.js') }}"></script>
|
|
|
|
<script src="{{ url_for('static', filename='js/main_inventory.js') }}"></script>
|
2021-12-28 11:36:02 +00:00
|
|
|
{% endblock main %}
|