신규 추가 작업 중

This commit is contained in:
ming 2025-05-29 08:46:12 +09:00
parent a117d417f4
commit 2d174d4fd0
34 changed files with 892 additions and 175 deletions

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 122.88 117.35" style="enable-background:new 0 0 122.88 117.35" xml:space="preserve">
<style type="text/css">.st0{fill-rule:evenodd;clip-rule:evenodd;}</style>
<g><path class="st0" d="M79.22,54.41c5.16,3.03,9.06,6.88,11.81,11.19h5.36v36.21h-5.73c-5.72,9.03-15.74,15.53-28.98,15.53 c-13.23,0-23.34-6.5-29.09-15.53h-5.96V65.6h5.91c2.98-4.48,7.25-8.48,12.96-11.58c3.04-1.64,4.88-3.69,4.9-5.53 c0.03-2.33-2.52-4.31-5.26-4.31h-1.36c-3.32,0-6.04-2.72-6.04-6.04l0,0c0-3.32,2.72-6.04,6.04-6.04h7.76l6.1-7.57 c-0.02-0.28-0.04-0.57-0.04-0.87v-9.99H32.87c-3.77,0-6.85-3.08-6.85-6.85l0,0c0-3.76,3.08-6.85,6.85-6.85h58.18 c3.76,0,6.85,3.08,6.85,6.85l0,0c0,3.77-3.08,6.85-6.85,6.85H67.51v9.99c0,0.41-0.03,0.82-0.07,1.21l5.48,7.23h6.67 c3.32,0,6.04,2.72,6.04,6.04l0,0c0,3.32-2.72,5.97-6.04,6.04c-4.57,0.1-6.25,2.06-6.04,4.34C73.91,52.73,76.83,53.01,79.22,54.41 L79.22,54.41z M101.34,65.6h4.2v-8.65c0-1.54,1.26-2.79,2.79-2.79h11.76c1.54,0,2.79,1.26,2.79,2.79v53.51 c0,1.54-1.26,2.79-2.79,2.79h-11.76c-1.54,0-2.79-1.26-2.79-2.79v-8.65h-4.2V65.6L101.34,65.6z M21.67,101.81h-4.33v8.65 c0,1.54-1.26,2.79-2.79,2.79H2.79C1.26,113.25,0,112,0,110.46V56.95c0-1.54,1.26-2.79,2.79-2.79h11.76c1.54,0,2.79,1.26,2.79,2.79 v8.65h4.33V101.81L21.67,101.81z"/></g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -9,14 +9,18 @@
--color-warning: rgb(255, 202, 40); --color-warning: rgb(255, 202, 40);
--color-accept: rgb(121, 134, 203); --color-accept: rgb(121, 134, 203);
--color-danger: rgb(239, 83, 80); --color-danger: rgb(239, 83, 80);
--color-table-border: rgb(130, 144, 158); --color-table-border: rgb(181, 188, 199);
--color-table-background: rgb(226, 228, 234);
/* theme */ /* theme */
--color-logo-color: rgb(21, 128, 120); --color-logo-color: rgb(21, 128, 120);
--color-base-background: rgb(39, 44, 56); --color-base-primary: rgb(44, 137, 255);
--color-base-secondary: rgb(55, 61, 71); --color-base-background: rgb(242, 244, 248);
--color-base-text: rgb(255, 255, 255); --color-base-sidebar: rgb(235, 238, 244);
--color-base-border: rgb(77, 84, 102); --color-base-content: rgb(253, 253, 253);
--color-base-third: rgb(201, 208, 210);
--color-base-text: rgb(39, 41, 49);
--color-base-border: rgb(223, 226, 234);
--base-font-size: 0.85rem; --base-font-size: 0.85rem;
--text-xs: calc(var(--base-font-size) * 0.75); --text-xs: calc(var(--base-font-size) * 0.75);
@ -53,7 +57,7 @@
} }
hr { hr {
@apply border-table-border @apply border-base-border
} }
.background-pattern { .background-pattern {
@ -89,7 +93,7 @@
} }
.select-style { .select-style {
@apply block w-full px-2 py-1.5 border border-default-slate/50 rounded-xs text-base-background appearance-none @apply block w-full px-2 py-1.5 border border-default-slate/50 rounded-xs appearance-none
} }
.select-style option { .select-style option {
@ -109,7 +113,7 @@
@apply w-14 h-8 bg-danger rounded-full peer-checked:bg-notice transition-all duration-300 @apply w-14 h-8 bg-danger rounded-full peer-checked:bg-notice transition-all duration-300
} }
.toggle_btn { .btn-toggle-round {
@apply absolute left-1 top-1 w-6 h-6 bg-white rounded-full transition-all duration-300 peer-checked:translate-x-full shadow-sm @apply absolute left-1 top-1 w-6 h-6 bg-white rounded-full transition-all duration-300 peer-checked:translate-x-full shadow-sm
} }
} }
@ -121,11 +125,11 @@
.side-bar { .side-bar {
/*@apply w-[16rem] pl-4 text-lg font-bold divide-y divide-base-border;*/ /*@apply w-[16rem] pl-4 text-lg font-bold divide-y divide-base-border;*/
@apply w-[16rem] pl-4 pr-4 lg:pr-0 text-lg font-bold; @apply w-[16rem] p-4 text-lg font-bold;
} }
.content { .content {
@apply lg:rounded-lg bg-base-secondary; @apply lg:rounded-lg bg-base-content p-0 lg:p-4
} }
.page-title { .page-title {
@ -148,21 +152,25 @@
@apply inline-flex items-center rounded-xs px-2.5 py-1.5 text-sm font-semibold hover:opacity-75 disabled:cursor-not-allowed disabled:opacity-30 disabled:hover:bg-white @apply inline-flex items-center rounded-xs px-2.5 py-1.5 text-sm font-semibold hover:opacity-75 disabled:cursor-not-allowed disabled:opacity-30 disabled:hover:bg-white
} }
.btn-toggle-text {
@apply bg-logo-color rounded-lg text-white text-center
}
/*Menu*/ /*Menu*/
.menu-group { .menu-group {
@apply flex flex-row py-2 px-4 my-4 gap-x-4 justify-between items-center w-full @apply flex flex-row py-1 px-4 my-2 gap-x-4 justify-between items-center w-full
} }
.menu-group-active { .menu-group-active {
@apply bg-base-secondary text-white rounded-md; @apply bg-base-primary rounded-full text-base-content;
} }
.menu-group:hover { /*.menu-group:hover {*/
@apply bg-base-secondary text-white transition-colors rounded-md; /* @apply bg-base-primary/30 transition-colors rounded-full;*/
} /*}*/
.menu-group-icon { .menu-group-icon {
@apply py-1 text-sm font-medium justify-center @apply flex py-1 justify-center items-center
} }
.menu-group-name { .menu-group-name {
@ -179,7 +187,7 @@
/*Dashboard*/ /*Dashboard*/
.dashboard-group { .dashboard-group {
@apply rounded-md bg-base-background h-32 p-4 flex flex-col justify-between cursor-pointer @apply rounded-md bg-base-background min-h-32 p-4 flex flex-col justify-between cursor-pointer
} }
/*Pagy*/ /*Pagy*/
@ -217,15 +225,31 @@
/*Base Table*/ /*Base Table*/
.base-table { .base-table {
@apply min-w-full whitespace-nowrap border border-table-border @apply min-w-full whitespace-nowrap
} }
.base-table th { .base-table th {
@apply bg-base-background px-2 py-2 text-left font-bold lg:table-cell @apply px-2 py-3 text-left font-bold lg:table-cell
}
.base-table tr {
@apply divide-x divide-base-border
} }
.base-table td { .base-table td {
@apply border-t border-table-border px-2 py-1 lg:table-cell whitespace-nowrap @apply border-t border-base-border px-2 py-1 lg:table-cell whitespace-nowrap
}
/*Base List*/
.base-list {
@apply overflow-y-auto divide-y divide-base-border lg:border lg:border-base-border lg:rounded-lg
}
.base-list ul {
@apply divide-y divide-base-border lg:rounded-b-lg
}
.base-list li{
@apply flex justify-between items-center px-4 py-2 space-x-4
} }
} }
@ -272,9 +296,8 @@
/*Fonts*/ /*Fonts*/
@font-face { @font-face {
font-family: 'GongGothicMedium'; font-family: "Chakra_Petch", sans-serif;
src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_20-10@1.0/GongGothicLight.woff') format('woff'); font-weight: 300;
font-weight: normal;
font-style: normal; font-style: normal;
} }

View File

@ -1,2 +0,0 @@
class DeviceController < ApplicationController
end

View File

@ -0,0 +1,25 @@
class EnvironmentController < ApplicationController
def index
@controllers = Controller.all
end
def view_temp
@controller = Controller.find(params[:id])
@schedule = Schedule.where(controller_id: params[:id]).order(:hour, :minute)
end
def view_humidity
@controller = Controller.find(params[:id])
@schedule = Schedule.where(controller_id: params[:id]).order(:hour, :minute)
end
def view_co2
@controller = Controller.find(params[:id])
@schedule = Schedule.where(controller_id: params[:id]).order(:hour, :minute)
end
def view_area
@controller = Controller.find(params[:id])
@schedule = Schedule.where(controller_id: params[:id]).order(:hour, :minute)
end
end

View File

@ -0,0 +1,2 @@
class NutrientController < ApplicationController
end

View File

@ -0,0 +1,2 @@
class RackController < ApplicationController
end

View File

@ -1,2 +0,0 @@
class WebController < ApplicationController
end

View File

@ -1,2 +1,10 @@
module ApplicationHelper module ApplicationHelper
def full_height_page?
controller_name.in?(%w[environment nutrient schedules]) && action_name == 'index' || action_name == 'schedule_edit'
end
def content_container_classes
base_classes = "flex-1 h-full pb-0 px-0 lg:pb-4 lg:px-4"
full_height_page? ? base_classes : "#{base_classes} overflow-y-auto"
end
end end

View File

@ -1,2 +0,0 @@
module DeviceHelper
end

View File

@ -0,0 +1,2 @@
module EnvironmentHelper
end

View File

@ -0,0 +1,2 @@
module NutrientHelper
end

View File

@ -0,0 +1,2 @@
module RackHelper
end

View File

@ -1,2 +0,0 @@
module WebHelper
end

View File

@ -1 +0,0 @@
<div class="p-4">DEVICE</div>

View File

@ -0,0 +1,100 @@
<div class="w-full h-full content">
<div class="flex-1 grid grid-cols-2 lg:grid-cols-4 gap-4">
<!-- 실내온도 -->
<%= link_to view_temp_environment_path(id: params[:id]), class: "dashboard-group" do %>
<div class="flex flex-col justify-between h-full">
<div class="text-xl">실내온도</div>
<div class="flex flex-row justify-between items-baseline w-full">
<i class="fa-solid fa-temperature-quarter text-base-text/80 text-4xl text-left w-full"></i>
<div class="items-baseline text-right w-full">
<span class="text-4xl font-['Chakra_Petch'] font-light">15.5</span>
<span class="text-2xl">°C</span>
</div>
</div>
</div>
<% end %>
<!-- 실내습도 -->
<%= link_to view_humidity_environment_path(id: params[:id]), class: "dashboard-group" do %>
<div class="flex flex-col justify-between h-full">
<div class="text-xl">실내습도</div>
<div class="flex flex-row justify-between items-baseline w-full">
<i class="fa-solid fa-droplet text-base-text/80 text-4xl text-left w-full"></i>
<div class="items-baseline text-right w-full"><span class="text-4xl font-['Chakra_Petch']">60</span>
<span class="text-2xl">%</span>
</div>
</div>
</div>
<% end %>
<!-- CO2 -->
<%= link_to view_co2_environment_path(id: params[:id]), class: "dashboard-group" do %>
<div class="flex flex-col justify-between h-full">
<div><span class="text-xl">CO</span><span class="text-sm">2</span></div>
<div class="flex flex-row justify-between items-baseline w-full">
<div class="size-10 bg-base-text/80 rounded-full text-base-background flex flex-col justify-center">
<div class="flex flex-row justify-center items-baseline">
<span class="text-xl">CO</span><span class="text-sm">2</span>
</div>
</div>
<div class="items-baseline text-right"><span class="text-4xl font-['Chakra_Petch']">60</span>
<span class="text-2xl">%</span></div>
</div>
</div>
<% end %>
<!-- none -->
<div class="dashboard-group"></div>
<!-- 랙 -->
<%= link_to rack_index_path, class: "dashboard-group" do %>
<div class="flex flex-col justify-between h-full">
<div class="text-xl">랙 정보</div>
<div class="flex flex-row justify-between items-baseline w-full">
<i class="fa-solid fa-lightbulb text-base-text/80 text-4xl text-left w-full"></i>
<div class="items-baseline text-right w-full"><span class="text-4xl font-['Chakra_Petch']">5</span>
<span class="text-2xl">라인</span>
</div>
</div>
</div>
<% end %>
<!-- 센서 구역 -->
<%= link_to view_area_environment_path(id: params[:id]), class: "dashboard-group" do %>
<div class="flex flex-col justify-between h-full">
<div class="text-xl">센서구역 정보</div>
<div class="flex flex-row justify-between items-baseline w-full">
<i class="fa-solid fa-fan text-base-text/80 text-4xl text-left w-full"></i>
<div class="items-baseline text-right w-full"><span class="text-4xl font-['Chakra_Petch']">6</span>
<span class="text-2xl">구역</span>
</div>
</div>
</div>
<% end %>
<!-- LED -->
<div class="dashboard-group">
<div class="flex flex-col justify-between h-full">
<div class="text-xl">LED</div>
<div class="flex flex-row justify-between items-baseline w-full">
<i class="fa-solid fa-lightbulb text-base-text/80 text-4xl text-left w-full"></i>
<div class="items-baseline text-right w-full"><span class="text-4xl font-['Chakra_Petch']"><div class="btn-toggle-text">AUTO</div></span>
</div>
</div>
</div>
</div>
<!-- Fan -->
<div class="dashboard-group">
<div class="flex flex-col justify-between h-full">
<div class="text-xl">FAN</div>
<div class="flex flex-row justify-between items-baseline w-full">
<i class="fa-solid fa-fan text-base-text/80 text-4xl text-left w-full"></i>
<div class="items-baseline text-right w-full"><span class="text-4xl font-['Chakra_Petch']"><div class="btn-toggle-text">AUTO</div></span>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,79 @@
<div class="flex flex-col h-full divide-y divide-base-border lg:rounded-lg">
<div class="flex flex-col flex-1 space-y-4 overflow-y-hidden">
<div class="flex justify-between">
<div class="flex flex-row items-center space-x-4">
<%= link_to environment_index_path(id: params[:id]), class: "flex items-center" do %>
<i class="fa-solid fa-angle-left text-3xl"></i>
<% end %>
<div class="text-2xl font-bold leading-10"><%= @controller.id %>동 센서구역 정보</div>
</div>
<%= link_to "수정", schedule_edit_schedule_path(@controller.id), class: "btn bg-default-slate" %>
</div>
<div class="base-list">
<ul>
<% if @schedule.present? %>
<% @schedule.each do |s| %>
<li>
<div class="flex items-center space-x-6">
<!-- 시간 -->
<div class="flex flex-col lg:flex-row items-baseline space-x-2">
<div>시간</div>
<div class="text-3xl flex items-baseline space-x-1">
<div class="text-center w-[36px]"><%= s.hour.to_s.rjust(2, '0') %></div>
<div>:</div>
<div class="text-center w-[36px]"><%= s.minute.to_s.rjust(2, '0') %></div>
</div>
</div>
<!-- 온도 -->
<div class="flex flex-col lg:flex-row items-baseline space-x-4">
<div>온도</div>
<div class="text-3xl flex items-end space-x-2">
<div class="text-left w-[50px]"><%= s.temperature %></div>
<div class="text-base leading-7">°C</div>
</div>
</div>
</div>
<!-- 사용 여부 -->
<div class="flex flex-col lg:flex-row items-baseline space-x-0 lg:space-x-4 items-end">
<div class="mb-1">ON/OFF</div>
<div class="text-3xl w-8 mr-0">
<%#= 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 %>
<% else %>
<li class="text-center p-4 w-full">저장된 스케줄이 없습니다.</li>
<% end %>
</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>

View File

@ -0,0 +1,58 @@
<div class="flex flex-col h-full divide-y divide-base-border lg:rounded-lg">
<div class="flex flex-col flex-1 space-y-4 overflow-y-hidden">
<div class="flex justify-between">
<div class="flex flex-row items-center space-x-4">
<%= link_to environment_index_path(id: params[:id]), class: "flex items-center" do %>
<i class="fa-solid fa-angle-left text-3xl"></i>
<% end %>
<div class="text-2xl font-bold leading-10"><%= @controller.id %>동 CO2 스케줄러</div>
</div>
<%= link_to "수정", schedule_edit_schedule_path(@controller.id), class: "btn bg-default-slate" %>
</div>
<div class="base-list">
<ul>
<% if @schedule.present? %>
<% @schedule.each do |s| %>
<li>
<div class="flex items-center space-x-6">
<!-- 시간 -->
<div class="flex flex-col lg:flex-row items-baseline space-x-2">
<div>시간</div>
<div class="text-3xl flex items-baseline space-x-1">
<div class="text-center w-[36px]"><%= s.hour.to_s.rjust(2, '0') %></div>
<div>:</div>
<div class="text-center w-[36px]"><%= s.minute.to_s.rjust(2, '0') %></div>
</div>
</div>
<!-- 농도 -->
<div class="flex flex-col lg:flex-row items-baseline space-x-4">
<div>농도</div>
<div class="text-3xl flex items-end space-x-2">
<div class="text-left w-[50px]"><%= s.temperature %></div>
<div class="text-base leading-7">%</div>
</div>
</div>
</div>
<!-- 사용 여부 -->
<div class="flex flex-col lg:flex-row items-baseline space-x-0 lg:space-x-4 items-end">
<div class="mb-1">ON/OFF</div>
<div class="text-3xl w-8 mr-0">
<%#= 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 %>
<% else %>
<li class="text-center p-4 w-full">저장된 스케줄이 없습니다.</li>
<% end %>
</ul>
</div>
</div>
</div>

View File

@ -0,0 +1,58 @@
<div class="flex flex-col h-full divide-y divide-base-border lg:rounded-lg">
<div class="flex flex-col flex-1 space-y-4 overflow-y-hidden">
<div class="flex justify-between">
<div class="flex flex-row items-center space-x-4">
<%= link_to environment_index_path(id: params[:id]), class: "flex items-center" do %>
<i class="fa-solid fa-angle-left text-3xl"></i>
<% end %>
<div class="text-2xl font-bold leading-10"><%= @controller.id %>동 습도 스케줄러</div>
</div>
<%= link_to "수정", schedule_edit_schedule_path(@controller.id), class: "btn bg-default-slate" %>
</div>
<div class="base-list">
<ul>
<% if @schedule.present? %>
<% @schedule.each do |s| %>
<li>
<div class="flex items-center space-x-6">
<!-- 시간 -->
<div class="flex flex-col lg:flex-row items-baseline space-x-2">
<div>시간</div>
<div class="text-3xl flex items-baseline space-x-1">
<div class="text-center w-[36px]"><%= s.hour.to_s.rjust(2, '0') %></div>
<div>:</div>
<div class="text-center w-[36px]"><%= s.minute.to_s.rjust(2, '0') %></div>
</div>
</div>
<!-- 습도 -->
<div class="flex flex-col lg:flex-row items-baseline space-x-4">
<div>습도</div>
<div class="text-3xl flex items-end space-x-2">
<div class="text-left w-[50px]"><%= s.temperature %></div>
<div class="text-base leading-7">%</div>
</div>
</div>
</div>
<!-- 사용 여부 -->
<div class="flex flex-col lg:flex-row items-baseline space-x-0 lg:space-x-4 items-end">
<div class="mb-1">ON/OFF</div>
<div class="text-3xl w-8 mr-0">
<%#= 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 %>
<% else %>
<li class="text-center p-4 w-full">저장된 스케줄이 없습니다.</li>
<% end %>
</ul>
</div>
</div>
</div>

View File

@ -0,0 +1,64 @@
<div class="flex flex-col h-full lg:rounded-lg">
<div class="flex flex-row items-center space-x-4 p-2">
<%= link_to environment_index_path(id: params[:id]), class: "flex items-center" do %>
<i class="fa-solid fa-angle-left text-2xl"></i>
<% end %>
<div class="text-2xl font-bold leading-10"><%= @controller.id %>동 온도 스케줄러</div>
</div>
<div class="flex flex-col flex-1 space-y-4 overflow-y-hidden content">
<div class="flex justify-between">
<%= link_to "수정", schedule_edit_schedule_path(@controller.id), class: "btn bg-default-slate" %>
</div>
<div class="lg:rounded-lg border border-base-border overflow-y-hidden">
<table class="base-table overflow-y-hidden">
<thead>
<tr>
<th>시간</th>
<th>온도</th>
<th>사용여부</th>
</tr>
</thead>
<tbody class="overflow-y-auto">
<% if @schedule.present? %>
<% @schedule.each do |s| %>
<tr>
<!-- 시간 -->
<td>
<div class="text-2xl flex items-baseline space-x-1">
<div class="text-center w-[36px]"><%= s.hour.to_s.rjust(2, '0') %></div>
<div>:</div>
<div class="text-center w-[36px]"><%= s.minute.to_s.rjust(2, '0') %></div>
</div>
</td>
<!-- 온도 -->
<td>
<div class="text-2xl flex items-end space-x-2">
<div class="text-left w-[50px]"><%= s.temperature %></div>
<div class="text-base leading-7">°C</div>
</div>
</td>
<!-- 사용 여부 -->
<td>
<div class="text-2xl w-8 mr-0">
<%#= 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>
</td>
</tr>
<% end %>
<% else %>
<tr>
<td colspan="3" class="text-center p-4 w-full">저장된 스케줄이 없습니다.</td>
</tr>
<% end %>
</thead>
</table>
</div>
</div>
</div>

View File

@ -21,16 +21,17 @@
<%= stylesheet_link_tag :app, "data-turbo-track": "reload" %> <%= stylesheet_link_tag :app, "data-turbo-track": "reload" %>
<%= javascript_include_tag "application", "data-turbo-track": "reload", type: "module" %> <%= javascript_include_tag "application", "data-turbo-track": "reload", type: "module" %>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css">
<link href="https://fonts.googleapis.com/css2?family=Chakra+Petch:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap" rel="stylesheet">
</head> </head>
<body class="background-pattern min-h-screen min-w-full overflow-x-auto h-full whitespace-nowrap"> <body class="min-h-screen min-w-full overflow-x-auto h-full whitespace-nowrap">
<%= turbo_frame_tag :modals %> <%= turbo_frame_tag :modals %>
<main class="flex flex-col h-full" data-controller="sidebar"> <main class="flex flex-row h-full min-h-screen" data-controller="sidebar">
<%= render "partials/header" %>
<div class="flex flex-row flex-1 w-full">
<%= render "partials/sidebar" %> <%= render "partials/sidebar" %>
<div class="flex-1 h-full pb-0 px-0 lg:pb-4 lg:px-4"> <div class="flex flex-col flex-1 w-full h-[100vh]">
<div class="flex-1 h-full content"> <%= render "partials/header" %>
<div class="flex-1 h-full pb-0 px-0 lg:pb-4 lg:px-4 lg:overflow-y-auto">
<div class="flex-1 h-full min-h-full">
<% if flash[:notice] %> <% if flash[:notice] %>
<div class="rounded-tl-md rounded-tr-md px-4 py-2 bg-accept text-white"> <div class="rounded-tl-md rounded-tr-md px-4 py-2 bg-accept text-white">
<%= raw flash[:notice] %> <%= raw flash[:notice] %>
@ -43,6 +44,7 @@
<%= yield %> <%= yield %>
</div> </div>
</div> </div>
<div class="h-10 text-md text-center opacity-60">© 2024 FARMITRY All Rights Reserved.</div>
</div> </div>
</main> </main>
</body> </body>

View File

@ -0,0 +1,212 @@
<div class="w-full h-full content">
<div class="flex-1 grid grid-cols-2 lg:grid-cols-4 gap-4">
<!-- pH -->
<div class="dashboard-group">
<div class="flex justify-between items-baseline">
<div class="text-4xl">pH</div>
<div class="text-3xl font-['Chakra_Petch']">7.1</div>
</div>
<div class="flex justify-between items-baseline">
<div class="text-2xl">
6.0 ~ 6.0
</div>
<div><i class="fa-solid fa-gear text-base-text/30 text-2xl"></i></div>
</div>
</div>
<!-- EC -->
<div class="dashboard-group">
<div class="flex justify-between items-baseline">
<div class="text-4xl">EC</div>
<div class="text-3xl font-['Chakra_Petch']">0.1</div>
</div>
<div class="flex justify-between items-baseline">
<div class="text-2xl">
0 ~ 1
</div>
<div><i class="fa-solid fa-gear text-base-text/30 text-2xl"></i></div>
</div>
</div>
<!-- 양액 온도 -->
<div class="dashboard-group">
<div class="flex flex-col justify-between h-full">
<div class="text-xl">양액 온도</div>
<div class="flex flex-row justify-between items-baseline w-full">
<!-- <i class="fa-solid fa-temperature-quarter text-base-text/80 text-4xl text-left w-full"></i>-->
<div class="items-baseline text-right w-full"><span class="text-4xl font-['Chakra_Petch']">20.96</span>
<span class="text-2xl">°C</span></div>
</div>
</div>
</div>
<!-- 수위 정보 -->
<div class="dashboard-group">
<div class="flex flex-col justify-between h-full">
<div class="text-xl">수위 정보</div>
<!-- <div class="flex flex-row justify-between items-baseline w-full">-->
<!-- <i class="fa-solid fa-temperature-quarter text-base-text/80 text-4xl text-left w-full"></i>-->
<!-- <div class="items-baseline text-right w-full"><span class="text-4xl font-['Chakra_Petch']">20.96</span>-->
<!-- <span class="text-2xl">°C</span></div>-->
<!-- </div>-->
</div>
</div>
<!-- 원수 탱크 -->
<div class="dashboard-group">
<div class="flex flex-col justify-between h-full">
<div class="text-xl">원수 탱크</div>
<div class="flex flex-row justify-between items-baseline w-full">
<i class="fa-solid fa-temperature-quarter text-base-text/80 text-4xl text-left w-full"></i>
<div class="items-baseline text-right w-full">
<span class="text-4xl font-['Chakra_Petch'] font-light"><div class="btn-toggle-text">ON</div></span>
</div>
</div>
</div>
</div>
<!-- 원수 펌프 -->
<div class="dashboard-group">
<div class="flex flex-col justify-between h-full">
<div class="text-xl">원수 펌프</div>
<div class="flex flex-row justify-between items-baseline w-full">
<i class="fa-solid fa-temperature-quarter text-base-text/80 text-4xl text-left w-full"></i>
<div class="items-baseline text-right w-full">
<span class="text-4xl font-['Chakra_Petch'] font-light"><div class="btn-toggle-text">ON</div></span>
</div>
</div>
</div>
</div>
<!-- 교반기A -->
<div class="dashboard-group">
<div class="flex flex-col justify-between h-full">
<div class="text-xl">교반기A</div>
<div class="flex flex-row justify-between items-baseline w-full">
<i class="fa-solid fa-temperature-quarter text-base-text/80 text-4xl text-left w-full"></i>
<div class="items-baseline text-right w-full">
<span class="text-4xl font-['Chakra_Petch'] font-light"><div class="btn-toggle-text">ON</div></span>
</div>
</div>
</div>
</div>
<!-- 교반기B -->
<div class="dashboard-group">
<div class="flex flex-col justify-between h-full">
<div class="text-xl">교반기B</div>
<div class="flex flex-row justify-between items-baseline w-full">
<i class="fa-solid fa-temperature-quarter text-base-text/80 text-4xl text-left w-full"></i>
<div class="items-baseline text-right w-full">
<span class="text-4xl font-['Chakra_Petch'] font-light"><div class="btn-toggle-text">ON</div></span>
</div>
</div>
</div>
</div>
<!-- 급수/공급 펌프 -->
<div class="dashboard-group">
<div class="flex flex-col justify-between h-full">
<div class="text-xl">급수/공급 펌프</div>
<div class="flex flex-row justify-between items-baseline w-full">
<i class="fa-solid fa-temperature-quarter text-base-text/80 text-4xl text-left w-full"></i>
<div class="items-baseline text-right w-full">
<span class="text-4xl font-['Chakra_Petch'] font-light"><div class="btn-toggle-text">ON</div></span>
</div>
</div>
</div>
</div>
<!-- 1번급수 솔벨브 -->
<div class="dashboard-group">
<div class="flex flex-col justify-between h-full">
<div class="text-xl">1번급수 솔벨브</div>
<div class="flex flex-row justify-between items-baseline w-full">
<i class="fa-solid fa-temperature-quarter text-base-text/80 text-4xl text-left w-full"></i>
<div class="items-baseline text-right w-full">
<span class="text-4xl font-['Chakra_Petch'] font-light"><div class="btn-toggle-text">ON</div></span>
</div>
</div>
</div>
</div>
<!-- 2번급수 솔벨브 -->
<div class="dashboard-group">
<div class="flex flex-col justify-between h-full">
<div class="text-xl">2번급수 솔벨브</div>
<div class="flex flex-row justify-between items-baseline w-full">
<i class="fa-solid fa-temperature-quarter text-base-text/80 text-4xl text-left w-full"></i>
<div class="items-baseline text-right w-full">
<span class="text-4xl font-['Chakra_Petch'] font-light"><div class="btn-toggle-text">ON</div></span>
</div>
</div>
</div>
</div>
<!-- 퇴수 솔벨브 -->
<div class="dashboard-group">
<div class="flex flex-col justify-between h-full">
<div class="text-xl">퇴수 솔벨브</div>
<div class="flex flex-row justify-between items-baseline w-full">
<i class="fa-solid fa-temperature-quarter text-base-text/80 text-4xl text-left w-full"></i>
<div class="items-baseline text-right w-full">
<span class="text-4xl font-['Chakra_Petch'] font-light"><div class="btn-toggle-text">ON</div></span>
</div>
</div>
</div>
</div>
<!-- 솔레노이드 벨브A -->
<div class="dashboard-group">
<div class="flex flex-col justify-between h-full">
<div class="text-xl">솔레노이드 벨브A</div>
<div class="flex flex-row justify-between items-baseline w-full">
<i class="fa-solid fa-temperature-quarter text-base-text/80 text-4xl text-left w-full"></i>
<div class="items-baseline text-right w-full">
<span class="text-4xl font-['Chakra_Petch'] font-light"><div class="btn-toggle-text">ON</div></span>
</div>
</div>
</div>
</div>
<!-- 솔레노이드 벨브B -->
<div class="dashboard-group">
<div class="flex flex-col justify-between h-full">
<div class="text-xl">솔레노이드 벨브B</div>
<div class="flex flex-row justify-between items-baseline w-full">
<i class="fa-solid fa-temperature-quarter text-base-text/80 text-4xl text-left w-full"></i>
<div class="items-baseline text-right w-full">
<span class="text-4xl font-['Chakra_Petch'] font-light"><div class="btn-toggle-text">ON</div></span>
</div>
</div>
</div>
</div>
<!-- 솔레노이드 벨브C -->
<div class="dashboard-group">
<div class="flex flex-col justify-between h-full">
<div class="text-xl">솔레노이드 벨브C</div>
<div class="flex flex-row justify-between items-baseline w-full">
<i class="fa-solid fa-temperature-quarter text-base-text/80 text-4xl text-left w-full"></i>
<div class="items-baseline text-right w-full">
<span class="text-4xl font-['Chakra_Petch'] font-light"><div class="btn-toggle-text">ON</div></span>
</div>
</div>
</div>
</div>
<!-- 긴급 정지 -->
<div class="dashboard-group">
<div class="flex flex-col justify-between h-full">
<div class="text-xl">긴급 정지</div>
<div class="flex flex-row justify-between items-baseline w-full">
<i class="fa-solid fa-temperature-quarter text-base-text/80 text-4xl text-left w-full"></i>
<div class="items-baseline text-right w-full">
<span class="text-4xl font-['Chakra_Petch'] font-light"><div class="btn-toggle-text">ON</div></span>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,13 +1,5 @@
<header class="flex header justify-between items-center" data-controller="timer"> <header class="flex header justify-between items-center" data-controller="timer">
<div class="flex flex-row h-full items-center">
<%= image_tag "svg/svg_logo.svg", class: "w-auto h-8 mr-4" %>
<%= link_to root_path do %>
<div class="flex h-full items-center tracking-[0.5rem]"><span class="text-logo-color">FARM</span>ITRY</div>
<% end %>
</div>
<div data-timer-target="output" class="hidden lg:block"></div> <div data-timer-target="output" class="hidden lg:block"></div>
<button data-action="click->sidebar#toggle" class="block lg:hidden p-2 cursor-pointer"> <button data-action="click->sidebar#toggle" class="block lg:hidden p-2 cursor-pointer">
<i class="fa-solid fa-bars text-2xl"></i> <i class="fa-solid fa-bars text-2xl"></i>
</button> </button>

View File

@ -24,7 +24,7 @@
From: "opacity-100 translate-y-0 sm:scale-100" From: "opacity-100 translate-y-0 sm:scale-100"
To: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95" To: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
--> -->
<div id="modals-panel" class="p-4 space-y-4 z-50 relative transform overflow-hidden rounded-md bg-base-secondary text-left shadow-xl transition-all w-full max-w-full mx-2 sm:mx-10 opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95 ease-out duration-500" data-controller="modals" data-action="modals:click:outside->modals#close"> <div id="modals-panel" class="p-4 space-y-4 z-50 relative transform overflow-hidden rounded-md bg-base-sidebar text-left shadow-xl transition-all w-full max-w-full mx-2 sm:mx-10 opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95 ease-out duration-500" data-controller="modals" data-action="modals:click:outside->modals#close">
<div> <div>
<%= render "partials/modals/#{type}" %> <%= render "partials/modals/#{type}" %>
</div> </div>

View File

@ -1,31 +1,66 @@
<div data-sidebar-target="overlay" data-action="click->sidebar#close" class="fixed inset-0 bg-black/50 z-40 hidden lg:hidden"></div> <div data-sidebar-target="overlay" data-action="click->sidebar#close" class="fixed inset-0 bg-black/50 z-40 hidden h-full"></div>
<nav class="side-bar overflow-y-auto transition-transform lg:translate-x-0 -translate-x-full bg-base-background lg:bg-transparent fixed lg:relative top-0 left-0 h-full z-40" data-sidebar-target="menu"> <nav class="side-bar overflow-y-auto transition-transform lg:translate-x-0 -translate-x-full bg-base-sidebar lg:bg-base-sidebar fixed lg:relative top-0 left-0 h-full lg:h-[100vh] z-40" data-sidebar-target="menu">
<%= link_to root_path, class: "menu-group #{'menu-group-active' if current_page?(root_path)}" do %> <div class="flex flex-row items-center justify-center">
<%= image_tag "svg/svg_logo.svg", class: "w-auto h-8 mr-4" %>
<%= link_to root_path do %>
<div class="flex h-full items-center text-center tracking-[0.5rem]"><span class="text-logo-color">FARM</span>ITRY</div>
<% end %>
</div>
<div class="mt-8">
<%= link_to environment_index_path(id: 1), class: "menu-group #{'menu-group-active' if current_page?(environment_index_path(id: 1))}" do %>
<div class="menu-group-icon"> <div class="menu-group-icon">
<i class="fa-solid fa-chart-line text-base-text text-4xl"></i> <i class="fa-solid fa-chart-line text-2xl"></i>
</div> </div>
<div class="menu-group-name"> <div class="menu-group-name">
현황 1동 환경부
</div> </div>
<% end %> <% end %>
<hr> <hr>
<% @controllers.each do |c| %> <%= link_to nutrient_index_path(id: 1), class: "menu-group #{'menu-group-active' if current_page?(nutrient_index_path(id: 1))}" do %>
<%= link_to view_schedule_path(c.id), class: "menu-group #{'menu-group-active' if current_page?(view_schedule_path(c.id))}" do %>
<div class="menu-group-icon"> <div class="menu-group-icon">
<i class="fa-solid fa-temperature-high text-base-text text-4xl"></i> <i class="fa-solid fa-chart-line text-2xl"></i>
</div> </div>
<div class="menu-group-name"> <div class="menu-group-name">
<%= c.name %> 1동 양액부
</div> </div>
<% end %> <% end %>
<hr> <hr>
<% end %> <%= link_to environment_index_path(id: 2), class: "menu-group #{'menu-group-active' if current_page?(environment_index_path(id: 2))}" do %>
<div class="menu-group">
<div class="menu-group-icon"> <div class="menu-group-icon">
<i class="fa-solid fa-gear text-base-text text-4xl"></i> <i class="fa-solid fa-chart-line text-2xl"></i>
</div> </div>
<div class="menu-group-name"> <div class="menu-group-name">
설청 2동 환경부
</div> </div>
<% end %>
<hr>
<%= link_to nutrient_index_path(id: 2), class: "menu-group #{'menu-group-active' if current_page?(nutrient_index_path(id: 2))}" do %>
<div class="menu-group-icon">
<i class="fa-solid fa-chart-line text-2xl"></i>
</div> </div>
<div class="menu-group-name">
2동 양액부
</div>
<% end %>
<hr>
<%= link_to rack_index_path, class: "menu-group #{'menu-group-active' if current_page?(rack_index_path)}" do %>
<div class="menu-group-icon">
<i class="fa-solid fa-chart-line text-2xl"></i>
</div>
<div class="menu-group-name">
통합 랙 정보
</div>
<% end %>
</div>
<%# @controllers.each do |c| %>
<%#= link_to view_schedule_path(c.id), class: "menu-group #{'menu-group-active' if current_page?(view_schedule_path(c.id))}" do %>
<!-- <div class="menu-group-icon">-->
<!-- <i class="fa-solid fa-temperature-high text-2xl"></i>-->
<!-- </div>-->
<!-- <div class="menu-group-name">-->
<%#= c.name %>
<!-- </div>-->
<%# end %>
<!-- <hr>-->
<%# end %>
</nav> </nav>

View File

@ -0,0 +1,38 @@
<div class="flex flex-col h-full divide-y divide-base-border lg:rounded-lg bg-base-third border border-table-border">
<div class="flex flex-col flex-1 space-y-4 overflow-y-hidden">
<div class="base-list">
<div class="flex justify-between p-4">
<div class="flex flex-row items-center space-x-4">
<%= link_to environment_index_path(id: 1), class: "flex items-center" do %>
<i class="fa-solid fa-angle-left text-3xl"></i>
<% end %>
<div class="text-2xl font-bold leading-10">통합 랙 정보</div>
</div>
</div>
<ul>
<li>
<div class="flex items-center space-x-6">
<!-- 시간 -->
<div class="flex flex-col lg:flex-row items-baseline space-x-2">
<div>시간</div>
<div class="text-3xl flex items-baseline space-x-1">
<div class="text-center w-[36px]">00</div>
<div>:</div>
<div class="text-center w-[36px]">00</div>
</div>
</div>
<!-- 온도 -->
<div class="flex flex-col lg:flex-row items-baseline space-x-4">
<div>온도</div>
<div class="text-3xl flex items-end space-x-2">
<div class="text-left w-[50px]">00</div>
<div class="text-base leading-7">°C</div>
</div>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>

View File

@ -6,7 +6,7 @@
<div class="flex flex-row justify-between items-baseline w-full"> <div class="flex flex-row justify-between items-baseline w-full">
<i class="fa-solid fa-temperature-quarter text-base-text/80 text-4xl text-left w-full"></i> <i class="fa-solid fa-temperature-quarter text-base-text/80 text-4xl text-left w-full"></i>
<div class="items-baseline text-right w-full"> <div class="items-baseline text-right w-full">
<span class="text-4xl font-['GongGothicMedium'] font-light">15.5</span> <span class="text-4xl font-['Chakra_Petch'] font-light">15.5</span>
<span class="text-2xl">°C</span> <span class="text-2xl">°C</span>
</div> </div>
</div> </div>
@ -19,7 +19,7 @@
<div class="text-xl">실내습도</div> <div class="text-xl">실내습도</div>
<div class="flex flex-row justify-between items-baseline w-full"> <div class="flex flex-row justify-between items-baseline w-full">
<i class="fa-solid fa-droplet text-base-text/80 text-4xl text-left w-full"></i> <i class="fa-solid fa-droplet text-base-text/80 text-4xl text-left w-full"></i>
<div class="items-baseline text-right w-full"><span class="text-4xl font-['GongGothicMedium']">60</span> <span class="text-2xl">%</span> <div class="items-baseline text-right w-full"><span class="text-4xl font-['Chakra_Petch']">60</span> <span class="text-2xl">%</span>
</div> </div>
</div> </div>
</div> </div>
@ -35,7 +35,7 @@
<span class="text-xl">CO</span><span class="text-sm">2</span> <span class="text-xl">CO</span><span class="text-sm">2</span>
</div> </div>
</div> </div>
<div class="items-baseline text-right"><span class="text-4xl font-['GongGothicMedium']">60</span> <span class="text-2xl">%</span></div> <div class="items-baseline text-right"><span class="text-4xl font-['Chakra_Petch']">60</span> <span class="text-2xl">%</span></div>
</div> </div>
</div> </div>
</div> </div>
@ -49,7 +49,7 @@
<div class="text-xl">FAN</div> <div class="text-xl">FAN</div>
<div class="flex flex-row justify-between items-baseline w-full"> <div class="flex flex-row justify-between items-baseline w-full">
<i class="fa-solid fa-fan text-base-text/80 text-4xl text-left w-full"></i> <i class="fa-solid fa-fan text-base-text/80 text-4xl text-left w-full"></i>
<div class="items-baseline text-right w-full"><span class="text-4xl font-['GongGothicMedium']">60</span> <span class="text-2xl">%</span> <div class="items-baseline text-right w-full"><span class="text-4xl font-['Chakra_Petch']">60</span> <span class="text-2xl">%</span>
</div> </div>
</div> </div>
</div> </div>
@ -61,7 +61,7 @@
<div class="text-xl">공조기</div> <div class="text-xl">공조기</div>
<div class="flex flex-row justify-between items-baseline w-full"> <div class="flex flex-row justify-between items-baseline w-full">
<i class="fa-solid fa-temperature-quarter text-base-text/80 text-4xl text-left w-full"></i> <i class="fa-solid fa-temperature-quarter text-base-text/80 text-4xl text-left w-full"></i>
<div class="items-baseline text-right w-full"><span class="text-4xl font-['GongGothicMedium']">15.5</span> <div class="items-baseline text-right w-full"><span class="text-4xl font-['Chakra_Petch']">15.5</span>
<span class="text-2xl">°C</span></div> <span class="text-2xl">°C</span></div>
</div> </div>
</div> </div>
@ -73,7 +73,7 @@
<div class="text-xl">LED</div> <div class="text-xl">LED</div>
<div class="flex flex-row justify-between items-baseline w-full"> <div class="flex flex-row justify-between items-baseline w-full">
<i class="fa-solid fa-lightbulb text-base-text/80 text-4xl text-left w-full"></i> <i class="fa-solid fa-lightbulb text-base-text/80 text-4xl text-left w-full"></i>
<div class="items-baseline text-right w-full"><span class="text-4xl font-['GongGothicMedium']">60</span> <span class="text-2xl">%</span> <div class="items-baseline text-right w-full"><span class="text-4xl font-['Chakra_Petch']">60</span> <span class="text-2xl">%</span>
</div> </div>
</div> </div>
</div> </div>
@ -86,7 +86,7 @@
<div class="dashboard-group"> <div class="dashboard-group">
<div class="flex justify-between items-baseline"> <div class="flex justify-between items-baseline">
<div class="text-4xl">pH</div> <div class="text-4xl">pH</div>
<div class="text-3xl font-['GongGothicMedium']">7.1</div> <div class="text-3xl font-['Chakra_Petch']">7.1</div>
</div> </div>
<div class="flex justify-between items-baseline"> <div class="flex justify-between items-baseline">
<div class="text-2xl"> <div class="text-2xl">
@ -100,7 +100,7 @@
<div class="dashboard-group"> <div class="dashboard-group">
<div class="flex justify-between items-baseline"> <div class="flex justify-between items-baseline">
<div class="text-4xl">EC</div> <div class="text-4xl">EC</div>
<div class="text-3xl font-['GongGothicMedium']">0.1</div> <div class="text-3xl font-['Chakra_Petch']">0.1</div>
</div> </div>
<div class="flex justify-between items-baseline"> <div class="flex justify-between items-baseline">
<div class="text-2xl"> <div class="text-2xl">
@ -116,7 +116,7 @@
<div class="text-xl">양액온도</div> <div class="text-xl">양액온도</div>
<div class="flex flex-row justify-between items-baseline w-full"> <div class="flex flex-row justify-between items-baseline w-full">
<!-- <i class="fa-solid fa-temperature-quarter text-base-text/80 text-4xl text-left w-full"></i>--> <!-- <i class="fa-solid fa-temperature-quarter text-base-text/80 text-4xl text-left w-full"></i>-->
<div class="items-baseline text-right w-full"><span class="text-4xl font-['GongGothicMedium']">20.96</span> <div class="items-baseline text-right w-full"><span class="text-4xl font-['Chakra_Petch']">20.96</span>
<span class="text-2xl">°C</span></div> <span class="text-2xl">°C</span></div>
</div> </div>
</div> </div>

View File

@ -1,24 +1,25 @@
<div class="flex flex-col h-full text-white overflow-y-auto"> <div class="flex flex-col h-full divide-y divide-base-border lg:rounded-lg bg-base-third border border-table-border">
<div class="flex flex-col flex-1 divide-y divide-base-border"> <div class="flex flex-col flex-1 space-y-4 overflow-y-hidden">
<%= form_with url: schedule_edit_update_schedules_path, method: :post, class: 'flex flex-col h-full' do %> <div class="overflow-y-auto divide-y divide-base-border">
<%= form_with url: schedule_edit_update_schedules_path, method: :post, class: 'flex flex-col' do %>
<%= hidden_field_tag :controller_id, params[:id] %> <%= hidden_field_tag :controller_id, params[:id] %>
<div class="divide-y divide-base-border"> <div class="divide-y divide-base-border">
<div class="flex justify-between p-4"> <div class="flex justify-between p-4">
<div class="text-2xl font-bold leading-10"><%= @controller.name %> 컨트롤러</div> <div class="text-2xl font-bold leading-10"><%= @controller.name %> 컨트롤러</div>
<%= submit_tag "업데이트", class: "btn bg-primary" %> <%= submit_tag "업데이트", class: "btn bg-primary" %>
</div> </div>
<ul class="divide-y divide-base-border whitespace-nowrap h-full relative"> <ul class="divide-y divide-table-border bg-table-background whitespace-nowrap h-full relative">
<% if @schedule.present? %> <% if @schedule.present? %>
<% @schedule.each do |s| %> <% @schedule.each do |s| %>
<li class="flex justify-between items-center px-4 py-2 space-x-4 h-full relative"> <li class="flex justify-between items-center px-4 py-2 space-x-4 h-full relative">
<div class="flex items-center space-x-4 basis-3/5 h-full"> <div class="flex items-center space-x-4 basis-3/5 h-full">
<!-- 시간 --> <!-- 시간 -->
<div class="flex flex-col lg:flex-row h-full items-center space-x-0 space-y-2 lg:space-x-4 lg:space-y-0"> <div class="flex flex-col lg:flex-row h-full items-center space-x-0 space-y-2 lg:space-x-4 lg:space-y-0">
<div class="text-white text-left w-full lg:w-auto">시간</div> <div class=" text-left w-full lg:w-auto">시간</div>
<div class="text-xl flex items-center space-x-1 w-full h-full"> <div class="text-xl flex items-center space-x-1 w-full h-full">
<%= select_tag "schedule[#{s.id}][hour]", <%= select_tag "schedule[#{s.id}][hour]",
options_for_select((0..23).map { |h| [h.to_s.rjust(2, '0'), h] }, s.hour), options_for_select((0..23).map { |h| [h.to_s.rjust(2, '0'), h] }, s.hour),
class: "select-style text-white min-w-[60px]" %> class: "select-style min-w-[60px]" %>
<div>:</div> <div>:</div>
<%= number_field_tag "schedule[#{s.id}][minute]", <%= number_field_tag "schedule[#{s.id}][minute]",
s.minute, min: 0, max: 59, step: 1, inputmode: "decimal", s.minute, min: 0, max: 59, step: 1, inputmode: "decimal",
@ -28,7 +29,7 @@
<!-- 온도 --> <!-- 온도 -->
<div class="flex flex-col lg:flex-row h-full items-center space-x-0 space-y-2 lg:space-x-4 lg:space-y-0"> <div class="flex flex-col lg:flex-row h-full items-center space-x-0 space-y-2 lg:space-x-4 lg:space-y-0">
<div class="text-white text-left w-full lg:w-auto">온도 (°C)</div> <div class=" text-left w-full lg:w-auto">온도 (°C)</div>
<div class="text-xl flex items-center"> <div class="text-xl flex items-center">
<%= number_field_tag "schedule[#{s.id}][temperature]", s.temperature, min: -99, max: 99, step: "0.1", inputmode: "decimal", class: "input-style min-w-[68px]" %> <%= number_field_tag "schedule[#{s.id}][temperature]", s.temperature, min: -99, max: 99, step: "0.1", inputmode: "decimal", class: "input-style min-w-[68px]" %>
</div> </div>
@ -38,17 +39,17 @@
<div class="flex items-center space-x-4 basis-2/5 justify-end h-full"> <div class="flex items-center space-x-4 basis-2/5 justify-end h-full">
<!-- 사용 여부 --> <!-- 사용 여부 -->
<div class="flex flex-col lg:flex-row items-center space-x-0 space-y-2 lg:space-x-4 lg:space-y-0 h-full"> <div class="flex flex-col lg:flex-row items-center space-x-0 space-y-2 lg:space-x-4 lg:space-y-0 h-full">
<div class="text-white">ON/OFF</div> <div class="">ON/OFF</div>
<label class="relative inline-flex items-center cursor-pointer h-full"> <label class="relative inline-flex items-center cursor-pointer h-full">
<%= check_box_tag "schedule[#{s.id}][is_active]", "1", s.is_active == true || s.is_active == 1, class: "sr-only peer" %> <%= check_box_tag "schedule[#{s.id}][is_active]", "1", s.is_active == true || s.is_active == 1, class: "sr-only peer" %>
<div class="toggle_style"></div> <div class="toggle_style"></div>
<div class="toggle_btn"></div> <div class="btn-toggle-round"></div>
</label> </label>
</div> </div>
<!-- 삭제 --> <!-- 삭제 -->
<div class="flex flex-col lg:flex-row items-center space-x-0 space-y-2 lg:space-x-4 lg:space-y-0 h-full relative"> <div class="flex flex-col lg:flex-row items-center space-x-0 space-y-2 lg:space-x-4 lg:space-y-0 h-full relative">
<div class="text-white">&nbsp;</div> <div class="">&nbsp;</div>
<%= link_to schedule_path(s), <%= link_to schedule_path(s),
data: { turbo_method: :delete, turbo_confirm: "정말 삭제하시겠습니까?" }, data: { turbo_method: :delete, turbo_confirm: "정말 삭제하시겠습니까?" },
class: "btn bg-danger text-sm flex items-center px-2 py-0 my-1.5 lg:px-4 lg:py-1.5 lg:my-0" do %> class: "btn bg-danger text-sm flex items-center px-2 py-0 my-1.5 lg:px-4 lg:py-1.5 lg:my-0" do %>
@ -79,3 +80,4 @@
</div> </div>
</div> </div>
</div> </div>
</div>

View File

@ -1,18 +1,18 @@
<div class="flex flex-col h-full divide-y divide-base-border text-white"> <div class="flex flex-col h-full divide-y divide-base-border lg:rounded-lg bg-base-third border border-table-border">
<div class="flex flex-col flex-1 space-y-4 overflow-y-hidden"> <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="base-list">
<div class="flex justify-between p-4"> <div class="flex justify-between p-4">
<div class="text-2xl font-bold leading-10"><%= @controller.name %> 컨트롤러</div> <div class="text-2xl font-bold leading-10"><%= @controller.name %> 컨트롤러</div>
<%= link_to "수정", schedule_edit_schedule_path(@controller.id), class: "btn bg-default-slate" %> <%= link_to "수정", schedule_edit_schedule_path(@controller.id), class: "btn bg-default-slate" %>
</div> </div>
<ul class="divide-y divide-base-border"> <ul>
<% if @schedule.present? %> <% if @schedule.present? %>
<% @schedule.each do |s| %> <% @schedule.each do |s| %>
<li class="flex justify-between items-center px-4 py-2 space-x-4"> <li>
<div class="flex items-center space-x-6"> <div class="flex items-center space-x-6">
<!-- 시간 --> <!-- 시간 -->
<div class="flex flex-col lg:flex-row items-baseline space-x-2"> <div class="flex flex-col lg:flex-row items-baseline space-x-2">
<div class="text-white">시간</div> <div>시간</div>
<div class="text-3xl flex items-baseline space-x-1"> <div class="text-3xl flex items-baseline space-x-1">
<div class="text-center w-[36px]"><%= s.hour.to_s.rjust(2, '0') %></div> <div class="text-center w-[36px]"><%= s.hour.to_s.rjust(2, '0') %></div>
<div>:</div> <div>:</div>
@ -22,17 +22,17 @@
<!-- 온도 --> <!-- 온도 -->
<div class="flex flex-col lg:flex-row items-baseline space-x-4"> <div class="flex flex-col lg:flex-row items-baseline space-x-4">
<div class="text-white">온도</div> <div>온도</div>
<div class="text-3xl flex items-end space-x-2"> <div class="text-3xl flex items-end space-x-2">
<div class="text-left w-[50px]"><%= s.temperature %></div> <div class="text-left w-[50px]"><%= s.temperature %></div>
<div class="text-white text-base leading-7">°C</div> <div class="text-base leading-7">°C</div>
</div> </div>
</div> </div>
</div> </div>
<!-- 사용 여부 --> <!-- 사용 여부 -->
<div class="flex flex-col lg:flex-row items-baseline space-x-0 lg:space-x-4 items-end"> <div class="flex flex-col lg:flex-row items-baseline space-x-0 lg:space-x-4 items-end">
<div class="text-white mb-1">ON/OFF</div> <div class="mb-1">ON/OFF</div>
<div class="text-3xl w-8 mr-0"> <div class="text-3xl w-8 mr-0">
<%#= s.is_active %> <%#= s.is_active %>
<% if s.is_active %> <% if s.is_active %>

View File

@ -1 +0,0 @@
<div>WEB</div>

View File

@ -11,7 +11,7 @@ Rails.application.routes.draw do
# Defines the root path route ("/") # Defines the root path route ("/")
root "schedules#index" root "environment#index"
resources :schedules do resources :schedules do
member do member do
@ -30,6 +30,15 @@ Rails.application.routes.draw do
end end
end end
resources :device resources :environment do
resources :web member do
get "view_temp"
get "view_humidity"
get "view_co2"
get "view_area"
end
end
resources :nutrient
resources :rack
end end

View File

@ -22,13 +22,13 @@ begin
end end
end end
rescue rescue
error_message = "[#{Time.now}] #{mode} 실행 실패 (station_id: #{controller_id}, value: #{value})" # error_message = "[#{Time.now}] #{mode} 실행 실패 (station_id: #{controller_id}, value: #{value})"
res = Sms.send_one( # res = Sms.send_one(
{ # {
to: '01062619801', # to: '01062619801',
from: '01062619801', # from: '01062619801',
text: error_message # text: error_message
} # }
) # )
puts res # puts res
end end

View File

@ -0,0 +1,7 @@
require "test_helper"
class EnvironmentControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end

View File

@ -1,6 +1,6 @@
require "test_helper" require "test_helper"
class DeviceControllerTest < ActionDispatch::IntegrationTest class NutrientControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do # test "the truth" do
# assert true # assert true
# end # end

View File

@ -1,6 +1,6 @@
require "test_helper" require "test_helper"
class WebControllerTest < ActionDispatch::IntegrationTest class RackControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do # test "the truth" do
# assert true # assert true
# end # end