Update dependencies for Rust and Admin interface.

- Updated Rust deps and one small change regarding chrono
- Updated bootstrap 5 css
- Updated datatables
- Replaced identicon.js with jdenticon.
  identicon.js is unmaintained ( https://github.com/stewartlord/identicon.js/issues/52 )
  The icon's are very different, but nice. It also doesn't need custom
  code to find and update the icons our selfs.
This commit is contained in:
BlackDex
2022-12-01 17:18:29 +01:00
committed by Daniel García
parent 63fb0e5a57
commit c885bbc947
11 changed files with 1756 additions and 497 deletions

View File

@@ -28,7 +28,7 @@
border: var(--bs-alert-border);
}
</style>
<script src="{{urlpath}}/vw_static/identicon.js"></script>
<script src="{{urlpath}}/vw_static/jdenticon.js"></script>
<script>
'use strict';
@@ -49,11 +49,6 @@
const hashHex = hashArray.map(b => b.toString(16).padStart(2, '0')).join('');
return hashHex;
}
async function identicon(email) {
const hash = await sha256(email);
const data = new Identicon(hash, { size: 48, format: 'svg' });
return "data:image/svg+xml;base64," + data.toString();
}
function toggleVis(input_id) {
const elem = document.getElementById(input_id);
const type = elem.getAttribute("type");

View File

@@ -16,7 +16,7 @@
{{#each page_data}}
<tr>
<td>
<img class="float-start me-2 rounded identicon" data-src="{{Id}}">
<svg width="48" height="48" class="float-start me-2 rounded" data-jdenticon-value="{{Id}}">
<div class="float-start">
<strong>{{Name}}</strong>
<span class="me-2">({{BillingEmail}})</span>
@@ -73,12 +73,6 @@
return false;
}
(async () => {
for (let e of document.querySelectorAll("img.identicon")) {
e.src = await identicon(e.dataset.src);
}
})();
document.addEventListener("DOMContentLoaded", function() {
$('#orgs-table').DataTable({
"responsive": true,

View File

@@ -19,7 +19,7 @@
{{#each page_data}}
<tr>
<td>
<img class="float-start me-2 rounded identicon" data-src="{{Email}}">
<svg width="48" height="48" class="float-start me-2 rounded" data-jdenticon-value="{{Email}}">
<div class="float-start">
<strong>{{Name}}</strong>
<span class="d-block">{{Email}}</span>
@@ -206,12 +206,6 @@
"3": { "name": "Manager", "color": "green" },
};
(async () => {
for (let e of document.querySelectorAll("img.identicon")) {
e.src = await identicon(e.dataset.src);
}
})();
document.querySelectorAll("[data-orgtype]").forEach(function (e) {
let orgtype = OrgTypes[e.dataset.orgtype];
e.style.backgroundColor = orgtype.color;