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

[mission-control-view] Extract inline script block in tech/andrey/jenkins/missioncontrol/MissionControlView/index.jelly

XMLWordPrintable

      Note

      While testing this plugin, evaluate whether the third-party libraries in src/main/webapp are compatible with CSP in restrictive mode. The plugin may need to be upgraded from jQuery 1.x to 3.x to fully function in CSP restrictive mode.

      Problem

      == Inline Script Block
      Line: 70
      ----
      <script type="text/javascript">
                      var jenkinsUrl = '${rootURL}';
                      var refreshInterval = 15*1000;
                      var nodeStatuses = [];
                      var buttonClass = '${it.statusButtonSize}';
                      var buildQueueSize = ${it.buildQueueSize};
                      var buildHistorySize = ${it.buildHistorySize};
      
                      nodeStatuses["Online"] = "${%Online}";
                      nodeStatuses["Offline"] = "${%Offline}";
      
                      function reload_info (interval) {
                          reload_jenkins_build_history('#jenkinsBuildHistory', jenkinsUrl + '/${it.url}', buildHistorySize);
                          reload_jenkins_job_statuses('#jenkinsJobStatuses', jenkinsUrl + '/${it.url}', buttonClass);
                          reload_jenkins_build_queue('#jenkinsBuildQueue', jenkinsUrl, buildQueueSize);
                          reload_jenkins_node_statuses('#jenkinsNodeStatuses', jenkinsUrl, nodeStatuses, buttonClass);
      
                          setTimeout(function(){ reload_info(interval); }, interval);
                      }
      
                      $$(document).ready(function(){
                          $$.ajaxSetup({ cache: false });
                          reload_info(refreshInterval);
                      });
                  </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: