diff --git a/app/controllers/action/nodes_controller.rb b/app/controllers/action/nodes_controller.rb index d85a6094a..ebccf8efe 100644 --- a/app/controllers/action/nodes_controller.rb +++ b/app/controllers/action/nodes_controller.rb @@ -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 diff --git a/app/models/action/node.rb b/app/models/action/node.rb index 79c54293d..3ce092fd2 100644 --- a/app/models/action/node.rb +++ b/app/models/action/node.rb @@ -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 diff --git a/db/migrate/202412030203041_add_action_nodes_type.rb b/db/migrate/202412030203041_add_action_nodes_type.rb new file mode 100644 index 000000000..b13aa3ee0 --- /dev/null +++ b/db/migrate/202412030203041_add_action_nodes_type.rb @@ -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