2022-09-20 08:27:02 +00:00
|
|
|
|
{% extends "ereuse_devicehub/base_site.html" %}
|
|
|
|
|
{% block main %}
|
|
|
|
|
|
|
|
|
|
<div class="pagetitle">
|
|
|
|
|
<h1>Inventory</h1>
|
|
|
|
|
<nav>
|
|
|
|
|
<ol class="breadcrumb">
|
|
|
|
|
<li class="breadcrumb-item"><a href="{{ url_for('inventory.devicelist')}}">Inventory</a></li>
|
|
|
|
|
<li class="breadcrumb-item active">Erasures disks</li>
|
|
|
|
|
</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" style="min-height: 650px;">
|
2022-11-18 17:46:10 +00:00
|
|
|
|
<ul class="nav nav-tabs nav-tabs-bordered">
|
|
|
|
|
|
|
|
|
|
<li class="nav-item">
|
2022-11-21 12:24:56 +00:00
|
|
|
|
<a href="{{ url_for('inventory.device_erasure_list') }}" class="nav-link{% if not orphans %} active{% endif %}">
|
|
|
|
|
All hard drivers
|
|
|
|
|
</a>
|
2022-11-18 17:46:10 +00:00
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
<li class="nav-item">
|
2022-11-21 12:24:56 +00:00
|
|
|
|
<a href="{{ url_for('inventory.device_erasure_list_orphans', orphans=1) }}" class="nav-link{% if orphans %} active{% endif %}">
|
|
|
|
|
Hard drives without device
|
|
|
|
|
</a>
|
2022-11-18 17:46:10 +00:00
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
<div class="tab-content pt-2">
|
2022-09-20 08:27:02 +00:00
|
|
|
|
<div id="devices-list" class="tab-pane fade devices-list active show">
|
|
|
|
|
<label class="btn btn-primary " for="SelectAllBTN"><input type="checkbox" id="SelectAllBTN" autocomplete="off"></label>
|
2022-11-21 12:24:56 +00:00
|
|
|
|
{% if orphans %}
|
|
|
|
|
<div class="btn-group dropdown ml-1">
|
|
|
|
|
<button id="btnLots" type="button" onclick="processSelectedDevices()" 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>
|
|
|
|
|
<span class="d-none" id="activeTradeModal" data-bs-toggle="modal" data-bs-target="#tradeLotModal"></span>
|
|
|
|
|
|
|
|
|
|
<ul class="dropdown-menu" aria-labelledby="btnLots" id="dropDownLotsSelector">
|
|
|
|
|
<div class="row w-100">
|
|
|
|
|
<div class="input-group mb-3 mx-2">
|
|
|
|
|
<div class="input-group-prepend">
|
|
|
|
|
<span class="input-group-text" id="basic-addon1"><i class="bi bi-search"></i></span>
|
|
|
|
|
</div>
|
|
|
|
|
<input type="text" class="form-control" id="lots-search" placeholder="search" aria-label="search" aria-describedby="basic-addon1">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<h6 class="dropdown-header">Select lots where to store the selected devices</h6>
|
|
|
|
|
<ul class="mx-3" id="LotsSelector"></ul>
|
|
|
|
|
<li><hr /></li>
|
|
|
|
|
<li>
|
|
|
|
|
<a href="#" class="dropdown-item" id="ApplyDeviceLots">
|
|
|
|
|
<i class="bi bi-check"></i>
|
|
|
|
|
Apply
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
{% endif %}
|
2022-09-20 08:27:02 +00:00
|
|
|
|
<div class="btn-group dropdown m-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>
|
|
|
|
|
<span class="d-none" id="exportAlertModal" data-bs-toggle="modal" data-bs-target="#exportErrorModal"></span>
|
|
|
|
|
<ul class="dropdown-menu" aria-labelledby="btnExport">
|
|
|
|
|
<li>
|
2022-09-21 09:35:31 +00:00
|
|
|
|
<a href="javascript:export_actions_erasure('actions_erasures')" class="dropdown-item">
|
2022-09-20 08:27:02 +00:00
|
|
|
|
<i class="bi bi-file-spreadsheet"></i>
|
2022-09-20 15:36:09 +00:00
|
|
|
|
Data Storage Spreadsheet
|
2022-09-20 08:27:02 +00:00
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<a href="javascript:export_file('certificates')" class="dropdown-item">
|
|
|
|
|
<i class="bi bi-eraser-fill"></i>
|
|
|
|
|
Erasure Certificate
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
2022-11-21 12:24:56 +00:00
|
|
|
|
{% if orphans %}
|
|
|
|
|
<div class="btn-group dropdown m-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>
|
|
|
|
|
Labels
|
|
|
|
|
</button>
|
|
|
|
|
<ul class="dropdown-menu" aria-labelledby="btnTags">
|
|
|
|
|
<li>
|
|
|
|
|
<form id="print_labels" method="post" action="{{ url_for('labels.print_labels') }}">
|
|
|
|
|
{% for f in form_print_labels %}
|
|
|
|
|
{{ f }}
|
|
|
|
|
{% endfor %}
|
|
|
|
|
<a href="javascript:$('#print_labels').submit()" class="dropdown-item">
|
|
|
|
|
<i class="bi bi-printer"></i>
|
|
|
|
|
Print labels
|
|
|
|
|
</a>
|
|
|
|
|
</form>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
{% endif %}
|
2022-09-20 08:27:02 +00:00
|
|
|
|
|
|
|
|
|
<div class="tab-content pt-2">
|
2022-11-23 12:36:34 +00:00
|
|
|
|
<div class="dataTable-top">
|
|
|
|
|
<div class="dataTable-dropdown">
|
|
|
|
|
<label>
|
|
|
|
|
<select class="dataTable-selector">
|
|
|
|
|
<option value="5"{% if erasure.per_page == 5 %} selected="selected"{% endif %}>
|
|
|
|
|
5
|
|
|
|
|
</option>
|
|
|
|
|
<option value="10"{% if erasure.per_page == 10 %} selected="selected"{% endif %}>
|
|
|
|
|
10
|
|
|
|
|
</option>
|
|
|
|
|
<option value="15"{% if erasure.per_page == 15 %} selected="selected"{% endif %}>
|
|
|
|
|
15
|
|
|
|
|
</option>
|
|
|
|
|
<option value="20"{% if erasure.per_page == 20 %} selected="selected"{% endif %}>
|
|
|
|
|
20
|
|
|
|
|
</option>
|
|
|
|
|
<option value="25"{% if erasure.per_page == 25 %} selected="selected"{% endif %}>
|
|
|
|
|
25
|
|
|
|
|
</option>
|
|
|
|
|
<option value="50"{% if erasure.per_page == 50 %} selected="selected"{% endif %}>
|
|
|
|
|
50
|
|
|
|
|
</option>
|
|
|
|
|
<option value="100"{% if erasure.per_page == 100 %} selected="selected"{% endif %}>
|
|
|
|
|
100
|
|
|
|
|
</option>
|
|
|
|
|
</select> entries per page
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="dataTable-search">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2022-11-23 15:13:30 +00:00
|
|
|
|
<div class="dataTable-container">
|
2022-09-20 08:27:02 +00:00
|
|
|
|
<table class="table">
|
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
<th scope="col">Select</th>
|
|
|
|
|
<th scope="col">Data Storage Serial</th>
|
2022-10-26 09:26:09 +00:00
|
|
|
|
<th scope="col">DHID</th>
|
2022-09-20 08:27:02 +00:00
|
|
|
|
<th scope="col">Snapshot ID</th>
|
2022-09-20 15:36:09 +00:00
|
|
|
|
<th scope="col">Type of Erasure</th>
|
|
|
|
|
<th scope="col">PHID Erasure Host</th>
|
|
|
|
|
<th scope="col">Result</th>
|
2022-09-20 08:27:02 +00:00
|
|
|
|
<th scope="col" data-type="date" data-format="YYYY-MM-DD hh:mm:ss">Time</th>
|
|
|
|
|
<th scope="col"></th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
2022-11-23 12:36:34 +00:00
|
|
|
|
{% for ac in erasure.items %}
|
2022-09-20 08:27:02 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<td>
|
|
|
|
|
<input type="checkbox" class="deviceSelect" data="{{ ac.device.id }}"
|
|
|
|
|
data-device-type="{{ ac.device.type }}" data-device-manufacturer="{{ ac.device.manufacturer }}"
|
2022-09-20 14:02:25 +00:00
|
|
|
|
data-device-dhid="{{ ac.device.dhid }}" data-device-vname="{{ ac.device.verbose_name }}"
|
2022-09-21 09:35:31 +00:00
|
|
|
|
data-action-erasure="{{ ac.id }}"
|
2022-09-20 08:27:02 +00:00
|
|
|
|
{% if form_new_allocate.type.data and ac.device.id in list_devices %}
|
|
|
|
|
checked="checked"
|
|
|
|
|
{% endif %}
|
|
|
|
|
/>
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
2022-10-25 09:10:39 +00:00
|
|
|
|
{% if ac.device.phid() %}
|
2022-09-20 08:27:02 +00:00
|
|
|
|
<a href="{{ url_for('inventory.device_details', id=ac.device.dhid)}}">
|
2022-11-21 14:14:02 +00:00
|
|
|
|
{% if ac.device.get_type_logo() %}
|
|
|
|
|
<i class="{{ ac.device.get_type_logo() }}" title="{{ ac.device.type }}"></i>
|
|
|
|
|
{% endif %}
|
2022-09-20 08:27:02 +00:00
|
|
|
|
{{ ac.device.serial_number.upper() }}
|
|
|
|
|
</a>
|
2022-10-25 09:10:39 +00:00
|
|
|
|
{% else %}
|
2022-11-21 14:14:02 +00:00
|
|
|
|
{% if ac.device.get_type_logo() %}
|
|
|
|
|
<i class="{{ ac.device.get_type_logo() }}" title="{{ ac.device.type }}"></i>
|
|
|
|
|
{% endif %}
|
2022-10-25 09:10:39 +00:00
|
|
|
|
{{ ac.device.serial_number.upper() }}
|
|
|
|
|
{% endif %}
|
2022-11-21 14:14:02 +00:00
|
|
|
|
{% if ac.device.lots | length > 0 %}
|
|
|
|
|
<h6 class="d-inline">
|
|
|
|
|
{% for lot in ac.device.get_lots_for_template() %}
|
|
|
|
|
<span class="badge rounded-pill bg-light text-dark">{{ lot }}</span>
|
|
|
|
|
{% endfor %}
|
|
|
|
|
</h6>
|
|
|
|
|
{% endif %}
|
2022-10-26 09:26:09 +00:00
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
{% if ac.device.phid() %}
|
|
|
|
|
<a href="{{ url_for('inventory.device_details', id=ac.device.dhid)}}">
|
|
|
|
|
{{ ac.device.dhid }}
|
|
|
|
|
</a>
|
|
|
|
|
{% else %}
|
|
|
|
|
{{ ac.device.dhid }}
|
|
|
|
|
{% endif %}
|
2022-09-20 08:27:02 +00:00
|
|
|
|
</td>
|
|
|
|
|
<td>
|
2022-09-20 10:43:04 +00:00
|
|
|
|
<a href="{{ url_for('inventory.export', export_id='snapshot') }}?id={{ ac.snapshot.uuid }}">
|
2022-11-23 12:36:34 +00:00
|
|
|
|
{{ ac.snapshot.uuid }}
|
2022-09-20 08:27:02 +00:00
|
|
|
|
</a>
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
{{ ac.type or '' }}
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
<a href="{{ url_for('inventory.device_details', id=ac.device.parent.dhid) }}">
|
2022-09-20 11:31:21 +00:00
|
|
|
|
{{ ac.get_phid() }}
|
2022-09-20 08:27:02 +00:00
|
|
|
|
</a>
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
{{ ac.severity }}
|
|
|
|
|
</td>
|
2022-09-21 09:35:31 +00:00
|
|
|
|
<td>{{ ac.created.strftime('%Y-%m-%d %H:%M:%S') }}</td>
|
2022-09-20 08:27:02 +00:00
|
|
|
|
<td>
|
2022-09-20 10:43:04 +00:00
|
|
|
|
<a href="{{ url_for('inventory.export', export_id='snapshot') }}?id={{ ac.snapshot.uuid }}">
|
2022-09-20 08:27:02 +00:00
|
|
|
|
<i class="bi bi-box-arrow-up-right"></i>
|
|
|
|
|
</a>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
{% endfor %}
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
2022-11-23 15:13:30 +00:00
|
|
|
|
</div>
|
2022-09-20 08:27:02 +00:00
|
|
|
|
|
|
|
|
|
</div>
|
2022-11-23 12:36:34 +00:00
|
|
|
|
<div class="dataTable-bottom">
|
|
|
|
|
<div class="dataTable-info">
|
|
|
|
|
Showing {{ erasure.first }} to {{ erasure.last }} of {{ erasure.total }} entries
|
|
|
|
|
</div>
|
|
|
|
|
<nav class="dataTable-pagination">
|
|
|
|
|
<ul class="dataTable-pagination-list">
|
|
|
|
|
{% if erasure.has_prev %}
|
|
|
|
|
<li class="pager">
|
|
|
|
|
<a href="{{ url_for('inventory.device_erasure_list', page=erasure.prev_num, per_page=erasure.per_page) }}">‹</a>
|
|
|
|
|
</li>
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% for page in erasure.iter_pages() %}
|
|
|
|
|
{% if page %}
|
|
|
|
|
{% if page == erasure.page %}
|
|
|
|
|
<li class="active"><a href="javascript:void()">{{ page }}</a></li>
|
|
|
|
|
{% else %}
|
|
|
|
|
<li class="">
|
|
|
|
|
<a href="{{ url_for('inventory.device_erasure_list', page=page, per_page=erasure.per_page) }}">
|
|
|
|
|
{{ page }}
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% endfor %}
|
|
|
|
|
{% if erasure.has_next %}
|
|
|
|
|
<li class="pager">
|
|
|
|
|
<a href="{{ url_for('inventory.device_erasure_list', page=erasure.next_num, per_page=erasure.per_page) }}">›</a>
|
|
|
|
|
</li>
|
|
|
|
|
{% endif %}
|
|
|
|
|
</ul>
|
|
|
|
|
</nav>
|
|
|
|
|
</div>
|
2022-09-20 08:27:02 +00:00
|
|
|
|
</div>
|
|
|
|
|
{% if lot and not lot.is_temporary %}
|
|
|
|
|
<div id="trade-documents-list" class="tab-pane fade trade-documents-list">
|
|
|
|
|
<h5 class="card-title">Documents</h5>
|
|
|
|
|
<table class="table">
|
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
<th scope="col">File</th>
|
|
|
|
|
<th scope="col" data-type="date" data-format="DD-MM-YYYY">Uploaded on</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
{% for doc in lot.trade.documents %}
|
|
|
|
|
<tr>
|
|
|
|
|
<td>
|
|
|
|
|
{% if doc.url %}
|
|
|
|
|
<a href="{{ doc.url.to_text() }}" target="_blank">{{ doc.file_name}}</a>
|
|
|
|
|
{% else %}
|
|
|
|
|
{{ doc.file_name}}
|
|
|
|
|
{% endif %}
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
{{ doc.created.strftime('%H:%M %d-%m-%Y')}}
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
{% endfor %}
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
</div><!-- End Bordered Tabs -->
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="NotificationsContainer" style="position: absolute; bottom: 0; right: 0; margin: 10px; margin-top: 70px; width: calc(100% - 310px);"></div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
{% include "inventory/lot_delete_modal.html" %}
|
|
|
|
|
{% include "inventory/actions.html" %}
|
|
|
|
|
{% include "inventory/allocate.html" %}
|
|
|
|
|
{% include "inventory/data_wipe.html" %}
|
|
|
|
|
{% include "inventory/trade.html" %}
|
|
|
|
|
{% include "inventory/alert_export_error.html" %}
|
|
|
|
|
{% include "inventory/alert_lots_changes.html" %}
|
|
|
|
|
|
|
|
|
|
<!-- Custom Code -->
|
|
|
|
|
<script>
|
2022-11-23 12:36:34 +00:00
|
|
|
|
$(document).ready(() => {
|
|
|
|
|
$(".dataTable-selector").on("change", function() {
|
|
|
|
|
const per_page = $('.dataTable-selector').val();
|
|
|
|
|
window.location.href = "{{ url_for('inventory.device_erasure_list', page=1) }}&per_page="+per_page;
|
|
|
|
|
});
|
|
|
|
|
});
|
2022-09-20 08:27:02 +00:00
|
|
|
|
</script>
|
2022-11-23 15:13:30 +00:00
|
|
|
|
<script>
|
|
|
|
|
let table = new simpleDatatables.DataTable("table", {
|
|
|
|
|
perPageSelect: [5, 10, 15, 20, 25, 50, 100],
|
|
|
|
|
perPage: 20
|
|
|
|
|
})
|
|
|
|
|
</script>
|
2022-11-23 12:36:34 +00:00
|
|
|
|
|
2022-09-20 08:27:02 +00:00
|
|
|
|
{% if config['DEBUG'] %}
|
|
|
|
|
<script src="{{ url_for('static', filename='js/main_inventory.js') }}"></script>
|
|
|
|
|
{% else %}
|
|
|
|
|
<script src="{{ url_for('static', filename='js/main_inventory.build.js') }}"></script>
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{% endblock main %}
|