Skip to content

Commit

Permalink
Show msg in list
Browse files Browse the repository at this point in the history
  • Loading branch information
nomeguy committed Oct 6, 2023
1 parent c97000d commit ebf08a9
Showing 1 changed file with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions web/src/SiteListPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import React from "react";
import {Link} from "react-router-dom";
import {Button, Col, Popconfirm, Row, Table, Tag} from "antd";
import {Button, Col, Popconfirm, Row, Table, Tag, Tooltip} from "antd";
import moment from "moment";
import * as Setting from "./Setting";
import * as SiteBackend from "./backend/SiteBackend";
Expand Down Expand Up @@ -216,19 +216,33 @@ class SiteListPage extends React.Component {
render: (text, record, index) => {
return record.nodes.map(node => {
const versionInfo = Setting.getVersionInfo(node.version, record.name);
if (versionInfo === null) {
return (
<Tag key={node.name} color={"processing"}>
{node.name}
</Tag>
);
const color = node.message === "" ? "processing" : "error";

const getTag = () => {
if (versionInfo === null) {
return (
<Tag key={node.name} color={color}>
{node.name}
</Tag>
);
} else {
return (
<a key={node.name} target="_blank" rel="noreferrer" href={versionInfo.link}>
<Tag color={color}>
{`${node.name} (${versionInfo.text})`}
</Tag>
</a>
);
}
};

if (node.message === "") {
return getTag();
} else {
return (
<a key={node.name} target="_blank" rel="noreferrer" href={versionInfo.link}>
<Tag color={"processing"}>
{`${node.name} (${versionInfo.text})`}
</Tag>
</a>
<Tooltip key={node.name} title={node.message}>
{getTag()}
</Tooltip>
);
}
});
Expand Down

0 comments on commit ebf08a9

Please sign in to comment.