farmitry_hvac/app/views/modbus/index.html.erb

37 lines
1.1 KiB
Plaintext

<meta http-equiv="refresh" content="5">
<% if flash[:notice] %>
<div class="mb-4 rounded bg-green-100 px-4 py-2 text-green-800 border border-green-300">
<%= flash[:notice] %>
</div>
<% elsif flash[:alert] %>
<div class="mb-4 rounded bg-red-100 px-4 py-2 text-red-800 border border-red-300">
<%= 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>
<% end %>
<div class="py-4">
<%= button_to "수정", schedule_edit_modbus_index_path, method: :get, class: "btn bg-primary" %>
</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>
<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>