@difizen/ai-flow
Version:
Scalable, out-of-the-box, agent-oriented flow
58 lines • 2.85 kB
JavaScript
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
import { PopoverInNode } from "../../../AIBasic/PopoverInNode";
import classNames from "../../../../utils/classnames";
import { Tag } from 'antd';
import React from 'react';
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
import { Fragment as _Fragment } from "react/jsx-runtime";
export var RunStatusMap = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, 'success', {
Label: '运行成功',
Color: 'green',
Cssclsname: 'bg-green-50'
}), 'processing', {
Label: '运行中',
Color: 'blue',
Cssclsname: 'bg-blue-50'
}), 'warning', {
Label: '警告',
Color: 'yellow',
Cssclsname: 'bg-yellow-50'
}), 'error', {
Label: '运行失败',
Color: 'red',
Cssclsname: 'bg-red-50'
});
export var NodeStatus = function NodeStatus(props) {
var status = props.status,
runDuration = props.runDuration;
var StatusInfo = RunStatusMap[status];
return /*#__PURE__*/_jsxs("div", {
className: classNames(StatusInfo.Cssclsname, 'h-10 flex items-center justify-between px-3 mb-2 rounded-xl'),
children: [/*#__PURE__*/_jsxs("div", {
className: "flex items-center gap-2 text-xs",
children: [StatusInfo.Label, /*#__PURE__*/_jsx(Tag, {
color: "success",
children: "".concat(runDuration, "s")
})]
}), /*#__PURE__*/_jsx(PopoverInNode, {
placement: "right",
trigger: 'click',
className: "nocopy nodelete nodrag noundo",
content: /*#__PURE__*/_jsxs(_Fragment, {
children: [/*#__PURE__*/_jsx("div", {
children: "\u8F93\u5165\uFF1A"
}), /*#__PURE__*/_jsx("div", {
children: "\u8F93\u51FA\uFF1A"
})]
}),
children: /*#__PURE__*/_jsx("span", {
className: "text-xs text-blue-500 cursor-pointer",
children: "\u8FD0\u884C\u7ED3\u679C"
})
})]
});
};