스케줄러 view 스타일 리스트로 수정
This commit is contained in:
parent
2f237acaec
commit
69c98034d6
|
|
@ -14,7 +14,7 @@
|
|||
/* theme */
|
||||
--color-base-background: rgb(39, 44, 56);
|
||||
--color-base-secondary: rgb(55, 61, 71);
|
||||
--color-base-text: rgb(152, 158, 172);
|
||||
--color-base-text: rgb(255, 255, 255);
|
||||
--color-base-border: rgb(77, 84, 102);
|
||||
|
||||
--base-font-size: 0.85rem;
|
||||
|
|
@ -78,7 +78,11 @@
|
|||
}
|
||||
|
||||
.select-style {
|
||||
@apply block w-full h-8 px-3 py-1.5 border border-default-slate/50 rounded-xs
|
||||
@apply block w-full h-8 px-3 py-1.5 border border-default-slate/50 rounded-xs text-base-background
|
||||
}
|
||||
|
||||
.select-style option {
|
||||
color: theme('colors.base-background');
|
||||
}
|
||||
|
||||
.input-style {
|
||||
|
|
@ -183,7 +187,7 @@
|
|||
}
|
||||
|
||||
.base-table th {
|
||||
@apply bg-base-text px-2 py-2 text-left font-bold lg:table-cell
|
||||
@apply bg-base-background px-2 py-2 text-left font-bold lg:table-cell
|
||||
}
|
||||
|
||||
.base-table td {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<td>
|
||||
<%= select_tag "schedule[#{s.id}][hour]",
|
||||
options_for_select((0..23).map { |h| [h.to_s.rjust(2, '0'), h] }, s.hour),
|
||||
class: "input-style" %>
|
||||
class: "select-style text-white" %>
|
||||
</td>
|
||||
<td><%= number_field_tag "schedule[#{s.id}][minute]", s.minute, min: 0, max: 59, step: 1, inputmode: "decimal", class: "input-style" %></td>
|
||||
<td><%= check_box_tag "schedule[#{s.id}][is_active]", "1", s.is_active == true || s.is_active == 1 %></td>
|
||||
|
|
|
|||
|
|
@ -1,30 +1,70 @@
|
|||
<div class="flex flex-col h-full divide-y divide-base-border text-white">
|
||||
<div class="flex flex-col flex-1 p-4 space-y-4 overflow-y-hidden">
|
||||
<div class="overflow-y-auto space-y-4">
|
||||
<div class="flex justify-between">
|
||||
<div class="flex flex-col flex-1 space-y-4 overflow-y-hidden">
|
||||
<div class="overflow-y-auto divide-y divide-base-border">
|
||||
<div class="flex justify-between p-4">
|
||||
<div class="text-2xl font-bold"><%= @controller.name %> 컨트롤러</div>
|
||||
<%= link_to "수정", schedule_edit_schedule_path(@controller.id), class: "btn bg-default-slate" %>
|
||||
</div>
|
||||
<table class="base-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>시간</th>
|
||||
<th>분</th>
|
||||
<th>사용여부</th>
|
||||
<th>온도</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<ul class="divide-y divide-base-border">
|
||||
<% @schedule.each do |s| %>
|
||||
<tr>
|
||||
<td><%= s.hour %>시</td>
|
||||
<td><%= s.minute %>분</td>
|
||||
<td><%= s.is_active %></td>
|
||||
<td><%= s.temperature %> °C</td>
|
||||
</tr>
|
||||
<li class="flex justify-between items-center px-4 py-2 space-x-4">
|
||||
<div class="flex items-center space-x-6">
|
||||
<!-- 시간 -->
|
||||
<div class="flex flex-col md:flex-row items-baseline space-x-2">
|
||||
<div class="text-white">시간</div>
|
||||
<div class="text-3xl flex items-baseline space-x-1">
|
||||
<div><%= s.hour.to_s.rjust(2, '0') %></div>
|
||||
<div>:</div>
|
||||
<div><%= s.minute.to_s.rjust(2, '0') %></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 온도 -->
|
||||
<div class="flex flex-col md:flex-row items-baseline space-x-4">
|
||||
<div class="text-white">온도</div>
|
||||
<div class="text-3xl flex items-end space-x-2">
|
||||
<div><%= s.temperature %></div>
|
||||
<div class="text-white text-xl leading-8">°C</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 사용 여부 -->
|
||||
<div class="flex flex-col md:flex-row items-baseline space-x-4">
|
||||
<div class="text-white mb-1">사용여부</div>
|
||||
<div class="text-3xl">
|
||||
<%#= s.is_active %>
|
||||
<% if s.is_active %>
|
||||
<i class="fa-solid fa-check text-notice"></i>
|
||||
<% else %>
|
||||
<i class="fa-solid fa-xmark text-danger"></i>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</ul>
|
||||
|
||||
<!-- <table class="base-table">-->
|
||||
<!-- <thead>-->
|
||||
<!-- <tr>-->
|
||||
<!-- <th>시간</th>-->
|
||||
<!-- <th>분</th>-->
|
||||
<!-- <th>사용여부</th>-->
|
||||
<!-- <th>온도</th>-->
|
||||
<!-- </tr>-->
|
||||
<!-- </thead>-->
|
||||
<!-- <tbody>-->
|
||||
<%# @schedule.each do |s| %>
|
||||
<!-- <tr>-->
|
||||
<!-- <td><%#= s.hour %>시</td>-->
|
||||
<!-- <td><%#= s.minute %>분</td>-->
|
||||
<!-- <td><%#= s.is_active %></td>-->
|
||||
<!-- <td><%#= s.temperature %> °C</td>-->
|
||||
<!-- </tr>-->
|
||||
<%# end %>
|
||||
<!-- </tbody>-->
|
||||
<!-- </table>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
18
modbus.rb
18
modbus.rb
|
|
@ -22,13 +22,13 @@ begin
|
|||
end
|
||||
end
|
||||
rescue
|
||||
error_message = "[#{Time.now}] #{mode} 실행 실패 (station_id: #{controller_id}, value: #{value})"
|
||||
res = Sms.send_one(
|
||||
{
|
||||
to: '01062619801',
|
||||
from: '01062619801',
|
||||
text: error_message
|
||||
}
|
||||
)
|
||||
puts res
|
||||
# error_message = "[#{Time.now}] #{mode} 실행 실패 (station_id: #{controller_id}, value: #{value})"
|
||||
# res = Sms.send_one(
|
||||
# {
|
||||
# to: '01062619801',
|
||||
# from: '01062619801',
|
||||
# text: error_message
|
||||
# }
|
||||
# )
|
||||
# puts res
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue