Merge branch 'standalone_develop' of https://gitlink.org.cn/Trustie/forgeplus into standalone_develop

This commit is contained in:
yystopf 2024-12-06 10:41:22 +08:00
commit bff1dbfc36
5 changed files with 19 additions and 9 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

@ -54,9 +54,9 @@ 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)
return normal_status(-1, '你没有权限操作') if project.owner?(user)
return normal_status(-1, '该仓库还未开通Page服务无法进行部署') if Page.exists?(user: user, project: project)
project = Project.find_by(identifier: params[:repository][:name],user_id: user.id)
return normal_status(-1, '项目不存在') if project.nil?
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)

View File

@ -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) }
@ -34,7 +34,7 @@ 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个字符" }
@ -42,6 +42,7 @@ class Action::Node < ApplicationRecord
validates :description, length: { maximum: 65535, too_long: "不能超过65535个字符"}
def content_yaml
"foo".to_yaml
<<~YAML

View File

@ -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

View File

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