diff --git a/scripts/check-console.cjs b/scripts/check-console.cjs
index bf13f47..2c24b8c 100644
--- a/scripts/check-console.cjs
+++ b/scripts/check-console.cjs
@@ -17,7 +17,7 @@ function load(file, name) {
assert.deepStrictEqual(compiled.errors, [], name + ' template must compile');
const source = parsed.script.content.replace(/^import .*;$/mg, '').replace('export default', 'module.exports =');
const context = {module:{exports:{}}, process:{env:{}}, window:{location:{protocol:'http:',hostname:'localhost'}},
- Icon:components.Icon, SensorTrend:components.SensorTrend, createDemo:demo, Date, Number, URL, AbortController,
+ Icon:components.Icon, SensorTrend:components.SensorTrend, BatteryGauge:components.BatteryGauge, createDemo:demo, Date, Number, URL, AbortController,
setTimeout, clearTimeout, setInterval, clearInterval};
vm.runInNewContext(source, context);
const options = context.module.exports;
@@ -28,6 +28,20 @@ function load(file, name) {
}
components.Icon = load('src/components/ConsoleIcon.vue', 'Icon');
components.SensorTrend = load('src/components/SensorTrend.vue', 'Trend');
+components.BatteryGauge = load('src/components/BatteryGauge.vue', 'BatteryGauge');
+const Gauge = Vue.extend(components.BatteryGauge);
+const gauge = new Gauge({propsData:{value:86}});
+assert.equal(gauge.numeric,86);
+assert.equal(gauge.valid,true);
+for (const value of [0,100,'42.5']) {
+ gauge.value=value; assert.equal(gauge.valid,true); assert(gauge._render().tag);
+}
+for (const value of [null,undefined,'',' ']) {
+ gauge.value=value; assert.equal(gauge.missing,true); assert.equal(gauge.valid,false);
+}
+for (const value of [-1,101,Infinity,NaN,'invalid',false,{}]) {
+ gauge.value=value; assert.equal(gauge.missing,false); assert.equal(gauge.valid,false);
+}
const options = load('src/pages/Dashboard.vue', 'Dashboard');
const route = Vue.observable({query:{view:'overview'}});
Vue.prototype.$route = route;
diff --git a/src/assets/operations-layout.css b/src/assets/operations-layout.css
index 3e7c5d6..51734d8 100644
--- a/src/assets/operations-layout.css
+++ b/src/assets/operations-layout.css
@@ -1,4 +1,11 @@
/* Operations console: readable type, compact chrome, clear status hierarchy. */
+/* Only these three paired rows stretch; stacked cards retain natural height. */
+@media(min-width:981px){
+ .console-app .overview-grid.equal-height-overview{align-items:stretch}
+}
+@media(min-width:681px){
+ .console-app .detail-grid.equal-height-device{align-items:stretch}
+}
.topbar-start{display:flex;align-items:center;gap:16px;min-width:0}
.sidebar-toggle{flex-shrink:0}
.monitor-toggle{border:0;background:none;display:flex;align-items:center;justify-content:space-between;width:100%;cursor:pointer}
@@ -116,3 +123,17 @@ th:first-child,td:first-child{padding-left:24px}
@media(max-width:680px){.brand.brand-logo{display:none}.monitor-toggle{display:flex;padding:9px 16px;margin:0;font-size:12px}.sidebar-collapsed .sidebar{display:none}.sidebar-collapsed .main-shell{margin-left:0}.sidebar nav{flex-wrap:wrap}.sidebar nav[style*=none]{display:none}.sidebar-toggle{width:30px;height:30px}.topbar-start{gap:9px}.breadcrumb{gap:7px}}
.logout-button{margin-left:auto;display:flex;align-items:center;gap:5px;padding:8px 3px;border:0;background:none;color:#a7b6c8;font-size:11px}.logout-button:hover{color:#79dcc2}.sidebar-collapsed .account{flex-direction:column}.sidebar-collapsed .logout-button{margin-left:0}.sidebar-collapsed .logout-button span{display:none}@media(max-width:680px){.sidebar-bottom{display:block}.sidebar-bottom .account{border:0;padding:0 15px 8px;justify-content:flex-end}.sidebar-bottom .account-avatar,.sidebar-bottom .account>div{display:none}.sidebar-bottom .logout-button{margin-left:0;font-size:12px}}
+
+/* Compact operational content; login styles are unaffected. */
+.console-app main{padding-bottom:24px}.console-app .page-heading{margin-bottom:22px}.console-app .overview-grid,.console-app .detail-grid{align-items:start}.console-app .metric-card{min-height:0;padding-top:20px;padding-bottom:20px}.console-app .metric-number{margin-top:10px}.console-app .section-heading{margin-top:20px;margin-bottom:14px}.console-app .device-select-label{font-size:14px;color:#a7b6c8}.console-app .attention-panel .empty-state,.console-app .energy-results .empty-state{min-height:0;padding:18px 24px 24px}.console-app .table-scroll .empty-state{min-height:110px}.console-app .diagnosis-feature{padding:12px 24px 24px}.console-app .sensor-tiles{padding:15px 20px 24px}.console-app .energy-results .panel-heading{padding-bottom:8px}.console-app .history-panel .panel-heading{padding-bottom:16px}.console-app .brand.brand-logo{margin-bottom:22px}@media(max-width:680px){.console-app .metric-card{padding:16px}.console-app .section-heading{gap:8px}.console-app .page-heading{margin-bottom:18px}}
+
+/* Center only the requested card bodies below their unchanged headers. */
+.console-app .center-empty-attention,.console-app .centered-sensors,.console-app .centered-diagnosis{display:flex;flex-direction:column}
+.console-app .center-empty-attention>.panel-heading,.console-app .centered-sensors>.panel-heading,.console-app .centered-diagnosis>.panel-heading{flex:none}
+.console-app .attention-panel.center-empty-attention>.attention-empty-body{flex:1;display:grid;place-items:center;text-align:center;padding:21px 24px}
+.console-app .attention-empty-group{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;text-align:center}
+.console-app .centered-sensors>.sensor-tiles{flex:1;align-content:center;align-items:center;width:100%;padding-block:19.5px}
+.console-app .centered-diagnosis>.diagnosis-feature{flex:1;align-items:center;justify-content:center;text-align:center;padding-block:18px}
+
+/* Battery history card only: retain trend data and share space with current gauge. */
+.console-app .battery-trend-layout{display:grid;grid-template-columns:minmax(0,7fr) minmax(0,3fr);align-items:center}.console-app .battery-trend-layout>.trend-wrap{min-width:0}.console-app .battery-gauge-region{min-width:0;padding:4px 24px 17px;display:flex;align-items:center;justify-content:center}@media(max-width:680px){.console-app .battery-gauge-region{padding:0 12px 12px}}@media(max-width:480px){.console-app .battery-trend-layout{grid-template-columns:minmax(0,1fr)}.console-app .battery-gauge-region{padding:0 16px 20px}.console-app .battery-gauge-region .battery-gauge{max-width:170px}}
diff --git a/src/components/BatteryGauge.vue b/src/components/BatteryGauge.vue
new file mode 100644
index 0000000..22fb0ba
--- /dev/null
+++ b/src/components/BatteryGauge.vue
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
diff --git a/src/data/consoleDemo.js b/src/data/consoleDemo.js
index 8567632..faccd66 100644
--- a/src/data/consoleDemo.js
+++ b/src/data/consoleDemo.js
@@ -1,7 +1,7 @@
// UI preview fixtures only. Never sent to the device API.
export function createDemo() {
const now = Date.now();
- const names = ['캠퍼스 정문'];
+ const names = ['SMART-HELMET-01'];
return names.map((name, i) => {
const samples = Array.from({length: 48}, (_, n) => ({
ts: new Date(now - (47-n)*30*60000 - (i===4 ? 7200000 : 0)).toISOString(),
@@ -11,7 +11,7 @@ export function createDemo() {
uv_state: n%12<3 ? 1 : 0, fan_state: n%8<4 ? 1 : 0,
lock: 1, helmet: i===2 ? 0 : 1, chg_ing: i%2, chg_done: 0
}));
- return { key: 'PM-'+String(i+1).padStart(3,'0'), name, last: samples[samples.length-1].ts, samples,
+ return { key: 'PM-'+String(i+1).padStart(3,'0'), name, location: '운영지점 01', last: samples[samples.length-1].ts, samples,
diagnosis: i===1 ? '오염 의심' : i===3 ? '파손 의심' : '정상', mode: i===3 ? '저전력' : '일반' };
});
}
diff --git a/src/pages/Dashboard.vue b/src/pages/Dashboard.vue
index f145f6d..5b930ee 100644
--- a/src/pages/Dashboard.vue
+++ b/src/pages/Dashboard.vue
@@ -2,57 +2,54 @@
-
+
- HELMET OPERATIONS
{{ currentNav.label }}
{{ descriptions[view] }}
{{ lastRefresh ? '갱신 '+clock(lastRefresh) : '갱신 대기' }}
+ {{ currentNav.label }}
{{ lastRefresh ? '갱신 '+clock(lastRefresh) : '갱신 대기' }}
{{ error }}
{{ notice }}
- {{ m.label }}
{{ m.value }}{{ m.unit }}
+ {{ m.label }}
{{ m.value }}{{ m.unit }}
-
+
센서 데이터 추이
{{ selected ? selected.name : '장치를 선택하세요' }} · {{ selectedKey || '—' }}
{{ trendField==='temp' ? '현재 온도' : '현재 습도' }}{{ value(latest[trendField]) }}{{ trendField==='temp' ? '°C' : '%' }}
-
확인이 필요한 장치
수신 상태와 주요 운영 알림
{{ attention.length }}{{ devices.length ? '확인이 필요한 항목이 없습니다' : '아직 연결된 장치가 없습니다' }}{{ demo ? '장치 상태를 확인하고 있습니다.' : '장치 연결 후 상태가 표시됩니다.' }}
+
확인이 필요한 장치
{{ attention.length }}{{ devices.length ? '확인이 필요한 항목이 없습니다' : '아직 연결된 장치가 없습니다' }}
- 장치 운영 현황 {{ devices.length }}
{{ demo ? '전체 장치의 연결 상태와 최신 데이터를 확인하세요.' : '현재 서버 연결 목록 기준 · 등록 장치 목록은 연동 예정' }}
+ 장치 목록 {{ devices.length }}
현재 연결 목록 · 등록 장치 목록 미연동
-
+
- {{ view==='devices'?'선택 장치 상세':'장치별 '+currentNav.label }}
장치를 선택하여 운영 데이터를 확인하세요.
- 조회할 장치가 없습니다장치 연결 상태를 확인하세요.
+ 선택 장치 상세
조회 장치
+ 조회할 장치가 없습니다
- 장치 정보
{{ isRecent(selected)?'수신 정상':'미수신' }}- 장치명
- {{ selected.name }}
- {{ demo?'장치 ID':'연결 식별자' }}
- {{ selected.key }}
- 최종 수신 시각
- {{ dateTime(selected.last) }}
- 안전모 보관
- {{ binary(latest.helmet,'보관 중','없음') }}
- 잠금 상태
- {{ binary(latest.lock,'잠김','해제') }}
최신 센서값
온도{{ value(latest.temp) }}°C
습도{{ value(latest.humi) }}%
배터리{{ value(latest.batt_pct) }}%
- 안전모 상태 진단
연동 예정{{ selected.diagnosis || '진단 결과 미연동' }}
진단 결과 수신 대기
{{ demo ? dateTime(selected.last) : '진단 시각: —' }}장치 제어
{{ c.label }}{{ c.key==='lock' ? binary(latest.lock,'잠김','해제') : state(latest[c.key]) }}
+ 장치 정보
{{ isRecent(selected)?'수신 정상':'미수신' }}- 장치명
- {{ selected.name }}
- 설치 위치
- {{ selected.location }}
- {{ demo?'장치 ID':'연결 식별자' }}
- {{ selected.key }}
- 최종 수신 시각
- {{ dateTime(selected.last) }}
- 안전모 보관
- {{ binary(latest.helmet,'보관 중','없음') }}
- 잠금 상태
- {{ binary(latest.lock,'잠김','해제') }}
최신 센서값
온도{{ value(latest.temp) }}°C
습도{{ value(latest.humi) }}%
배터리{{ value(latest.batt_pct) }}%
+ 안전모 상태 진단
연동 예정{{ selected.diagnosis || '진단 결과 미연동' }}
진단 결과 수신 대기
{{ demo ? dateTime(selected.last) : '진단 시각: —' }}장치 제어
{{ c.label }}{{ c.key==='lock' ? binary(latest.lock,'잠김','해제') : state(latest[c.key]) }}
{{ c.label }}{{ binary(latest[c.key],'가동 중','대기 중') }}
최종 수신 {{ dateTime(selected.last) }}
{{ state(latest[c.key]) }}
- UV · FAN 가동 현황
최근 수신 구간의 OFF → ON 전환 횟수
{{ c.label }}
{{ transitionCount(c.key) }}회 기간별 전체 작동 이력과 정확한 가동 횟수는 저장 이력 API 연동 후 제공됩니다.
+ 가동 횟수
최근 수신 구간의 OFF → ON 전환 횟수
{{ c.label }}
{{ transitionCount(c.key) }}회 전체 작동 이력 미연동 · 수신 구간 내 전환 횟수 기준
- {{ m.label }}
{{ m.value }}{{ m.unit }}
배터리 잔량 추이
{{ selected.name }} · 최근 수신 구간
{{ binary(latest.chg_ing,'충전 중','충전 대기') }}저전력 운영 모드
연동 예정{{ selected.mode || '운영 모드 미연동' }}
장치에서 제공하는 저전력 운영 모드를 표시합니다.
저전력 제어 결과
연동 예정제어 결과 수신 대기발생 시각과 제어 결과를 연동하면 이곳에 표시됩니다.
+ {{ m.label }}
{{ m.value }}{{ m.unit }}
배터리 잔량 추이
{{ selected.name }} · 최근 수신 구간
{{ binary(latest.chg_ing,'충전 중','충전 대기') }}저전력 제어 결과
연동 예정제어 결과 수신 대기
-
+
-
장치 제어 확인
{{ pendingControl.name }} ({{ pendingControl.target }})
{{ pendingControl.label }} {{ pendingControl.action }}
{{ demo?'화면의 장치 상태를 변경합니다.':'확인하면 선택한 실제 장비에 명령을 전송합니다.' }}
@@ -62,11 +59,12 @@