diff --git a/docs/configuration.md b/docs/configuration.md index d6398ba7..49685ef8 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -537,7 +537,7 @@ ID of the template to inherit config values from. Inherited fields take their value from the template and follow it when it changes, setting a field on this instance stops inheriting it. Object fields like `factorio.settings` are inherited per property, properties set on this instance override the ones from the template. When set on an existing instance fields with the same value as the template or the default value become inherited, except the server name in `factorio.settings`. -`instance.name`, `instance.is_template`, `instance.template_id`, the port fields and hidden fields are never inherited. +`instance.name`, `instance.is_template`, `instance.template_id`, the port fields, `factorio.rcon_password` and hidden fields are never inherited. A template may itself inherit from another template, but not from itself through a chain of templates. The fields currently inherited are stored in the hidden `instance.inherited_fields` field. In the web interface inherited values are locked and must be unlocked before they can be changed. diff --git a/packages/lib/src/config/definitions.ts b/packages/lib/src/config/definitions.ts index a76698f0..03c602f5 100644 --- a/packages/lib/src/config/definitions.ts +++ b/packages/lib/src/config/definitions.ts @@ -542,10 +542,10 @@ export class InstanceConfig extends classes.Config { return config; } - /** Fields that are never inherited from a template, ports would clash on a shared host */ + /** Fields that are never inherited from a template, ports clash on a shared host and secrets stay per instance */ static uninheritableFields = [ "instance.name", "instance.is_template", "instance.template_id", - "factorio.game_port", "factorio.rcon_port", "factorio.lua_udp_port", + "factorio.game_port", "factorio.rcon_port", "factorio.rcon_password", "factorio.lua_udp_port", ]; /** True if the field can take its value from a template */ diff --git a/packages/web_ui/src/components/InstanceList.tsx b/packages/web_ui/src/components/InstanceList.tsx index 8d69f044..02315695 100644 --- a/packages/web_ui/src/components/InstanceList.tsx +++ b/packages/web_ui/src/components/InstanceList.tsx @@ -23,7 +23,6 @@ type InstanceListProps = { instances: ReadonlyMap>; size?: SizeType; hideAssignedHost?: boolean; - tableNamespace?: string; }; export default function InstanceList(props: InstanceListProps) { @@ -31,7 +30,7 @@ export default function InstanceList(props: InstanceListProps) { let [hosts] = useHosts(); const [systems] = useSystems(); const tableState = useTableQueryState({ - namespace: props.tableNamespace ?? "instance", defaultSortKey: "name", + namespace: "instance", defaultSortKey: "name", }); const nameSearch = useColumnSearch( tableState, "name", instance => instance.name, "Search instances" diff --git a/packages/web_ui/src/components/InstancesPage.tsx b/packages/web_ui/src/components/InstancesPage.tsx index 9e6a7d54..7fbbd3b8 100644 --- a/packages/web_ui/src/components/InstancesPage.tsx +++ b/packages/web_ui/src/components/InstancesPage.tsx @@ -1,6 +1,7 @@ import React, { useContext, useEffect, useState } from "react"; import { useNavigate } from "react-router-dom"; -import { Button, Checkbox, Form, Input, Modal, Select, Space, Tooltip, Typography } from "antd"; +import { Button, Checkbox, Form, Input, Modal, Select, Space, Table, Tooltip, Typography } from "antd"; +import type { ColumnType } from "antd/es/table/interface"; import * as lib from "@clusterio/lib"; @@ -13,6 +14,8 @@ import { useHosts } from "../model/host"; import { useInstanceConfig, useInstances } from "../model/instance"; import { useSaves } from "../model/saves"; import InstanceList from "./InstanceList"; +import Link from "./Link"; +import useRowNavigation from "../util/useRowNavigation"; import { notifyErrorHandler } from "../util/notify"; import type { Control } from "../util/websocket"; @@ -92,6 +95,7 @@ export function CreateInstanceButton({ buttonText = "Create", buttonType = "prim initial?: CreateInstanceInitial; buttonText?: string; buttonType?: "primary" | "default"; + buttonSize?: "small"; }) { let control = useContext(ControlContext); let account = useAccount(); @@ -195,6 +199,7 @@ export function CreateInstanceButton({ buttonText = "Create", buttonType = "prim return <>