Skip to content

Commit

Permalink
[JENKINS-74072] Extract inline JavaScript from `DependencyCheck/Resul…
Browse files Browse the repository at this point in the history
…tAction/index.jelly`
  • Loading branch information
yaroslavafenkin committed Nov 18, 2024
1 parent a9c49bb commit c9e41cd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,8 @@ limitations under the License.
data-sorting="true" data-editing="false" data-state="true">
</table>

<script type="text/javascript">
var view = <st:bind value="${it}"/>

view.getSeverityDistributionJson(function (data) {
var json = data.responseJSON;
generateSeverityDistributionBar("severity-distribution", "Severity Distribution",
json.critical, json.high, json.medium, json.low, json.info, json.unassigned);
});

view.getFindingsJson(function (data) {
(function ($) {
$('.table').footable(data.responseJSON);
})(jQuery);
});
</script>
<st:bind value="${it}" var="view"/>
<st:adjunct includes="org.jenkinsci.plugins.DependencyCheck.ResultAction.resource"/>

</l:main-panel>
</l:layout>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
window.addEventListener("DOMContentLoaded", () => {
view.getSeverityDistributionJson(function (data) {
var json = data.responseJSON;
generateSeverityDistributionBar("severity-distribution", "Severity Distribution",
json.critical, json.high, json.medium, json.low, json.info, json.unassigned);
});

view.getFindingsJson(function (data) {
(function ($) {
$('.table').footable(data.responseJSON);
})(jQuery);
});
});

0 comments on commit c9e41cd

Please sign in to comment.