Compare commits
No commits in common. "09068d9f707f44bd21be7069d190f1501fd249f7" and "fed1b75fd251191128bbbbaf26162a1ceeaa9107" have entirely different histories.
09068d9f70
...
fed1b75fd2
|
|
@ -1,5 +0,0 @@
|
|||
<svg width="189" height="189" viewBox="0 0 189 189" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M187.296 112.455C178.909 156.06 140.551 189 94.5 189C42.8066 189 0.807589 147.494 0.0114746 95.99C3.71633 92.1456 7.55581 88.7053 11.4659 85.6265C11.1579 88.5422 11 91.5027 11 94.5C11 140.616 48.3842 178 94.5 178C126.824 178 154.858 159.633 168.736 132.765C176.362 127.258 182.483 120.223 187.296 112.455ZM188.892 89.9371C185.31 93.8915 181.585 97.4466 177.777 100.643C177.925 98.6143 178 96.5659 178 94.5C178 48.3843 140.616 11 94.5 11C63.5437 11 36.5219 27.8457 22.1015 52.8701C14.5028 57.4406 8.23356 63.4529 3.13478 70.2708C13.8339 29.8192 50.6846 0 94.5 0C145.161 0 186.511 39.8653 188.892 89.9371Z" fill="#158078"/>
|
||||
<path d="M128 59C73.6 23 25 55.6667 7.5 76.5C7.5 76.5 44 50.0086 88.5 59C21 66 1.5 95.5 1.5 95.5L7.5 105.5L16 99.5C16 99.5 25 110 47.5 105.5C70 101 101.5 55 128 59Z" fill="#158078"/>
|
||||
<path d="M60 128.621C114.4 164.621 163 131.954 180.5 111.121C180.5 111.121 144 137.613 99.5 128.621C167 121.621 186.5 92.1211 186.5 92.1211L180.5 82.1211L172 88.1211C172 88.1211 163 77.6211 140.5 82.1211C118 86.6211 86.5 132.621 60 128.621Z" fill="#158078"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.2 KiB |
|
|
@ -2,14 +2,14 @@
|
|||
|
||||
@theme {
|
||||
--color-default: rgb(226, 232, 240);
|
||||
--color-default-slate: rgb(100, 116, 139);
|
||||
--color-default-slate-dark: rgb(71, 85, 105);
|
||||
--color-defaultSlate: rgb(100, 116, 139);
|
||||
--color-defaultSlateDark: rgb(71, 85, 105);
|
||||
--color-primary: rgb(66, 165, 245);
|
||||
--color-notice: rgb(19, 198, 154);
|
||||
--color-warning: rgb(255, 202, 40);
|
||||
--color-accept: rgb(121, 134, 203);
|
||||
--color-danger: rgb(239, 83, 80);
|
||||
--color-table-border: rgb(203, 213, 225);
|
||||
--color-tableBorder: rgb(203, 213, 225);
|
||||
|
||||
--base-font-size: 0.85rem;
|
||||
--text-xs: calc(var(--base-font-size) * 0.75);
|
||||
|
|
@ -42,11 +42,11 @@
|
|||
|
||||
@layer base {
|
||||
body {
|
||||
@apply text-sm text-default-slate-dark
|
||||
@apply text-sm text-defaultSlateDark
|
||||
}
|
||||
|
||||
hr {
|
||||
@apply border-table-border
|
||||
@apply border-tableBorder
|
||||
}
|
||||
|
||||
a.disabled {
|
||||
|
|
@ -58,41 +58,33 @@
|
|||
}
|
||||
|
||||
.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-xs bg-defaultSlate px-2 py-0.5 text-sm font-semibold leading-6 text-white
|
||||
shadow-xs hover:opacity-80 cursor-pointer
|
||||
}
|
||||
|
||||
.card {
|
||||
@apply bg-white border border-table-border rounded-xs shadow-xs
|
||||
@apply bg-white border border-tableBorder rounded-xs shadow-xs
|
||||
}
|
||||
|
||||
/*Form*/
|
||||
.label-style {
|
||||
@apply block my-1 font-bold text-default-slate-dark
|
||||
@apply block my-1 font-bold text-defaultSlateDark
|
||||
}
|
||||
|
||||
.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-defaultSlate/50 rounded-xs
|
||||
}
|
||||
|
||||
.input-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-defaultSlate/50 rounded-xs
|
||||
}
|
||||
|
||||
.textarea-style {
|
||||
@apply block w-full pl-4 flex-1 py-1.5 ring-1 ring-inset ring-default-slate/50 rounded-xs
|
||||
@apply block w-full pl-4 flex-1 py-1.5 ring-1 ring-inset ring-defaultSlate/50 rounded-xs
|
||||
}
|
||||
}
|
||||
|
||||
@layer utilities {
|
||||
.header {
|
||||
@apply p-4 text-lg font-bold h-16 flex justify-between items-center;
|
||||
}
|
||||
|
||||
.side-bar {
|
||||
@apply w-64 px-4 text-lg font-bold divide-y divide-default-slate-dark;
|
||||
}
|
||||
|
||||
.page-title {
|
||||
@apply text-xl font-bold;
|
||||
}
|
||||
|
|
@ -102,7 +94,7 @@
|
|||
}
|
||||
|
||||
.form-title {
|
||||
@apply text-center text-3xl font-bold tracking-tight text-default-slate-dark
|
||||
@apply text-center text-3xl font-bold tracking-tight text-defaultSlateDark
|
||||
}
|
||||
|
||||
.field {
|
||||
|
|
@ -115,15 +107,15 @@
|
|||
|
||||
/*Menu*/
|
||||
.menu-group {
|
||||
@apply flex flex-row py-6 px-4 gap-x-4 justify-between items-center w-full
|
||||
@apply py-2 px-4
|
||||
}
|
||||
|
||||
.menu-group-icon {
|
||||
@apply py-1 text-sm text-default-slate-dark font-medium justify-center
|
||||
.menu-group-title {
|
||||
@apply py-1 text-sm text-defaultSlateDark font-medium
|
||||
}
|
||||
|
||||
.menu-group-name {
|
||||
@apply p-1 flex-1
|
||||
.menu-group-items {
|
||||
@apply p-1
|
||||
}
|
||||
|
||||
.menu-group-items-title {
|
||||
|
|
@ -131,16 +123,16 @@
|
|||
}
|
||||
|
||||
.copyright {
|
||||
@apply text-default-slate-dark text-center
|
||||
@apply text-defaultSlateDark text-center
|
||||
}
|
||||
|
||||
/*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-defaultSlate;
|
||||
}
|
||||
|
||||
.pagy a:not(.gap) {
|
||||
@apply block rounded-xs px-2 py-1 border border-default-slate/50;
|
||||
@apply block rounded-xs px-2 py-1 border border-defaultSlate/50;
|
||||
}
|
||||
|
||||
.pagy a:not(.gap):hover {
|
||||
|
|
@ -148,11 +140,11 @@
|
|||
}
|
||||
|
||||
.pagy a:not(.gap):not([href]) {
|
||||
@apply text-default-slate/50 border border-default-slate/25 cursor-default
|
||||
@apply text-defaultSlate/50 border border-defaultSlate/25 cursor-default
|
||||
}
|
||||
|
||||
.pagy a:not(.gap).current {
|
||||
@apply text-white bg-default-slate
|
||||
@apply text-white bg-defaultSlate
|
||||
}
|
||||
|
||||
.pagy a.gap {
|
||||
|
|
@ -169,15 +161,15 @@
|
|||
|
||||
/*Base Table*/
|
||||
.base-table {
|
||||
@apply min-w-full divide-y divide-table-border whitespace-nowrap border border-table-border
|
||||
@apply min-w-full divide-y divide-tableBorder whitespace-nowrap
|
||||
}
|
||||
|
||||
.base-table th {
|
||||
@apply bg-default px-2 py-2 text-left font-semibold text-default-slate-dark lg:table-cell
|
||||
@apply bg-default px-2 py-2 text-left font-semibold text-defaultSlateDark lg:table-cell
|
||||
}
|
||||
|
||||
.base-table td {
|
||||
@apply border-t border-table-border px-2 py-1 text-default-slate lg:table-cell whitespace-nowrap
|
||||
@apply border-t border-tableBorder px-2 py-1 text-defaultSlate lg:table-cell whitespace-nowrap
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,3 @@ import { application } from "./application"
|
|||
|
||||
import HelloController from "./hello_controller"
|
||||
application.register("hello", HelloController)
|
||||
|
||||
import TimerController from "./timer_controller"
|
||||
application.register("timer", TimerController)
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
import { Controller } from "@hotwired/stimulus"
|
||||
|
||||
// Connects to data-controller="timer"
|
||||
export default class extends Controller {
|
||||
static targets = ["output"]
|
||||
|
||||
connect() {
|
||||
this.updateTime()
|
||||
this.interval = setInterval(() => this.updateTime(), 1000)
|
||||
}
|
||||
|
||||
disconnect() {
|
||||
clearInterval(this.interval)
|
||||
}
|
||||
|
||||
updateTime() {
|
||||
const now = new Date()
|
||||
const formatted = `${now.getFullYear()}년 ${String(now.getMonth() + 1).padStart(2, '0')}월 ${String(now.getDate()).padStart(2, '0')}일 ` +
|
||||
`${String(now.getHours()).padStart(2, '0')}시 ${String(now.getMinutes()).padStart(2, '0')}분 ${String(now.getSeconds()).padStart(2, '0')}초`
|
||||
this.outputTarget.textContent = formatted
|
||||
}
|
||||
}
|
||||
|
|
@ -20,19 +20,11 @@
|
|||
<%# Includes all stylesheet files in app/assets/stylesheets %>
|
||||
<%= stylesheet_link_tag :app, "data-turbo-track": "reload" %>
|
||||
<%= 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">
|
||||
</head>
|
||||
|
||||
<body class="h-screen overflow-hidden">
|
||||
<main class="flex flex-col h-full divide-y divide-border-table-border">
|
||||
<%= render "partials/header" %>
|
||||
<div class="flex flex-row flex-1 w-full divide-x divide-border-table-border overflow-hidden">
|
||||
<%= render "partials/sidebar" %>
|
||||
<div class="w-full h-full">
|
||||
<%= yield %>
|
||||
</div>
|
||||
</div>
|
||||
<body>
|
||||
<main class="m-4">
|
||||
<%= yield %>
|
||||
</main>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
<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] %>
|
||||
|
|
@ -7,41 +9,28 @@
|
|||
<%= flash[:alert] %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="flex flex-col h-full divide-y divide-border-table-border">
|
||||
<div class="flex-1 overflow-y-auto p-4 space-y-4">
|
||||
<table class="base-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>시간</th>
|
||||
<th>온도</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @schedule.each do |s| %>
|
||||
<tr>
|
||||
<td><%= s.hour %>시</td>
|
||||
<td><%= s.temperature %> °C</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<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>
|
||||
</div>
|
||||
<% @schedule.each do |s| %>
|
||||
<div class="flex justify-items-center gap-x-2">
|
||||
<div><%= s.hour %>시</div>
|
||||
<div><%= s.temperature %> °C</div>
|
||||
</div>
|
||||
<div class="flex p-4">
|
||||
<%= link_to "수정", "/modbus/schedule_edit", class: "btn bg-default-slate" %>
|
||||
</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>
|
||||
|
|
|
|||
|
|
@ -1,24 +1,14 @@
|
|||
<%= form_with url: schedule_edit_update_modbus_index_path, method: :post, class: 'flex flex-col h-full divide-y divide-border-table-border' do %>
|
||||
<div class="flex-1 overflow-y-auto p-4">
|
||||
<table class="base-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>시간</th>
|
||||
<th>온도</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @schedule.each do |s| %>
|
||||
<tr>
|
||||
<td><%= s.hour %>시</td>
|
||||
<td><%= number_field_tag "schedule[#{s.id}][temperature]", s.temperature, step: "0.1", inputmode: "decimal", class: "border px-2 py-1 rounded" %> °C</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<%= form_with url: schedule_edit_update_modbus_index_path, method: :post do %>
|
||||
<% @schedule.each do |s| %>
|
||||
<div class="flex justify-items-center gap-x-2 pb-2">
|
||||
<div><%= s.hour %>시</div>
|
||||
<div>
|
||||
<%= number_field_tag "schedule[#{s.id}][temperature]", s.temperature, step: "0.1", inputmode: "decimal", class: "border px-2 py-1 rounded" %> °C
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="flex p-4">
|
||||
<%= submit_tag "업데이트", class: "btn bg-primary" %>
|
||||
<div class="pt-4">
|
||||
<%= submit_tag "업데이트", class: "bg-blue-500 text-white px-4 py-2 rounded" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
<header class="flex header" data-controller="timer">
|
||||
<div class="flex flex-row h-full">
|
||||
<%= image_tag "svg/svg_logo.svg", class: "w-16 h-auto" %>
|
||||
<div class="flex h-full items-center tracking-[0.5rem]">FARMITRY</div>
|
||||
</div>
|
||||
<div data-timer-target="output" class="text-gray-600"></div>
|
||||
<div class="flex flex-row items-center gap-x-4">
|
||||
<i class="fa-solid fa-circle-user text-4xl text-default-slate-dark"></i>
|
||||
<%= link_to "로그아웃", '', class: "btn" %>
|
||||
</div>
|
||||
</header>
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
<nav class="side-bar overflow-y-auto">
|
||||
<div class="menu-group">
|
||||
<div class="menu-group-icon">
|
||||
<i class="fa-solid fa-house text-default-slate-dark text-4xl"></i>
|
||||
</div>
|
||||
<div class="menu-group-name">
|
||||
HOME
|
||||
</div>
|
||||
</div>
|
||||
<div class="menu-group">
|
||||
<div class="menu-group-icon">
|
||||
<i class="fa-solid fa-temperature-high text-default-slate-dark text-4xl"></i>
|
||||
</div>
|
||||
<div class="menu-group-name">
|
||||
메뉴 2
|
||||
</div>
|
||||
</div>
|
||||
<div class="menu-group">
|
||||
<div class="menu-group-icon">
|
||||
<i class="fa-solid fa-fan text-default-slate-dark text-4xl"></i>
|
||||
</div>
|
||||
<div class="menu-group-name">
|
||||
메뉴 3
|
||||
</div>
|
||||
</div>
|
||||
<div class="menu-group">
|
||||
<div class="menu-group-icon">
|
||||
<i class="fa-solid fa-arrows-spin text-default-slate-dark text-4xl"></i>
|
||||
</div>
|
||||
<div class="menu-group-name">
|
||||
메뉴 4
|
||||
</div>
|
||||
</div>
|
||||
<div class="menu-group">
|
||||
<div class="menu-group-icon">
|
||||
<i class="fa-solid fa-gear text-default-slate-dark text-4xl"></i>
|
||||
</div>
|
||||
<div class="menu-group-name">
|
||||
설청
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
Loading…
Reference in New Issue