mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-13 15:14:52 +09:00
Sort hosts in AssignInstanceModal (#542)
This commit is contained in:
1 parent
6f6fe54d5c
commit
8704a24f26
1 file changed
+2
-1
@@ -9,6 +9,7 @@ import { notifyErrorHandler } from "../util/notify";
|
||||
import { useHosts } from "../model/host";
|
||||
|
||||
const { Paragraph } = Typography;
|
||||
const strcmp = new Intl.Collator(undefined, { numeric: true, sensitivity: "base" }).compare;
|
||||
|
||||
|
||||
type AssignInstanceModalProps = {
|
||||
@@ -80,7 +81,7 @@ export default function AssignInstanceModal(props: AssignInstanceModalProps) {
|
||||
<Select.Option value={"null"}>
|
||||
<Typography.Text italic>Unassigned</Typography.Text>
|
||||
</Select.Option>
|
||||
{[...hosts.values()].map((host) => <Select.Option
|
||||
{[...hosts.values()].sort((a, b) => strcmp(a.name, b.name)).map((host) => <Select.Option
|
||||
key={host["id"]}
|
||||
value={host["id"]}
|
||||
disabled={!host["connected"]}
|
||||
|
||||
Reference in new issue
Block a user