jobs list
parent
e48ab6ca45
commit
dd89432244
|
@ -166,6 +166,10 @@
|
||||||
"robotics": {
|
"robotics": {
|
||||||
"robots": {
|
"robots": {
|
||||||
"header": "Roboter",
|
"header": "Roboter",
|
||||||
|
"button": {
|
||||||
|
"permitJoin": "Beitreten erlauben",
|
||||||
|
"disableJoin": "Beitreten deaktivieren"
|
||||||
|
},
|
||||||
"column": {
|
"column": {
|
||||||
"id": "ID",
|
"id": "ID",
|
||||||
"type": "Typ",
|
"type": "Typ",
|
||||||
|
|
|
@ -166,6 +166,10 @@
|
||||||
"robotics": {
|
"robotics": {
|
||||||
"robots": {
|
"robots": {
|
||||||
"header": "Robots",
|
"header": "Robots",
|
||||||
|
"button": {
|
||||||
|
"permitJoin": "Permit Join",
|
||||||
|
"disableJoin": "Disable Join"
|
||||||
|
},
|
||||||
"column": {
|
"column": {
|
||||||
"id": "ID",
|
"id": "ID",
|
||||||
"type": "Type",
|
"type": "Type",
|
||||||
|
|
|
@ -658,7 +658,7 @@ export default function GroupTasksViewModal({ isOpen }) {
|
||||||
}
|
}
|
||||||
content={
|
content={
|
||||||
<>
|
<>
|
||||||
<p>
|
<p style={{ margin: 0 }}>
|
||||||
<span style={{ fontWeight: "bold" }}>ID:</span>{" "}
|
<span style={{ fontWeight: "bold" }}>ID:</span>{" "}
|
||||||
{paramGroupTaskId} <br />
|
{paramGroupTaskId} <br />
|
||||||
<span style={{ fontWeight: "bold" }}>
|
<span style={{ fontWeight: "bold" }}>
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
import {
|
import {
|
||||||
Badge,
|
Badge,
|
||||||
|
Button,
|
||||||
Input,
|
Input,
|
||||||
Popconfirm,
|
Popconfirm,
|
||||||
|
Popover,
|
||||||
Space,
|
Space,
|
||||||
Table,
|
Table,
|
||||||
|
Tooltip,
|
||||||
Typography,
|
Typography,
|
||||||
notification,
|
notification,
|
||||||
} from "antd";
|
} from "antd";
|
||||||
|
@ -18,6 +21,7 @@ import {
|
||||||
} from "../../../utils";
|
} from "../../../utils";
|
||||||
import MyPagination from "../../../Components/MyPagination";
|
import MyPagination from "../../../Components/MyPagination";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
|
import { FileTextOutlined, KeyOutlined } from "@ant-design/icons";
|
||||||
|
|
||||||
const ReceivedSSECommands = {
|
const ReceivedSSECommands = {
|
||||||
UpdateRobotStatus: 1,
|
UpdateRobotStatus: 1,
|
||||||
|
@ -26,6 +30,8 @@ const ReceivedSSECommands = {
|
||||||
RemoveUnauthorizedRobot: 4,
|
RemoveUnauthorizedRobot: 4,
|
||||||
RemoveRobot: 5,
|
RemoveRobot: 5,
|
||||||
RobotUpdated: 6,
|
RobotUpdated: 6,
|
||||||
|
UpdateRobotCurrentJob: 7,
|
||||||
|
UpdateRobotJobsWaitingCount: 8,
|
||||||
};
|
};
|
||||||
|
|
||||||
function getRobotTypeString(type) {
|
function getRobotTypeString(type) {
|
||||||
|
@ -51,6 +57,7 @@ export default function Robots() {
|
||||||
setUnauthorizedRobotsPaginationPage,
|
setUnauthorizedRobotsPaginationPage,
|
||||||
] = useState(1);
|
] = useState(1);
|
||||||
const [selectedRobotName, setSelectedRobotName] = useState("");
|
const [selectedRobotName, setSelectedRobotName] = useState("");
|
||||||
|
const [permitJoinEnabled, setPermitJoinEnabled] = useState(false);
|
||||||
|
|
||||||
const sseEventSource = useRef(null);
|
const sseEventSource = useRef(null);
|
||||||
|
|
||||||
|
@ -111,13 +118,35 @@ export default function Robots() {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("robotics.robots.column.currentJob"),
|
title: t("robotics.robots.column.currentJob"),
|
||||||
dataIndex: "currentJob",
|
dataIndex: "currentJobName",
|
||||||
key: "currentJob",
|
key: "currentJobName",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("robotics.robots.column.jobsWaiting"),
|
title: t("robotics.robots.column.jobsWaiting"),
|
||||||
dataIndex: "jobsWaiting",
|
dataIndex: "jobsWaitingCount",
|
||||||
key: "jobsWaiting",
|
key: "jobsWaitingCount",
|
||||||
|
render: (parameter, record) => (
|
||||||
|
<>
|
||||||
|
{parameter > 0 ? (
|
||||||
|
<Popover
|
||||||
|
title="Jobs waiting"
|
||||||
|
content={
|
||||||
|
record._jobsWaitingNameList !== null && (
|
||||||
|
<ul style={{ paddingLeft: 14 }}>
|
||||||
|
{record._jobsWaitingNameList.map((jobName, index) => (
|
||||||
|
<li key={index}>{jobName}</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{parameter}
|
||||||
|
</Popover>
|
||||||
|
) : (
|
||||||
|
parameter
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("robotics.robots.column.address"),
|
title: t("robotics.robots.column.address"),
|
||||||
|
@ -153,7 +182,6 @@ export default function Robots() {
|
||||||
placeholder="Name"
|
placeholder="Name"
|
||||||
value={selectedRobotName}
|
value={selectedRobotName}
|
||||||
onChange={(e) => setSelectedRobotName(e.target.value)}
|
onChange={(e) => setSelectedRobotName(e.target.value)}
|
||||||
minLength={Constants.GLOBALS.MIN_ROBOTICS_ROBOT_NAME_LENGTH}
|
|
||||||
maxLength={Constants.GLOBALS.MAX_ROBOTICS_ROBOT_NAME_LENGTH}
|
maxLength={Constants.GLOBALS.MAX_ROBOTICS_ROBOT_NAME_LENGTH}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
@ -237,11 +265,12 @@ export default function Robots() {
|
||||||
type: getRobotTypeString(robot.Type),
|
type: getRobotTypeString(robot.Type),
|
||||||
name: robot.Name,
|
name: robot.Name,
|
||||||
status: getRobotStatusBadge(robot.Status),
|
status: getRobotStatusBadge(robot.Status),
|
||||||
currentJob:
|
currentJobName:
|
||||||
robot.CurrentJobId === ""
|
robot.CurrentJobName === ""
|
||||||
? Constants.TEXT_EMPTY_PLACEHOLDER
|
? Constants.TEXT_EMPTY_PLACEHOLDER
|
||||||
: robot.CurrentJobId,
|
: robot.CurrentJobName,
|
||||||
jobsWaiting: robot.JobsWaitingCount,
|
jobsWaitingCount: robot.JobsWaitingCount,
|
||||||
|
_jobsWaitingNameList: robot.JobsWaitingNameList,
|
||||||
address: robot.Address,
|
address: robot.Address,
|
||||||
firmwareVersion: robot.FirmwareVersion,
|
firmwareVersion: robot.FirmwareVersion,
|
||||||
connectedAt: FormatDatetime(robot.ConnectedAt),
|
connectedAt: FormatDatetime(robot.ConnectedAt),
|
||||||
|
@ -491,6 +520,34 @@ export default function Robots() {
|
||||||
return newArr;
|
return newArr;
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case ReceivedSSECommands.UpdateRobotCurrentJob:
|
||||||
|
robotsContext.setRobots((arr) => {
|
||||||
|
const newArr = [...arr];
|
||||||
|
|
||||||
|
const index = arr.findIndex((x) => x.Id === body.RobotId);
|
||||||
|
|
||||||
|
if (index !== -1) {
|
||||||
|
newArr[index].CurrentJobName = body.JobName;
|
||||||
|
newArr[index].JobsWaitingNameList = body.JobsWaitingNameList;
|
||||||
|
}
|
||||||
|
|
||||||
|
return newArr;
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case ReceivedSSECommands.UpdateRobotJobsWaitingCount:
|
||||||
|
robotsContext.setRobots((arr) => {
|
||||||
|
const newArr = [...arr];
|
||||||
|
|
||||||
|
const index = arr.findIndex((x) => x.Id === body.RobotId);
|
||||||
|
|
||||||
|
if (index !== -1) {
|
||||||
|
newArr[index].JobsWaitingCount = body.JobsWaitingCount;
|
||||||
|
newArr[index].JobsWaitingNameList = body.JobsWaitingNameList;
|
||||||
|
}
|
||||||
|
|
||||||
|
return newArr;
|
||||||
|
});
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -509,10 +566,26 @@ export default function Robots() {
|
||||||
<>
|
<>
|
||||||
{notificationContextHolder}
|
{notificationContextHolder}
|
||||||
|
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
justifyContent: "space-between",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Typography.Title level={4}>
|
<Typography.Title level={4}>
|
||||||
{t("robotics.robots.header")} ({robotsContext.robots.length})
|
{t("robotics.robots.header")} ({robotsContext.robots.length}){" "}
|
||||||
|
<Tooltip title={t("userProfile.icon.viewApiDoc")}>
|
||||||
|
<Link target="_blank" to={Constants.ROBOTICS_SWAGGER_ADDRESS}>
|
||||||
|
<FileTextOutlined style={{ fontSize: 16 }} />
|
||||||
|
</Link>
|
||||||
|
</Tooltip>
|
||||||
</Typography.Title>
|
</Typography.Title>
|
||||||
|
|
||||||
|
<Button icon={<KeyOutlined />}>
|
||||||
|
{t("userProfile.button.createApiKey.title")}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<Table
|
<Table
|
||||||
scroll={{ x: "max-content" }}
|
scroll={{ x: "max-content" }}
|
||||||
columns={getRobotsTableContent()}
|
columns={getRobotsTableContent()}
|
||||||
|
|
|
@ -13,6 +13,7 @@ let staticContentAddress = "";
|
||||||
let wsAddress = "";
|
let wsAddress = "";
|
||||||
let logApiAddress = "";
|
let logApiAddress = "";
|
||||||
let roboticsApiAddress = "";
|
let roboticsApiAddress = "";
|
||||||
|
var roboticsSwaggerAddress = "";
|
||||||
|
|
||||||
if (window.location.hostname === "localhost" && window.location.port === "") {
|
if (window.location.hostname === "localhost" && window.location.port === "") {
|
||||||
// for docker container testing on localhost
|
// for docker container testing on localhost
|
||||||
|
@ -21,6 +22,7 @@ if (window.location.hostname === "localhost" && window.location.port === "") {
|
||||||
wsAddress = "ws://localhost/ws";
|
wsAddress = "ws://localhost/ws";
|
||||||
logApiAddress = "http://localhost/lm/v1/log";
|
logApiAddress = "http://localhost/lm/v1/log";
|
||||||
roboticsApiAddress = "http://localhost/rcm/v1";
|
roboticsApiAddress = "http://localhost/rcm/v1";
|
||||||
|
roboticsSwaggerAddress = "http://localhost/rcm/swagger/index.html";
|
||||||
} else if (window.location.hostname === "localhost") {
|
} else if (window.location.hostname === "localhost") {
|
||||||
// programming on localhost
|
// programming on localhost
|
||||||
apiAddress = "http://localhost:50050/v1";
|
apiAddress = "http://localhost:50050/v1";
|
||||||
|
@ -28,6 +30,7 @@ if (window.location.hostname === "localhost" && window.location.port === "") {
|
||||||
wsAddress = "ws://localhost:50050/ws";
|
wsAddress = "ws://localhost:50050/ws";
|
||||||
logApiAddress = "http://127.0.0.1:50110/v1/log";
|
logApiAddress = "http://127.0.0.1:50110/v1/log";
|
||||||
roboticsApiAddress = "http://localhost:50055/v1";
|
roboticsApiAddress = "http://localhost:50055/v1";
|
||||||
|
roboticsSwaggerAddress = "http://localhost:50055/swagger/index.html";
|
||||||
/*} else if (window.location.hostname === "192.168.178.93") {
|
/*} else if (window.location.hostname === "192.168.178.93") {
|
||||||
apiAddress = "http://192.168.178.93:50050/v1";
|
apiAddress = "http://192.168.178.93:50050/v1";
|
||||||
staticContentAddress = "http://192.168.178.93:50050/";
|
staticContentAddress = "http://192.168.178.93:50050/";
|
||||||
|
@ -39,6 +42,7 @@ if (window.location.hostname === "localhost" && window.location.port === "") {
|
||||||
wsAddress = `${wssProtocol}${window.location.hostname}/ws`;
|
wsAddress = `${wssProtocol}${window.location.hostname}/ws`;
|
||||||
logApiAddress = `${window.location.protocol}${window.location.hostname}/lm/v1/log`;
|
logApiAddress = `${window.location.protocol}${window.location.hostname}/lm/v1/log`;
|
||||||
roboticsApiAddress = `${window.location.protocol}${window.location.hostname}/rcm/v1`;
|
roboticsApiAddress = `${window.location.protocol}${window.location.hostname}/rcm/v1`;
|
||||||
|
roboticsSwaggerAddress = `${window.location.protocol}${window.location.hostname}/rcm/swagger/index.html`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Constants = {
|
export const Constants = {
|
||||||
|
@ -61,6 +65,7 @@ export const Constants = {
|
||||||
WS_ADDRESS: wsAddress,
|
WS_ADDRESS: wsAddress,
|
||||||
LOG_API_ADDRESS: logApiAddress,
|
LOG_API_ADDRESS: logApiAddress,
|
||||||
ROBOTICS_API_ADDRESS: roboticsApiAddress, // robot-control-manager
|
ROBOTICS_API_ADDRESS: roboticsApiAddress, // robot-control-manager
|
||||||
|
ROBOTICS_SWAGGER_ADDRESS: roboticsSwaggerAddress,
|
||||||
ROUTE_PATHS: {
|
ROUTE_PATHS: {
|
||||||
EQUIPMENT_DOCUMENTATION: "/equipment-documentation",
|
EQUIPMENT_DOCUMENTATION: "/equipment-documentation",
|
||||||
EQUIPMENT_DOCUMENTATION_VIEW: "/equipment-documentation/",
|
EQUIPMENT_DOCUMENTATION_VIEW: "/equipment-documentation/",
|
||||||
|
|
Loading…
Reference in New Issue