diff --git a/app/views/modbus/index.html.erb b/app/views/modbus/index.html.erb index ae77f45..16de25f 100644 --- a/app/views/modbus/index.html.erb +++ b/app/views/modbus/index.html.erb @@ -7,12 +7,41 @@ <%= flash[:alert] %> <% end %> +
+
+ + + + + + + + + <% @schedule.each do |s| %> + + + + + <% end %> + +
시간온도
<%= s.hour %>시<%= s.temperature %> °C
+
+
+ <%= button_to "스케쥴러 시작", start_modbus_index_path, method: :post, class: "btn bg-accept" %> + <%= button_to "스케쥴러 정지", stop_modbus_index_path, method: :post, class: "btn bg-danger" %> +
-<% @schedule.each do |s| %> -
-
<%= s.hour %>시
-
<%= s.temperature %> °C
+
+ 스케쥴러 상태: + <% if @modbus_running %> + 실행 중 + <% else %> + 정지됨 + <% end %> +
+
-<% end %> - -<%= link_to "수정", "/modbus/schedule_edit", class: "btn btn-primary" %> +
+ <%= link_to "수정", "/modbus/schedule_edit", class: "btn bg-default-slate" %> +
+
\ No newline at end of file diff --git a/app/views/modbus/schedule_edit.html.erb b/app/views/modbus/schedule_edit.html.erb index c986172..dfdc53e 100644 --- a/app/views/modbus/schedule_edit.html.erb +++ b/app/views/modbus/schedule_edit.html.erb @@ -1,14 +1,24 @@ -<%= form_with url: "/modbus/schedule_edit_update", method: :post do %> - <% @schedule.each do |s| %> -
-
<%= s.hour %>시
-
- <%= number_field_tag "schedule[#{s.id}][temperature]", s.temperature, step: "0.1", inputmode: "decimal", class: "border px-2 py-1 rounded" %> °C -
-
- <% end %> - -
- <%= submit_tag "업데이트", class: "bg-blue-500 text-white px-4 py-2 rounded" %> +<%= form_with url: schedule_edit_update_modbus_index_path, method: :post, class: 'flex flex-col h-full divide-y divide-border-table-border' do %> +
+ + + + + + + + + <% @schedule.each do |s| %> + + + + + <% end %> + +
시간온도
<%= s.hour %>시<%= number_field_tag "schedule[#{s.id}][temperature]", s.temperature, step: "0.1", inputmode: "decimal", class: "border px-2 py-1 rounded" %> °C
-<% end %> + +
+ <%= submit_tag "업데이트", class: "btn bg-primary" %> +
+<% end %> \ No newline at end of file