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

[remoting-kafka] Extract inline script block in io/jenkins/plugins/remotingkafka/GlobalKafkaConfiguration/config.jelly

XMLWordPrintable

      Problem

      == Inline Script Block
      Line: 62
      ----
      <script>
              var resultElement = document.getElementsByClassName('start-kafka-button').item(0)
                      .parentElement.parentElement.lastElementChild;
      
              function callback(mutationsList) {
                  for (var mutation of mutationsList) {
                      if (mutation.type === 'childList') {
                          var result = resultElement.firstElementChild.textContent;
                          if (result.startsWith("Success")) {
                              var matches = result.match(/Success. Zookeeper: (.+) and Kafka: (.+)/);
                              document.getElementsByClassName('zookeeper-textbox').item(0).value = matches[1];
                              document.getElementsByClassName('kafka-textbox').item(0).value = matches[2];
                          }
                      }
                  }
              }
      
              var observer = new MutationObserver(callback);
              observer.observe(resultElement, {childList: true});
          </script>
      ----
      

      Solution

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

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

              Created:
              Updated: