62 lines
2.1 KiB
HTML
62 lines
2.1 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}Sources - Context7 Docs{% endblock %}
|
|
|
|
{% block content %}
|
|
<h2>Git Repository Sync</h2>
|
|
|
|
<div class="status-message">Add Git repositories to <code>docs_sources.yaml</code>, then sync them into searchable libraries.</div>
|
|
|
|
<h3>Add Git Source</h3>
|
|
<form method="post" action="/sources/add" class="sync-form">
|
|
<label for="library_id">Library ID:</label>
|
|
<input type="text" id="library_id" name="library_id" placeholder="my-project" required>
|
|
|
|
<label for="repo_url">Repository URL:</label>
|
|
<input type="text" id="repo_url" name="repo_url" placeholder="https://github.com/user/repo.git" required>
|
|
|
|
<label for="name">Display Name:</label>
|
|
<input type="text" id="name" name="name" placeholder="My Project">
|
|
|
|
<label for="description">Description:</label>
|
|
<input type="text" id="description" name="description" placeholder="Project documentation">
|
|
|
|
<label for="branch">Branch:</label>
|
|
<input type="text" id="branch" name="branch" value="main">
|
|
|
|
<label for="include_paths">Include Paths:</label>
|
|
<textarea id="include_paths" name="include_paths" rows="4">docs</textarea>
|
|
|
|
<label for="exclude_paths">Exclude Paths:</label>
|
|
<textarea id="exclude_paths" name="exclude_paths" rows="4">node_modules
|
|
.git</textarea>
|
|
|
|
<button type="submit">Save Git Source</button>
|
|
</form>
|
|
|
|
<form method="post" action="/sources/sync" class="sync-form">
|
|
<label for="override">Override existing repos:</label>
|
|
<input type="checkbox" id="override" name="override">
|
|
<button type="submit">Sync All Repositories</button>
|
|
</form>
|
|
|
|
<div id="source-list"></div>
|
|
|
|
{% if sources %}
|
|
<h3>Configured Sources</h3>
|
|
<div class="source-cards">
|
|
{% for src in sources %}
|
|
<div class="source-card">
|
|
<strong>{{ src.library_id | default('unknown') }}</strong><br>
|
|
URL: {{ src.repo_url | default('N/A')[:60] }}<br>
|
|
Branch: {{ src.branch | default('main') }}<br>
|
|
Include: {{ (src.include_paths | default(['*']) | join(', ')) }}
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% else %}
|
|
<p>No git sources configured. Add repositories to <code>docs_sources.yaml</code>.</p>
|
|
{% endif %}
|
|
|
|
{% endblock %}
|