From 36bcd642533503501adb5421999e8dc2258d1b8d Mon Sep 17 00:00:00 2001 From: darshan-jahagirdar Date: Mon, 11 May 2026 22:59:18 +0530 Subject: [PATCH] Make third-party JS paths configurable --- html5-client/Makefile | 6 ++++++ html5-client/src/html/index.tpl.html | 12 +++++------ make.config | 30 ++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 6 deletions(-) diff --git a/html5-client/Makefile b/html5-client/Makefile index d9231c1..4f4a76b 100644 --- a/html5-client/Makefile +++ b/html5-client/Makefile @@ -103,6 +103,12 @@ assemble-html: createdirs perl -pe 's|##PCAP-BUTTON##|`cat $(PCAP_BUTTON_PART)`|ge' -i ${TPL} perl -pe 's|##PCAP-DISABLED-MODAL##|`cat $(PCAP_DISABLED_MODAL_PART)`|ge' -i ${TPL} perl -pe 's|##PRODUCT-BRANDING##|${PRODUCT_BRANDING}|ge' -i ${TPL} + perl -pe 's|##JQUERY-JS##|${JQUERY_JS}|g' -i ${TPL} + perl -pe 's|##MUSTACHE-JS##|${MUSTACHE_JS}|g' -i ${TPL} + perl -pe 's|##CBUFFER-JS##|${CBUFFER_JS}|g' -i ${TPL} + perl -pe 's|##BOOTSTRAP-BUNDLE-JS##|${BOOTSTRAP_BUNDLE_JS}|g' -i ${TPL} + perl -pe 's|##D3-JS##|${D3_JS}|g' -i ${TPL} + perl -pe 's|##PAKO-JS##|${PAKO_JS}|g' -i ${TPL} install: install -d ${DESTDIR}/var/lib/jittertrap/ diff --git a/html5-client/src/html/index.tpl.html b/html5-client/src/html/index.tpl.html index 5bf350c..23f2555 100644 --- a/html5-client/src/html/index.tpl.html +++ b/html5-client/src/html/index.tpl.html @@ -12,12 +12,12 @@ - - - - - - + + + + + + diff --git a/make.config b/make.config index cc67cfd..b164d40 100644 --- a/make.config +++ b/make.config @@ -55,6 +55,36 @@ ifndef WEB_SERVER_DOCUMENT_ROOT WEB_SERVER_DOCUMENT_ROOT = /var/lib/jittertrap endif +# ------------------------------------------------------------------------------ +# HTML Client Asset Locations +# ------------------------------------------------------------------------------ + +# Override these at build time when distribution packages serve JavaScript +# libraries from system-wide paths instead of JitterTrap's bundled web assets. +ifndef JQUERY_JS +JQUERY_JS = js/jquery-3.7.1.min.js +endif + +ifndef MUSTACHE_JS +MUSTACHE_JS = js/mustache.min.js +endif + +ifndef CBUFFER_JS +CBUFFER_JS = js/cbuffer.js +endif + +ifndef BOOTSTRAP_BUNDLE_JS +BOOTSTRAP_BUNDLE_JS = js/bootstrap.bundle.min.js +endif + +ifndef D3_JS +D3_JS = js/d3.v7.min.js +endif + +ifndef PAKO_JS +PAKO_JS = js/pako.min.js +endif + # ------------------------------------------------------------------------------ # Performance Tuning # ------------------------------------------------------------------------------