|
|
<!DOCTYPE html> |
|
|
<html lang="ko"> |
|
|
<head> |
|
|
<script type="text/javascript"> |
|
|
(function(c,l,a,r,i,t,y){ |
|
|
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; |
|
|
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; |
|
|
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); |
|
|
})(window, document, "clarity", "script", "ujskfvh0bu"); |
|
|
</script> |
|
|
<meta charset="UTF-8"> |
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
|
<title>ν둬ννΈ κ΄λ¦¬ - SOY NV AI</title> |
|
|
<style> |
|
|
* { |
|
|
margin: 0; |
|
|
padding: 0; |
|
|
box-sizing: border-box; |
|
|
} |
|
|
|
|
|
body { |
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; |
|
|
background: #f5f5f5; |
|
|
color: #202124; |
|
|
line-height: 1.6; |
|
|
} |
|
|
|
|
|
.header { |
|
|
background: #ffffff; |
|
|
border-bottom: 1px solid #dadce0; |
|
|
padding: 16px 24px; |
|
|
display: flex; |
|
|
justify-content: space-between; |
|
|
align-items: center; |
|
|
position: sticky; |
|
|
top: 0; |
|
|
z-index: 100; |
|
|
box-shadow: 0 1px 2px rgba(0,0,0,0.1); |
|
|
} |
|
|
|
|
|
.header-title { |
|
|
display: flex; |
|
|
align-items: center; |
|
|
gap: 12px; |
|
|
font-size: 18px; |
|
|
font-weight: 500; |
|
|
} |
|
|
|
|
|
.header-actions { |
|
|
display: flex; |
|
|
gap: 8px; |
|
|
align-items: center; |
|
|
flex-wrap: wrap; |
|
|
} |
|
|
|
|
|
|
|
|
.dropdown { |
|
|
position: relative; |
|
|
display: inline-block; |
|
|
} |
|
|
|
|
|
|
|
|
.dropdown::after { |
|
|
content: ''; |
|
|
position: absolute; |
|
|
left: 0; |
|
|
right: 0; |
|
|
top: 100%; |
|
|
height: 8px; |
|
|
} |
|
|
|
|
|
.dropdown-toggle { |
|
|
padding: 8px 16px; |
|
|
background: #f1f3f4; |
|
|
color: #202124; |
|
|
border: none; |
|
|
border-radius: 6px; |
|
|
font-size: 14px; |
|
|
font-weight: 500; |
|
|
cursor: pointer; |
|
|
transition: all 0.2s; |
|
|
display: flex; |
|
|
align-items: center; |
|
|
gap: 6px; |
|
|
} |
|
|
|
|
|
.dropdown-toggle:hover { |
|
|
background: #e8eaed; |
|
|
} |
|
|
|
|
|
.dropdown-toggle::after { |
|
|
content: 'βΌ'; |
|
|
font-size: 10px; |
|
|
transition: transform 0.2s; |
|
|
} |
|
|
|
|
|
.dropdown:hover .dropdown-toggle::after { |
|
|
transform: rotate(180deg); |
|
|
} |
|
|
|
|
|
.dropdown-menu { |
|
|
position: absolute; |
|
|
top: calc(100% + 4px); |
|
|
left: 0; |
|
|
margin-top: 0; |
|
|
background: white; |
|
|
border: 1px solid #dadce0; |
|
|
border-radius: 6px; |
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); |
|
|
min-width: 200px; |
|
|
opacity: 0; |
|
|
visibility: hidden; |
|
|
transform: translateY(-8px); |
|
|
transition: all 0.2s ease; |
|
|
z-index: 10000; |
|
|
padding: 4px 0; |
|
|
pointer-events: none; |
|
|
} |
|
|
|
|
|
.dropdown:hover .dropdown-menu { |
|
|
opacity: 1; |
|
|
visibility: visible; |
|
|
transform: translateY(0); |
|
|
pointer-events: auto; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.dropdown-item { |
|
|
display: block; |
|
|
padding: 10px 16px; |
|
|
color: #202124; |
|
|
text-decoration: none; |
|
|
font-size: 14px; |
|
|
transition: background 0.2s; |
|
|
} |
|
|
|
|
|
.dropdown-item:hover { |
|
|
background: #f8f9fa; |
|
|
} |
|
|
|
|
|
.dropdown-item:first-child { |
|
|
border-top-left-radius: 6px; |
|
|
border-top-right-radius: 6px; |
|
|
} |
|
|
|
|
|
.dropdown-item:last-child { |
|
|
border-bottom-left-radius: 6px; |
|
|
border-bottom-right-radius: 6px; |
|
|
} |
|
|
|
|
|
.menu-toggle { |
|
|
display: none; |
|
|
background: none; |
|
|
border: none; |
|
|
font-size: 24px; |
|
|
cursor: pointer; |
|
|
padding: 8px; |
|
|
color: #202124; |
|
|
} |
|
|
|
|
|
.mobile-menu { |
|
|
display: none; |
|
|
position: fixed; |
|
|
top: 0; |
|
|
left: 0; |
|
|
right: 0; |
|
|
bottom: 0; |
|
|
background: rgba(0, 0, 0, 0.5); |
|
|
z-index: 1000; |
|
|
} |
|
|
|
|
|
.mobile-menu.active { |
|
|
display: block; |
|
|
} |
|
|
|
|
|
.mobile-menu-content { |
|
|
position: fixed; |
|
|
top: 0; |
|
|
right: -100%; |
|
|
width: 280px; |
|
|
max-width: 80%; |
|
|
height: 100%; |
|
|
background: white; |
|
|
box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1); |
|
|
transition: right 0.3s ease; |
|
|
overflow-y: auto; |
|
|
z-index: 1001; |
|
|
} |
|
|
|
|
|
.mobile-menu.active .mobile-menu-content { |
|
|
right: 0; |
|
|
} |
|
|
|
|
|
.mobile-menu-header { |
|
|
padding: 16px 20px; |
|
|
border-bottom: 1px solid #dadce0; |
|
|
display: flex; |
|
|
justify-content: space-between; |
|
|
align-items: center; |
|
|
background: white; |
|
|
position: sticky; |
|
|
top: 0; |
|
|
z-index: 10; |
|
|
} |
|
|
|
|
|
.mobile-menu-title { |
|
|
font-size: 18px; |
|
|
font-weight: 500; |
|
|
} |
|
|
|
|
|
.mobile-menu-close { |
|
|
background: none; |
|
|
border: none; |
|
|
font-size: 24px; |
|
|
cursor: pointer; |
|
|
color: #202124; |
|
|
padding: 0; |
|
|
width: 32px; |
|
|
height: 32px; |
|
|
display: flex; |
|
|
align-items: center; |
|
|
justify-content: center; |
|
|
} |
|
|
|
|
|
.mobile-menu-items { |
|
|
padding: 8px 0; |
|
|
} |
|
|
|
|
|
.mobile-menu-item { |
|
|
display: block; |
|
|
padding: 12px 20px; |
|
|
color: #202124; |
|
|
text-decoration: none; |
|
|
border-bottom: 1px solid #f1f3f4; |
|
|
transition: background 0.2s; |
|
|
} |
|
|
|
|
|
.mobile-menu-item:hover { |
|
|
background: #f8f9fa; |
|
|
} |
|
|
|
|
|
.mobile-menu-user { |
|
|
padding: 16px 20px; |
|
|
border-bottom: 1px solid #dadce0; |
|
|
color: #5f6368; |
|
|
font-size: 14px; |
|
|
} |
|
|
|
|
|
@media (max-width: 768px) { |
|
|
.header { |
|
|
padding: 12px 16px; |
|
|
} |
|
|
|
|
|
.header-title { |
|
|
font-size: 18px; |
|
|
} |
|
|
|
|
|
.header-title span:first-child { |
|
|
display: none; |
|
|
} |
|
|
|
|
|
.menu-toggle { |
|
|
display: block; |
|
|
} |
|
|
|
|
|
.header-actions { |
|
|
display: none; |
|
|
} |
|
|
} |
|
|
|
|
|
.btn { |
|
|
padding: 8px 16px; |
|
|
border: none; |
|
|
border-radius: 4px; |
|
|
font-size: 14px; |
|
|
cursor: pointer; |
|
|
text-decoration: none; |
|
|
display: inline-block; |
|
|
transition: background-color 0.2s; |
|
|
} |
|
|
|
|
|
.btn-primary { |
|
|
background: #1a73e8; |
|
|
color: white; |
|
|
} |
|
|
|
|
|
.btn-primary:hover { |
|
|
background: #1557b0; |
|
|
} |
|
|
|
|
|
.btn-secondary { |
|
|
background: #f1f3f4; |
|
|
color: #202124; |
|
|
} |
|
|
|
|
|
.btn-secondary:hover { |
|
|
background: #e8eaed; |
|
|
} |
|
|
|
|
|
.btn-success { |
|
|
background: #34a853; |
|
|
color: white; |
|
|
} |
|
|
|
|
|
.btn-success:hover { |
|
|
background: #2d8e47; |
|
|
} |
|
|
|
|
|
.container { |
|
|
max-width: 1200px; |
|
|
margin: 0 auto; |
|
|
padding: 24px; |
|
|
} |
|
|
|
|
|
.page-header { |
|
|
margin-bottom: 24px; |
|
|
} |
|
|
|
|
|
.page-header h1 { |
|
|
font-size: 24px; |
|
|
margin-bottom: 8px; |
|
|
} |
|
|
|
|
|
.page-header p { |
|
|
color: #5f6368; |
|
|
} |
|
|
|
|
|
.prompt-editor { |
|
|
background: white; |
|
|
border-radius: 8px; |
|
|
padding: 24px; |
|
|
box-shadow: 0 1px 2px rgba(0,0,0,0.1); |
|
|
margin-bottom: 24px; |
|
|
} |
|
|
|
|
|
.form-group { |
|
|
margin-bottom: 20px; |
|
|
} |
|
|
|
|
|
.form-group label { |
|
|
display: block; |
|
|
margin-bottom: 8px; |
|
|
font-weight: 500; |
|
|
color: #202124; |
|
|
} |
|
|
|
|
|
.form-group textarea { |
|
|
width: 100%; |
|
|
min-height: 300px; |
|
|
padding: 12px; |
|
|
border: 1px solid #dadce0; |
|
|
border-radius: 4px; |
|
|
font-size: 14px; |
|
|
font-family: 'Consolas', 'Monaco', monospace; |
|
|
resize: vertical; |
|
|
line-height: 1.5; |
|
|
} |
|
|
|
|
|
.form-group textarea:focus { |
|
|
outline: none; |
|
|
border-color: #1a73e8; |
|
|
box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1); |
|
|
} |
|
|
|
|
|
.form-help { |
|
|
margin-top: 8px; |
|
|
font-size: 12px; |
|
|
color: #5f6368; |
|
|
} |
|
|
|
|
|
.alert { |
|
|
padding: 12px 16px; |
|
|
border-radius: 4px; |
|
|
margin-bottom: 16px; |
|
|
display: none; |
|
|
} |
|
|
|
|
|
.alert.success { |
|
|
background: #e8f5e9; |
|
|
color: #137333; |
|
|
border: 1px solid #34a853; |
|
|
} |
|
|
|
|
|
.alert.error { |
|
|
background: #fce8e6; |
|
|
color: #c5221f; |
|
|
border: 1px solid #ea4335; |
|
|
} |
|
|
|
|
|
.alert.show { |
|
|
display: block; |
|
|
} |
|
|
|
|
|
.button-group { |
|
|
display: flex; |
|
|
gap: 12px; |
|
|
margin-top: 24px; |
|
|
} |
|
|
|
|
|
.prompt-info { |
|
|
background: #f8f9fa; |
|
|
border-left: 4px solid #1a73e8; |
|
|
padding: 16px; |
|
|
border-radius: 4px; |
|
|
margin-bottom: 24px; |
|
|
} |
|
|
|
|
|
.prompt-info h3 { |
|
|
margin-bottom: 8px; |
|
|
font-size: 16px; |
|
|
} |
|
|
|
|
|
.prompt-info p { |
|
|
margin-bottom: 4px; |
|
|
font-size: 14px; |
|
|
color: #5f6368; |
|
|
} |
|
|
</style> |
|
|
</head> |
|
|
<body> |
|
|
<div class="header"> |
|
|
<div class="header-title"> |
|
|
<span>π</span> |
|
|
<span>ν둬ννΈ κ΄λ¦¬</span> |
|
|
</div> |
|
|
<button class="menu-toggle" onclick="toggleMobileMenu()" aria-label="λ©λ΄ μ΄κΈ°">β°</button> |
|
|
<div class="header-actions"> |
|
|
<span style="margin-right: 12px; color: #5f6368;">{{ current_user.nickname or current_user.username }}</span> |
|
|
|
|
|
{# μ¬μ΄νΈ κ΄λ¦¬ #} |
|
|
<div class="dropdown"> |
|
|
<button type="button" class="dropdown-toggle">μ¬μ΄νΈ κ΄λ¦¬</button> |
|
|
<div class="dropdown-menu"> |
|
|
<a href="{{ url_for('main.admin') }}" class="dropdown-item">μ¬μ©μ κ΄λ¦¬</a> |
|
|
<a href="{{ url_for('main.admin_tokens') }}" class="dropdown-item">ν ν° ν΅κ³</a> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
{# μΉμμ€ κ΄λ¦¬ #} |
|
|
<div class="dropdown"> |
|
|
<button type="button" class="dropdown-toggle">μΉμμ€ κ΄λ¦¬</button> |
|
|
<div class="dropdown-menu"> |
|
|
<a href="{{ url_for('main.admin_webnovels') }}" class="dropdown-item">μΉμμ€ μ
λ‘λ λ° κ΄λ¦¬</a> |
|
|
<a href="{{ url_for('main.admin_messages') }}" class="dropdown-item">λ©μμ§ νμΈ</a> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
{# AI μ€μ #} |
|
|
<div class="dropdown"> |
|
|
<button type="button" class="dropdown-toggle">AI μ€μ </button> |
|
|
<div class="dropdown-menu"> |
|
|
<a href="{{ url_for('main.admin_settings') }}" class="dropdown-item">AI μ€μ </a> |
|
|
<a href="{{ url_for('main.admin_prompts') }}" class="dropdown-item">ν둬ννΈ κ΄λ¦¬</a> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
{# μ±λ΄ #} |
|
|
<div class="dropdown"> |
|
|
<button type="button" class="dropdown-toggle">μ±λ΄</button> |
|
|
<div class="dropdown-menu"> |
|
|
<a href="{{ url_for('main.admin_tags') }}" class="dropdown-item">νκ·Έ/ν둬ννΈ</a> |
|
|
<a href="{{ url_for('main.admin_chatbot_prompts') }}" class="dropdown-item">μ±λ΄ ν둬ννΈ</a> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
{# νΈμκΈ°λ₯ #} |
|
|
<div class="dropdown"> |
|
|
<button type="button" class="dropdown-toggle">νΈμκΈ°λ₯</button> |
|
|
<div class="dropdown-menu"> |
|
|
<a href="{{ url_for('main.admin_utils') }}" class="dropdown-item">μ νΈ</a> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
{# λ©μΈμΌλ‘ #} |
|
|
<a href="{{ url_for('main.index') }}" class="btn btn-secondary" style="padding: 8px 16px; font-size: 14px; margin-right: 4px;">λ©μΈμΌλ‘</a> |
|
|
<a href="{{ url_for('main.logout') }}" class="btn btn-secondary" style="padding: 8px 16px; font-size: 14px;">λ‘κ·Έμμ</a> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="mobile-menu" id="mobileMenu" onclick="closeMobileMenuOnBackdrop(event)"> |
|
|
<div class="mobile-menu-content" onclick="event.stopPropagation()"> |
|
|
<div class="mobile-menu-header"> |
|
|
<div class="mobile-menu-title">λ©λ΄</div> |
|
|
<button class="mobile-menu-close" onclick="toggleMobileMenu()" aria-label="λ©λ΄ λ«κΈ°">×</button> |
|
|
</div> |
|
|
<div class="mobile-menu-user">{{ current_user.nickname or current_user.username }}</div> |
|
|
<div class="mobile-menu-items"> |
|
|
<div style="padding: 8px 20px; font-size: 11px; font-weight: 600; color: #5f6368; text-transform: uppercase; border-bottom: 1px solid #f1f3f4;">μ¬μ΄νΈ κ΄λ¦¬</div> |
|
|
<a href="{{ url_for('main.admin') }}" class="mobile-menu-item" onclick="closeMobileMenu()">μ¬μ©μ κ΄λ¦¬</a> |
|
|
<a href="{{ url_for('main.admin_tokens') }}" class="mobile-menu-item" onclick="closeMobileMenu()">ν ν° ν΅κ³</a> |
|
|
|
|
|
<div style="padding: 8px 20px; font-size: 11px; font-weight: 600; color: #5f6368; text-transform: uppercase; border-bottom: 1px solid #f1f3f4; margin-top: 8px;">μΉμμ€ κ΄λ¦¬</div> |
|
|
<a href="{{ url_for('main.admin_webnovels') }}" class="mobile-menu-item" onclick="closeMobileMenu()">μΉμμ€ μ
λ‘λ λ° κ΄λ¦¬</a> |
|
|
<a href="{{ url_for('main.admin_messages') }}" class="mobile-menu-item" onclick="closeMobileMenu()">λ©μμ§ νμΈ</a> |
|
|
|
|
|
<div style="padding: 8px 20px; font-size: 11px; font-weight: 600; color: #5f6368; text-transform: uppercase; border-bottom: 1px solid #f1f3f4; margin-top: 8px;">AI μ€μ </div> |
|
|
<a href="{{ url_for('main.admin_settings') }}" class="mobile-menu-item" onclick="closeMobileMenu()">AI μ€μ </a> |
|
|
<a href="{{ url_for('main.admin_prompts') }}" class="mobile-menu-item" onclick="closeMobileMenu()">ν둬ννΈ κ΄λ¦¬</a> |
|
|
|
|
|
<div style="padding: 8px 20px; font-size: 11px; font-weight: 600; color: #5f6368; text-transform: uppercase; border-bottom: 1px solid #f1f3f4; margin-top: 8px;">μ±λ΄</div> |
|
|
<a href="{{ url_for('main.admin_tags') }}" class="mobile-menu-item" onclick="closeMobileMenu()">νκ·Έ/ν둬ννΈ</a> |
|
|
<a href="{{ url_for('main.admin_chatbot_prompts') }}" class="mobile-menu-item" onclick="closeMobileMenu()">μ±λ΄ ν둬ννΈ</a> |
|
|
|
|
|
<div style="padding: 8px 20px; font-size: 11px; font-weight: 600; color: #5f6368; text-transform: uppercase; border-bottom: 1px solid #f1f3f4; margin-top: 8px;">νΈμκΈ°λ₯</div> |
|
|
<a href="{{ url_for('main.admin_utils') }}" class="mobile-menu-item" onclick="closeMobileMenu()">μ νΈ</a> |
|
|
|
|
|
<div style="padding: 8px 20px; font-size: 11px; font-weight: 600; color: #5f6368; text-transform: uppercase; border-bottom: 1px solid #f1f3f4; margin-top: 8px;">κΈ°ν</div> |
|
|
<a href="{{ url_for('main.index') }}" class="mobile-menu-item" onclick="closeMobileMenu()">λ©μΈμΌλ‘</a> |
|
|
<a href="{{ url_for('main.logout') }}" class="mobile-menu-item" onclick="closeMobileMenu()">λ‘κ·Έμμ</a> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div class="container"> |
|
|
<div class="page-header"> |
|
|
<h1>μμ€ν
ν둬ννΈ κ΄λ¦¬</h1> |
|
|
<p>μ§λ¬Έν λ μλμΌλ‘ λΆμ΄λ ν둬ννΈλ₯Ό μ€μ ν μ μμ΅λλ€. μ΄ ν둬ννΈλ λν λ©μμ§μλ νμλμ§ μμ΅λλ€.</p> |
|
|
</div> |
|
|
|
|
|
<div class="alert" id="alert"></div> |
|
|
|
|
|
<div class="prompt-info"> |
|
|
<h3>π‘ ν둬ννΈ μ¬μ© λ°©λ²</h3> |
|
|
<p>β’ μ€μ ν ν둬ννΈλ λͺ¨λ μ§λ¬Έ μμ μλμΌλ‘ λΆμ΄μ AIμκ² μ λ¬λ©λλ€.</p> |
|
|
<p>β’ ν둬ννΈλ μ¬μ©μμκ²λ 보μ΄μ§ μμΌλ©°, AI μλ΅ νμ§ ν₯μμ μν΄ μ¬μ©λ©λλ€.</p> |
|
|
<p>β’ μ: "νμ μ μ€νκ² λ΅λ³νμΈμ." λλ "μΉμμ€μ λ§₯λ½μ κ³ λ €νμ¬ λ΅λ³νμΈμ."</p> |
|
|
</div> |
|
|
|
|
|
<div class="prompt-editor"> |
|
|
<div class="form-group"> |
|
|
<label for="promptContent">μμ€ν
ν둬ννΈ</label> |
|
|
<textarea id="promptContent" placeholder="μ: νμ μ μ€νκ³ μμΈνκ² λ΅λ³νμΈμ. μΉμμ€μ λ§₯λ½μ κ³ λ €νμ¬ μΌκ΄μ± μλ λ΅λ³μ μ 곡νμΈμ."></textarea> |
|
|
<div class="form-help"> |
|
|
μ§λ¬Έ μμ μλμΌλ‘ μΆκ°λ ν둬ννΈλ₯Ό μ
λ ₯νμΈμ. λΉμλλ©΄ ν둬ννΈλ₯Ό μ¬μ©νμ§ μμ΅λλ€. |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div class="button-group"> |
|
|
<button class="btn btn-primary" onclick="savePrompt()">μ μ₯</button> |
|
|
<button class="btn btn-secondary" onclick="loadPrompt()">μλ‘κ³ μΉ¨</button> |
|
|
<button class="btn btn-secondary" onclick="clearPrompt()">μ΄κΈ°ν</button> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<script> |
|
|
function toggleMobileMenu() { |
|
|
const menu = document.getElementById('mobileMenu'); |
|
|
menu.classList.toggle('active'); |
|
|
document.body.style.overflow = menu.classList.contains('active') ? 'hidden' : ''; |
|
|
} |
|
|
|
|
|
function closeMobileMenu() { |
|
|
const menu = document.getElementById('mobileMenu'); |
|
|
menu.classList.remove('active'); |
|
|
document.body.style.overflow = ''; |
|
|
} |
|
|
|
|
|
function closeMobileMenuOnBackdrop(event) { |
|
|
if (event.target.id === 'mobileMenu') { |
|
|
closeMobileMenu(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
window.addEventListener('DOMContentLoaded', () => { |
|
|
loadPrompt(); |
|
|
}); |
|
|
|
|
|
|
|
|
async function loadPrompt() { |
|
|
try { |
|
|
const response = await fetch('/api/admin/prompts', { |
|
|
credentials: 'include' |
|
|
}); |
|
|
const data = await response.json(); |
|
|
|
|
|
if (response.ok) { |
|
|
document.getElementById('promptContent').value = data.prompt || ''; |
|
|
} else { |
|
|
showAlert('ν둬ννΈλ₯Ό λΆλ¬μ€λ μ€ μ€λ₯κ° λ°μνμ΅λλ€: ' + (data.error || 'μ μ μλ μ€λ₯'), 'error'); |
|
|
} |
|
|
} catch (error) { |
|
|
showAlert('ν둬ννΈλ₯Ό λΆλ¬μ€λ μ€ μ€λ₯κ° λ°μνμ΅λλ€: ' + error.message, 'error'); |
|
|
console.error('ν둬ννΈ λΆλ¬μ€κΈ° μ€λ₯:', error); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
async function savePrompt() { |
|
|
const promptContent = document.getElementById('promptContent').value.trim(); |
|
|
|
|
|
try { |
|
|
const response = await fetch('/api/admin/prompts', { |
|
|
method: 'POST', |
|
|
headers: { |
|
|
'Content-Type': 'application/json' |
|
|
}, |
|
|
credentials: 'include', |
|
|
body: JSON.stringify({ |
|
|
prompt: promptContent |
|
|
}) |
|
|
}); |
|
|
|
|
|
const data = await response.json(); |
|
|
|
|
|
if (response.ok) { |
|
|
showAlert('ν둬ννΈκ° μ±κ³΅μ μΌλ‘ μ μ₯λμμ΅λλ€.', 'success'); |
|
|
} else { |
|
|
showAlert('ν둬ννΈ μ μ₯ μ€ μ€λ₯κ° λ°μνμ΅λλ€: ' + (data.error || 'μ μ μλ μ€λ₯'), 'error'); |
|
|
} |
|
|
} catch (error) { |
|
|
showAlert('ν둬ννΈ μ μ₯ μ€ μ€λ₯κ° λ°μνμ΅λλ€: ' + error.message, 'error'); |
|
|
console.error('ν둬ννΈ μ μ₯ μ€λ₯:', error); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function clearPrompt() { |
|
|
if (confirm('ν둬ννΈλ₯Ό μ΄κΈ°ννμκ² μ΅λκΉ?')) { |
|
|
document.getElementById('promptContent').value = ''; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function showAlert(message, type) { |
|
|
const alert = document.getElementById('alert'); |
|
|
alert.textContent = message; |
|
|
alert.className = `alert ${type} show`; |
|
|
|
|
|
setTimeout(() => { |
|
|
alert.classList.remove('show'); |
|
|
}, 5000); |
|
|
} |
|
|
</script> |
|
|
</body> |
|
|
</html> |
|
|
|
|
|
|
|
|
|
|
|
|