mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-22 08:13:12 +09:00
Merge pull request #909 from Cooldude2606/fix/small-things
Multiple small changes
This commit is contained in:
16 files changed
+126
-92
No files matched your search
+5
-5
@@ -35,11 +35,11 @@
|
|||||||
"external_plugins/*/*"
|
"external_plugins/*/*"
|
||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@clusterio/controller": "workspace:*",
|
"@clusterio/controller": "workspace:^",
|
||||||
"@clusterio/ctl": "workspace:*",
|
"@clusterio/ctl": "workspace:^",
|
||||||
"@clusterio/host": "workspace:*",
|
"@clusterio/host": "workspace:^",
|
||||||
"@clusterio/lib": "workspace:*",
|
"@clusterio/lib": "workspace:^",
|
||||||
"@clusterio/web_ui": "workspace:*",
|
"@clusterio/web_ui": "workspace:^",
|
||||||
"@eslint/eslintrc": "^3.3.1",
|
"@eslint/eslintrc": "^3.3.1",
|
||||||
"@eslint/js": "^9.32.0",
|
"@eslint/js": "^9.32.0",
|
||||||
"@stylistic/eslint-plugin": "^5.2.2",
|
"@stylistic/eslint-plugin": "^5.2.2",
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
"node": ">=20"
|
"node": ">=20"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@clusterio/lib": "workspace:*",
|
"@clusterio/lib": "workspace:^",
|
||||||
"@sinclair/typebox": "catalog:",
|
"@sinclair/typebox": "catalog:",
|
||||||
"busboy": "^1.6.0",
|
"busboy": "^1.6.0",
|
||||||
"compression": "^1.8.0",
|
"compression": "^1.8.0",
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
"yargs": "^17.7.2"
|
"yargs": "^17.7.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@clusterio/web_ui": "workspace:*",
|
"@clusterio/web_ui": "workspace:^",
|
||||||
"@swc/core": "catalog:",
|
"@swc/core": "catalog:",
|
||||||
"@types/busboy": "^1.5.0",
|
"@types/busboy": "^1.5.0",
|
||||||
"@types/compression": "^1.7.2",
|
"@types/compression": "^1.7.2",
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
"node": ">=20"
|
"node": ">=20"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@clusterio/lib": "workspace:*",
|
"@clusterio/lib": "workspace:^",
|
||||||
"as-table": "^1.0.55",
|
"as-table": "^1.0.55",
|
||||||
"winston": "catalog:",
|
"winston": "catalog:",
|
||||||
"yargs": "^17.7.2"
|
"yargs": "^17.7.2"
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
"node": ">=20"
|
"node": ">=20"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@clusterio/lib": "workspace:*",
|
"@clusterio/lib": "workspace:^",
|
||||||
"@sinclair/typebox": "catalog:",
|
"@sinclair/typebox": "catalog:",
|
||||||
"jimp": "^1.6.0",
|
"jimp": "^1.6.0",
|
||||||
"jszip": "catalog:",
|
"jszip": "catalog:",
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ant-design/icons": "^5.6.1",
|
"@ant-design/icons": "^5.6.1",
|
||||||
"@clusterio/lib": "workspace:*",
|
"@clusterio/lib": "workspace:^",
|
||||||
"@sinclair/typebox": "^0.30.4",
|
"@sinclair/typebox": "^0.30.4",
|
||||||
"@swc/core": "^1.13.3",
|
"@swc/core": "^1.13.3",
|
||||||
"antd": "^5.24.2",
|
"antd": "^5.24.2",
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ export default function InstanceControlButton(props: InstanceControlButtonProps)
|
|||||||
const account = useAccount();
|
const account = useAccount();
|
||||||
const control = useContext(ControlContext);
|
const control = useContext(ControlContext);
|
||||||
const [switching, setSwitching] = useState<boolean>(false);
|
const [switching, setSwitching] = useState<boolean>(false);
|
||||||
|
const [popconfirm, setPopconfirm] = useState<string | null>(null);
|
||||||
|
|
||||||
const instanceId = props.instance.id;
|
const instanceId = props.instance.id;
|
||||||
const instanceStatus = props.instance.status;
|
const instanceStatus = props.instance.status;
|
||||||
@@ -88,35 +89,43 @@ export default function InstanceControlButton(props: InstanceControlButtonProps)
|
|||||||
if (account.hasPermission("core.instance.kill")) {
|
if (account.hasPermission("core.instance.kill")) {
|
||||||
actions.push({
|
actions.push({
|
||||||
key: "kill",
|
key: "kill",
|
||||||
|
label: "Kill",
|
||||||
danger: true,
|
danger: true,
|
||||||
disabled: instanceStatus === "stopped",
|
disabled: instanceStatus === "stopped",
|
||||||
label: (<Popconfirm
|
onClick: () => setPopconfirm("kill"),
|
||||||
title={<>
|
|
||||||
Killing this instance may leave you save and player data corrupted.
|
|
||||||
Are you sure you want to kill the instance?
|
|
||||||
</>}
|
|
||||||
placement="bottomRight"
|
|
||||||
okText="Kill"
|
|
||||||
okButtonProps={{ danger: true }}
|
|
||||||
onConfirm={() => {
|
|
||||||
control.sendTo(
|
|
||||||
{ instanceId },
|
|
||||||
new lib.InstanceKillRequest(),
|
|
||||||
).catch(
|
|
||||||
notifyErrorHandler("Error killing instance")
|
|
||||||
).finally(actionFinish);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Kill
|
|
||||||
</Popconfirm>),
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return <VariableDropdownButton
|
return <div style={{ position: "relative", display: "inline-block" }}>
|
||||||
{...props}
|
<VariableDropdownButton
|
||||||
type="primary"
|
{...props}
|
||||||
actions={actions}
|
type="primary"
|
||||||
loading={switching}
|
actions={actions}
|
||||||
disabled={!(showStart || showStop)}
|
loading={switching}
|
||||||
/>;
|
disabled={!(showStart || showStop)}
|
||||||
|
/>
|
||||||
|
<Popconfirm
|
||||||
|
title={<>
|
||||||
|
Killing this instance may leave you save and player data corrupted.
|
||||||
|
Are you sure you want to kill the instance?
|
||||||
|
</>}
|
||||||
|
open={popconfirm === "kill"}
|
||||||
|
placement="bottomRight"
|
||||||
|
okText="Kill"
|
||||||
|
okButtonProps={{ danger: true }}
|
||||||
|
onCancel={() => setPopconfirm(null)}
|
||||||
|
onConfirm={() => {
|
||||||
|
control.sendTo(
|
||||||
|
{ instanceId },
|
||||||
|
new lib.InstanceKillRequest(),
|
||||||
|
).catch(
|
||||||
|
notifyErrorHandler("Error killing instance")
|
||||||
|
).finally(actionFinish);
|
||||||
|
setPopconfirm(null);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{/* Used to position the popup under the button */}
|
||||||
|
<span style={{ position: "absolute", right: 0, top: "100%", width: 1, height: 1 }} />
|
||||||
|
</Popconfirm>
|
||||||
|
</div>;
|
||||||
}
|
}
|
||||||
@@ -231,7 +231,8 @@ export default function UsersTable({ instanceId, onlyOnline = false, pagination,
|
|||||||
},
|
},
|
||||||
sorter: (a: lib.UserDetails, b: lib.UserDetails) => sortLastSeen(a, b, instanceId, instanceId),
|
sorter: (a: lib.UserDetails, b: lib.UserDetails) => sortLastSeen(a, b, instanceId, instanceId),
|
||||||
render: (_: any, user: lib.UserDetails) => formatLastSeen(user, instanceId),
|
render: (_: any, user: lib.UserDetails) => formatLastSeen(user, instanceId),
|
||||||
responsive: ["lg"],
|
// Responsive breaks defaultFilteredValue, see: https://github.com/ant-design/ant-design/issues/32847
|
||||||
|
// responsive: ["lg"],
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -23,19 +23,19 @@
|
|||||||
"node": ">=20"
|
"node": ">=20"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@clusterio/web_ui": "workspace:*",
|
"@clusterio/web_ui": "workspace:^",
|
||||||
"@clusterio/host": "workspace:*",
|
"@clusterio/host": "workspace:^",
|
||||||
"@clusterio/ctl": "workspace:*",
|
"@clusterio/ctl": "workspace:^",
|
||||||
"@clusterio/lib": "workspace:*"
|
"@clusterio/lib": "workspace:^"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sinclair/typebox": "catalog:"
|
"@sinclair/typebox": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@clusterio/web_ui": "workspace:*",
|
"@clusterio/web_ui": "workspace:^",
|
||||||
"@clusterio/host": "workspace:*",
|
"@clusterio/host": "workspace:^",
|
||||||
"@clusterio/ctl": "workspace:*",
|
"@clusterio/ctl": "workspace:^",
|
||||||
"@clusterio/lib": "workspace:*",
|
"@clusterio/lib": "workspace:^",
|
||||||
"@types/node": "catalog:",
|
"@types/node": "catalog:",
|
||||||
"@types/react": "catalog:",
|
"@types/react": "catalog:",
|
||||||
"typescript": "catalog:",
|
"typescript": "catalog:",
|
||||||
|
|||||||
@@ -23,19 +23,19 @@
|
|||||||
"node": ">=20"
|
"node": ">=20"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@clusterio/controller": "workspace:*",
|
"@clusterio/controller": "workspace:^",
|
||||||
"@clusterio/host": "workspace:*",
|
"@clusterio/host": "workspace:^",
|
||||||
"@clusterio/lib": "workspace:*",
|
"@clusterio/lib": "workspace:^",
|
||||||
"@clusterio/web_ui": "workspace:*"
|
"@clusterio/web_ui": "workspace:^"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sinclair/typebox": "catalog:"
|
"@sinclair/typebox": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@clusterio/controller": "workspace:*",
|
"@clusterio/controller": "workspace:^",
|
||||||
"@clusterio/host": "workspace:*",
|
"@clusterio/host": "workspace:^",
|
||||||
"@clusterio/lib": "workspace:*",
|
"@clusterio/lib": "workspace:^",
|
||||||
"@clusterio/web_ui": "workspace:*",
|
"@clusterio/web_ui": "workspace:^",
|
||||||
"@types/node": "catalog:",
|
"@types/node": "catalog:",
|
||||||
"@types/react": "catalog:",
|
"@types/react": "catalog:",
|
||||||
"antd": "catalog:",
|
"antd": "catalog:",
|
||||||
|
|||||||
@@ -23,10 +23,10 @@
|
|||||||
"node": ">=20"
|
"node": ">=20"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@clusterio/controller": "workspace:*",
|
"@clusterio/controller": "workspace:^",
|
||||||
"@clusterio/web_ui": "workspace:*",
|
"@clusterio/web_ui": "workspace:^",
|
||||||
"@clusterio/host": "workspace:*",
|
"@clusterio/host": "workspace:^",
|
||||||
"@clusterio/lib": "workspace:*"
|
"@clusterio/lib": "workspace:^"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sinclair/typebox": "catalog:",
|
"@sinclair/typebox": "catalog:",
|
||||||
@@ -34,10 +34,10 @@
|
|||||||
"express": "catalog:"
|
"express": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@clusterio/controller": "workspace:*",
|
"@clusterio/controller": "workspace:^",
|
||||||
"@clusterio/web_ui": "workspace:*",
|
"@clusterio/web_ui": "workspace:^",
|
||||||
"@clusterio/host": "workspace:*",
|
"@clusterio/host": "workspace:^",
|
||||||
"@clusterio/lib": "workspace:*",
|
"@clusterio/lib": "workspace:^",
|
||||||
"@types/express": "catalog:",
|
"@types/express": "catalog:",
|
||||||
"@types/jsonwebtoken": "catalog:",
|
"@types/jsonwebtoken": "catalog:",
|
||||||
"@types/node": "catalog:",
|
"@types/node": "catalog:",
|
||||||
|
|||||||
@@ -89,9 +89,11 @@ function LoginForm(props: LoginFormProps) {
|
|||||||
Start Factorio, join one of the following multiplayer servers
|
Start Factorio, join one of the following multiplayer servers
|
||||||
and type <Text keyboard>/web-login</Text> into the chat:
|
and type <Text keyboard>/web-login</Text> into the chat:
|
||||||
</Paragraph>
|
</Paragraph>
|
||||||
<ul>
|
<div style={{ maxHeight: 160, overflowY: "auto", paddingLeft: 16 }}>
|
||||||
{servers.map(text => <li key={text}>{text}</li>)}
|
<ul>
|
||||||
</ul>
|
{servers.map(text => <li key={text}>{text}</li>)}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<Paragraph>Enter the code displayed in the in-game dialog here:</Paragraph>
|
<Paragraph>Enter the code displayed in the in-game dialog here:</Paragraph>
|
||||||
|
|||||||
@@ -23,19 +23,19 @@
|
|||||||
"node": ">=20"
|
"node": ">=20"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@clusterio/controller": "workspace:*",
|
"@clusterio/controller": "workspace:^",
|
||||||
"@clusterio/host": "workspace:*",
|
"@clusterio/host": "workspace:^",
|
||||||
"@clusterio/lib": "workspace:*",
|
"@clusterio/lib": "workspace:^",
|
||||||
"@clusterio/web_ui": "workspace:*"
|
"@clusterio/web_ui": "workspace:^"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sinclair/typebox": "catalog:"
|
"@sinclair/typebox": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@clusterio/controller": "workspace:*",
|
"@clusterio/controller": "workspace:^",
|
||||||
"@clusterio/host": "workspace:*",
|
"@clusterio/host": "workspace:^",
|
||||||
"@clusterio/lib": "workspace:*",
|
"@clusterio/lib": "workspace:^",
|
||||||
"@clusterio/web_ui": "workspace:*",
|
"@clusterio/web_ui": "workspace:^",
|
||||||
"@types/node": "catalog:",
|
"@types/node": "catalog:",
|
||||||
"@types/react": "catalog:",
|
"@types/react": "catalog:",
|
||||||
"typescript": "catalog:",
|
"typescript": "catalog:",
|
||||||
|
|||||||
@@ -23,14 +23,14 @@
|
|||||||
"node": ">=20"
|
"node": ">=20"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@clusterio/web_ui": "workspace:*",
|
"@clusterio/web_ui": "workspace:^",
|
||||||
"@clusterio/host": "workspace:*",
|
"@clusterio/host": "workspace:^",
|
||||||
"@clusterio/lib": "workspace:*"
|
"@clusterio/lib": "workspace:^"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@clusterio/web_ui": "workspace:*",
|
"@clusterio/web_ui": "workspace:^",
|
||||||
"@clusterio/host": "workspace:*",
|
"@clusterio/host": "workspace:^",
|
||||||
"@clusterio/lib": "workspace:*",
|
"@clusterio/lib": "workspace:^",
|
||||||
"@types/node": "catalog:",
|
"@types/node": "catalog:",
|
||||||
"@types/react": "catalog:",
|
"@types/react": "catalog:",
|
||||||
"typescript": "catalog:",
|
"typescript": "catalog:",
|
||||||
|
|||||||
@@ -23,19 +23,19 @@
|
|||||||
"node": ">=20"
|
"node": ">=20"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@clusterio/controller": "workspace:*",
|
"@clusterio/controller": "workspace:^",
|
||||||
"@clusterio/host": "workspace:*",
|
"@clusterio/host": "workspace:^",
|
||||||
"@clusterio/lib": "workspace:*",
|
"@clusterio/lib": "workspace:^",
|
||||||
"@clusterio/web_ui": "workspace:*"
|
"@clusterio/web_ui": "workspace:^"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sinclair/typebox": "catalog:"
|
"@sinclair/typebox": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@clusterio/controller": "workspace:*",
|
"@clusterio/controller": "workspace:^",
|
||||||
"@clusterio/host": "workspace:*",
|
"@clusterio/host": "workspace:^",
|
||||||
"@clusterio/lib": "workspace:*",
|
"@clusterio/lib": "workspace:^",
|
||||||
"@clusterio/web_ui": "workspace:*",
|
"@clusterio/web_ui": "workspace:^",
|
||||||
"@types/express": "catalog:",
|
"@types/express": "catalog:",
|
||||||
"@types/node": "catalog:",
|
"@types/node": "catalog:",
|
||||||
"@types/react": "catalog:",
|
"@types/react": "catalog:",
|
||||||
|
|||||||
@@ -95,6 +95,11 @@ export interface Issue {
|
|||||||
html_url: string,
|
html_url: string,
|
||||||
state: string,
|
state: string,
|
||||||
body?: string | null,
|
body?: string | null,
|
||||||
|
user: {
|
||||||
|
login: string,
|
||||||
|
url: string,
|
||||||
|
html_url: string,
|
||||||
|
}
|
||||||
pull_request?: {
|
pull_request?: {
|
||||||
url: string,
|
url: string,
|
||||||
html_url: string,
|
html_url: string,
|
||||||
|
|||||||
@@ -187,11 +187,17 @@ async function fetchIssuesUpdatedSince(since: string) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function printMarkdown(changelog: Changelog, issues: Issue[], refText: (issue: Issue) => string) {
|
function printMarkdown(
|
||||||
|
changelog: Changelog,
|
||||||
|
issues: Issue[],
|
||||||
|
users: Issue["user"][],
|
||||||
|
refText: (issue: Issue) => string,
|
||||||
|
userText: (user: Issue["user"]) => string,
|
||||||
|
) {
|
||||||
const sections = new Set([...changelogSections, ...Object.keys(changelog)]);
|
const sections = new Set([...changelogSections, ...Object.keys(changelog)]);
|
||||||
for (const section of sections) {
|
for (const section of sections) {
|
||||||
if (section in changelog) {
|
if (section in changelog) {
|
||||||
console.log(`### ${section}`);
|
console.log(`### ${section}\n`);
|
||||||
const entries = changelog[section];
|
const entries = changelog[section];
|
||||||
console.log(entries.map(text => (
|
console.log(entries.map(text => (
|
||||||
`- ${text.replaceAll(/#(\d+)/g, (ref, idAsText) => {
|
`- ${text.replaceAll(/#(\d+)/g, (ref, idAsText) => {
|
||||||
@@ -209,6 +215,9 @@ function printMarkdown(changelog: Changelog, issues: Issue[], refText: (issue: I
|
|||||||
console.log();
|
console.log();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(`Many thanks to the following for contributing to this release:`);
|
||||||
|
console.log(users.map(userText).join("\n"))
|
||||||
}
|
}
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
@@ -222,13 +231,21 @@ async function main() {
|
|||||||
));
|
));
|
||||||
|
|
||||||
const changelog = changelogFromPullRequests(pullRequests, issues);
|
const changelog = changelogFromPullRequests(pullRequests, issues);
|
||||||
|
const users = [...new Map(pullRequests.map(issue => [issue.user.login, issue.user])).values()]
|
||||||
|
|
||||||
console.log();
|
console.log();
|
||||||
console.log("=== Github markdown ===");
|
console.log("=== Github Release Markdown ===");
|
||||||
printMarkdown(changelog, issues, issue => `${repository}#${issue.number}`);
|
printMarkdown(changelog, issues, users,
|
||||||
|
issue => `${repository}#${issue.number}`,
|
||||||
|
user => `@${user.login}`,
|
||||||
|
);
|
||||||
|
|
||||||
console.log();
|
console.log();
|
||||||
console.log("=== Discord markdown ===");
|
console.log("=== Discord / Changelog Markdown ===");
|
||||||
printMarkdown(changelog, issues, issue => `[#${issue.number}](<${issue.html_url}>)`);
|
printMarkdown(changelog, issues, users,
|
||||||
|
issue => `[#${issue.number}](<${issue.html_url}>)`,
|
||||||
|
user => `[@${user.login}](<${user.html_url}>)`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (import.meta.main) {
|
if (import.meta.main) {
|
||||||
|
|||||||
Reference in new issue
Block a user