Browse Source

v1.0.1 - Fixing Appendix D Reports

v1.0.2
John Haverlack 3 years ago
parent
commit
c547b99f11
  1. 36
      itam-data-analyzer.js
  2. 2
      web/root/docs/data.md
  3. 2
      web/root/site/data.html
  4. 2
      web/root/site/search/search_index.json
  5. BIN
      web/root/site/sitemap.xml.gz

36
itam-data-analyzer.js

@ -769,21 +769,35 @@ function skq_index_data_to_app_d_sw_csv(keys, data) {
// console.log(amid)
// console.log(JSON.stringify(data[amid], null, 2))
for (sw in data[amid]) {
apps[ data[amid]['NAME'] + ':' + data[amid]['VERSION'] ] += amid + ','
csv += '"' + amid + '",'
let hk = 0
for (k in keymap) {
if (data[amid][sw][k]) {
csv += '"' + data[amid][sw][k]
if (hk < (Object.keys(keymap).length-1)) { csv += ","} else { csv += "\n" }
}
hk++
if (!apps.hasOwnProperty(data[amid][sw]['NAME'] + ':-:' + data[amid][sw]['VERSION'])) {
apps[ data[amid][sw]['NAME'] + ':-:' + data[amid][sw]['VERSION'] ] = {}
apps[ data[amid][sw]['NAME'] + ':-:' + data[amid][sw]['VERSION'] ]['Asset IDs'] = ''
apps[ data[amid][sw]['NAME'] + ':-:' + data[amid][sw]['VERSION'] ]['Name of Software'] = data[amid][sw]['NAME']
apps[ data[amid][sw]['NAME'] + ':-:' + data[amid][sw]['VERSION'] ]['Installed Version'] = data[amid][sw]['VERSION']
apps[ data[amid][sw]['NAME'] + ':-:' + data[amid][sw]['VERSION'] ]['Date of Install'] = ''
}
apps[ data[amid][sw]['NAME'] + ':-:' + data[amid][sw]['VERSION'] ]['Asset IDs'] += amid + ', '
if (data[amid][sw]['INSTALL_DATE']) {
let inst = skqlib.tell_time(data[amid][sw]['INSTALL_DATE'])
apps[ data[amid][sw]['NAME'] + ':-:' + data[amid][sw]['VERSION'] ]['Date of Install'] += inst['UTC']['YYYY-MM-DD'] + ', '
}
}
console.log(JSON.stringify(apps, null, 2))
}
for (a in apps) {
for (k in apps[a]) {
if (k != 'Date of Install') {
csv += '"' + String(apps[a][k]).replace(RegExp(', $'), '') + '",'
} else {
csv += '"' + String(apps[a][k]).replace(RegExp(', $'), '') + '"' + "\n"
}
}
}
// console.log(JSON.stringify(apps, null, 2))
// console.log(JSON.stringify(Object.keys(apps), null, 2))
return csv
}

2
web/root/docs/data.md

@ -10,7 +10,7 @@
</div>
<!-- <div class="col-sm=1"></div> -->
<div class="col-sm-4">
<h4><span class="fas fa-box-open"></span> Software Applications</h4>
<h4><span class="fas fa-box-open"></span> Software</h4>
<a href="api/data/proc/sw-index-data.csv" class="btn btn-success" style="margin: 3px;" title="Software Data Download CSV Format"><span class="fas fa-download"></span> Software Inventory <span class="fas fa-table"></span></a><br>
<a href="api/data/proc/sw-index-data.json" class="btn btn-primary" style="margin: 3px;" title="Software Data Download JSON Format"><span class="fas fa-download"></span> Software Inventory <span class="fas fa-file-code"></span></a><br>
</div>

2
web/root/site/data.html

@ -140,7 +140,7 @@
</div>
<!-- <div class="col-sm=1"></div> -->
<div class="col-sm-4">
<h4><span class="fas fa-box-open"></span> Software Applications</h4>
<h4><span class="fas fa-box-open"></span> Software</h4>
<a href="api/data/proc/sw-index-data.csv" class="btn btn-success" style="margin: 3px;" title="Software Data Download CSV Format"><span class="fas fa-download"></span> Software Inventory <span class="fas fa-table"></span></a><br>
<a href="api/data/proc/sw-index-data.json" class="btn btn-primary" style="margin: 3px;" title="Software Data Download JSON Format"><span class="fas fa-download"></span> Software Inventory <span class="fas fa-file-code"></span></a><br>
</div>

2
web/root/site/search/search_index.json
File diff suppressed because it is too large
View File

BIN
web/root/site/sitemap.xml.gz

Loading…
Cancel
Save