first deployment of kikomiko with url photos
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
8d98304137
commit
ae3ed7c7b7
@@ -0,0 +1,395 @@
|
||||
@font-face {
|
||||
font-family: "YekanBakh";
|
||||
src: url("./fonts/yekan-bakh/YekanBakh_FaNum_Regular.woff") format("woff");
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "YekanBakh";
|
||||
src: url("./fonts/yekan-bakh/YekanBakh_FaNum_Medium.woff") format("woff");
|
||||
font-weight: 500;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "YekanBakh";
|
||||
src: url("./fonts/yekan-bakh/YekanBakh_FaNum_Bold.woff") format("woff");
|
||||
font-weight: 700;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
:root {
|
||||
--bg: #f3e8e1;
|
||||
--bg-deep: #e7d4c8;
|
||||
--ink: #1c1410;
|
||||
--muted: #6b574c;
|
||||
--line: rgba(28, 20, 16, 0.12);
|
||||
--card: rgba(255, 252, 249, 0.92);
|
||||
--accent: #1c1410;
|
||||
--ok: #1f6b4a;
|
||||
--danger: #9b2c2c;
|
||||
--warn: #8a5a12;
|
||||
--shadow: 0 18px 40px rgba(48, 28, 18, 0.08);
|
||||
--radius: 16px;
|
||||
--font: "YekanBakh", "Tahoma", sans-serif;
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
html, body { margin: 0; min-height: 100%; }
|
||||
body {
|
||||
font-family: var(--font);
|
||||
color: var(--ink);
|
||||
background:
|
||||
radial-gradient(1200px 600px at 10% -10%, #fff7f1 0%, transparent 55%),
|
||||
radial-gradient(900px 500px at 100% 0%, #f0d7cb 0%, transparent 50%),
|
||||
linear-gradient(180deg, var(--bg), var(--bg-deep));
|
||||
line-height: 1.55;
|
||||
}
|
||||
|
||||
button, input, select, textarea {
|
||||
font: inherit;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
a { color: inherit; }
|
||||
|
||||
.hidden { display: none !important; }
|
||||
|
||||
/* Login */
|
||||
.login-wrap {
|
||||
min-height: 100vh;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
padding: 2rem 1rem;
|
||||
}
|
||||
.login-card {
|
||||
width: min(420px, 100%);
|
||||
background: var(--card);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: calc(var(--radius) + 4px);
|
||||
box-shadow: var(--shadow);
|
||||
padding: 2rem 1.6rem 1.6rem;
|
||||
}
|
||||
.login-card h1 {
|
||||
margin: 0 0 0.35rem;
|
||||
font-size: 1.55rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
.login-card .sub {
|
||||
margin: 0 0 1.4rem;
|
||||
color: var(--muted);
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
.field { margin-bottom: 0.9rem; }
|
||||
.field label {
|
||||
display: block;
|
||||
margin-bottom: 0.35rem;
|
||||
font-size: 0.9rem;
|
||||
color: var(--muted);
|
||||
}
|
||||
.field input, .field select, .field textarea {
|
||||
width: 100%;
|
||||
border: 1px solid var(--line);
|
||||
background: #fff;
|
||||
border-radius: 12px;
|
||||
padding: 0.7rem 0.85rem;
|
||||
outline: none;
|
||||
}
|
||||
.field input:focus, .field select:focus, .field textarea:focus {
|
||||
border-color: rgba(28, 20, 16, 0.35);
|
||||
box-shadow: 0 0 0 3px rgba(28, 20, 16, 0.08);
|
||||
}
|
||||
.field textarea { min-height: 90px; resize: vertical; }
|
||||
|
||||
.btn {
|
||||
appearance: none;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 12px;
|
||||
padding: 0.65rem 1rem;
|
||||
background: var(--accent);
|
||||
color: #fffaf6;
|
||||
cursor: pointer;
|
||||
font-weight: 500;
|
||||
}
|
||||
.btn:hover { filter: brightness(1.08); }
|
||||
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
|
||||
.btn-ghost {
|
||||
background: transparent;
|
||||
color: var(--ink);
|
||||
border-color: var(--line);
|
||||
}
|
||||
.btn-danger {
|
||||
background: transparent;
|
||||
color: var(--danger);
|
||||
border-color: rgba(155, 44, 44, 0.35);
|
||||
}
|
||||
.btn-row { display: flex; flex-wrap: wrap; gap: 0.55rem; }
|
||||
|
||||
.msg {
|
||||
margin: 0.75rem 0 0;
|
||||
padding: 0.65rem 0.8rem;
|
||||
border-radius: 10px;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
.msg.error { background: rgba(155, 44, 44, 0.1); color: var(--danger); }
|
||||
.msg.ok { background: rgba(31, 107, 74, 0.1); color: var(--ok); }
|
||||
.msg.info { background: rgba(28, 20, 16, 0.06); color: var(--muted); }
|
||||
|
||||
/* Shell */
|
||||
.app {
|
||||
display: grid;
|
||||
grid-template-columns: 240px 1fr;
|
||||
min-height: 100vh;
|
||||
}
|
||||
.sidebar {
|
||||
padding: 1.4rem 1rem;
|
||||
border-left: 1px solid var(--line);
|
||||
background: rgba(255, 250, 246, 0.72);
|
||||
backdrop-filter: blur(8px);
|
||||
}
|
||||
.brand {
|
||||
font-weight: 700;
|
||||
font-size: 1.2rem;
|
||||
margin: 0 0.4rem 1.2rem;
|
||||
}
|
||||
.nav-btn {
|
||||
width: 100%;
|
||||
text-align: right;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
border-radius: 10px;
|
||||
padding: 0.7rem 0.8rem;
|
||||
cursor: pointer;
|
||||
color: var(--muted);
|
||||
margin-bottom: 0.2rem;
|
||||
}
|
||||
.nav-btn:hover { background: rgba(28, 20, 16, 0.05); color: var(--ink); }
|
||||
.nav-btn.active {
|
||||
background: var(--ink);
|
||||
color: #fffaf6;
|
||||
}
|
||||
.sidebar-foot {
|
||||
margin-top: 2rem;
|
||||
padding: 0 0.4rem;
|
||||
color: var(--muted);
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
.main {
|
||||
padding: 1.4rem 1.5rem 2.5rem;
|
||||
max-width: 1200px;
|
||||
}
|
||||
.panel-head {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
margin-bottom: 1.1rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.panel-head h2 {
|
||||
margin: 0;
|
||||
font-size: 1.45rem;
|
||||
}
|
||||
.panel-head p {
|
||||
margin: 0.25rem 0 0;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.stats {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: 0.8rem;
|
||||
margin-bottom: 1.2rem;
|
||||
}
|
||||
.stat {
|
||||
background: var(--card);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius);
|
||||
padding: 1rem 1.1rem;
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
.stat strong {
|
||||
display: block;
|
||||
font-size: 1.5rem;
|
||||
margin-top: 0.2rem;
|
||||
}
|
||||
.stat span { color: var(--muted); font-size: 0.9rem; }
|
||||
|
||||
.card {
|
||||
background: var(--card);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius);
|
||||
box-shadow: var(--shadow);
|
||||
padding: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.toolbar {
|
||||
display: flex;
|
||||
gap: 0.6rem;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 0.9rem;
|
||||
align-items: center;
|
||||
}
|
||||
.toolbar input[type="search"] {
|
||||
flex: 1;
|
||||
min-width: 180px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 12px;
|
||||
padding: 0.65rem 0.85rem;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
font-size: 0.92rem;
|
||||
}
|
||||
th, td {
|
||||
text-align: right;
|
||||
padding: 0.7rem 0.45rem;
|
||||
border-bottom: 1px solid var(--line);
|
||||
vertical-align: top;
|
||||
}
|
||||
th { color: var(--muted); font-weight: 500; }
|
||||
tr:hover td { background: rgba(28, 20, 16, 0.02); }
|
||||
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; direction: ltr; text-align: left; }
|
||||
.badge {
|
||||
display: inline-block;
|
||||
padding: 0.15rem 0.45rem;
|
||||
border-radius: 999px;
|
||||
font-size: 0.75rem;
|
||||
border: 1px solid var(--line);
|
||||
color: var(--muted);
|
||||
}
|
||||
.badge.on { color: var(--ok); border-color: rgba(31, 107, 74, 0.35); }
|
||||
.badge.off { color: var(--danger); border-color: rgba(155, 44, 44, 0.35); }
|
||||
|
||||
.grid-2 {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 0.8rem;
|
||||
}
|
||||
.grid-3 {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
gap: 0.8rem;
|
||||
}
|
||||
|
||||
.modal-backdrop {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(28, 20, 16, 0.35);
|
||||
display: grid;
|
||||
place-items: center;
|
||||
padding: 1rem;
|
||||
z-index: 40;
|
||||
}
|
||||
.modal {
|
||||
width: min(920px, 100%);
|
||||
max-height: min(90vh, 900px);
|
||||
overflow: auto;
|
||||
background: #fffaf7;
|
||||
border-radius: 18px;
|
||||
border: 1px solid var(--line);
|
||||
box-shadow: var(--shadow);
|
||||
padding: 1.2rem;
|
||||
}
|
||||
.modal h3 { margin: 0 0 1rem; }
|
||||
.check {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
margin: 0.6rem 0 1rem;
|
||||
}
|
||||
|
||||
.variants-box {
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 14px;
|
||||
padding: 0.85rem;
|
||||
background: rgba(255, 255, 255, 0.65);
|
||||
margin: 0.4rem 0 1rem;
|
||||
}
|
||||
.variants-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 0.75rem;
|
||||
margin-bottom: 0.75rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.variants-head h4 {
|
||||
margin: 0;
|
||||
font-size: 1rem;
|
||||
}
|
||||
.variants-head p {
|
||||
margin: 0.2rem 0 0;
|
||||
color: var(--muted);
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
.variant-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.7rem;
|
||||
}
|
||||
.variant-card {
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 12px;
|
||||
padding: 0.75rem;
|
||||
background: #fff;
|
||||
}
|
||||
.variant-card-top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 0.5rem;
|
||||
margin-bottom: 0.55rem;
|
||||
}
|
||||
.variant-card-top strong {
|
||||
font-size: 0.92rem;
|
||||
}
|
||||
.variant-swatch {
|
||||
width: 1.1rem;
|
||||
height: 1.1rem;
|
||||
border-radius: 999px;
|
||||
border: 1px solid var(--line);
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin-left: 0.35rem;
|
||||
background: #ddd;
|
||||
}
|
||||
.variant-empty {
|
||||
color: var(--muted);
|
||||
font-size: 0.9rem;
|
||||
margin: 0.2rem 0;
|
||||
}
|
||||
|
||||
pre.out {
|
||||
background: #1c1410;
|
||||
color: #f7efe8;
|
||||
border-radius: 12px;
|
||||
padding: 0.9rem;
|
||||
overflow: auto;
|
||||
font-size: 0.82rem;
|
||||
direction: ltr;
|
||||
text-align: left;
|
||||
max-height: 280px;
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.app { grid-template-columns: 1fr; }
|
||||
.sidebar {
|
||||
border-left: 0;
|
||||
border-bottom: 1px solid var(--line);
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.35rem;
|
||||
align-items: center;
|
||||
}
|
||||
.brand { width: 100%; margin-bottom: 0.4rem; }
|
||||
.nav-btn { width: auto; }
|
||||
.sidebar-foot { display: none; }
|
||||
.stats, .grid-2, .grid-3 { grid-template-columns: 1fr; }
|
||||
table { display: block; overflow-x: auto; }
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../dist/fonts
|
||||
@@ -0,0 +1,349 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fa" dir="rtl">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="robots" content="noindex, nofollow" />
|
||||
<title>پنل مدیریت کیکومیکو</title>
|
||||
<link rel="stylesheet" href="/admin.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="loginView" class="login-wrap hidden">
|
||||
<form class="login-card" id="loginForm">
|
||||
<h1>کیکومیکو</h1>
|
||||
<p class="sub">ورود به پنل مدیریت محتوا</p>
|
||||
<div class="field">
|
||||
<label for="username">نام کاربری</label>
|
||||
<input id="username" name="username" autocomplete="username" required />
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="password">رمز عبور</label>
|
||||
<input id="password" name="password" type="password" autocomplete="current-password" required />
|
||||
</div>
|
||||
<button class="btn" type="submit" style="width:100%">ورود</button>
|
||||
<p id="loginMsg" class="msg error hidden"></p>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="appView" class="app hidden">
|
||||
<aside class="sidebar">
|
||||
<div class="brand">Kikomiko Admin</div>
|
||||
<button type="button" class="nav-btn active" data-panel="dashboard">داشبورد</button>
|
||||
<button type="button" class="nav-btn" data-panel="products">محصولات</button>
|
||||
<button type="button" class="nav-btn" data-panel="categories">دستهها</button>
|
||||
<button type="button" class="nav-btn" data-panel="import">ورود / همگامسازی</button>
|
||||
<button type="button" class="nav-btn" data-panel="settings">تنظیمات</button>
|
||||
<button type="button" class="nav-btn" id="logoutBtn">خروج</button>
|
||||
<div class="sidebar-foot">
|
||||
کاربر: <span id="whoami"></span>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<main class="main">
|
||||
<section id="panel-dashboard" class="panel">
|
||||
<div class="panel-head">
|
||||
<div>
|
||||
<h2>داشبورد</h2>
|
||||
<p>خلاصه وضعیت کاتالوگ</p>
|
||||
</div>
|
||||
<button type="button" class="btn" id="exportBtn">خروجی به catalog.json</button>
|
||||
<button type="button" class="btn btn-ghost" id="downloadCatalogBtn">دانلود JSON کامل با واریانتها</button>
|
||||
</div>
|
||||
<div class="stats">
|
||||
<div class="stat"><span>محصولات</span><strong id="statProducts">—</strong></div>
|
||||
<div class="stat"><span>دستهها</span><strong id="statCategories">—</strong></div>
|
||||
<div class="stat"><span>موجودی کل</span><strong id="statStock">—</strong></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<p class="msg info" style="margin:0">
|
||||
بعد از ویرایش محصولات، «خروجی به catalog.json» را بزنید تا
|
||||
<span class="mono">dist/data/catalog.dedupe2.json</span> برای فروشگاه بهروز شود.
|
||||
</p>
|
||||
<pre class="out hidden" id="dashOut"></pre>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="panel-products" class="panel hidden">
|
||||
<div class="panel-head">
|
||||
<div>
|
||||
<h2>محصولات</h2>
|
||||
<p>افزودن و ویرایش محصولات</p>
|
||||
</div>
|
||||
<button type="button" class="btn" id="newProductBtn">محصول جدید</button>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="toolbar">
|
||||
<input type="search" id="productSearch" placeholder="جستجو: نام، اسلاگ، SKU…" />
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>نام</th>
|
||||
<th>دسته</th>
|
||||
<th>واریانت</th>
|
||||
<th>قیمت</th>
|
||||
<th>موجودی</th>
|
||||
<th>وضعیت</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="productRows"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="panel-categories" class="panel hidden">
|
||||
<div class="panel-head">
|
||||
<div>
|
||||
<h2>دستهها</h2>
|
||||
<p>ساختار دستهبندی فروشگاه</p>
|
||||
</div>
|
||||
<div class="btn-row">
|
||||
<button type="button" class="btn-ghost btn" id="seedCatsBtn">ورود دستههای سایت</button>
|
||||
<button type="button" class="btn" id="newCategoryBtn">دسته جدید</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>عنوان</th>
|
||||
<th>اسلاگ</th>
|
||||
<th>والد</th>
|
||||
<th>ترتیب</th>
|
||||
<th>وضعیت</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="categoryRows"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="panel-import" class="panel hidden">
|
||||
<div class="panel-head">
|
||||
<div>
|
||||
<h2>ورود داده و همگامسازی</h2>
|
||||
<p>کاتالوگ قدیمی، اسکریپت واکشی، همگامسازی موجودی</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h3 style="margin-top:0">ورود کاتالوگ قدیمی</h3>
|
||||
<p style="color:var(--muted);margin-top:0">از فایل فعلی فروشگاه یا JSON آپلودشده.</p>
|
||||
<div class="btn-row">
|
||||
<button type="button" class="btn" id="importDistBtn">ورود از dist/catalog.dedupe2.json</button>
|
||||
<label class="btn btn-ghost" style="cursor:pointer">
|
||||
آپلود JSON
|
||||
<input type="file" id="importFile" accept="application/json,.json" hidden />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h3 style="margin-top:0">پشتیبان دیتابیس (SQLite)</h3>
|
||||
<p style="color:var(--muted);margin-top:0">
|
||||
دیتابیس را در Git نگه ندارید. از اینجا دانلود کنید و روی سرور دیگر بازیابی کنید.
|
||||
فایلهای خیلی بزرگ کاتالوگ JSON را همچنان با
|
||||
<span class="mono">import_catalog.py</span> وارد کنید.
|
||||
</p>
|
||||
<div class="btn-row">
|
||||
<button type="button" class="btn" id="downloadDbBtn">دانلود kikomiko.db</button>
|
||||
<label class="btn btn-ghost" style="cursor:pointer">
|
||||
بازیابی از فایل .db
|
||||
<input type="file" id="importDbFile" accept=".db,application/octet-stream,application/x-sqlite3" hidden />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h3 style="margin-top:0">ورود دستهای از KIKO (پیشنهادی)</h3>
|
||||
<p style="color:var(--muted);margin-top:0;line-height:1.75">
|
||||
لینکها را دستی بچسبانید، یا از نقشهٔ سایت اصلی همهٔ خانوادههای محصول را کشف و وارد کنید.
|
||||
محصولات تکراری رد میشوند. بعد از اتمام، از داشبورد <strong>خروجی به catalog.json</strong> را بزنید.
|
||||
</p>
|
||||
<div class="field">
|
||||
<label for="kikoBulkUrls">لینکهای محصول KIKO (هر خط یکی)</label>
|
||||
<textarea id="kikoBulkUrls" class="mono" dir="ltr" style="text-align:left;min-height:140px" placeholder="https://www.kikocosmetics.com/en-gb/p/product-a-123/ https://www.kikocosmetics.com/en-gb/p/product-b-456/"></textarea>
|
||||
</div>
|
||||
<div class="grid-2">
|
||||
<div class="field">
|
||||
<label for="kikoBulkLimit">حداکثر در هر دسته</label>
|
||||
<input id="kikoBulkLimit" type="number" min="1" max="80" value="15" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="kikoBulkMarket">مارکت</label>
|
||||
<input id="kikoBulkMarket" type="text" value="en-gb" dir="ltr" />
|
||||
</div>
|
||||
</div>
|
||||
<label style="display:flex;gap:0.5rem;align-items:center;margin-bottom:0.5rem;font-size:0.9rem">
|
||||
<input id="kikoBulkOverwrite" type="checkbox" />
|
||||
اگر توضیح فارسی از قبل هست، با متن انگلیسی KIKO جایگزین شود
|
||||
</label>
|
||||
<label style="display:flex;gap:0.5rem;align-items:center;margin-bottom:0.75rem;font-size:0.9rem">
|
||||
<input id="kikoBulkSkipExisting" type="checkbox" checked />
|
||||
محصولاتی که از قبل در ادمین هستند دوباره گرفته نشوند
|
||||
</label>
|
||||
<div class="btn-row">
|
||||
<button type="button" class="btn" id="kikoDiscoverBtn">کشف همه از نقشه سایت</button>
|
||||
<button type="button" class="btn" id="kikoCatalogAllBtn">ورود همه محصولات جدید (خودکار)</button>
|
||||
</div>
|
||||
<div class="btn-row" style="margin-top:0.5rem">
|
||||
<button type="button" class="btn btn-ghost" id="kikoBulkUrlsBtn">ورود دستهای از این لینکها</button>
|
||||
<button type="button" class="btn btn-ghost" id="kikoBulkExistingBtn">تکمیل محصولات موجودِ ناقص از KIKO</button>
|
||||
</div>
|
||||
<p id="kikoBulkMsg" class="msg hidden"></p>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h3 style="margin-top:0">Fetcher / Sync</h3>
|
||||
<p style="color:var(--muted);margin-top:0">
|
||||
اسکریپتهای خودمیزبان در پوشه <span class="mono">admin/fetchers/</span>
|
||||
</p>
|
||||
<div class="grid-2">
|
||||
<div class="field">
|
||||
<label for="fetcherSelect">اسکریپت</label>
|
||||
<select id="fetcherSelect"></select>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="fetcherAction">عملیات</label>
|
||||
<select id="fetcherAction">
|
||||
<option value="fetch">ورود محصولات (fetch)</option>
|
||||
<option value="sync">همگامسازی موجودی (sync)</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="fetcherConfig">پیکربندی JSON</label>
|
||||
<textarea id="fetcherConfig" class="mono" dir="ltr" style="text-align:left;min-height:120px">{
|
||||
{
|
||||
"path": "./sample-remote-products.json"
|
||||
}
|
||||
</textarea>
|
||||
</div>
|
||||
<button type="button" class="btn" id="runFetcherBtn">اجرا</button>
|
||||
<p id="fetcherDesc" class="msg info" style="margin-top:0.8rem"></p>
|
||||
</div>
|
||||
|
||||
<pre class="out" id="importOut">آماده.</pre>
|
||||
</section>
|
||||
|
||||
<section id="panel-settings" class="panel hidden">
|
||||
<div class="panel-head">
|
||||
<div>
|
||||
<h2>تنظیمات</h2>
|
||||
<p>رمز عبور، کلید هوش مصنوعی و ترجمه توضیحات</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card" style="max-width:560px;margin-bottom:1.25rem">
|
||||
<h3 style="margin:0 0 0.75rem;font-weight:600">ترجمه با هوش مصنوعی</h3>
|
||||
<p class="muted" style="margin:0 0 1rem;font-size:0.9rem;line-height:1.7">
|
||||
کلید API سازگار با OpenAI را ذخیره کنید، سپس توضیحات انگلیسی محصولات را به فارسی ترجمه کنید.
|
||||
کلید فقط روی سرور ادمین نگه داشته میشود و در خروجی کاتالوگ نیست.
|
||||
</p>
|
||||
<form id="aiSettingsForm">
|
||||
<div class="field">
|
||||
<label for="aiApiKey">کلید OpenAI / Chat API</label>
|
||||
<input id="aiApiKey" type="password" autocomplete="off" placeholder="sk-..." />
|
||||
<p id="aiKeyHint" class="muted" style="margin:0.35rem 0 0;font-size:0.8rem"></p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="aiBaseUrl">آدرس پایه API</label>
|
||||
<input id="aiBaseUrl" type="url" placeholder="https://api.openai.com/v1" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="aiModel">مدل</label>
|
||||
<input id="aiModel" type="text" placeholder="gpt-4o-mini" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="serpApiKey">کلید SerpAPI <span class="muted">(اختیاری)</span></label>
|
||||
<input id="serpApiKey" type="password" autocomplete="off" placeholder="serpapi key" />
|
||||
<p id="serpKeyHint" class="muted" style="margin:0.35rem 0 0;font-size:0.8rem"></p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="categoryApiKey">کلید ترجمه دستهها به فارسی <span class="muted">(اختیاری — در غیر این صورت از کلید OpenAI استفاده میشود)</span></label>
|
||||
<input id="categoryApiKey" type="password" autocomplete="off" placeholder="sk-... یا همان کلید OpenAI" />
|
||||
<p id="categoryKeyHint" class="muted" style="margin:0.35rem 0 0;font-size:0.8rem"></p>
|
||||
</div>
|
||||
<div class="btn-row">
|
||||
<button class="btn" type="submit">ذخیره تنظیمات AI</button>
|
||||
</div>
|
||||
<p id="aiSettingsMsg" class="msg hidden"></p>
|
||||
</form>
|
||||
<hr style="border:0;border-top:1px solid rgba(0,0,0,0.08);margin:1.25rem 0" />
|
||||
<h4 style="margin:0 0 0.5rem;font-weight:600">ترجمه دستهها به فارسی</h4>
|
||||
<p class="muted" style="margin:0 0 0.85rem;font-size:0.88rem;line-height:1.7">
|
||||
عنوان انگلیسی دسته (`name`) را به `nameFa` ترجمه میکند تا منو و فیلترها فارسی شوند.
|
||||
</p>
|
||||
<div class="field">
|
||||
<label for="catTranslateLimit">حداکثر دسته در هر اجرا</label>
|
||||
<input id="catTranslateLimit" type="number" min="1" max="200" value="50" />
|
||||
</div>
|
||||
<label style="display:flex;gap:0.5rem;align-items:center;margin-bottom:0.75rem;font-size:0.9rem">
|
||||
<input id="catOverwrite" type="checkbox" />
|
||||
بازنویسی نام فارسی موجود (اگر هنوز انگلیسی باشد)
|
||||
</label>
|
||||
<div class="btn-row">
|
||||
<button class="btn btn-ghost" type="button" id="catTranslateDryRunBtn">پیشنمایش دستههای نیازمند ترجمه</button>
|
||||
<button class="btn" type="button" id="catTranslateBtn">ترجمه دستهها به فارسی</button>
|
||||
</div>
|
||||
<p id="catTranslateMsg" class="msg hidden"></p>
|
||||
<hr style="border:0;border-top:1px solid rgba(0,0,0,0.08);margin:1.25rem 0" />
|
||||
<h4 style="margin:0 0 0.5rem;font-weight:600">ترجمه توضیحات (OpenAI)</h4>
|
||||
<div class="field">
|
||||
<label for="aiTranslateLimit">حداکثر محصول در هر اجرا</label>
|
||||
<input id="aiTranslateLimit" type="number" min="1" max="100" value="25" />
|
||||
</div>
|
||||
<label style="display:flex;gap:0.5rem;align-items:center;margin-bottom:0.75rem;font-size:0.9rem">
|
||||
<input id="aiOverwrite" type="checkbox" />
|
||||
بازنویسی توضیحات فارسی موجود (فقط اگر هنوز انگلیسی باشد)
|
||||
</label>
|
||||
<div class="btn-row">
|
||||
<button class="btn btn-ghost" type="button" id="aiTranslateDryRunBtn">پیشنمایش موارد نیازمند ترجمه</button>
|
||||
<button class="btn" type="button" id="aiTranslateBtn">ترجمه توضیحات به فارسی</button>
|
||||
</div>
|
||||
<p id="aiTranslateMsg" class="msg hidden"></p>
|
||||
<hr style="border:0;border-top:1px solid rgba(0,0,0,0.08);margin:1.25rem 0" />
|
||||
<h4 style="margin:0 0 0.5rem;font-weight:600">پر کردن مشخصات با SerpAPI</h4>
|
||||
<p class="muted" style="margin:0 0 0.85rem;font-size:0.88rem;line-height:1.7">
|
||||
برای هر محصول، کوئریهای استاندارد مشخصات (`detailQueries`) در ایمپورت/اکسپورت ذخیره میشود
|
||||
(مثل howToUse، labTests، size، …). SerpAPI همان کوئریها را برای فیلدهای خالی اجرا میکند.
|
||||
</p>
|
||||
<div class="field">
|
||||
<label for="serpFillLimit">حداکثر محصول در هر اجرا</label>
|
||||
<input id="serpFillLimit" type="number" min="1" max="50" value="10" />
|
||||
</div>
|
||||
<label style="display:flex;gap:0.5rem;align-items:center;margin-bottom:0.75rem;font-size:0.9rem">
|
||||
<input id="serpOverwrite" type="checkbox" />
|
||||
بازنویسی مشخصات موجود
|
||||
</label>
|
||||
<div class="btn-row">
|
||||
<button class="btn btn-ghost" type="button" id="serpDryRunBtn">پیشنمایش کوئریهای ناقص</button>
|
||||
<button class="btn" type="button" id="serpFillBtn">پر کردن مشخصات با SerpAPI</button>
|
||||
</div>
|
||||
<p id="serpFillMsg" class="msg hidden"></p>
|
||||
<pre id="aiTranslateOut" class="muted" style="margin-top:0.75rem;white-space:pre-wrap;font-size:0.8rem;max-height:220px;overflow:auto"></pre>
|
||||
</div>
|
||||
<div class="card" style="max-width:560px">
|
||||
<h3 style="margin:0 0 0.75rem;font-weight:600">تغییر رمز عبور</h3>
|
||||
<form id="passwordForm">
|
||||
<div class="field">
|
||||
<label for="currentPass">رمز فعلی</label>
|
||||
<input id="currentPass" type="password" required autocomplete="current-password" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="newPass">رمز جدید (حداقل ۱۰ کاراکتر)</label>
|
||||
<input id="newPass" type="password" required minlength="10" autocomplete="new-password" />
|
||||
</div>
|
||||
<button class="btn" type="submit">ذخیره رمز</button>
|
||||
<p id="passMsg" class="msg hidden"></p>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<div id="modalRoot" class="modal-backdrop hidden"></div>
|
||||
<script src="/admin.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user