mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-16 23:30:41 +09:00
Add master server Web Root config
Add web_root option to the master server and use it create URLs for resources hosted by it. This permits hosting the master server web interface behind reverse proxy under a dedicated path.
This commit is contained in:
1 parent
5e9d9097e1
commit
8ebf0fc754
9 files changed
+27
-15
No files matched your search
@@ -30,12 +30,13 @@ const masterInventoryGauge = new prometheus.Gauge(
|
||||
class MasterPlugin extends plugin.BaseMasterPlugin {
|
||||
async init() {
|
||||
|
||||
let root = this.master.config.get("master.web_root");
|
||||
this.ui = {
|
||||
sidebar: [
|
||||
{
|
||||
getHtml: () => `
|
||||
<div class="nav-item mr-1">
|
||||
<a class="nav-link align-middle" href="/subspace_storage/storage">Storage</a>
|
||||
<a class="nav-link align-middle" href="${root}subspace_storage/storage">Storage</a>
|
||||
</div>`,
|
||||
},
|
||||
],
|
||||
|
||||
@@ -62,7 +62,7 @@ function updateInventory() {
|
||||
drawcontents(data);
|
||||
}
|
||||
}
|
||||
xmlhttp.open("GET", "/api/inventory", true);
|
||||
xmlhttp.open("GET", `${root}api/inventory`, true);
|
||||
xmlhttp.send();
|
||||
}
|
||||
if(JSON.parse(localStorage.settings)["Periodically update storage screen"]) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!doctype HTML>
|
||||
<head>
|
||||
<%- include("head") %>
|
||||
<script defer src="/subspace_storage/storage.js"></script>
|
||||
<script defer src="<%= locals.root %>subspace_storage/storage.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
Reference in new issue
Block a user