Mark missing or missmatched checksum for mods in mod packs

Mark mods in the UI and the mod-pack show ctl command that are missing
with a question mark and mark mods with a missmatched checksum with an
exclamation mark.
This commit is contained in:
Hornwitser committed 2022-11-10 00:28:50 +01:00
1 parent e6add2f7e6
commit fb75e47eda
3 files changed
+36 -4

No files matched your search

@@ -1,5 +1,6 @@
import React, { Fragment } from "react";
import { Descriptions, Grid, Typography } from "antd";
import ExclamationCircleOutlined from "@ant-design/icons/ExclamationCircleOutlined";
import { libHelpers } from "@clusterio/lib";
@@ -11,6 +12,12 @@ export default function ModDetails(props) {
const mod = props.mod;
return <Descriptions className="borderless" bordered size="small" column={{ xs: 1, sm: 1, md: 1, lg: 2 }}>
{mod.error && <Descriptions.Item label={<><ExclamationCircleOutlined/> Error</>} span={2}>
{mod.error === "missing" && "The given version of this mod is missing from the master storage."}
{mod.error === "bad_checksum"
&& "Checksum of the mod in the master storage does not match the checksum provided by this mod pack."
}
</Descriptions.Item>}
{props.actions && !screens.lg
&& <Descriptions.Item label="Action">{props.actions(mod)}</Descriptions.Item>
}