Merge branch 'standalone_develop' of https://gitlink.org.cn/Trustie/forgeplus into standalone_develop
This commit is contained in:
commit
bff1dbfc36
|
@ -61,9 +61,11 @@ class Action::NodesController < ApplicationController
|
||||||
|
|
||||||
def node_params
|
def node_params
|
||||||
if params.require(:action_node)
|
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
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -54,9 +54,9 @@ class SitePagesController < ApplicationController
|
||||||
user = User.find_by_login params[:repository][:owner][:login]
|
user = User.find_by_login params[:repository][:owner][:login]
|
||||||
return normal_status(-1, '你还未开通Page服务,无法进行部署') unless user.website_permission
|
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.owner?(user)
|
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)
|
@page = Page.find_by(user: user, project: project)
|
||||||
response_str = @page.deploy_page(branch)
|
response_str = @page.deploy_page(branch)
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
# index_action_nodes_on_action_node_types_id (action_node_types_id)
|
# index_action_nodes_on_action_node_types_id (action_node_types_id)
|
||||||
# index_action_nodes_on_user_id (user_id)
|
# index_action_nodes_on_user_id (user_id)
|
||||||
#
|
#
|
||||||
|
# node_type 0: 触发器 1: 任务作业, 2: 步骤
|
||||||
class Action::Node < ApplicationRecord
|
class Action::Node < ApplicationRecord
|
||||||
self.table_name = 'action_nodes'
|
self.table_name = 'action_nodes'
|
||||||
default_scope { order(sort_no: :asc) }
|
default_scope { order(sort_no: :asc) }
|
||||||
|
@ -34,7 +34,7 @@ class Action::Node < ApplicationRecord
|
||||||
|
|
||||||
belongs_to :user, optional: true
|
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 :name, presence: { message: "不能为空" }
|
||||||
validates :full_name, length: { maximum: 200, too_long: "不能超过200个字符" }
|
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个字符"}
|
validates :description, length: { maximum: 65535, too_long: "不能超过65535个字符"}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def content_yaml
|
def content_yaml
|
||||||
"foo".to_yaml
|
"foo".to_yaml
|
||||||
<<~YAML
|
<<~YAML
|
||||||
|
|
|
@ -2,7 +2,7 @@ json.types @node_types.each do |node_type|
|
||||||
if node_type.name.to_s == "未分类"
|
if node_type.name.to_s == "未分类"
|
||||||
json.extract! node_type, :id, :name
|
json.extract! node_type, :id, :name
|
||||||
json.nodes @no_type_nodes do |node|
|
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.inputs node.action_node_inputs do |node_input|
|
||||||
json.partial! "node_input", locals: { node_input: node_input, node: node }
|
json.partial! "node_input", locals: { node_input: node_input, node: node }
|
||||||
end
|
end
|
||||||
|
@ -10,7 +10,7 @@ json.types @node_types.each do |node_type|
|
||||||
else
|
else
|
||||||
json.extract! node_type, :id, :name
|
json.extract! node_type, :id, :name
|
||||||
json.nodes node_type.action_nodes do |node|
|
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.inputs node.action_node_inputs do |node_input|
|
||||||
json.partial! "node_input", locals: { node_input: node_input, node: node }
|
json.partial! "node_input", locals: { node_input: node_input, node: node }
|
||||||
end
|
end
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue