UI: API Key 입력란 제거, 내부 상수로 자동 첨부
검토 콘솔(탐지 검토 + 코퍼스 관리 탭)에서 사용자가 매번 API Key를 입력하던 부분을 제거. DEFAULT_API_KEY 상수로 자동 첨부.main
parent
3b69bdf0f0
commit
bc40ace2fd
|
|
@ -237,9 +237,6 @@
|
||||||
<label>본문 텍스트 <span style="color: var(--accent)">*</span></label>
|
<label>본문 텍스트 <span style="color: var(--accent)">*</span></label>
|
||||||
<textarea id="text" placeholder="검사할 본문을 붙여넣으세요. 최소 1자."></textarea>
|
<textarea id="text" placeholder="검사할 본문을 붙여넣으세요. 최소 1자."></textarea>
|
||||||
|
|
||||||
<label>API Key</label>
|
|
||||||
<input type="text" id="api-key" value="combooks-key-change-me">
|
|
||||||
|
|
||||||
<details style="margin-top: 14px;">
|
<details style="margin-top: 14px;">
|
||||||
<summary style="cursor: pointer; font-size: 12px; color: var(--accent); user-select: none;">⚙ 고급 옵션 (임계값, 자서전 모드)</summary>
|
<summary style="cursor: pointer; font-size: 12px; color: var(--accent); user-select: none;">⚙ 고급 옵션 (임계값, 자서전 모드)</summary>
|
||||||
<div style="margin-top: 10px; padding: 12px; background: var(--panel-2); border-radius: 6px;">
|
<div style="margin-top: 10px; padding: 12px; background: var(--panel-2); border-radius: 6px;">
|
||||||
|
|
@ -323,9 +320,6 @@
|
||||||
<label>.txt 파일 업로드 (또는)</label>
|
<label>.txt 파일 업로드 (또는)</label>
|
||||||
<input type="file" id="corpus-file" accept=".txt">
|
<input type="file" id="corpus-file" accept=".txt">
|
||||||
|
|
||||||
<label>API Key</label>
|
|
||||||
<input type="text" id="corpus-api-key" value="combooks-key-change-me">
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<button id="corpus-upload-btn">업로드</button>
|
<button id="corpus-upload-btn">업로드</button>
|
||||||
<button class="ghost" id="corpus-refresh-btn">목록 새로고침</button>
|
<button class="ghost" id="corpus-refresh-btn">목록 새로고침</button>
|
||||||
|
|
@ -364,6 +358,9 @@
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
// 검토 콘솔 내부 호출에 자동 첨부할 기본 키 (사내 운영용)
|
||||||
|
const DEFAULT_API_KEY = "combooks-key-change-me";
|
||||||
|
|
||||||
const SAMPLES = {
|
const SAMPLES = {
|
||||||
copy: {
|
copy: {
|
||||||
title: "어미만 변경한 표절 (홍길동전 기반)",
|
title: "어미만 변경한 표절 (홍길동전 기반)",
|
||||||
|
|
@ -426,7 +423,7 @@ async function runDetect() {
|
||||||
const docId = document.getElementById("doc-id").value.trim() || `web-${Date.now()}`;
|
const docId = document.getElementById("doc-id").value.trim() || `web-${Date.now()}`;
|
||||||
const title = document.getElementById("title").value.trim();
|
const title = document.getElementById("title").value.trim();
|
||||||
const author = document.getElementById("author").value.trim();
|
const author = document.getElementById("author").value.trim();
|
||||||
const apiKey = document.getElementById("api-key").value.trim();
|
const apiKey = DEFAULT_API_KEY;
|
||||||
|
|
||||||
const thresholdVal = parseFloat(document.getElementById("threshold-slider").value);
|
const thresholdVal = parseFloat(document.getElementById("threshold-slider").value);
|
||||||
const autobioMode = document.querySelector('input[name="autobio-mode"]:checked').value;
|
const autobioMode = document.querySelector('input[name="autobio-mode"]:checked').value;
|
||||||
|
|
@ -617,7 +614,7 @@ document.querySelectorAll(".tab-btn").forEach((btn) => {
|
||||||
|
|
||||||
// ========== 코퍼스 관리 ==========
|
// ========== 코퍼스 관리 ==========
|
||||||
async function loadCorpus() {
|
async function loadCorpus() {
|
||||||
const apiKey = document.getElementById("corpus-api-key").value.trim();
|
const apiKey = DEFAULT_API_KEY;
|
||||||
const tbody = document.getElementById("corpus-tbody");
|
const tbody = document.getElementById("corpus-tbody");
|
||||||
tbody.innerHTML = '<tr><td colspan="4" style="color: var(--muted); text-align: center; padding: 20px;">로딩 중…</td></tr>';
|
tbody.innerHTML = '<tr><td colspan="4" style="color: var(--muted); text-align: center; padding: 20px;">로딩 중…</td></tr>';
|
||||||
try {
|
try {
|
||||||
|
|
@ -650,7 +647,7 @@ async function uploadCorpus() {
|
||||||
const title = document.getElementById("corpus-title").value.trim();
|
const title = document.getElementById("corpus-title").value.trim();
|
||||||
const text = document.getElementById("corpus-text").value.trim();
|
const text = document.getElementById("corpus-text").value.trim();
|
||||||
const file = document.getElementById("corpus-file").files[0];
|
const file = document.getElementById("corpus-file").files[0];
|
||||||
const apiKey = document.getElementById("corpus-api-key").value.trim();
|
const apiKey = DEFAULT_API_KEY;
|
||||||
const statusEl = document.getElementById("corpus-status");
|
const statusEl = document.getElementById("corpus-status");
|
||||||
|
|
||||||
if (!title) {
|
if (!title) {
|
||||||
|
|
@ -703,7 +700,7 @@ async function uploadCorpus() {
|
||||||
|
|
||||||
async function deleteDoc(docId) {
|
async function deleteDoc(docId) {
|
||||||
if (!confirm(`'${docId}' 문서를 삭제하시겠습니까? 인덱스가 재빌드됩니다.`)) return;
|
if (!confirm(`'${docId}' 문서를 삭제하시겠습니까? 인덱스가 재빌드됩니다.`)) return;
|
||||||
const apiKey = document.getElementById("corpus-api-key").value.trim();
|
const apiKey = DEFAULT_API_KEY;
|
||||||
try {
|
try {
|
||||||
const resp = await fetch(`/v1/corpus/${encodeURIComponent(docId)}`, {
|
const resp = await fetch(`/v1/corpus/${encodeURIComponent(docId)}`, {
|
||||||
method: "DELETE",
|
method: "DELETE",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue