force installing python libs over dashboard
parent
2f6f4c9037
commit
2319023ef5
|
@ -141,7 +141,8 @@
|
||||||
"popover": {
|
"popover": {
|
||||||
"groupTaskId.title": "Gruppenaufgabe",
|
"groupTaskId.title": "Gruppenaufgabe",
|
||||||
"groupTaskStep.title": "Gruppenaufgabe Schritt",
|
"groupTaskStep.title": "Gruppenaufgabe Schritt",
|
||||||
"role.title": "Rolle"
|
"role.title": "Rolle",
|
||||||
|
"groupId.title": "Gruppen ID"
|
||||||
},
|
},
|
||||||
"card": { "checkbox.info": "INFO", "checkbox.error": "FEHLER" },
|
"card": { "checkbox.info": "INFO", "checkbox.error": "FEHLER" },
|
||||||
"tooltip": {
|
"tooltip": {
|
||||||
|
@ -164,33 +165,31 @@
|
||||||
"action": {
|
"action": {
|
||||||
"title": "Maßnahme",
|
"title": "Maßnahme",
|
||||||
"roleChange": {
|
"roleChange": {
|
||||||
"popconfirm.title": "Rolle ändern in",
|
"popconfirm": {
|
||||||
"roleChange.popconfirm.okText": "Ändern"
|
"title": "Rolle ändern in",
|
||||||
|
"okText": "Ändern"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"changeRole": "Rolle ändern",
|
"changeRole": "Rolle ändern",
|
||||||
"delete": {
|
"delete": {
|
||||||
"link": "Löschen",
|
"link": "Löschen",
|
||||||
"popconfirm": { "okText": "User löschen" },
|
"popconfirm": {
|
||||||
"delete": {
|
"title": "Sind Sie sicher, dass Sie den Benutzer löschen wollen?",
|
||||||
"popconfirm": {
|
"okText": "User löschen"
|
||||||
"title": "Sind Sie sicher, dass Sie den Benutzer löschen wollen?"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"deactivate": {
|
"deactivate": {
|
||||||
"link": "Deaktivieren",
|
"link": "Deaktivieren",
|
||||||
"popconfirm": {
|
"popconfirm": {
|
||||||
"okText": "Benutzer deaktivieren",
|
"title": "Sind Sie sicher, dass Sie den Benutzer deaktivieren wollen?",
|
||||||
"title": "Sind Sie sicher, dass Sie den Benutzer deaktivieren wollen?"
|
"okText": "Benutzer deaktivieren"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"activate": {
|
"activate": {
|
||||||
"link": "Aktivieren",
|
"link": "Aktivieren",
|
||||||
"popconfirm": { "okText": "Benutzer aktivieren" },
|
"popconfirm": {
|
||||||
"activate": {
|
"title": "Sind Sie sicher, dass Sie den Benutzer aktivieren wollen?",
|
||||||
"popconfirm": {
|
"okText": "Benutzer aktivieren"
|
||||||
"title": "Sind Sie sicher, dass Sie den Benutzer aktivieren wollen?"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,7 +141,8 @@
|
||||||
"popover": {
|
"popover": {
|
||||||
"groupTaskId.title": "Group Task",
|
"groupTaskId.title": "Group Task",
|
||||||
"groupTaskStep.title": "Group Task Step",
|
"groupTaskStep.title": "Group Task Step",
|
||||||
"role.title": "Role"
|
"role.title": "Role",
|
||||||
|
"groupId.title": "Group ID"
|
||||||
},
|
},
|
||||||
"card": { "checkbox.info": "INFO", "checkbox.error": "ERROR" },
|
"card": { "checkbox.info": "INFO", "checkbox.error": "ERROR" },
|
||||||
"tooltip": {
|
"tooltip": {
|
||||||
|
@ -164,33 +165,31 @@
|
||||||
"action": {
|
"action": {
|
||||||
"title": "Action",
|
"title": "Action",
|
||||||
"roleChange": {
|
"roleChange": {
|
||||||
"popconfirm.title": "Change role to",
|
"popconfirm": {
|
||||||
"roleChange.popconfirm.okText": "Change"
|
"title": "Change role to",
|
||||||
|
"okText": "Change"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"changeRole": "Change Role",
|
"changeRole": "Change Role",
|
||||||
"delete": {
|
"delete": {
|
||||||
"link": "Delete",
|
"link": "Delete",
|
||||||
"popconfirm": { "okText": "Delete User" },
|
"popconfirm": {
|
||||||
"delete": {
|
"title": "Are you sure you want to delete the user?",
|
||||||
"popconfirm": {
|
"okText": "Delete User"
|
||||||
"title": "Are you sure you want to delete the user?"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"deactivate": {
|
"deactivate": {
|
||||||
"link": "Deactivate",
|
"link": "Deactivate",
|
||||||
"popconfirm": {
|
"popconfirm": {
|
||||||
"okText": "Deactivate User",
|
"title": "Are you sure you want to deactivate the user?",
|
||||||
"title": "Are you sure you want to deactivate the user?"
|
"okText": "Deactivate User"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"activate": {
|
"activate": {
|
||||||
"link": "Activate",
|
"link": "Activate",
|
||||||
"popconfirm": { "okText": "Activate User" },
|
"popconfirm": {
|
||||||
"activate": {
|
"title": "Are you sure you want to activate the user?",
|
||||||
"popconfirm": {
|
"okText": "Activate User"
|
||||||
"title": "Are you sure you want to activate the user?"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -297,6 +297,61 @@ export default function LogCard({ type }) {
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
} else if (splittedMessage[s] === "%groupId%") {
|
||||||
|
const foundDataCategory = data.Logs[i].LogData.find(
|
||||||
|
(data) => data.Type === "category"
|
||||||
|
);
|
||||||
|
|
||||||
|
const foundDataGroupId = data.Logs[i].LogData.find(
|
||||||
|
(data) => data.Type === "groupId"
|
||||||
|
);
|
||||||
|
|
||||||
|
if (
|
||||||
|
foundDataCategory !== undefined &&
|
||||||
|
foundDataGroupId !== undefined
|
||||||
|
) {
|
||||||
|
const foundGroup = webSocketContext.CategoryGroups.find(
|
||||||
|
(categoryGroup) =>
|
||||||
|
categoryGroup.category === foundDataCategory.Value
|
||||||
|
).groups.find(
|
||||||
|
(group) => group.id === foundDataGroupId.Value
|
||||||
|
);
|
||||||
|
|
||||||
|
items.push(
|
||||||
|
<ColoredSpanItem
|
||||||
|
key={s}
|
||||||
|
dataLogs={data.Logs[i]}
|
||||||
|
splittedMessage={splittedMessage[s]}
|
||||||
|
children={
|
||||||
|
<Popover
|
||||||
|
content={
|
||||||
|
<div>
|
||||||
|
<span style={{ fontWeight: "bold" }}>ID: </span>
|
||||||
|
<span>{foundDataGroupId.Value}</span>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
title={t("logCard.popover.groupId.title")}
|
||||||
|
trigger="click"
|
||||||
|
>
|
||||||
|
{" "}
|
||||||
|
<span style={{ cursor: "pointer" }}>
|
||||||
|
{foundGroup !== undefined
|
||||||
|
? foundGroup.name
|
||||||
|
: foundDataGroupId.Value}
|
||||||
|
</span>
|
||||||
|
</Popover>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
items.push(
|
||||||
|
<ColoredSpanItem
|
||||||
|
key={s}
|
||||||
|
dataLogs={data.Logs[i]}
|
||||||
|
splittedMessage={splittedMessage[s]}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
items.push(
|
items.push(
|
||||||
<ColoredSpanItem
|
<ColoredSpanItem
|
||||||
|
@ -412,14 +467,14 @@ export default function LogCard({ type }) {
|
||||||
</Space>
|
</Space>
|
||||||
}
|
}
|
||||||
style={{
|
style={{
|
||||||
height: "97vh",
|
height: "90vh",
|
||||||
overflow: "hidden",
|
overflow: "hidden",
|
||||||
overflowWrap: "break-word",
|
overflowWrap: "break-word",
|
||||||
width: "100%",
|
width: "100%",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{!loadingSpinner ? (
|
{!loadingSpinner ? (
|
||||||
<div style={{ height: "86vh", overflowY: "scroll", paddingRight: 6 }}>
|
<div style={{ height: "80vh", overflowY: "scroll", paddingRight: 6 }}>
|
||||||
{logData.Logs.filter((log) => {
|
{logData.Logs.filter((log) => {
|
||||||
return (
|
return (
|
||||||
(log.Type === 0 && checkboxInfoChecked) ||
|
(log.Type === 0 && checkboxInfoChecked) ||
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
import {
|
import { DownOutlined, PlusOutlined, ReloadOutlined } from "@ant-design/icons";
|
||||||
DownloadOutlined,
|
|
||||||
PlusOutlined,
|
|
||||||
ReloadOutlined,
|
|
||||||
} from "@ant-design/icons";
|
|
||||||
import {
|
import {
|
||||||
Badge,
|
Badge,
|
||||||
Button,
|
Button,
|
||||||
Divider,
|
Divider,
|
||||||
|
Dropdown,
|
||||||
Popconfirm,
|
Popconfirm,
|
||||||
Popover,
|
Popover,
|
||||||
Space,
|
Space,
|
||||||
|
@ -196,12 +193,34 @@ export default function GroupTaskTableList({
|
||||||
return items;
|
return items;
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleOnConfirm = (category) => {
|
const handleOnReloadGroupTasksConfirm = (category) => {
|
||||||
webSocketContext.SendSocketMessage(SentMessagesCommands.ReloadGroupTasks, {
|
webSocketContext.SendSocketMessage(SentMessagesCommands.ReloadGroupTasks, {
|
||||||
category: category,
|
category: category,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleOnInstallPythonDependenciesConfirm = (category, groupId) => {
|
||||||
|
webSocketContext.SendSocketMessage(
|
||||||
|
SentMessagesCommands.GroupTasksInstallPythonDependencies,
|
||||||
|
{
|
||||||
|
category: category,
|
||||||
|
groupId: groupId,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const dropDownItems =
|
||||||
|
categoryGroup.groups !== undefined
|
||||||
|
? categoryGroup.groups.map((group, index) => {
|
||||||
|
return {
|
||||||
|
key: index,
|
||||||
|
label: group.name,
|
||||||
|
category: group.category,
|
||||||
|
groupid: group.id,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
: [];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Divider orientation="left">{categoryGroup.category}</Divider>
|
<Divider orientation="left">{categoryGroup.category}</Divider>
|
||||||
|
@ -246,21 +265,27 @@ export default function GroupTaskTableList({
|
||||||
.XYInstallPythonDependencies,
|
.XYInstallPythonDependencies,
|
||||||
categoryGroup.category
|
categoryGroup.category
|
||||||
) && (
|
) && (
|
||||||
<Popconfirm
|
<Dropdown
|
||||||
placement="left"
|
menu={{
|
||||||
title={t(
|
items: dropDownItems,
|
||||||
"groupTasks.groupTasksTableList.popover.installPythonDependencies.title"
|
onClick: ({ key }) =>
|
||||||
)}
|
handleOnInstallPythonDependenciesConfirm(
|
||||||
cancelText={t("common.button.cancel")}
|
dropDownItems[key].category,
|
||||||
okText={t("common.button.confirm")}
|
dropDownItems[key].groupid
|
||||||
onConfirm={() => handleOnConfirm(categoryGroup.category)}
|
),
|
||||||
|
}}
|
||||||
|
arrow
|
||||||
|
trigger="click"
|
||||||
>
|
>
|
||||||
<Button icon={<DownloadOutlined />}>
|
<Button>
|
||||||
{t(
|
<Space>
|
||||||
"groupTasks.groupTasksTableList.button.installPythonDependencies"
|
{t(
|
||||||
)}
|
"groupTasks.groupTasksTableList.button.installPythonDependencies"
|
||||||
|
)}
|
||||||
|
<DownOutlined />
|
||||||
|
</Space>
|
||||||
</Button>
|
</Button>
|
||||||
</Popconfirm>
|
</Dropdown>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{hasXYPermission(
|
{hasXYPermission(
|
||||||
|
@ -273,7 +298,9 @@ export default function GroupTaskTableList({
|
||||||
title={t("groupTasks.groupTasksTableList.popover.reload.title")}
|
title={t("groupTasks.groupTasksTableList.popover.reload.title")}
|
||||||
cancelText={t("common.button.cancel")}
|
cancelText={t("common.button.cancel")}
|
||||||
okText={t("common.button.confirm")}
|
okText={t("common.button.confirm")}
|
||||||
onConfirm={() => handleOnConfirm(categoryGroup.category)}
|
onConfirm={() =>
|
||||||
|
handleOnReloadGroupTasksConfirm(categoryGroup.category)
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<Button icon={<ReloadOutlined />}>
|
<Button icon={<ReloadOutlined />}>
|
||||||
{t("common.button.reload")}
|
{t("common.button.reload")}
|
||||||
|
@ -292,3 +319,25 @@ export default function GroupTaskTableList({
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
<Popconfirm
|
||||||
|
placement="left"
|
||||||
|
title={t(
|
||||||
|
"groupTasks.groupTasksTableList.popover.installPythonDependencies.title"
|
||||||
|
)}
|
||||||
|
cancelText={t("common.button.cancel")}
|
||||||
|
okText={t("common.button.confirm")}
|
||||||
|
onConfirm={() =>
|
||||||
|
handleOnInstallPythonDependenciesConfirm(
|
||||||
|
categoryGroup.category
|
||||||
|
)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<Button icon={<DownloadOutlined />}>
|
||||||
|
{t(
|
||||||
|
"groupTasks.groupTasksTableList.button.installPythonDependencies"
|
||||||
|
)}
|
||||||
|
</Button>
|
||||||
|
</Popconfirm>
|
||||||
|
*/
|
||||||
|
|
25
src/utils.js
25
src/utils.js
|
@ -212,6 +212,9 @@ const ReceivedMessagesCommands = {
|
||||||
NewUserApiKeyCreated: 30,
|
NewUserApiKeyCreated: 30,
|
||||||
DeletedUserApiKey: 31,
|
DeletedUserApiKey: 31,
|
||||||
NewApiKeyUsageCount: 32,
|
NewApiKeyUsageCount: 32,
|
||||||
|
InstallingPythonDependencies: 33,
|
||||||
|
InstallingPythonDependenciesFailed: 34,
|
||||||
|
InstallingPythonDependenciesFinished: 35,
|
||||||
};
|
};
|
||||||
|
|
||||||
// commands sent to the backend server
|
// commands sent to the backend server
|
||||||
|
@ -236,6 +239,7 @@ export const SentMessagesCommands = {
|
||||||
HandleUserActionTaskStep: 18,
|
HandleUserActionTaskStep: 18,
|
||||||
CreateNewUserApiKey: 19,
|
CreateNewUserApiKey: 19,
|
||||||
DeleteUserApiKey: 20,
|
DeleteUserApiKey: 20,
|
||||||
|
GroupTasksInstallPythonDependencies: 21,
|
||||||
};
|
};
|
||||||
|
|
||||||
export function WebSocketProvider({
|
export function WebSocketProvider({
|
||||||
|
@ -1011,8 +1015,25 @@ export function WebSocketProvider({
|
||||||
return updatedUser;
|
return updatedUser;
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case ReceivedMessagesCommands.InstallingPythonDependencies:
|
||||||
default:
|
notificationApi["info"]({
|
||||||
|
message: `Installing python dependencies for ${body.GroupId} of ${body.Category}`,
|
||||||
|
description: `This may take a while`,
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case ReceivedMessagesCommands.InstallingPythonDependenciesFailed:
|
||||||
|
notificationApi["error"]({
|
||||||
|
message: `Installing python dependencies for ${body.GroupId} of ${body.Category} failed`,
|
||||||
|
description: `Please check the logs`,
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case ReceivedMessagesCommands.InstallingPythonDependenciesFinished:
|
||||||
|
notificationApi["success"]({
|
||||||
|
message: `Installing python dependencies for ${body.GroupId} of ${body.Category} finished`,
|
||||||
|
description: `You can now start the group task`,
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case ReceivedMessagesCommands.default:
|
||||||
console.error("unknown command", cmd);
|
console.error("unknown command", cmd);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue