Compare commits
17 Commits
f7cedfd799
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 13557d32a6 | |||
| 32842d4b6e | |||
| c6dd64137b | |||
| 703a279ffa | |||
| 27bf89fa3e | |||
| 0d388b8c42 | |||
| ba25fada8e | |||
| ac06cd281f | |||
| a98aab4f45 | |||
| 36bea152fd | |||
| 90f89e08b8 | |||
| 7a99cd1dda | |||
| 9badb4dcd1 | |||
| 05f610bd86 | |||
| 91aefdba24 | |||
| fc61bc87f6 | |||
| 02932e8b79 |
@@ -12,6 +12,7 @@
|
|||||||
--color-table-border: rgb(130, 144, 158);
|
--color-table-border: rgb(130, 144, 158);
|
||||||
|
|
||||||
/* theme */
|
/* theme */
|
||||||
|
--color-logo-color: rgb(21, 128, 120);
|
||||||
--color-base-background: rgb(39, 44, 56);
|
--color-base-background: rgb(39, 44, 56);
|
||||||
--color-base-secondary: rgb(55, 61, 71);
|
--color-base-secondary: rgb(55, 61, 71);
|
||||||
--color-base-text: rgb(255, 255, 255);
|
--color-base-text: rgb(255, 255, 255);
|
||||||
@@ -48,13 +49,23 @@
|
|||||||
|
|
||||||
@layer base {
|
@layer base {
|
||||||
body {
|
body {
|
||||||
@apply text-sm text-default-slate-dark
|
@apply bg-base-background text-base-text font-['Pretendard-Regular']
|
||||||
}
|
}
|
||||||
|
|
||||||
hr {
|
hr {
|
||||||
@apply border-table-border
|
@apply border-table-border
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.background-pattern {
|
||||||
|
background-image: repeating-linear-gradient(
|
||||||
|
-45deg,
|
||||||
|
rgba(255, 255, 255, 0.01) 0,
|
||||||
|
rgba(255, 255, 255, 0.01) 24px,
|
||||||
|
transparent 1px,
|
||||||
|
transparent 36px
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
a.disabled {
|
a.disabled {
|
||||||
@apply pointer-events-none cursor-not-allowed opacity-50
|
@apply pointer-events-none cursor-not-allowed opacity-50
|
||||||
}
|
}
|
||||||
@@ -64,7 +75,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
@apply justify-center rounded-md bg-default-slate px-4 py-2 text-sm font-semibold leading-6 text-white
|
@apply justify-center rounded-md bg-default-slate px-4 py-2 font-semibold leading-6 text-white
|
||||||
shadow-xs hover:opacity-80 cursor-pointer
|
shadow-xs hover:opacity-80 cursor-pointer
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,7 +89,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.select-style {
|
.select-style {
|
||||||
@apply block w-full px-3 py-1.5 border border-default-slate/50 rounded-xs text-base-background
|
@apply block w-full px-2 py-1.5 border border-default-slate/50 rounded-xs text-base-background appearance-none
|
||||||
}
|
}
|
||||||
|
|
||||||
.select-style option {
|
.select-style option {
|
||||||
@@ -86,7 +97,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.input-style {
|
.input-style {
|
||||||
@apply block w-full px-3 py-1.5 border border-default-slate/50 rounded-xs
|
@apply block w-full px-2 py-1.5 border border-default-slate/50 rounded-xs
|
||||||
}
|
}
|
||||||
|
|
||||||
.textarea-style {
|
.textarea-style {
|
||||||
@@ -109,11 +120,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.side-bar {
|
.side-bar {
|
||||||
@apply w-[16rem] px-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;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
@apply rounded-lg bg-base-secondary;
|
@apply lg:rounded-lg bg-base-secondary;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-title {
|
.page-title {
|
||||||
@@ -138,7 +150,15 @@
|
|||||||
|
|
||||||
/*Menu*/
|
/*Menu*/
|
||||||
.menu-group {
|
.menu-group {
|
||||||
@apply flex flex-row py-6 px-4 gap-x-4 justify-between items-center w-full
|
@apply flex flex-row py-2 px-4 my-4 gap-x-4 justify-between items-center w-full
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-group-active {
|
||||||
|
@apply bg-base-secondary text-white rounded-md;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-group:hover {
|
||||||
|
@apply bg-base-secondary text-white transition-colors rounded-md;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-group-icon {
|
.menu-group-icon {
|
||||||
@@ -157,6 +177,11 @@
|
|||||||
@apply text-default-slate-dark text-center
|
@apply text-default-slate-dark text-center
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*Dashboard*/
|
||||||
|
.dashboard-group {
|
||||||
|
@apply rounded-md bg-base-background h-32 p-4 flex flex-col justify-between cursor-pointer
|
||||||
|
}
|
||||||
|
|
||||||
/*Pagy*/
|
/*Pagy*/
|
||||||
.pagy {
|
.pagy {
|
||||||
@apply flex items-center justify-center space-x-1 font-semibold text-sm text-default-slate;
|
@apply flex items-center justify-center space-x-1 font-semibold text-sm text-default-slate;
|
||||||
@@ -234,3 +259,28 @@
|
|||||||
::-webkit-scrollbar-thumb:hover {
|
::-webkit-scrollbar-thumb:hover {
|
||||||
background-color: rgba(100, 100, 100, 0.6);
|
background-color: rgba(100, 100, 100, 0.6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.input-style::-webkit-outer-spin-button,
|
||||||
|
.input-style::-webkit-inner-spin-button {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-style[type="number"] {
|
||||||
|
-moz-appearance: textfield;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Fonts*/
|
||||||
|
@font-face {
|
||||||
|
font-family: 'GongGothicMedium';
|
||||||
|
src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_20-10@1.0/GongGothicLight.woff') format('woff');
|
||||||
|
font-weight: normal;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Pretendard-Regular';
|
||||||
|
src: url('https://fastly.jsdelivr.net/gh/Project-Noonnu/noonfonts_2107@1.1/Pretendard-Regular.woff') format('woff');
|
||||||
|
font-weight: 400;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
@@ -23,20 +23,20 @@
|
|||||||
<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">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="min-h-screen bg-base-background text-base-text min-w-[400px] overflow-x-auto h-full">
|
<body class="background-pattern 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-col h-full" data-controller="sidebar">
|
||||||
<%= render "partials/header" %>
|
<%= render "partials/header" %>
|
||||||
<div class="flex flex-row flex-1 w-full">
|
<div class="flex flex-row flex-1 w-full">
|
||||||
<%= render "partials/sidebar" %>
|
<%= render "partials/sidebar" %>
|
||||||
<div class="flex-1 h-full pb-4 px-4 md:pl-0">
|
<div class="flex-1 h-full pb-0 px-0 lg:pb-4 lg:px-4">
|
||||||
<div class="flex-1 h-full content">
|
<div class="flex-1 h-full content">
|
||||||
<% if flash[:notice] %>
|
<% if flash[:notice] %>
|
||||||
<div class="rounded 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] %>
|
||||||
</div>
|
</div>
|
||||||
<% elsif flash[:alert] %>
|
<% elsif flash[:alert] %>
|
||||||
<div class="rounded px-4 py-2 bg-danger text-white">
|
<div class="rounded-tl-md rounded-tr-md px-4 py-2 bg-danger text-white">
|
||||||
<%= raw flash[:alert] %>
|
<%= raw flash[:alert] %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
<header class="flex header justify-between items-center">
|
<header class="flex header justify-between items-center" data-controller="timer">
|
||||||
<div class="flex flex-row h-full items-center">
|
<div class="flex flex-row h-full items-center">
|
||||||
<%= image_tag "svg/svg_logo.svg", class: "w-auto h-8 mr-4" %>
|
<%= image_tag "svg/svg_logo.svg", class: "w-auto h-8 mr-4" %>
|
||||||
<%= link_to root_path do %>
|
<%= link_to root_path do %>
|
||||||
<div class="flex h-full items-center tracking-[0.5rem]">FARMITRY</div>
|
<div class="flex h-full items-center tracking-[0.5rem]"><span class="text-logo-color">FARM</span>ITRY</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div data-timer-target="output" class="hidden md:block"></div>
|
<div data-timer-target="output" class="hidden lg:block"></div>
|
||||||
|
|
||||||
<button data-action="click->sidebar#toggle" class="block md: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>
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<%= turbo_frame_tag :modals do %>
|
<%= turbo_frame_tag :modals do %>
|
||||||
<div class="relative z-40" aria-labelledby="modal-title" role="dialog" aria-modal="true">
|
<div class="relative z-50" aria-labelledby="modal-title" role="dialog" aria-modal="true">
|
||||||
<!--
|
<!--
|
||||||
Background backdrop, show/hide based on modal state.
|
Background backdrop, show/hide based on modal state.
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
-->
|
-->
|
||||||
<div id="modals-backdrop" class="fixed inset-0 bg-base-background transition-opacity opacity-0 ease-out duration-500" aria-hidden="true"></div>
|
<div id="modals-backdrop" class="fixed inset-0 bg-base-background transition-opacity opacity-0 ease-out duration-500" aria-hidden="true"></div>
|
||||||
|
|
||||||
<div class="fixed inset-0 z-40 w-screen overflow-y-auto py-4">
|
<div class="fixed inset-0 z-50 w-screen overflow-y-auto py-4">
|
||||||
<div class="flex min-h-full items-center justify-center text-center sm:items-center">
|
<div class="flex min-h-full items-center justify-center text-center sm:items-center">
|
||||||
<!--
|
<!--
|
||||||
Modal panel, show/hide based on modal state.
|
Modal panel, show/hide based on modal state.
|
||||||
@@ -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-40 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-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>
|
<div>
|
||||||
<%= render "partials/modals/#{type}" %>
|
<%= render "partials/modals/#{type}" %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,26 +1,28 @@
|
|||||||
<div data-sidebar-target="overlay" data-action="click->sidebar#close" class="fixed inset-0 bg-black/50 z-40 hidden md:hidden"></div>
|
<div data-sidebar-target="overlay" data-action="click->sidebar#close" class="fixed inset-0 bg-black/50 z-40 hidden lg:hidden"></div>
|
||||||
<nav class="side-bar overflow-y-auto transition-transform md:translate-x-0 -translate-x-full fixed md:relative top-0 left-0 h-full bg-base-background z-50" data-sidebar-target="menu">
|
<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">
|
||||||
<div class="menu-group">
|
<%= link_to root_path, class: "menu-group #{'menu-group-active' if current_page?(root_path)}" do %>
|
||||||
<div class="menu-group-icon">
|
<div class="menu-group-icon">
|
||||||
<i class="fa-solid fa-house text-base-text/30 text-4xl"></i>
|
<i class="fa-solid fa-chart-line text-base-text text-4xl"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="menu-group-name">
|
<div class="menu-group-name">
|
||||||
HOME
|
현황
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<% end %>
|
||||||
|
<hr >
|
||||||
<% @controllers.each do |c| %>
|
<% @controllers.each do |c| %>
|
||||||
<%= link_to view_schedule_path(c.id), class: "menu-group" 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/30 text-4xl"></i>
|
<i class="fa-solid fa-temperature-high text-base-text text-4xl"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="menu-group-name">
|
<div class="menu-group-name">
|
||||||
<%= c.name %>
|
<%= c.name %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<hr >
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="menu-group">
|
<div class="menu-group">
|
||||||
<div class="menu-group-icon">
|
<div class="menu-group-icon">
|
||||||
<i class="fa-solid fa-gear text-base-text/30 text-4xl"></i>
|
<i class="fa-solid fa-gear text-base-text text-4xl"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="menu-group-name">
|
<div class="menu-group-name">
|
||||||
설청
|
설청
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<%= form_with model: @schedule, method: :post, data: { turbo: false }, class: 'flex flex-col h-full space-y-4' do |form| %>
|
<%= form_with model: @schedule, method: :post, data: { turbo: false }, class: 'flex flex-col h-full space-y-4' do |form| %>
|
||||||
<%= form.hidden_field :controller_id, value: params[:id] %>
|
<%= form.hidden_field :controller_id, value: params[:id] %>
|
||||||
<div class="flex-1 text-white space-y-4">
|
<div class="flex-1 text-white space-y-4">
|
||||||
<div class="text-2xl font-bold"><%= Controller.find(params[:id]).name %> 컨트롤러</div>
|
<div class="text-2xl font-bold leading-10"><%= Controller.find(params[:id]).name %> 컨트롤러</div>
|
||||||
<table class="base-table">
|
<table class="base-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>시간</th>
|
<th>시간</th>
|
||||||
<th>분</th>
|
<th>분</th>
|
||||||
<th>사용여부</th>
|
<th>ON/OFF</th>
|
||||||
<th>온도</th>
|
<th>온도</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
<%= form.select :hour,
|
<%= form.select :hour,
|
||||||
options_for_select((0..23).map { |h| [h.to_s.rjust(2, '0'), h] }, @schedule.hour),
|
options_for_select((0..23).map { |h| [h.to_s.rjust(2, '0'), h] }, @schedule.hour),
|
||||||
{},
|
{},
|
||||||
class: "input-style" %>
|
class: "select-style text-white" %>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<%= form.number_field :minute,
|
<%= form.number_field :minute,
|
||||||
|
|||||||
@@ -1 +1,159 @@
|
|||||||
<div>MAIN</div>
|
<div class="flex-1 grid grid-cols-2 lg:grid-cols-4 gap-4 p-4">
|
||||||
|
<!-- 실내온도 -->
|
||||||
|
<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-['GongGothicMedium'] font-light">15.5</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-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>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- CO2 -->
|
||||||
|
<div class="dashboard-group">
|
||||||
|
<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-['GongGothicMedium']">60</span> <span class="text-2xl">%</span></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- none -->
|
||||||
|
<div class="dashboard-group">1</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-['GongGothicMedium']">60</span> <span class="text-2xl">%</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-['GongGothicMedium']">15.5</span>
|
||||||
|
<span class="text-2xl">°C</span></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 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-['GongGothicMedium']">60</span> <span class="text-2xl">%</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- none -->
|
||||||
|
<div class="dashboard-group">1</div>
|
||||||
|
|
||||||
|
<!-- pH -->
|
||||||
|
<div class="dashboard-group">
|
||||||
|
<div class="flex justify-between items-baseline">
|
||||||
|
<div class="text-4xl">pH</div>
|
||||||
|
<div class="text-3xl font-['GongGothicMedium']">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-['GongGothicMedium']">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-['GongGothicMedium']">20.96</span>
|
||||||
|
<span class="text-2xl">°C</span></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- none -->
|
||||||
|
<div class="dashboard-group">1</div>
|
||||||
|
|
||||||
|
<!-- none -->
|
||||||
|
<div class="dashboard-group">
|
||||||
|
<div class="flex flex-col justify-center space-y-4 h-full">
|
||||||
|
<i class="fa-solid fa-recycle text-base-text/80 text-5xl text-center w-full"></i>
|
||||||
|
<div class="text-xl text-center">자동화</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- none -->
|
||||||
|
<div class="dashboard-group">
|
||||||
|
<div class="flex flex-col justify-center space-y-4 h-full">
|
||||||
|
<i class="fa-solid fa-rotate-right text-base-text/80 text-5xl text-center w-full"></i>
|
||||||
|
<div class="text-xl text-center">초기화</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- none -->
|
||||||
|
<div class="dashboard-group">
|
||||||
|
<div class="flex flex-col justify-center space-y-4 h-full">
|
||||||
|
<i class="fa-solid fa-circle-pause text-base-text/80 text-5xl text-center w-full"></i>
|
||||||
|
<div class="text-xl text-center">긴급 정지</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- none -->
|
||||||
|
<div class="dashboard-group">
|
||||||
|
<div class="flex flex-col justify-center space-y-4 h-full">
|
||||||
|
<i class="fa-solid fa-faucet-drip text-base-text/80 text-5xl text-center w-full"></i>
|
||||||
|
<div class="text-xl text-center">1회 급수 설정</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -4,57 +4,63 @@
|
|||||||
<%= 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"><%= @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">
|
<ul class="divide-y divide-base-border whitespace-nowrap h-full relative">
|
||||||
<% @schedule.each do |s| %>
|
<% if @schedule.present? %>
|
||||||
<li class="flex justify-between items-center px-4 py-2 space-x-4">
|
<% @schedule.each do |s| %>
|
||||||
<div class="flex items-center space-x-4 basis-2/3">
|
<li class="flex justify-between items-stretch 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 flex-col md:flex-row w-full items-center space-x-0 space-y-2 md:space-x-2 md:space-y-0">
|
<!-- 시간 -->
|
||||||
<div class="text-white">시간</div>
|
<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-xl flex items-center space-x-1">
|
<div class="text-white text-left w-full lg:w-auto">시간</div>
|
||||||
<%= select_tag "schedule[#{s.id}][hour]",
|
<div class="text-xl flex items-center space-x-1 w-full h-full">
|
||||||
options_for_select((0..23).map { |h| [h.to_s.rjust(2, '0'), h] }, s.hour),
|
<%= select_tag "schedule[#{s.id}][hour]",
|
||||||
class: "select-style text-white" %>
|
options_for_select((0..23).map { |h| [h.to_s.rjust(2, '0'), h] }, s.hour),
|
||||||
<div>:</div>
|
class: "select-style text-white min-w-[60px]" %>
|
||||||
<%= number_field_tag "schedule[#{s.id}][minute]", s.minute, min: 0, max: 59, step: 1, inputmode: "decimal", class: "input-style" %>
|
<div>:</div>
|
||||||
</div>
|
<%= number_field_tag "schedule[#{s.id}][minute]",
|
||||||
</div>
|
s.minute, min: 0, max: 59, step: 1, inputmode: "decimal",
|
||||||
|
class: "input-style min-w-[60px]" %>
|
||||||
<!-- 온도 -->
|
</div>
|
||||||
<div class="flex flex-col md:flex-row w-full items-center space-x-0 space-y-2 md:space-x-4 md:space-y-0">
|
</div>
|
||||||
<div class="text-white">온도</div>
|
|
||||||
<div class="text-xl flex items-center space-x-2">
|
<!-- 온도 -->
|
||||||
<div>
|
<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">
|
||||||
<%= number_field_tag "schedule[#{s.id}][temperature]", s.temperature, step: "0.1", inputmode: "decimal", class: "input-style" %>
|
<div class="text-white text-left w-full lg:w-auto">온도 (°C)</div>
|
||||||
|
<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]" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-white text-xl leading-8">°C</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex items-center space-x-6 basis-1/3 justify-end">
|
<div class="flex items-center space-x-4 basis-2/5 justify-end h-full">
|
||||||
<!-- 사용 여부 -->
|
<!-- 사용 여부 -->
|
||||||
<div class="flex flex-col md:flex-row items-center space-x-0 space-y-2 md:space-x-4 md:space-y-0">
|
<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">사용여부</div>
|
<div class="text-white">ON/OFF</div>
|
||||||
<label class="relative inline-flex items-center cursor-pointer">
|
<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="toggle_btn"></div>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 삭제 -->
|
<!-- 삭제 -->
|
||||||
<%= link_to "삭제", schedule_path(s),
|
<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">
|
||||||
data: {
|
<div class="text-white"> </div>
|
||||||
turbo_method: :delete,
|
<%= link_to schedule_path(s),
|
||||||
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" %>
|
<div class="hidden lg:block">삭제</div>
|
||||||
</div>
|
<div class="block lg:hidden"><i class="fa-solid fa-xmark"></i></div>
|
||||||
</li>
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<li class="text-center p-4 w-full">저장된 스케줄이 없습니다.</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,48 +2,52 @@
|
|||||||
<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="overflow-y-auto 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"><%= @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 class="divide-y divide-base-border">
|
||||||
<% @schedule.each do |s| %>
|
<% if @schedule.present? %>
|
||||||
<li class="flex justify-between items-center px-4 py-2 space-x-4">
|
<% @schedule.each do |s| %>
|
||||||
<div class="flex items-center space-x-6">
|
<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="flex flex-col lg:flex-row items-baseline space-x-2">
|
||||||
<div class="text-3xl flex items-baseline space-x-1">
|
<div class="text-white">시간</div>
|
||||||
<div><%= s.hour.to_s.rjust(2, '0') %></div>
|
<div class="text-3xl flex items-baseline space-x-1">
|
||||||
<div>:</div>
|
<div class="text-center w-[36px]"><%= s.hour.to_s.rjust(2, '0') %></div>
|
||||||
<div><%= s.minute.to_s.rjust(2, '0') %></div>
|
<div>:</div>
|
||||||
</div>
|
<div class="text-center w-[36px]"><%= s.minute.to_s.rjust(2, '0') %></div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 온도 -->
|
<!-- 온도 -->
|
||||||
<div class="flex flex-col md: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 class="text-white">온도</div>
|
||||||
<div class="text-3xl flex items-end space-x-2">
|
<div class="text-3xl flex items-end space-x-2">
|
||||||
<div><%= s.temperature %></div>
|
<div class="text-left w-[50px]"><%= s.temperature %></div>
|
||||||
<div class="text-white text-xl leading-8">°C</div>
|
<div class="text-white text-base leading-7">°C</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 사용 여부 -->
|
<!-- 사용 여부 -->
|
||||||
<div class="flex flex-col md:flex-row items-baseline space-x-4">
|
<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">사용여부</div>
|
<div class="text-white mb-1">ON/OFF</div>
|
||||||
<div class="text-3xl">
|
<div class="text-3xl w-8 mr-0">
|
||||||
<%#= s.is_active %>
|
<%#= s.is_active %>
|
||||||
<% if s.is_active %>
|
<% if s.is_active %>
|
||||||
<i class="fa-solid fa-check text-notice"></i>
|
<i class="fa-solid fa-check text-notice"></i>
|
||||||
<% else %>
|
<% else %>
|
||||||
<i class="fa-solid fa-xmark text-danger"></i>
|
<i class="fa-solid fa-xmark text-danger"></i>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
<% else %>
|
||||||
|
<li class="text-center p-4 w-full">저장된 스케줄이 없습니다.</li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<!-- <table class="base-table">-->
|
<!-- <table class="base-table">-->
|
||||||
<!-- <thead>-->
|
<!-- <thead>-->
|
||||||
|
|||||||
18
modbus.rb
18
modbus.rb
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user