mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-18 23:33:12 +09:00
Added public_address field to lists
- InstanceList - SlavesPage Added public_address field to messages - slaveProperties - instanceProperties
This commit is contained in:
8 files changed
+37
-3
No files matched your search
@@ -19,7 +19,13 @@ export default function InstanceList(props) {
|
||||
}
|
||||
return String(slaveId);
|
||||
}
|
||||
|
||||
function slavePublicAddress(slaveId) {
|
||||
let slave = slaveList.find(s => s.id === slaveId);
|
||||
if (slave) {
|
||||
return slave.public_address;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
let columns = [
|
||||
{
|
||||
title: "Name",
|
||||
@@ -33,6 +39,15 @@ export default function InstanceList(props) {
|
||||
render: instance => slaveName(instance["assigned_slave"]),
|
||||
sorter: (a, b) => strcmp(slaveName(a["assigned_slave"]), slaveName(b["assigned_slave"])),
|
||||
},
|
||||
{
|
||||
title: "Public address",
|
||||
key: "public_address",
|
||||
render: instance => {
|
||||
let address = slavePublicAddress(instance["assigned_slave"]);
|
||||
return address ? `${address}:${instance["game_port"] || "unknown"}` : "";
|
||||
},
|
||||
sorter: (a, b) => strcmp(slavePublicAddress(a["assigned_slave"]), slavePublicAddress(b["assigned_slave"])),
|
||||
},
|
||||
{
|
||||
title: "Status",
|
||||
dataIndex: "status",
|
||||
|
||||
Reference in new issue
Block a user