Skip to content

Commit f3bef03

Browse files
committed
Upgrade vis.js to vis-network 10.0.2 and vis-data 8.0.3 in /storm-webapp; Fix Java 20 -> 21 in YAML files; Fix Frontend Plugin to use Node 24
1 parent 0fddc5b commit f3bef03

9 files changed

Lines changed: 140 additions & 60 deletions

File tree

.github/workflows/nightlies.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ jobs:
4040
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
4141
with:
4242
python-version: '3.10'
43-
- name: Set up JDK ${{ matrix.java }}
43+
- name: Set up JDK 21
4444
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
4545
with:
4646
distribution: temurin
47-
java-version: 20
47+
java-version: 21
4848
- name: Ensure a clean state without storm artifacts
4949
run: rm -rf ~/.m2/repository/org/apache/storm
5050
- name: Set up project dependencies

.github/workflows/snapshots.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ jobs:
4040
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
4141
with:
4242
python-version: '3.10'
43-
- name: Set up JDK ${{ matrix.java }}
43+
- name: Set up JDK 21
4444
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
4545
with:
4646
distribution: temurin
47-
java-version: 20
47+
java-version: 21
4848
- id: extract_version
4949
name: Extract project version
5050
shell: bash

.github/workflows/update-license-files.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ jobs:
4242
with:
4343
python-version: '3.10'
4444

45-
- name: Set up JDK 17
45+
- name: Set up JDK 21
4646
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
4747
with:
4848
distribution: temurin
49-
java-version: 17
49+
java-version: 21
5050

5151
- name: Ensure clean state without storm artifacts
5252
run: rm -rf ~/.m2/repository/org/apache/storm

storm-webapp/package-lock.json

Lines changed: 84 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

storm-webapp/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"moment": "2.30.1",
2929
"mustache": "4.2.0",
3030
"typeahead.js": "0.11.1",
31-
"vis": "4.21.0"
31+
"vis-data": "8.0.3",
32+
"vis-network": "10.0.2"
3233
},
3334
"devDependencies": {
3435
"css-loader": "^7.1.1",

storm-webapp/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@
160160
<artifactId>frontend-maven-plugin</artifactId>
161161
<version>2.0.0</version>
162162
<configuration>
163-
<nodeVersion>v20.18.0</nodeVersion>
163+
<nodeVersion>v24.14.1</nodeVersion>
164164
<workingDirectory>${basedir}</workingDirectory>
165165
<installDirectory>target</installDirectory>
166166
</configuration>

storm-webapp/src/main/java/org/apache/storm/daemon/ui/WEB-INF/visualize.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
<details>
7474
<summary>
7575
{{#:show_link}}
76-
<a href="#" onclick="network.selectNodes(['{{:component}}']); handleNodeClickEvent('{{:component}}'); return false;">{{:component}}</a>
76+
<a href="#" data-component="{{:component}}" class="component-link">{{:component}}</a>
7777
{{/:show_link}}
7878
{{^:show_link}}
7979
{{:component}}

storm-webapp/src/main/webapp/js/visualization.js

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,23 @@
1616
* limitations under the License.
1717
*/
1818

19+
function tooltipElement(lines) {
20+
var container = document.createElement("div");
21+
lines.forEach(function(line, i) {
22+
if (line.bold) {
23+
var b = document.createElement("b");
24+
b.textContent = line.text;
25+
container.appendChild(b);
26+
} else {
27+
container.appendChild(document.createTextNode(line.text));
28+
}
29+
if (i < lines.length - 1) {
30+
container.appendChild(document.createElement("br"));
31+
}
32+
});
33+
return container;
34+
}
35+
1936
var visNS = {
2037
// Update / refresh setting
2138
shouldUpdate: true,
@@ -257,10 +274,12 @@ function parseNode(nodeJson, nodeId) {
257274
selectedCol = "#ffc180";
258275
}
259276

260-
// Generate title
261-
var title = "<b>" + nodeId + "</b><br/>";
262-
title += "Capacity: " + nodeJson[":capacity"] + "<br/>";
263-
title += "Latency: " + nodeJson[":latency"]
277+
// Generate title as DOM element (vis-network 10 does not render HTML strings)
278+
var title = tooltipElement([
279+
{ text: nodeId, bold: true },
280+
{ text: "Capacity: " + nodeJson[":capacity"] },
281+
{ text: "Latency: " + nodeJson[":latency"] }
282+
])
264283

265284
// Construct the node
266285
var node = {
@@ -317,7 +336,11 @@ function parseEdge(edgeJson, sourceId) {
317336
"from": edgeJson[":component"],
318337
"to": sourceId,
319338
"label": edgeJson[":stream"],
320-
"title": "From: " + edgeJson[":component"] + "<br>To: " + sourceId + "<br>Grouping: " + edgeJson[":grouping"]
339+
"title": tooltipElement([
340+
{ text: "From: " + edgeJson[":component"] },
341+
{ text: "To: " + sourceId },
342+
{ text: "Grouping: " + edgeJson[":grouping"] }
343+
])
321344
});
322345
}
323346
}
@@ -410,12 +433,22 @@ function asc_sort(a, b){
410433
return ($(b).text()) < ($(a).text()) ? 1 : -1;
411434
}
412435

413-
// Expose for Cypress testing and inline script access
414-
window.visNS = visNS;
415-
window.checkStream = checkStream;
436+
// Expose for Cypress testing only
437+
if (window.Cypress) {
438+
window.visNS = visNS;
439+
window.checkStream = checkStream;
440+
}
416441

417442
$(document).ready(function() {
418443
visNS.networkContainer = document.getElementById("mynetwork");
419444
update();
445+
446+
// Delegated handler replaces inline onclick on component links
447+
$(document).on('click', '.component-link', function(e) {
448+
e.preventDefault();
449+
var comp = $(this).attr('data-component');
450+
visNS.network.selectNodes([comp]);
451+
handleNodeClickEvent(comp);
452+
});
420453
});
421454

storm-webapp/src/main/webapp/js/visualize-entry.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
// --- CSS ---
2323
require('bootstrap/dist/css/bootstrap.min.css');
24-
require('vis/dist/vis.min.css');
24+
require('vis-network/styles/vis-network.min.css');
2525
require('../css/style.css');
2626

2727
// --- jQuery ---
@@ -52,8 +52,10 @@ $.url = function (param) {
5252
return u;
5353
};
5454

55-
// --- vis.js ---
56-
var vis = require('vis');
55+
// --- vis-network + vis-data ---
56+
var vis = {};
57+
vis.Network = require('vis-network/peer').Network;
58+
vis.DataSet = require('vis-data/peer').DataSet;
5759
window.vis = vis;
5860

5961
// --- Custom Storm visualization code ---

0 commit comments

Comments
 (0)