Skip to content

Commit

Permalink
Merge pull request #100 from seokho-son/main
Browse files Browse the repository at this point in the history
Add xRequestIdSelect and fix clipboard
  • Loading branch information
seokho-son authored Nov 20, 2023
2 parents 696a834 + b394c94 commit 9efc77f
Show file tree
Hide file tree
Showing 2 changed files with 346 additions and 358 deletions.
39 changes: 26 additions & 13 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,20 @@
</div>
</div>

<!-- X-Request-Id list -->
<div class="form-group col">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text" id="xRequestIdLabel">Req Log</span>
</div>
<select id="xRequestIdSelect" name="xRequestId" class="form-control" aria-label="X-Request-Id"
aria-describedby="xRequestIdLabel" onchange="handleRequestIdSelection();">
<option value="">Select ID</option>
<!-- Options will be filled dynamically -->
</select>
</div>
</div>

<div class="form-group col dropdown">
<button class="btn btn-secondary dropdown-toggle w-100" type="button" id="mapControlDropdown"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Expand Down Expand Up @@ -625,7 +639,7 @@

</div>
<iframe id="iframe" src="http://localhost:1323/tumblebug/swagger/index.html"
style="visibility:hidden; width:100%; height:100%; position:absolute; top:0; left:0;"></iframe>
style="visibility:hidden; width:100%; height:100%; position:absolute; top:0; left:0;"></iframe>

</div>

Expand All @@ -641,11 +655,11 @@
if (iframe.style.visibility === "hidden") {
map.style.display = "none";
iframe.style.visibility = "visible";
iframe.style.position = "static";
iframe.style.position = "static";
} else {
map.style.display = "block";
iframe.style.visibility = "hidden";
iframe.style.position = "absolute";
iframe.style.position = "absolute";
}
}
</script>
Expand All @@ -663,17 +677,16 @@

<script type="text/javascript">
document.addEventListener('DOMContentLoaded', (event) => {
document.querySelectorAll('#namespace, #mcisid, #subgroupid, #vmid').forEach(element => {
let previousValue = null;

element.addEventListener('click', () => {

if (element.value && element.selectedIndex >= 0 && element.options[element.selectedIndex] && element.value !== previousValue) {
var tosave = element.options[element.selectedIndex].text
navigator.clipboard.writeText(tosave)
// event linster for copy to clipboard
document.querySelectorAll('.input-group-text').forEach(label => {
label.addEventListener('click', () => {
// get seleted option
const select = label.parentElement.nextElementSibling;
if (select && select.options[select.selectedIndex]) {
var toCopy = select.options[select.selectedIndex].text;
navigator.clipboard.writeText(toCopy)
.then(() => {
console.log('Text copied to clipboard: ' + tosave);
previousValue = element.value;
console.log('Text copied to clipboard: ' + toCopy);
})
.catch(err => {
console.error('Error in copying text: ', err);
Expand Down
Loading

0 comments on commit 9efc77f

Please sign in to comment.