|
@@ -4,6 +4,8 @@ import { ITaskData } from "../api/task";
|
|
|
import "../article/article.css";
|
|
import "../article/article.css";
|
|
|
import { useEffect, useState } from "react";
|
|
import { useEffect, useState } from "react";
|
|
|
import ChannelSelectWithToken from "../channel/ChannelSelectWithToken";
|
|
import ChannelSelectWithToken from "../channel/ChannelSelectWithToken";
|
|
|
|
|
+import { TChannelType } from "../api/Channel";
|
|
|
|
|
+import { TPower } from "../api/token";
|
|
|
|
|
|
|
|
type TParamType =
|
|
type TParamType =
|
|
|
| "number"
|
|
| "number"
|
|
@@ -113,8 +115,8 @@ const TaskBuilderProp = ({ workflow, channelsId, onChange }: IWidget) => {
|
|
|
|
|
|
|
|
const Value = (item: IParam, taskId: number, paramId: number) => {
|
|
const Value = (item: IParam, taskId: number, paramId: number) => {
|
|
|
let channelType: string | undefined;
|
|
let channelType: string | undefined;
|
|
|
|
|
+ const [key, channel, power] = item.key.replaceAll("%", "").split("@");
|
|
|
if (item.key.includes("@channel")) {
|
|
if (item.key.includes("@channel")) {
|
|
|
- const [_, channel] = item.key.split("@");
|
|
|
|
|
if (channel.includes(":")) {
|
|
if (channel.includes(":")) {
|
|
|
channelType = channel.split(":")[1].replaceAll("%", "");
|
|
channelType = channel.split(":")[1].replaceAll("%", "");
|
|
|
}
|
|
}
|
|
@@ -142,7 +144,8 @@ const TaskBuilderProp = ({ workflow, channelsId, onChange }: IWidget) => {
|
|
|
) : (
|
|
) : (
|
|
|
<ChannelSelectWithToken
|
|
<ChannelSelectWithToken
|
|
|
channelsId={channelsId}
|
|
channelsId={channelsId}
|
|
|
- type={channelType}
|
|
|
|
|
|
|
+ type={channelType as TChannelType}
|
|
|
|
|
+ power={power ? (power as TPower) : undefined}
|
|
|
onChange={(e) => {
|
|
onChange={(e) => {
|
|
|
console.debug("channel select onChange", e);
|
|
console.debug("channel select onChange", e);
|
|
|
change(taskId, paramId, e ?? "", item.initValue, item.step);
|
|
change(taskId, paramId, e ?? "", item.initValue, item.step);
|