Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-74608

[nutanix-calm] Extract inline script block and event handler in com/calm/GlobalConfiguration/CalmGlobalConfiguration/config.jelly

XMLWordPrintable

      Problems

      == Inline Script Block
      Line: 49
      ----
      <script>
            function doValidate(){
                       var statusElement = document.getElementById("status");
                       statusElement.value = null;
                       prismCentralIp = document.getElementById("prismCentralIp").getValue();
                       parent = document.getElementById("prismCentralIp").parentElement.parentElement;
                       credLocator = null;
                       sibling = parent.nextSibling;
                       while(sibling) {
                         credLocator = sibling.querySelector(".credentials-select");
                         if (credLocator != null) {
                           break;
                         }
                         sibling = sibling.nextSibling;
                       }
                       credentialId = credLocator.getValue();
                       validateCertificate = document.getElementById("validateCertificate").getValue();
                       console.log("certs "+ Boolean(validateCertificate));
                       calmConfig.isCalmEnabled(prismCentralIp, credentialId, Boolean(validateCertificate), function (obj){
                       message = obj.responseObject();
                       statusElement.value = message;
                      });
            }
          </script>
      ----
      
      == Inline Event Handler
      Line: 43
      ----
      <input type="button" value="Verify" onclick="doValidate()" class="verify"/>
      ----
      

      Solutions

      https://www.jenkins.io/doc/developer/security/csp/#inline-javascript-blocks
      https://www.jenkins.io/doc/developer/security/csp/#inline-event-handlers

            Unassigned Unassigned
            basil Basil Crow
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: