forked from meshery/meshery
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request meshery#10756 from iArchitSharma/permRef
Keys table added
- Loading branch information
Showing
5 changed files
with
153 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<style> | ||
tbody { | ||
display: table-row-group; | ||
vertical-align: middle; | ||
unicode-bidi: isolate; | ||
border-color: inherit; | ||
} | ||
|
||
td { | ||
padding: 1rem; | ||
border-top: 2px solid var(--color-primary-dark); | ||
} | ||
|
||
#excelTable tbody tr:nth-of-type(odd) { | ||
background-color: var(--color-primary-medium) !important; | ||
} | ||
|
||
</style> | ||
<table style="margin:auto;padding-right:25%; padding-left:20%; margin-top:3rem;" id="excelTable" border="1"> | ||
<thead> | ||
<tr> | ||
<th style="text-align:left; padding:1rem;">Category</th> | ||
<th style="text-align:left; padding:1rem;">Key Name</th> | ||
<th style="text-align:left; padding:1rem;">Description</th> | ||
<th style="text-align:left; padding:1rem;">Keychain Name</th> | ||
<!-- <th style="text-align:left; padding:1rem;">Key ID</th> --> | ||
</tr> | ||
</thead> | ||
</table> | ||
<script> | ||
window.onload = function() { | ||
const xhr = new XMLHttpRequest(); | ||
xhr.open('GET', '../../assets/excel/keys.csv', true); | ||
xhr.responseType = 'arraybuffer'; | ||
|
||
xhr.onload = function() { | ||
if (xhr.status === 200) { | ||
const data = new Uint8Array(xhr.response); | ||
const workbook = XLSX.read(data, { type: 'array' }); | ||
const sheet = workbook.Sheets[workbook.SheetNames[0]]; | ||
const htmlTable = XLSX.utils.sheet_to_html(sheet); | ||
|
||
// Remove the first, second row | ||
const tableElement = document.createElement('div'); | ||
tableElement.innerHTML = htmlTable; | ||
tableElement.querySelector('table').deleteRow(0); | ||
tableElement.querySelector('table').deleteRow(0); | ||
|
||
// Remove the columns | ||
const rows = tableElement.querySelectorAll('tr'); | ||
rows.forEach(row => { | ||
row.deleteCell(3); | ||
row.deleteCell(3); | ||
row.deleteCell(3); | ||
row.deleteCell(3); | ||
row.deleteCell(3); | ||
row.deleteCell(3); | ||
row.deleteCell(3); | ||
row.deleteCell(3); | ||
row.deleteCell(4); | ||
row.deleteCell(5); | ||
row.deleteCell(6); | ||
row.deleteCell(5); | ||
row.deleteCell(4); | ||
}); | ||
|
||
document.getElementById('excelTable').innerHTML += tableElement.innerHTML; | ||
} else { | ||
console.error('Failed to load Excel file! Status code: ' + xhr.status); | ||
} | ||
}; | ||
|
||
xhr.onerror = function() { | ||
console.error('Failed to load Excel file!'); | ||
}; | ||
|
||
xhr.send(); | ||
}; | ||
</script> | ||
|
||
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.4/xlsx.full.min.js"></script> |
Oops, something went wrong.