流水线节点管理和模板管理

This commit is contained in:
2024-05-07 14:08:46 +08:00
parent 5a61933857
commit 8ae91ff558
48 changed files with 1348 additions and 9 deletions

View File

@@ -0,0 +1,43 @@
<%= form_with(model: template, local: true) do |form| %>
<% if template.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(template.errors.count, "error") %> prohibited this node type from being saved:</h2>
<ul>
<% template.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= form.label :name, "模板名称" %>
<%= form.text_field :name %>
</div>
<div class="field">
<%= form.label :description, "描述" %>
<%= form.text_area :description, rows: 5, :style => 'width:800px;' %>
</div>
<div class="field">
<%= form.label :img, "配图" %>
<%= form.text_field :img %>
</div>
<div class="field">
<%= form.label :sort_no, "排序号" %>
<%= form.text_field :sort_no %>
</div>
<div class="field">
<%= form.label :yaml, "yaml语法代码" %>
<%= form.text_area :yaml, rows: 5, :style => 'width:1200px;' %>
</div>
<div class="field">
<%= form.label :json, "json语法代码" %>
<%= form.text_area :json, rows: 5, :style => 'width:1200px;' %>
</div>
<div class="actions" style="margin-top:10px;">
<!-- <a href="/managements/competition/customize" style="font-size: 28px;">>>前往节点管理页面</a>-->
<%= form.submit("保存") %>
</div>
<% end %>

View File

@@ -0,0 +1,6 @@
<h1>编辑
<!-- <a href="/managements/competition/customize" style="font-size: 28px;">>>前往定制竞赛管理页面</a>-->
</h1>
<%= render 'form', template: @template %>
<%= link_to 'Back', action_templates_path %>

View File

@@ -0,0 +1,37 @@
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
<h1>action 模板配置<%= link_to '>>>Back action节点首页', action_nodes_path %>
<!-- <a href="/managements/competition/customize" style="font-size: 28px;">>>前往节点配置</a>-->
</h1>
<p>说明该界面适用于action 模板配置</p>
<table border="1" width="100%">
<thead>
<tr>
<th>ID</th>
<th width="20%">模板名称</th>
<th width="25%">描述</th>
<th>排序号</th>
<th>更新时间</th>
<th colspan="2">操作</th>
</tr>
</thead>
<!-- :id, :name, :input_type, :description, :sort_no,-->
<tbody>
<% @templates.each do |info| %>
<tr>
<td><%= info.id %></td>
<td><%= info.name %></td>
<td><%= info.description %></td>
<td><%= info.sort_no %></td>
<td><%= info.updated_at&.strftime('%Y-%m-%d %H:%M') %></td>
<td><%= link_to '编辑', edit_action_template_path(info) %></td>
<td><%= link_to 'Destroy', action_template_path(info), method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%= link_to '新增', new_action_template_path %>

View File

@@ -0,0 +1,3 @@
json.templates @templates.each do |tpl|
json.extract! tpl, :id, :name, :description, :img, :sort_no, :json, :yaml
end

View File

@@ -0,0 +1,5 @@
<h1>新增</h1>
<%= render 'form', template: @template %>
<%= link_to 'Back', action_templates_path %>

View File

@@ -0,0 +1 @@
json.extract! @template, :id, :name, :description, :img, :sort_no, :json, :yaml