From 10a33ace70f02ecc6009290ba9f64c349c10ac2b Mon Sep 17 00:00:00 2001 From: feng <281221230@qq.com> Date: Thu, 28 Nov 2024 16:51:21 +0800 Subject: [PATCH 1/8] fix sitepage softbot_build bug --- app/controllers/site_pages_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/site_pages_controller.rb b/app/controllers/site_pages_controller.rb index 085f1b027..ca1b5800b 100644 --- a/app/controllers/site_pages_controller.rb +++ b/app/controllers/site_pages_controller.rb @@ -54,7 +54,8 @@ class SitePagesController < ApplicationController user = User.find_by_login params[:repository][:owner][:login] return normal_status(-1, '你还未开通Page服务,无法进行部署') unless user.website_permission - project = Project.where(identifier: params[:repository][:name],user_id: user.id) + project = Project.find_by(identifier: params[:repository][:name],user_id: user.id) + return normal_status(-1, '项目不存在') if project.nil? return normal_status(-1, '你没有权限操作') if project.owner?(user) return normal_status(-1, '该仓库还未开通Page服务,无法进行部署') if Page.exists?(user: user, project: project) From b6645bd34a902915a02d06840aac5c7332390a22 Mon Sep 17 00:00:00 2001 From: feng <281221230@qq.com> Date: Thu, 28 Nov 2024 17:16:00 +0800 Subject: [PATCH 2/8] fix sitepage softbot_build --- app/controllers/site_pages_controller.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/site_pages_controller.rb b/app/controllers/site_pages_controller.rb index ca1b5800b..9fa1b494a 100644 --- a/app/controllers/site_pages_controller.rb +++ b/app/controllers/site_pages_controller.rb @@ -56,7 +56,6 @@ class SitePagesController < ApplicationController project = Project.find_by(identifier: params[:repository][:name],user_id: user.id) return normal_status(-1, '项目不存在') if project.nil? - return normal_status(-1, '你没有权限操作') if project.owner?(user) return normal_status(-1, '该仓库还未开通Page服务,无法进行部署') if Page.exists?(user: user, project: project) @page = Page.find_by(user: user, project: project) From 9885881a28911a3adf3bdaffbadac21483e9a842 Mon Sep 17 00:00:00 2001 From: feng <281221230@qq.com> Date: Thu, 28 Nov 2024 17:29:58 +0800 Subject: [PATCH 3/8] Page.exist fix --- app/controllers/site_pages_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/site_pages_controller.rb b/app/controllers/site_pages_controller.rb index 9fa1b494a..408add73a 100644 --- a/app/controllers/site_pages_controller.rb +++ b/app/controllers/site_pages_controller.rb @@ -56,7 +56,7 @@ class SitePagesController < ApplicationController project = Project.find_by(identifier: params[:repository][:name],user_id: user.id) return normal_status(-1, '项目不存在') if project.nil? - return normal_status(-1, '该仓库还未开通Page服务,无法进行部署') if Page.exists?(user: user, project: project) + return normal_status(-1, '该仓库还未开通Page服务,无法进行部署') unless Page.exists?(user: user, project: project) @page = Page.find_by(user: user, project: project) response_str = @page.deploy_page(branch) From 0ca548f3a677b1f62bae0ed09c09511e23e07bc1 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Tue, 3 Dec 2024 11:13:54 +0800 Subject: [PATCH 4/8] =?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 From 18d575512d3da477cef685c36211a08037e52b63 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Tue, 3 Dec 2024 11:23:54 +0800 Subject: [PATCH 5/8] =?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/models/action/node.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/action/node.rb b/app/models/action/node.rb index 3ce092fd2..072089835 100644 --- a/app/models/action/node.rb +++ b/app/models/action/node.rb @@ -42,7 +42,7 @@ class Action::Node < ApplicationRecord validates :description, length: { maximum: 65535, too_long: "不能超过65535个字符"} # type 0: 触发器 1: 任务作业, 2: 步骤 - enum type: {trigger: 0, job: 1, step: 2} + enum type: {start: 0, job: 1, step: 2} def content_yaml From 1901aca44cabdff71f94e8b4ca9ab9c3f07e073c Mon Sep 17 00:00:00 2001 From: xxq250 Date: Tue, 3 Dec 2024 11:27:52 +0800 Subject: [PATCH 6/8] =?UTF-8?q?fixed=20action=E7=B1=BB=E5=9E=8B=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=B8=BAnode=5Ftype?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/action/node.rb | 2 +- db/migrate/202412030203041_add_action_nodes_type.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/action/node.rb b/app/models/action/node.rb index 072089835..ea072bded 100644 --- a/app/models/action/node.rb +++ b/app/models/action/node.rb @@ -42,7 +42,7 @@ class Action::Node < ApplicationRecord validates :description, length: { maximum: 65535, too_long: "不能超过65535个字符"} # type 0: 触发器 1: 任务作业, 2: 步骤 - enum type: {start: 0, job: 1, step: 2} + enum node_type: {start: 0, job: 1, step: 2} def content_yaml diff --git a/db/migrate/202412030203041_add_action_nodes_type.rb b/db/migrate/202412030203041_add_action_nodes_type.rb index b13aa3ee0..bc7d77f4f 100644 --- a/db/migrate/202412030203041_add_action_nodes_type.rb +++ b/db/migrate/202412030203041_add_action_nodes_type.rb @@ -1,6 +1,6 @@ class AddActionNodesType < ActiveRecord::Migration[5.2] def change - add_column :action_nodes, :type, :string + add_column :action_nodes, :node_type, :string add_column :action_nodes, :is_mutil_link, :boolean add_column :action_nodes, :link_type, :string end From 5939e59347812bf6249d53aed3aaa5dc48abfc5e Mon Sep 17 00:00:00 2001 From: xxq250 Date: Tue, 3 Dec 2024 11:30:23 +0800 Subject: [PATCH 7/8] =?UTF-8?q?fixed=20action=E7=B1=BB=E5=9E=8B=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=B8=BAnode=5Ftype?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/action/nodes/index.json.jbuilder | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/action/nodes/index.json.jbuilder b/app/views/action/nodes/index.json.jbuilder index fc8a38505..835c7f145 100644 --- a/app/views/action/nodes/index.json.jbuilder +++ b/app/views/action/nodes/index.json.jbuilder @@ -2,7 +2,7 @@ json.types @node_types.each do |node_type| if node_type.name.to_s == "未分类" json.extract! node_type, :id, :name json.nodes @no_type_nodes do |node| - json.extract! node, :id, :label, :name, :full_name, :description, :icon, :action_node_types_id, :yaml, :sort_no, :use_count + json.extract! node, :id, :label, :name, :full_name, :description, :icon, :action_node_types_id, :yaml, :sort_no, :use_count, :node_type, :is_mutil_link, :link_type json.inputs node.action_node_inputs do |node_input| json.partial! "node_input", locals: { node_input: node_input, node: node } end @@ -10,7 +10,7 @@ json.types @node_types.each do |node_type| else json.extract! node_type, :id, :name json.nodes node_type.action_nodes do |node| - json.extract! node, :id, :label, :name, :full_name, :description, :icon, :action_node_types_id, :yaml, :sort_no, :use_count + json.extract! node, :id, :label, :name, :full_name, :description, :icon, :action_node_types_id, :yaml, :sort_no, :use_count, :node_type, :is_mutil_link, :link_type json.inputs node.action_node_inputs do |node_input| json.partial! "node_input", locals: { node_input: node_input, node: node } end From d9880b66d77e78d231229e7b328da0de85da9cc5 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Tue, 3 Dec 2024 11:48:47 +0800 Subject: [PATCH 8/8] =?UTF-8?q?fixed=20action=E8=8A=82=E7=82=B9=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/action/node.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/models/action/node.rb b/app/models/action/node.rb index ea072bded..290d302bd 100644 --- a/app/models/action/node.rb +++ b/app/models/action/node.rb @@ -23,7 +23,7 @@ # index_action_nodes_on_action_node_types_id (action_node_types_id) # index_action_nodes_on_user_id (user_id) # - +# node_type 0: 触发器 1: 任务作业, 2: 步骤 class Action::Node < ApplicationRecord self.table_name = 'action_nodes' default_scope { order(sort_no: :asc) } @@ -41,8 +41,6 @@ class Action::Node < ApplicationRecord validates :label, length: { maximum: 200, too_long: "不能超过200个字符" } validates :description, length: { maximum: 65535, too_long: "不能超过65535个字符"} - # type 0: 触发器 1: 任务作业, 2: 步骤 - enum node_type: {start: 0, job: 1, step: 2} def content_yaml