update
This commit is contained in:
77
templates/settings/database.php
Normal file
77
templates/settings/database.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
$migrationStatus = is_array($status ?? null) ? $status : [];
|
||||
$pending = (int) ($migrationStatus['pending'] ?? 0);
|
||||
$total = (int) ($migrationStatus['total'] ?? 0);
|
||||
$applied = (int) ($migrationStatus['applied'] ?? 0);
|
||||
$pendingFiles = (array) ($migrationStatus['pending_files'] ?? []);
|
||||
$logs = is_array($runLogs ?? null) ? $runLogs : [];
|
||||
?>
|
||||
|
||||
<h4 class="fw-bold mb-4">Baza danych — Migracje</h4>
|
||||
|
||||
<div class="row g-3 mb-4">
|
||||
<div class="col-md-4">
|
||||
<div class="card text-center">
|
||||
<div class="card-body">
|
||||
<div class="text-muted small text-uppercase fw-bold">Wszystkie</div>
|
||||
<div class="fs-3 fw-bold text-dark"><?= $total ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card text-center">
|
||||
<div class="card-body">
|
||||
<div class="text-muted small text-uppercase fw-bold">Wykonane</div>
|
||||
<div class="fs-3 fw-bold text-success"><?= $applied ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card text-center">
|
||||
<div class="card-body">
|
||||
<div class="text-muted small text-uppercase fw-bold">Oczekujace</div>
|
||||
<div class="fs-3 fw-bold <?= $pending > 0 ? 'text-warning' : 'text-muted' ?>"><?= $pending ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($pending > 0): ?>
|
||||
<div class="alert alert-warning d-flex align-items-center justify-content-between">
|
||||
<span><strong><?= $pending ?></strong> migracji oczekuje na wykonanie.</span>
|
||||
<form action="/settings/database/migrate" method="post" class="d-inline">
|
||||
<button type="submit" class="btn btn-primary btn-sm">Uruchom migracje</button>
|
||||
</form>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="alert alert-success mb-4">Baza danych jest aktualna.</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="card mb-4">
|
||||
<div class="card-header">Oczekujace pliki migracji</div>
|
||||
<div class="card-body p-0">
|
||||
<table class="table table-sm mb-0">
|
||||
<thead>
|
||||
<tr><th>Plik</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if (empty($pendingFiles)): ?>
|
||||
<tr><td class="text-muted">Brak oczekujacych migracji.</td></tr>
|
||||
<?php else: ?>
|
||||
<?php foreach ($pendingFiles as $filename): ?>
|
||||
<tr><td><code><?= htmlspecialchars((string) $filename) ?></code></td></tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if (!empty($logs)): ?>
|
||||
<div class="card">
|
||||
<div class="card-header">Logi ostatniego uruchomienia</div>
|
||||
<div class="card-body">
|
||||
<pre class="mb-0 small" style="white-space: pre-wrap;"><?php foreach ($logs as $line): ?><?= htmlspecialchars((string) $line) . "\n" ?><?php endforeach; ?></pre>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@@ -46,8 +46,33 @@
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="article_generation_prompt" class="form-label">Prompt do generowania artykułu</label>
|
||||
<textarea class="form-control" id="article_generation_prompt" name="article_generation_prompt" rows="6"><?= htmlspecialchars($settings['article_generation_prompt']) ?></textarea>
|
||||
<small class="text-muted">Dostępne placeholdery: {min_words}, {max_words}</small>
|
||||
<textarea class="form-control" id="article_generation_prompt" name="article_generation_prompt" rows="10"><?= htmlspecialchars($settings['article_generation_prompt']) ?></textarea>
|
||||
<small class="text-muted">Dostepne placeholdery: {min_words}, {max_words}. Zalecenie: prompt opisuje styl i strukture, a temat jest dopinany automatycznie.</small>
|
||||
</div>
|
||||
|
||||
<h6 class="mb-3 mt-4 border-bottom pb-2">Linkowanie wewnetrzne (Smart Matching)</h6>
|
||||
|
||||
<div class="form-check form-switch mb-3">
|
||||
<input type="hidden" name="internal_linking_enabled" value="0">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="internal_linking_enabled" name="internal_linking_enabled" value="1" <?= (string) ($settings['internal_linking_enabled'] ?? '1') !== '0' ? 'checked' : '' ?>>
|
||||
<label class="form-check-label" for="internal_linking_enabled">Wlacz automatyczne linkowanie wewnetrzne</label>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col">
|
||||
<label for="internal_link_min_count" class="form-label">Min. liczba linkow</label>
|
||||
<input type="number" class="form-control" id="internal_link_min_count" name="internal_link_min_count" min="0" max="8" value="<?= htmlspecialchars($settings['internal_link_min_count'] ?? '2') ?>">
|
||||
</div>
|
||||
<div class="col">
|
||||
<label for="internal_link_max_count" class="form-label">Max. liczba linkow</label>
|
||||
<input type="number" class="form-control" id="internal_link_max_count" name="internal_link_max_count" min="1" max="8" value="<?= htmlspecialchars($settings['internal_link_max_count'] ?? '4') ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="openai_embedding_model" class="form-label">Model embeddingow</label>
|
||||
<input type="text" class="form-control" id="openai_embedding_model" name="openai_embedding_model" value="<?= htmlspecialchars($settings['openai_embedding_model'] ?? 'text-embedding-3-small') ?>" placeholder="text-embedding-3-small">
|
||||
<small class="text-muted">Wykorzystywany do semantycznego dopasowania powiazanych artykulow.</small>
|
||||
</div>
|
||||
|
||||
<h5 class="mb-3 mt-4 border-bottom pb-2">Obrazki</h5>
|
||||
|
||||
Reference in New Issue
Block a user