istio.io/istio@v0.0.0-20240520182934-d79c90f27776/pkg/ctrlz/topics/assets/templates/signals.html (about)

     1  {{ define "content" }}
     2  
     3  <p>
     4      Send signals to the running process.
     5  </p>
     6  
     7  <br>
     8  <button class="btn btn-istio" onclick="sendSIGUSR1()">SIGUSR1</button>
     9  
    10  {{ template "last-refresh" .}}
    11  
    12  <script>
    13      "use strict";
    14  
    15      function sendSIGUSR1() {
    16          let url = window.location.protocol + "//" + window.location.host + "/signalj/SIGUSR1";
    17  
    18          let ajax = new XMLHttpRequest();
    19          ajax.onload = onload;
    20          ajax.onerror = onerror;
    21          ajax.open("PUT", url, true);
    22          ajax.send();
    23  
    24          function onload() {
    25              console.log(url + " -> " + ajax.status)
    26          }
    27  
    28          function onerror(e) {
    29              console.error(e);
    30          }
    31      }
    32  </script>
    33  
    34  {{ end }}