fixed action节点增加类型和链接控制

This commit is contained in:
xxq250 2024-12-03 11:13:54 +08:00
parent 54fa4e0521
commit 0ca548f3a6
3 changed files with 15 additions and 3 deletions

View File

@ -61,9 +61,11 @@ class Action::NodesController < ApplicationController
def node_params
if params.require(:action_node)
params.require(:action_node).permit(:name, :label, :full_name, :description, :icon, :action_node_types_id, :is_local, :local_url, :yaml, :sort_no)
params.require(:action_node).permit(:name, :label, :full_name, :description, :icon, :action_node_types_id,
:is_local, :local_url, :yaml, :sort_no, :type, :is_mutil_link, :link_type)
else
params.permit(:name, :label, :full_name, :description, :icon, :action_node_types_id, :is_local, :local_url, :yaml, :sort_no)
params.permit(:name, :label, :full_name, :description, :icon, :action_node_types_id, :is_local, :local_url,
:yaml, :sort_no, :type, :is_mutil_link, :link_type)
end
end
end

View File

@ -34,13 +34,16 @@ class Action::Node < ApplicationRecord
belongs_to :user, optional: true
attr_accessor :cust_name, :run_values, :input_values
attr_accessor :cust_name, :run_values, :input_values, :next_step_nodes
validates :name, presence: { message: "不能为空" }
validates :full_name, length: { maximum: 200, too_long: "不能超过200个字符" }
validates :label, length: { maximum: 200, too_long: "不能超过200个字符" }
validates :description, length: { maximum: 65535, too_long: "不能超过65535个字符"}
# type 0: 触发器 1: 任务作业, 2: 步骤
enum type: {trigger: 0, job: 1, step: 2}
def content_yaml
"foo".to_yaml

View File

@ -0,0 +1,7 @@
class AddActionNodesType < ActiveRecord::Migration[5.2]
def change
add_column :action_nodes, :type, :string
add_column :action_nodes, :is_mutil_link, :boolean
add_column :action_nodes, :link_type, :string
end
end