Add advanced custom CSS/JS file support per template (#7361)

Introduces a new 'customFiles' array in the config schema for granular domain-level CSS and JavaScript customization. Updates webserver logic to inject custom CSS/JS tags based on template scope, replacing static custom.css/custom.js references in all Handlebars views. Also updates meshctrl.js to support the new config property.
This commit is contained in:
TheDevRyan
2025-10-24 11:53:37 +01:00
committed by GitHub
parent e5205f285b
commit c7d1c0e18f
27 changed files with 176 additions and 21 deletions

View File

@@ -14,7 +14,7 @@
<link type="text/css" href="styles/ol3-contextmenu.min.css" media="screen" rel="stylesheet" title="CSS" />
<link type="text/css" href="styles/xterm.css" media="screen" rel="stylesheet" title="CSS" />
<link type="text/css" href="styles/flatpickr.min.css" media="screen" rel="stylesheet" title="CSS">
<link type="text/css" href="styles/custom.css" media="screen" rel="stylesheet" title="CSS" />
{{{customCSSTags}}}
<link rel="apple-touch-icon" href="/favicon-303x303.png" />
<script type="text/javascript" src="scripts/common-0.0.1{{{min}}}.js"></script>
<script type="text/javascript" src="scripts/meshcentral{{{min}}}.js"></script>
@@ -50,7 +50,7 @@
<script keeplink=1 type="text/javascript" src="scripts/ol3-contextmenu{{{min}}}.js"></script>
<script keeplink=1 type="text/javascript" src="scripts/purify{{{min}}}.js"></script>
<script keeplink=1 type="text/javascript" src="scripts/marked{{{min}}}.js"></script>
<script type="text/javascript" src="scripts/custom.js"></script>
{{{customJSTags}}}
<title>{{{title}}}</title>
</head>
<body id="body" oncontextmenu="handleContextMenu(event)" style="display:none;min-width:495px" onload="if (typeof(startup) !== 'undefined') startup();">