추가 개발 내용 merge

This commit is contained in:
ming 2025-04-17 10:52:01 +09:00
parent d33c49d1e1
commit a479f5da7c
2 changed files with 59 additions and 20 deletions

View File

@ -7,12 +7,41 @@
<%= flash[:alert] %>
</div>
<% end %>
<% @schedule.each do |s| %>
<div class="flex justify-items-center gap-x-2">
<div><%= s.hour %>시</div>
<div><%= s.temperature %> °C</div>
<div class="flex flex-col h-full divide-y divide-border-table-border">
<div class="flex-1 overflow-y-auto p-4 space-y-4">
<table class="base-table">
<thead>
<tr>
<th>시간</th>
<th>온도</th>
</tr>
</thead>
<tbody>
<% @schedule.each do |s| %>
<tr>
<td><%= s.hour %>시</td>
<td><%= s.temperature %> °C</td>
</tr>
<% end %>
</tbody>
</table>
<div>
<div class="flex gap-x-2">
<%= button_to "스케쥴러 시작", start_modbus_index_path, method: :post, class: "btn bg-accept" %>
<%= button_to "스케쥴러 정지", stop_modbus_index_path, method: :post, class: "btn bg-danger" %>
</div>
<% end %>
<%= link_to "수정", "/modbus/schedule_edit", class: "btn btn-primary" %>
<div class="py-4">
<span class="font-semibold">스케쥴러 상태:</span>
<% if @modbus_running %>
<span class="text-accept font-bold">실행 중</span>
<% else %>
<span class="text-danger font-bold">정지됨</span>
<% end %>
</div>
</div>
</div>
<div class="flex p-4">
<%= link_to "수정", "/modbus/schedule_edit", class: "btn bg-default-slate" %>
</div>
</div>

View File

@ -1,14 +1,24 @@
<%= form_with url: "/modbus/schedule_edit_update", method: :post do %>
<%= form_with url: schedule_edit_update_modbus_index_path, method: :post, class: 'flex flex-col h-full divide-y divide-border-table-border' do %>
<div class="flex-1 overflow-y-auto p-4">
<table class="base-table">
<thead>
<tr>
<th>시간</th>
<th>온도</th>
</tr>
</thead>
<tbody>
<% @schedule.each do |s| %>
<div class="flex justify-items-center gap-x-2 pb-2">
<div><%= s.hour %>시</div>
<div>
<%= number_field_tag "schedule[#{s.id}][temperature]", s.temperature, step: "0.1", inputmode: "decimal", class: "border px-2 py-1 rounded" %> °C
</div>
</div>
<tr>
<td><%= s.hour %>시</td>
<td><%= number_field_tag "schedule[#{s.id}][temperature]", s.temperature, step: "0.1", inputmode: "decimal", class: "border px-2 py-1 rounded" %> °C</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<div class="pt-4">
<%= submit_tag "업데이트", class: "bg-blue-500 text-white px-4 py-2 rounded" %>
<div class="flex p-4">
<%= submit_tag "업데이트", class: "btn bg-primary" %>
</div>
<% end %>