mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-25 16:33:12 +09:00
Link to mod portal
This commit is contained in:
1 parent
d50230becc
commit
2936973a75
1 file changed
+27
-7
@@ -1,9 +1,7 @@
|
|||||||
import React, { Fragment, useState, useContext, useEffect, useMemo } from "react";
|
import React, { Fragment, useState, useContext, useEffect, useMemo } from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { Button, Form, Input, Modal, Popconfirm, Space, Table, Typography, Upload, Alert, Select } from "antd";
|
import { Button, Form, Input, Modal, Popconfirm, Space, Table, Typography, Upload, Alert, Select, Tooltip } from "antd";
|
||||||
import ImportOutlined from "@ant-design/icons/ImportOutlined";
|
import { ImportOutlined, PlusOutlined, SearchOutlined } from "@ant-design/icons";
|
||||||
import PlusOutlined from "@ant-design/icons/PlusOutlined";
|
|
||||||
import SearchOutlined from "@ant-design/icons/SearchOutlined";
|
|
||||||
import { Static } from "@sinclair/typebox";
|
import { Static } from "@sinclair/typebox";
|
||||||
|
|
||||||
import * as lib from "@clusterio/lib";
|
import * as lib from "@clusterio/lib";
|
||||||
@@ -320,7 +318,7 @@ function SearchModsButton() {
|
|||||||
title="Search Mod Portal"
|
title="Search Mod Portal"
|
||||||
open={open}
|
open={open}
|
||||||
onCancel={() => { setOpen(false); }}
|
onCancel={() => { setOpen(false); }}
|
||||||
width={800}
|
width={1000}
|
||||||
footer={[
|
footer={[
|
||||||
<Button key="close" onClick={() => { setOpen(false); }}>
|
<Button key="close" onClick={() => { setOpen(false); }}>
|
||||||
Close
|
Close
|
||||||
@@ -330,8 +328,10 @@ function SearchModsButton() {
|
|||||||
>
|
>
|
||||||
<Form
|
<Form
|
||||||
form={form}
|
form={form}
|
||||||
layout="vertical"
|
layout="horizontal"
|
||||||
onValuesChange={handleSearch} // Trigger update on any form change
|
labelCol={{ span: 6 }}
|
||||||
|
wrapperCol={{ span: 18 }}
|
||||||
|
onValuesChange={handleSearch}
|
||||||
initialValues={{ factorioVersion: factorioVersion, name: searchText }}
|
initialValues={{ factorioVersion: factorioVersion, name: searchText }}
|
||||||
>
|
>
|
||||||
<Form.Item name="name" label="Filter by Name or Title">
|
<Form.Item name="name" label="Filter by Name or Title">
|
||||||
@@ -466,6 +466,26 @@ function SearchModsButton() {
|
|||||||
key: "version",
|
key: "version",
|
||||||
render: (_, record) => record.latest_release?.version ?? "N/A",
|
render: (_, record) => record.latest_release?.version ?? "N/A",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: "Actions",
|
||||||
|
key: "actions",
|
||||||
|
align: "center",
|
||||||
|
render: (_, record) => (
|
||||||
|
<Tooltip title="Open in Factorio Mod Portal">
|
||||||
|
<Typography.Link
|
||||||
|
href={`https://mods.factorio.com/mod/${record.name}`}
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
src="https://mods.factorio.com/static/favicon.ico"
|
||||||
|
alt="Factorio Mod Portal"
|
||||||
|
style={{ height: "1em", verticalAlign: "middle" }}
|
||||||
|
/>
|
||||||
|
</Typography.Link>
|
||||||
|
</Tooltip>
|
||||||
|
),
|
||||||
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
Reference in new issue
Block a user