From 0ca548f3a677b1f62bae0ed09c09511e23e07bc1 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Tue, 3 Dec 2024 11:13:54 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20action=E8=8A=82=E7=82=B9=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=B1=BB=E5=9E=8B=E5=92=8C=E9=93=BE=E6=8E=A5=E6=8E=A7?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/action/nodes_controller.rb | 6 ++++-- app/models/action/node.rb | 5 ++++- db/migrate/202412030203041_add_action_nodes_type.rb | 7 +++++++ 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 db/migrate/202412030203041_add_action_nodes_type.rb 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