增加流水线节点名称,和标识区分

This commit is contained in:
2024-05-31 10:56:46 +08:00
parent 62de4a0ac8
commit b96d52a84d
13 changed files with 39 additions and 9 deletions

View File

@@ -36,6 +36,11 @@ class Action::Node < ApplicationRecord
attr_accessor :cust_name, :run_values, :input_values
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个字符"}
def content_yaml
"foo".to_yaml

View File

@@ -24,4 +24,7 @@ class Action::NodeInput < ApplicationRecord
default_scope { order(sort_no: :asc) }
belongs_to :action_node, :class_name => 'Action::Node', foreign_key: "action_nodes_id"
validates :name, presence: { message: "不能为空" }
validates :description, length: { maximum: 65535, too_long: "不能超过65535个字符"}
end

View File

@@ -29,6 +29,9 @@ class Action::NodeSelect < ApplicationRecord
belongs_to :action_node, :class_name => 'Action::Node', foreign_key: "action_nodes_id"
belongs_to :user, optional: true
validates :name, presence: { message: "不能为空" }
validates :description, length: { maximum: 65535, too_long: "不能超过65535个字符"}
def value
if self.val_ext.blank?
self.val

View File

@@ -15,4 +15,7 @@ class Action::NodeType < ApplicationRecord
default_scope { order(sort_no: :asc) }
has_many :action_nodes, :class_name => 'Action::Node', foreign_key: "action_node_types_id"
validates :name, presence: { message: "不能为空" }
validates :description, length: { maximum: 65535, too_long: "不能超过65535个字符"}
end

View File

@@ -33,5 +33,7 @@ class Action::Pipeline < ApplicationRecord
belongs_to :user, optional: true
belongs_to :project
validates :name, presence: { message: "不能为空" }
validates :json, length: { maximum: 65535, too_long: "不能超过65535个字符"}
validates :yaml, length: { maximum: 65535, too_long: "不能超过65535个字符"}
end

View File

@@ -17,4 +17,7 @@ class Action::Template < ApplicationRecord
self.table_name = 'action_templates'
default_scope { order(sort_no: :asc) }
validates :name, presence: { message: "不能为空" }
validates :description, length: { maximum: 65535, too_long: "不能超过65535个字符"}
end