mirror of
https://github.com/headporter81/specialsource-homepage-frontend.git
synced 2026-12-06 07:11:02 +09:00
This commit is contained in:
1 parent
61a5955378
commit
94d2710d5e
2 files changed
+255
-37
No files matched your search
+184
-37
@@ -21,6 +21,14 @@
|
||||
<option value="white">VT220 (백색)</option>
|
||||
<option value="plasma">GRiD COMPASS (플라즈마)</option>
|
||||
</select>
|
||||
|
||||
<button
|
||||
class="pc-mode-btn"
|
||||
:class="{ active: pcTongsinMode }"
|
||||
@click="togglePcTongsinMode"
|
||||
>
|
||||
PC통신 모드
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="nav-menu">
|
||||
@@ -50,46 +58,72 @@
|
||||
<transition name="fade" mode="out-in">
|
||||
|
||||
<div v-if="activeMenu === 'main'" class="sub-page main-page" key="main">
|
||||
<div class="ascii-container" :class="{ 'is-collapsed': logoDone }">
|
||||
<div class="ascii-clip">
|
||||
<transition name="fade">
|
||||
<pre
|
||||
v-if="!isBooting && !logoDone"
|
||||
class="ascii-art"
|
||||
v-html="formattedAscii"
|
||||
@animationend="logoDone = true"
|
||||
></pre>
|
||||
</transition>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="!isBooting" class="dash-grid">
|
||||
<div v-if="isLoggedIn" class="dash-panel">
|
||||
<h4>LIVE SESSION</h4>
|
||||
<div class="dash-stat"><span>LIVE</span><b class="pulse-text">{{ activeNow }}</b></div>
|
||||
<div class="dash-stat"><span>TODAY</span><b>{{ todayUnique }}</b></div>
|
||||
<template v-if="!pcTongsinMode">
|
||||
<div class="ascii-container" :class="{ 'is-collapsed': logoDone }">
|
||||
<div class="ascii-clip">
|
||||
<transition name="fade">
|
||||
<pre
|
||||
v-if="!isBooting && !logoDone"
|
||||
class="ascii-art"
|
||||
v-html="formattedAscii"
|
||||
@animationend="logoDone = true"
|
||||
></pre>
|
||||
</transition>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dash-panel">
|
||||
<h4>SERVER SOURCE</h4>
|
||||
<span :class="['dash-chip', currentServerSource]">[{{ currentServerSourceDisplay }}]</span>
|
||||
</div>
|
||||
<div v-if="!isBooting" class="dash-grid">
|
||||
<div v-if="isLoggedIn" class="dash-panel">
|
||||
<h4>LIVE SESSION</h4>
|
||||
<div class="dash-stat"><span>LIVE</span><b class="pulse-text">{{ activeNow }}</b></div>
|
||||
<div class="dash-stat"><span>TODAY</span><b>{{ todayUnique }}</b></div>
|
||||
</div>
|
||||
|
||||
<div class="dash-panel weather-panel">
|
||||
<h4>SEOUL WEATHER</h4>
|
||||
<div v-if="weather.loading" class="weather-loading">SYNCING...</div>
|
||||
<div v-else-if="weather.error" class="weather-loading">SYNC FAILED</div>
|
||||
<template v-else>
|
||||
<pre class="weather-ascii">{{ weatherIcon }}</pre>
|
||||
<div class="dash-stat"><span>TEMP</span><b>{{ weather.temp }}°C</b></div>
|
||||
<div class="dash-stat"><span>COND</span><b>{{ weatherLabel }}</b></div>
|
||||
</template>
|
||||
</div>
|
||||
<div class="dash-panel">
|
||||
<h4>SERVER SOURCE</h4>
|
||||
<span :class="['dash-chip', currentServerSource]">[{{ currentServerSourceDisplay }}]</span>
|
||||
</div>
|
||||
|
||||
<div class="dash-panel">
|
||||
<h4>SESSION</h4>
|
||||
<div class="dash-stat"><span>USER</span><b>{{ isLoggedIn ? currentUsername : 'anonymous' }}</b></div>
|
||||
<div class="dash-stat"><span>DISPLAY</span><b>{{ activeThemeLabel }}</b></div>
|
||||
<div class="dash-panel weather-panel">
|
||||
<h4>SEOUL WEATHER</h4>
|
||||
<div v-if="weather.loading" class="weather-loading">SYNCING...</div>
|
||||
<div v-else-if="weather.error" class="weather-loading">SYNC FAILED</div>
|
||||
<template v-else>
|
||||
<pre class="weather-ascii">{{ weatherIcon }}</pre>
|
||||
<div class="dash-stat"><span>TEMP</span><b>{{ weather.temp }}°C</b></div>
|
||||
<div class="dash-stat"><span>COND</span><b>{{ weatherLabel }}</b></div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<div class="dash-panel">
|
||||
<h4>SESSION</h4>
|
||||
<div class="dash-stat"><span>USER</span><b>{{ isLoggedIn ? currentUsername : 'anonymous' }}</b></div>
|
||||
<div class="dash-stat"><span>DISPLAY</span><b>{{ activeThemeLabel }}</b></div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div v-else class="pc-tongsin-screen">
|
||||
<div class="pc-titlebar">
|
||||
<span>SPECIALSOURCE-BBS v3.2</span>
|
||||
<span>{{ isLoggedIn ? `ONLINE · ${currentUsername || 'admin'} 접속중` : 'ONLINE · 비로그인' }}</span>
|
||||
</div>
|
||||
<div class="pc-body">
|
||||
<div class="pc-screen-title">SPECIALSOURCE.SYSTEM 메인 메뉴</div>
|
||||
<div class="pc-screen-sub">하단 터미널에 번호나 메뉴명을 입력하거나, 줄을 클릭하세요.</div>
|
||||
<hr class="pc-rule">
|
||||
<div
|
||||
v-for="(entry, idx) in pcMenuEntries"
|
||||
:key="entry.id"
|
||||
class="pc-menu-row"
|
||||
@click="activatePcMenuEntry(entry)"
|
||||
>
|
||||
<span class="pc-menu-num">{{ idx + 1 }}.</span>
|
||||
<span class="pc-menu-label">{{ entry.name }}</span>
|
||||
<span v-if="entry.id === 'board' && board.loaded" class="pc-menu-badge">(안읽음 {{ board.posts.length }})</span>
|
||||
</div>
|
||||
<hr class="pc-rule">
|
||||
<div class="pc-footer-hint">예) <b>3</b> 또는 <b>board</b> 입력 → 자유게시판 이동</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -132,7 +166,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="board-layout">
|
||||
<div v-if="!pcTongsinMode" class="board-layout">
|
||||
<div class="board-rail">
|
||||
<button
|
||||
class="rail-item"
|
||||
@@ -202,6 +236,39 @@
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else class="pc-tongsin-screen">
|
||||
<div class="pc-titlebar">
|
||||
<span>SPECIALSOURCE-BBS v3.2</span>
|
||||
<span>{{ isLoggedIn ? `ONLINE · ${currentUsername || 'admin'} 접속중` : 'ONLINE · 비로그인' }}</span>
|
||||
</div>
|
||||
<div class="pc-body">
|
||||
<div class="pc-screen-title">[3] {{ boardViewMode === 'viewed' ? '내가 읽은 글' : '자유게시판' }}</div>
|
||||
<div class="pc-screen-sub">글 번호를 입력하면 읽습니다 · 총 {{ board.posts.length }}건</div>
|
||||
<hr class="pc-rule">
|
||||
<div v-if="board.error === 'auth'" class="pc-screen-sub">
|
||||
로그인이 필요합니다. <b class="pc-menu-badge" style="cursor:pointer" @click="changeMenu('login')">LOGIN으로 이동</b>
|
||||
</div>
|
||||
<div v-else-if="board.loading && board.posts.length === 0" class="pc-screen-sub">SYNCING...</div>
|
||||
<div v-else-if="board.posts.length === 0" class="pc-screen-sub">
|
||||
{{ boardViewMode === 'viewed' ? '아직 읽은 게시물이 없습니다.' : '표시할 글이 없습니다.' }}
|
||||
</div>
|
||||
<template v-else>
|
||||
<div
|
||||
v-for="(post, idx) in board.posts"
|
||||
:key="post.id"
|
||||
class="pc-post-row"
|
||||
@click="openPostDetail(post)"
|
||||
>
|
||||
<span class="pc-post-idx">{{ idx + 1 }}</span>
|
||||
<span class="pc-post-title">{{ post.title }}</span>
|
||||
<span class="pc-post-meta">{{ post.sourceLabel }} · 조회 {{ post.views }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<hr class="pc-rule">
|
||||
<div class="pc-footer-hint"><b>번호</b>=글읽기 · <b>M</b>=메인메뉴 · <b>L</b>=목록</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else-if="activeMenu === 'login'" class="sub-page login-page" key="login">
|
||||
@@ -809,6 +876,86 @@ const handleLoginSubmit = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
const pcTongsinMode = ref(false);
|
||||
|
||||
const pcMenuEntries = computed(() => {
|
||||
const authEntry = isLoggedIn.value
|
||||
? { id: '__logout', name: 'LOGOUT' }
|
||||
: { id: 'login', name: 'LOGIN' };
|
||||
return [...menuItems, authEntry];
|
||||
});
|
||||
|
||||
const activatePcMenuEntry = (entry) => {
|
||||
if (entry.id === '__logout') {
|
||||
handleLogout();
|
||||
} else {
|
||||
changeMenu(entry.id);
|
||||
}
|
||||
};
|
||||
|
||||
const pcTongsinCommand = (raw) => {
|
||||
const term = termInstance.value;
|
||||
const input = (raw || '').trim();
|
||||
if (!term || !input) return;
|
||||
const lower = input.toLowerCase();
|
||||
|
||||
if (activeMenu.value === 'board') {
|
||||
if (lower === 'm' || lower === '메인') {
|
||||
changeMenu('main');
|
||||
return;
|
||||
}
|
||||
if (lower === 'l' || lower === '목록') {
|
||||
term.echo('[SYS] 현재 목록입니다.');
|
||||
return;
|
||||
}
|
||||
const idx = Number(input);
|
||||
if (!Number.isNaN(idx) && board.value.posts[idx - 1]) {
|
||||
openPostDetail(board.value.posts[idx - 1]);
|
||||
return;
|
||||
}
|
||||
term.error(`※ 목록에 없는 번호입니다: "${input}"`);
|
||||
return;
|
||||
}
|
||||
|
||||
const numIdx = Number(input);
|
||||
if (!Number.isNaN(numIdx) && pcMenuEntries.value[numIdx - 1]) {
|
||||
activatePcMenuEntry(pcMenuEntries.value[numIdx - 1]);
|
||||
return;
|
||||
}
|
||||
if (lower === 'm' || lower === '메인') {
|
||||
changeMenu('main');
|
||||
return;
|
||||
}
|
||||
const found = pcMenuEntries.value.find(
|
||||
(entry) => entry.id.toLowerCase() === lower || entry.name.toLowerCase() === lower
|
||||
);
|
||||
if (found) {
|
||||
activatePcMenuEntry(found);
|
||||
return;
|
||||
}
|
||||
|
||||
term.error(`※ 알 수 없는 명령입니다: "${input}"`);
|
||||
};
|
||||
|
||||
const togglePcTongsinMode = () => {
|
||||
pcTongsinMode.value = !pcTongsinMode.value;
|
||||
if (!termInstance.value) return;
|
||||
|
||||
if (pcTongsinMode.value) {
|
||||
termInstance.value.push(pcTongsinCommand, { name: 'pctongsin', prompt: '번호/메뉴 > ' });
|
||||
termInstance.value.echo('[SYS] PC통신 모드 진입. 번호나 메뉴명을 입력하세요 (예: 3 또는 board).');
|
||||
} else {
|
||||
termInstance.value.pop();
|
||||
termInstance.value.echo('[SYS] PC통신 모드 종료.');
|
||||
}
|
||||
};
|
||||
|
||||
watch(activeMenu, (id) => {
|
||||
if (!pcTongsinMode.value || !termInstance.value) return;
|
||||
const label = id === 'board' ? '게시판' : '메인';
|
||||
termInstance.value.set_prompt(`${label} > `);
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
if (shouldShowBootLog()) {
|
||||
runBootSequence();
|
||||
|
||||
Reference in new issue
Block a user