fix: TypeError str/Path в verify_script + заметная кнопка Копировать
1. verify_script получал str вместо Path → TypeError при job_dir / "file" Теперь: Path(job_dir) внутри функции 2. Кнопка «Копировать параметры» — inline под таблицей, контрастная (красная рамка) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
+2
-1
@@ -62,12 +62,13 @@ def verify_script(
|
||||
script: str,
|
||||
source_dir: str,
|
||||
target_file: str,
|
||||
job_dir: Path,
|
||||
job_dir: str | Path,
|
||||
) -> dict:
|
||||
"""Execute script on 2 sample files to verify correctness.
|
||||
|
||||
Returns {"ok": True/False, "processed": int, "errors": [...], "error": str}.
|
||||
"""
|
||||
job_dir = Path(job_dir)
|
||||
# Select 2 sample xlsx files
|
||||
all_xlsx = sorted(
|
||||
f for f in Path(source_dir).rglob("*.xlsx")
|
||||
|
||||
+6
-6
@@ -32,8 +32,10 @@ pre { background: #2c2c2c; color: #f5f0eb; padding: .8rem; border-radius: 6px; o
|
||||
.info-row span { background: #ede5db; padding: 3px 10px; border-radius: 6px; }
|
||||
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; margin-right: 6px; }
|
||||
@keyframes spin { to { transform: rotate(360deg); } }
|
||||
.copy-btn { position: absolute; top: 4px; right: 4px; padding: 3px 10px; font-size: .7rem; background: rgba(255,255,255,.85); color: var(--muted); border: 1px solid var(--border); border-radius: 4px; cursor: pointer; z-index: 1; }
|
||||
.copy-btn:hover { background: #fff; color: var(--text); }
|
||||
.copy-btn { position: absolute; top: 4px; right: 4px; padding: 4px 12px; font-size: .75rem; background: var(--card); color: var(--accent); border: 1.5px solid var(--accent); border-radius: 4px; cursor: pointer; z-index: 1; font-weight: 600; }
|
||||
.copy-btn:hover { background: var(--accent); color: #fff; }
|
||||
.copy-btn-inline { display: inline-block; padding: 4px 14px; font-size: .75rem; background: var(--card); color: var(--accent); border: 1.5px solid var(--accent); border-radius: 4px; cursor: pointer; font-weight: 600; margin-top: .5rem; }
|
||||
.copy-btn-inline:hover { background: var(--accent); color: #fff; }
|
||||
.verify-ok { background: #e8f5e9; border: 1px solid var(--green); border-radius: 6px; padding: .5rem .8rem; margin: .5rem 0; font-size: .85rem; color: var(--green); }
|
||||
.verify-fail { background: #fce4ec; border: 1px solid var(--accent); border-radius: 6px; padding: .5rem .8rem; margin: .5rem 0; font-size: .85rem; color: var(--accent); }
|
||||
</style>
|
||||
@@ -75,10 +77,8 @@ pre { background: #2c2c2c; color: #f5f0eb; padding: .8rem; border-radius: 6px; o
|
||||
<div class="card hidden" id="step-confirm">
|
||||
<label>3. Проверьте найденные параметры</label>
|
||||
<div id="verify-badge"></div>
|
||||
<div style="position:relative">
|
||||
<div id="summary-view" style="font-size:.9rem;line-height:1.6"></div>
|
||||
<button class="copy-btn" onclick="copyText('summary-view')" title="Копировать">Копировать</button>
|
||||
</div>
|
||||
<div id="summary-view" style="font-size:.9rem;line-height:1.6"></div>
|
||||
<button class="copy-btn-inline" onclick="copyText('summary-view')" title="Копировать параметры">Копировать параметры</button>
|
||||
<details style="margin-top:.8rem">
|
||||
<summary style="cursor:pointer;color:var(--muted);font-size:.8rem">Показать скрипт (для разработчиков)</summary>
|
||||
<div style="position:relative">
|
||||
|
||||
Reference in New Issue
Block a user