Skip to content

Commit

Permalink
Fix nodes page
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Jan 18, 2025
1 parent 3aacc28 commit 01c8ea4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
12 changes: 4 additions & 8 deletions core/src/main/resources/hudson/model/ComputerSet/index.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ THE SOFTWARE.
Entrance to the configuration page
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:s="/lib/form">
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:s="/lib/form" xmlns:dd="/lib/layout/dropdowns">
<l:layout title="${%Nodes}">
<st:include page="sidepanel.jelly" />
<!-- no need for additional breadcrumb here as we're on an index page already including breadcrumb -->
Expand All @@ -52,6 +52,9 @@ THE SOFTWARE.
</button>
</form>
</l:hasAdministerOrManage>
<t:iconSize>
<dd:item icon="symbol-information-circle" id="button-computer-icon-legend" text="${%Legend}" />
</t:iconSize>
</l:app-bar>

<j:set var="monitors" value="${it._monitors}"/>
Expand Down Expand Up @@ -123,13 +126,6 @@ THE SOFTWARE.
</tr>
</tbody>
</table>
<t:iconSize>
<div class="jenkins-buttons-row jenkins-buttons-row--invert">
<button class="jenkins-button jenkins-button--tertiary" id="button-computer-icon-legend">
${%Legend}
</button>
</div>
</t:iconSize>
<template id="template-computer-icon-legend" data-title="${%Computer icon legend}">
<st:include page="_legend.jelly"/>
</template>
Expand Down
30 changes: 18 additions & 12 deletions src/main/js/pages/computer-set/index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
import { createElementFromHtml } from "@/util/dom";
import behaviorShim from "@/util/behavior-shim";

document
.querySelector("#button-computer-icon-legend")
.addEventListener("click", () => {
const template = document.querySelector("#template-computer-icon-legend");
const title = template.getAttribute("data-title");
const content = createElementFromHtml(
"<div>" + template.innerHTML + "</div>",
);
behaviorShim.specify(
"#button-computer-icon-legend",
"icon-legend",
999,
(button) => {
button.addEventListener("click", () => {
const template = document.querySelector("#template-computer-icon-legend");
const title = template.getAttribute("data-title");
const content = createElementFromHtml(
"<div>" + template.innerHTML + "</div>",
);

dialog.modal(content, {
maxWidth: "550px",
title: title,
dialog.modal(content, {
maxWidth: "550px",
title: title,
});
});
});
},
);

0 comments on commit 01c8ea4

Please sign in to comment.