AI 生成: 一个从 Gitea 服务器获取最新项目的工具,支持命令行使用和 Web 界面查看。
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Gitea 最新项目</title>
|
||||
<link rel="stylesheet" href="/static/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>Gitea 最新项目</h1>
|
||||
|
||||
<form method="post" class="search-form">
|
||||
<div class="field">
|
||||
<label>Gitea 地址</label>
|
||||
<input type="text" name="base_url" value="{{ form.base_url }}" placeholder="https://gitea.example.com" required>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>用户名 / 组织名</label>
|
||||
<input type="text" name="owner" value="{{ form.owner }}" placeholder="myuser" required>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>访问令牌(可选)</label>
|
||||
<input type="password" name="token" value="{{ form.token }}" placeholder="私有仓库需要">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>数量</label>
|
||||
<input type="number" name="limit" value="{{ form.limit }}" min="1" max="50">
|
||||
</div>
|
||||
<div class="field checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="is_org" {% if form.is_org %}checked{% endif %}>
|
||||
作为组织查询
|
||||
</label>
|
||||
</div>
|
||||
<button type="submit">获取最新项目</button>
|
||||
</form>
|
||||
|
||||
{% if error %}
|
||||
<div class="error">{{ error }}</div>
|
||||
{% endif %}
|
||||
|
||||
{% if repos %}
|
||||
<h2>结果({{ repos|length }} 个)</h2>
|
||||
<ul class="repo-list">
|
||||
{% for repo in repos %}
|
||||
<li class="repo-item">
|
||||
<a href="{{ repo.html_url }}" target="_blank" rel="noopener" class="repo-name">{{ repo.full_name }}</a>
|
||||
<p class="repo-desc">{{ repo.description or '(无描述)' }}</p>
|
||||
<div class="repo-meta">
|
||||
<span>更新于 {{ repo.updated_at }}</span>
|
||||
{% if repo.language %}<span>语言:{{ repo.language }}</span>{% endif %}
|
||||
<span>⭐ {{ repo.stars_count }}</span>
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user