From 69c98034d6842f1b898926501d8bdabe950da2c9 Mon Sep 17 00:00:00 2001 From: ming Date: Mon, 28 Apr 2025 11:26:34 +0900 Subject: [PATCH] =?UTF-8?q?=EC=8A=A4=EC=BC=80=EC=A4=84=EB=9F=AC=20view=20?= =?UTF-8?q?=EC=8A=A4=ED=83=80=EC=9D=BC=20=EB=A6=AC=EC=8A=A4=ED=8A=B8?= =?UTF-8?q?=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stylesheets/application.tailwind.css | 10 ++- app/views/schedules/schedule_edit.html.erb | 2 +- app/views/schedules/view.html.erb | 82 ++++++++++++++----- modbus.rb | 18 ++-- 4 files changed, 78 insertions(+), 34 deletions(-) diff --git a/app/assets/stylesheets/application.tailwind.css b/app/assets/stylesheets/application.tailwind.css index 7dae164..613572e 100644 --- a/app/assets/stylesheets/application.tailwind.css +++ b/app/assets/stylesheets/application.tailwind.css @@ -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 { diff --git a/app/views/schedules/schedule_edit.html.erb b/app/views/schedules/schedule_edit.html.erb index ef15d8c..2f4088c 100644 --- a/app/views/schedules/schedule_edit.html.erb +++ b/app/views/schedules/schedule_edit.html.erb @@ -23,7 +23,7 @@ <%= 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" %> <%= number_field_tag "schedule[#{s.id}][minute]", s.minute, min: 0, max: 59, step: 1, inputmode: "decimal", class: "input-style" %> <%= check_box_tag "schedule[#{s.id}][is_active]", "1", s.is_active == true || s.is_active == 1 %> diff --git a/app/views/schedules/view.html.erb b/app/views/schedules/view.html.erb index 8dd921d..19cc4aa 100644 --- a/app/views/schedules/view.html.erb +++ b/app/views/schedules/view.html.erb @@ -1,30 +1,70 @@
-
-
-
+
+
+
<%= @controller.name %> 컨트롤러
<%= link_to "수정", schedule_edit_schedule_path(@controller.id), class: "btn bg-default-slate" %>
- - - - - - - - - - +
    <% @schedule.each do |s| %> -
- - - - - +
  • +
    + +
    +
    시간
    +
    +
    <%= s.hour.to_s.rjust(2, '0') %>
    +
    :
    +
    <%= s.minute.to_s.rjust(2, '0') %>
    +
    +
    + + +
    +
    온도
    +
    +
    <%= s.temperature %>
    +
    °C
    +
    +
    +
    + + +
    +
    사용여부
    +
    + <%#= s.is_active %> + <% if s.is_active %> + + <% else %> + + <% end %> +
    +
    +
  • <% end %> - -
    시간사용여부온도
    <%= s.hour %>시<%= s.minute %>분<%= s.is_active %><%= s.temperature %> °C
    + + + + + + + + + + + + + <%# @schedule.each do |s| %> + + + + + + + <%# end %> + +
    diff --git a/modbus.rb b/modbus.rb index 77c989b..0ef6e52 100644 --- a/modbus.rb +++ b/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