Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • andersharrisson/csentry
  • ics-infrastructure/csentry
2 results
Show changes
Showing
with 593 additions and 323 deletions
app/static/favicon/favicon.ico

14.7 KiB

app/static/favicon/mstile-150x150.png

3.56 KiB

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="512.000000pt" height="512.000000pt" viewBox="0 0 512.000000 512.000000"
preserveAspectRatio="xMidYMid meet">
<metadata>
Created by potrace 1.11, written by Peter Selinger 2001-2013
</metadata>
<g transform="translate(0.000000,512.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M3538 4085 c-1 -1 -59 -6 -128 -9 -129 -7 -161 -10 -220 -21 -19 -4
-46 -9 -60 -11 -143 -26 -385 -110 -487 -170 l-45 -26 34 -24 c64 -47 201
-190 268 -279 156 -209 244 -408 300 -682 l16 -83 -485 -2 -486 -3 67 -66
c105 -104 257 -197 433 -262 61 -23 279 -89 485 -147 36 -10 90 -26 120 -35
30 -9 62 -17 70 -19 8 -2 42 -12 75 -22 33 -10 65 -19 70 -20 36 -8 183 -59
231 -80 140 -62 197 -157 147 -247 -57 -103 -202 -159 -393 -153 -195 7 -322
79 -368 208 -13 38 -21 48 -39 48 -13 0 -23 -6 -23 -13 0 -24 -99 -217 -152
-296 -95 -142 -220 -281 -347 -384 -18 -15 -32 -29 -30 -31 2 -2 35 -17 73
-35 265 -124 564 -185 906 -184 187 0 271 7 464 40 130 22 462 139 507 179 8
8 19 14 24 14 12 0 76 44 156 106 182 144 294 332 324 547 12 86 7 211 -11
269 -3 10 -7 30 -10 44 -14 75 -107 223 -183 291 -130 115 -329 211 -594 287
-88 26 -354 90 -415 101 -67 11 -304 76 -365 99 -185 69 -259 136 -243 220 12
63 104 136 193 152 103 19 246 7 323 -27 74 -33 107 -73 124 -151 l6 -28 535
0 c422 0 535 3 535 13 0 6 -5 32 -11 57 -6 25 -13 55 -15 68 -3 13 -15 52 -29
87 -129 345 -492 581 -1000 651 -22 3 -51 7 -65 10 -14 2 -77 6 -140 10 -63 3
-120 7 -127 9 -6 2 -13 2 -15 0z"/>
<path d="M1375 4069 c-91 -13 -106 -16 -160 -30 -394 -98 -722 -339 -930 -682
-26 -43 -56 -100 -67 -125 -11 -26 -29 -65 -39 -88 -30 -67 -78 -243 -93 -339
-14 -90 -15 -416 -2 -480 4 -16 11 -55 17 -85 92 -459 413 -866 841 -1063 76
-35 241 -92 293 -102 178 -32 226 -37 345 -38 198 -1 313 16 490 69 369 112
711 401 894 757 37 73 59 121 72 162 2 6 12 36 23 68 11 32 23 72 26 90 l6 32
-432 0 -432 0 -50 -75 c-62 -91 -127 -158 -199 -203 -116 -73 -214 -100 -363
-100 -138 -1 -227 21 -344 83 -253 135 -389 470 -326 800 58 301 260 514 530
555 44 7 190 7 245 0 198 -26 379 -158 480 -352 l22 -43 434 0 c239 0 434 1
434 3 0 1 -9 36 -21 77 -11 41 -22 82 -24 90 -7 29 -52 135 -84 200 -108 221
-287 425 -499 569 -156 105 -411 208 -592 236 -25 4 -54 9 -65 12 -39 9 -371
11 -430 2z"/>
</g>
</svg>
{
"name": "",
"short_name": "",
"icons": [
{
"src": "/static/favicon/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/static/favicon/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
File added
File added
File added
File added
app/static/img/CS_entry_TEST_v03.gif

11.1 KiB

<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 2560 854" style="enable-background:new 0 0 2560 854;" xml:space="preserve">
<style type="text/css">
.st0{fill:#F2FAFC;}
</style>
<g id="Layer_1">
<g>
<path class="st0" d="M886.8,303.7c-67.8-15.7-130.9-36.1-130.9-66.2c0-18.1,18.5-44.6,72.4-44.6c75.5,0,78.5,36.1,80.1,50.6h251
c-21.6-175.8-215.6-210.8-328-210.8c-82.9,0-160.7,19.3-220.1,53.9c2,1.5,3.9,3,5.9,4.6c67.8,54.1,114.8,131,132.4,216.5l6.2,30.1
H527.8c35.5,45.9,101.4,77.4,175.7,95.9c163.2,49.4,226.4,55.4,226.4,101.2c0,32.5-46.2,51.8-89.3,51.8c-10.8,0-86.2,0-97-61.4
h-8.6c-23.9,61.6-63.3,116.7-114.1,158.7c-4.1,3.4-8.4,6.7-12.6,10c70.8,39.7,159.6,52.9,229.2,52.9c189.4,0,348-86.7,348-233.6
C1185.5,368.8,1031.5,335,886.8,303.7z"/>
<g>
<path class="st0" d="M726.2,469.6c-36.2,152-170.1,276.2-351,276.2C172.6,745.8,17,586.6,17,387.6C17,191,170.2,31.8,370.4,31.8
c177.3,0,320.8,117,354.6,281H522.3c-21.7-45.8-61.5-94.1-144.7-94.1c-47-2.4-86.8,15.7-115.8,47c-27.7,31.4-43.4,74.8-43.4,123
c0,97.7,63.9,170.1,159.2,170.1c83.2,0,123-48.2,144.7-89.2H726.2z"/>
</g>
<g>
<path class="st0" d="M1312.9,628.4c3.5,29.7,31.8,49.4,64.5,49.4c26.7,0,40.8-11.6,50.9-26.2h85.7c-13.6,31.3-33.3,55.5-57,71.6
c-23.2,16.6-50.9,25.2-79.7,25.2c-80.2,0-148.2-65-148.2-148.2c0-78.2,61.5-150.3,146.7-150.3c42.9,0,79.7,16.6,105.9,44.4
c35.3,37.8,45.9,82.7,39.3,134.1H1312.9z M1438.9,564.9c-2-13.1-19.2-44.4-62.5-44.4c-43.4,0-60.5,31.3-62.5,44.4H1438.9z"/>
<path class="st0" d="M1559.9,459.5h78.2v29.7c9.6-13.6,27.2-39.3,77.1-39.3c94.3,0,103.9,76.6,103.9,114.5v175h-83.7V586.6
c0-30.8-6.6-58-43.9-58c-41.3,0-47.9,29.7-47.9,58.5v152.3h-83.7V459.5z"/>
<path class="st0" d="M1895.2,523.1h-41.3v-63.5h41.3v-93.3h83.7v93.3h40.3v63.5h-40.3v216.3h-83.7V523.1z"/>
<path class="st0" d="M2055.1,459.5h78.7v31.3c8.1-15.1,22.7-40.8,71.1-40.8v84.2h-3c-42.9,0-63,15.6-63,55v150.3h-83.7V459.5z"/>
<path class="st0" d="M2332.9,725.2L2229,459.5h89.2l57,162.4l53.4-162.4h88.7l-140.2,373.1h-88.7L2332.9,725.2z"/>
</g>
</g>
</g>
<g id="lines">
</g>
<g id="rest">
</g>
</svg>
app/static/img/csentry_keyvisual_v02.png

333 KiB

$(document).ready(function() {
var attributes_table = $("#attributes_table").DataTable({
"ajax": function(data, callback, settings) {
var kind = $('li a.nav-link.active').text();
$(document).ready(function () {
var attributes_table = $("#attributes_table").DataTable({
ajax: function (data, callback, settings) {
var kind = $("li a.nav-link.active").text();
$.getJSON(
$SCRIPT_ROOT + "/inventory/_retrieve_attributes/" + kind,
function(json) {
function (json) {
callback(json);
});
}
);
},
"order": [[2, 'asc']],
"columnDefs": [
order: [[2, "asc"]],
columnDefs: [
{
"targets": [0],
"orderable": false,
'className': 'text-center align-middle',
"render": function(data, type, row) {
targets: [0],
orderable: false,
className: "text-center align-middle",
render: function (data, type, row) {
// render a checkbox to add/remove the attribute to the user's favorites
var checked = data.favorite ? "checked" : ""
return '<input type="checkbox" value="' + data.id + '" ' + checked + '>'
var checked = data.favorite ? "checked" : "";
return (
'<input type="checkbox" value="' + data.id + '" ' + checked + ">"
);
},
"width": "5%",
width: "5%",
},
{
"targets": [1],
"orderable": false,
"render": function(data, type, row) {
targets: [1],
orderable: false,
render: function (data, type, row) {
// render QR code from base64 string
return '<img class="img-fluid" src="data:image/png;base64,' + data + '">';
return (
'<img class="img-fluid" src="data:image/png;base64,' + data + '">'
);
},
"width": "10%",
}
width: "10%",
},
],
"paging": false
paging: false,
});
// update the user favorites
$("#attributes_table").on('change', 'input[type="checkbox"]', function() {
var kind = $('li a.nav-link.active').text();
$("#attributes_table").on("change", 'input[type="checkbox"]', function () {
var kind = $("li a.nav-link.active").text();
$.ajax({
type: "POST",
url: $SCRIPT_ROOT + "/inventory/_update_favorites/" + kind ,
url: $SCRIPT_ROOT + "/inventory/_update_favorites/" + kind,
data: JSON.stringify({
id: $(this).val(),
checked: this.checked
checked: this.checked,
}),
contentType : 'application/json'
contentType: "application/json",
});
});
var attributes_favorites_table = $("#attributes_favorites_table").DataTable({
"ajax": function(data, callback, settings) {
var attributes_favorites_table = $("#attributes_favorites_table").DataTable({
ajax: function (data, callback, settings) {
$.getJSON(
$SCRIPT_ROOT + "/inventory/_retrieve_attributes_favorites",
function(json) {
function (json) {
callback(json);
});
}
);
},
"order": [[1, 'asc']],
"columnDefs": [
order: [[1, "asc"]],
columnDefs: [
{
"targets": [0],
"orderable": false,
"render": function(data, type, row) {
targets: [0],
orderable: false,
render: function (data, type, row) {
// render QR code from base64 string
return '<img class="img-fluid" src="data:image/png;base64,' + data + '">';
return (
'<img class="img-fluid" src="data:image/png;base64,' + data + '">'
);
},
"width": "10%",
}
width: "10%",
},
],
"paging": false
paging: false,
});
});
This diff is collapsed.
This diff is collapsed.
$(document).ready(function() {
$.fn.focusWithoutScrolling = function(){
var x = window.scrollX, y = window.scrollY;
$(document).ready(function () {
$.fn.focusWithoutScrolling = function () {
var x = window.scrollX,
y = window.scrollY;
this.focus();
window.scrollTo(x, y);
return this; //chainability
......@@ -15,11 +15,11 @@ $(document).ready(function() {
// Prevent enter key to submit the form when scanning a label
// and remove the ICS:ics_id: prefix
$("#ics_id").keydown(function(event) {
if(event.keyCode == 13) {
$("#ics_id").keydown(function (event) {
if (event.keyCode == 13) {
event.preventDefault();
var value = $(this).val();
$(this).val(value.replace('CSE:ics_id:', ''));
$(this).val(value.replace("CSE:ics_id:", ""));
$("#serial_number").focus();
return false;
}
......@@ -28,22 +28,21 @@ $(document).ready(function() {
// Prevent enter key to submit the form when scanning serial number
// Focus on the submit button so that scanning the Submit action
// will submit the form (due to the CR sent by the scanner)
$("#serial_number").keydown(function(event) {
if(event.keyCode == 13) {
$("#serial_number").keydown(function (event) {
if (event.keyCode == 13) {
event.preventDefault();
$("#submit").focusWithoutScrolling();
return false;
}
});
$("#clear").click(function() {
$("#clear").click(function () {
// clear all select fields
$("select").val('');
$("select").val("");
});
// Update the stack member field linked to the host when changing it
$("#host_id").on('change', function() {
$("#host_id").on("change", function () {
update_stack_member();
});
});
function flash_alert(message, category) {
var htmlString = '<div class="alert alert-' + category + ' alert-dismissible" role="alert">'
htmlString += '<button type="button" class="close" data-dismiss="alert" aria-label="Close">'
htmlString += '<span aria-hidden="true">&times;</span></button>' + message + '</div>'
var htmlString =
'<div class="alert alert-' + category + ' alert-dismissible" role="alert">';
htmlString +=
'<button type="button" class="close" data-dismiss="alert" aria-label="Close">';
htmlString +=
'<span aria-hidden="true">&times;</span></button>' + message + "</div>";
$(htmlString).prependTo("#mainContent").hide().slideDown();
}
function remove_alerts() {
$(".alert").slideUp("normal", function() {
$(".alert").slideUp("normal", function () {
$(this).remove();
});
}
......@@ -27,35 +30,36 @@ function check_job_status(status_url, $modal) {
dataType: "json",
url: status_url,
cache: false,
success: function(data, status, request) {
success: function (data, status, request) {
switch (data.status) {
case "unknown":
$modal.modal('hide');
$modal.modal("hide");
flash_alert("Unknown job id", "danger");
break;
case "finished":
$modal.modal('hide');
$modal.modal("hide");
switch (data.func_name) {
case "generate_items_excel_file":
window.location.href = $SCRIPT_ROOT + "/static/files/" + data.result;
window.location.href =
$SCRIPT_ROOT + "/static/files/" + data.result;
break;
}
break;
case "failed":
$modal.modal('hide');
$modal.modal("hide");
flash_alert(data.message, "danger");
break;
case "started":
if( data.progress !== null ) {
if (data.progress !== null) {
update_progress_bar(data.progress);
}
default:
// queued/started/deferred
setTimeout(function() {
setTimeout(function () {
check_job_status(status_url, $modal);
}, 500);
}
}
},
});
}
......@@ -63,15 +67,20 @@ function check_job_status(status_url, $modal) {
function update_selectfield(field_id, data, selected_value) {
var $field = $(field_id);
$field.empty();
$.map(data, function(option, index) {
if( option == "None" ) {
$.map(data, function (option, index) {
if (option == "None") {
var text = "";
} else {
var text = option;
}
$field.append($("<option></option>").attr("value", option).text(text));
});
$field.val(selected_value);
if (selected_value == "") {
$field.prop("disabled", true);
} else {
$field.val(selected_value);
$field.prop("disabled", false);
}
}
// Function to populate dynamically the stack_member field
......@@ -82,24 +91,45 @@ function update_stack_member() {
$.getJSON(
$SCRIPT_ROOT + "/inventory/_retrieve_free_stack_members/" + host_id,
{
ics_id: $("#ics_id").val()
ics_id: $("#ics_id").val(),
},
function(json) {
update_selectfield("#stack_member", json.data.stack_members, json.data.selected_member);
function (json) {
update_selectfield(
"#stack_member",
json.data.stack_members,
json.data.selected_member
);
$("#stack_member").prop("disabled", json.data.disabled);
}
);
}
$(document).ready(function() {
// Function to initialize tooltip on DataTables search box
// Only used when using server side processing
function configure_search_tooltip() {
$(".dataTables_filter").tooltip({
title:
"Enter keyword(s) or use wildcard character '*' for partial match. See the help for more information.",
});
// Hide the tooltip when clicking in the search box
$("input[type='search'").focus(function () {
$(".dataTables_filter").tooltip("hide");
});
}
$(document).ready(function () {
// When an invalid input was submitted, the server
// adds the "is-invalid" class to form fields to display
// them in red with an error message
// When starting to type again, we want to remove the error
// message to not confuse the user
$('input[type="text"]').keyup(function(event) {
$('input[type="text"]').keyup(function (event) {
$(this).removeClass("is-invalid");
});
// Initialize selectize with the default options
// for all Select and MultiSelect fields with the
// selectize-default class
$(".selectize-default").selectize();
});
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.