Files
blogsite/blog/templates/explore.html
T
xiaoan 89b4ed1642 加入「拾源」:想法 → GitHub 条件 → 仓库 → AI 解读与存档
- 新增 explore 应用:Idea / SearchSpec / Repository / Note 及迁移
- Ollama 生成 GitHub 检索条件(language / stars / topic / sort),并批量解读仓库简介
- 接入 GitHub 仓库搜索 REST API,结果入库并按想法关联
- 想法级与仓库级「我的其他思考」,支持多条添加与删除
- 新增存档页:按想法 / 有想法的仓库两个视角,跨想法合并仓库
- 前端 /explore/ 四步流程、条件展示、筛选器、AI 解读目录、?idea= 恢复现场
- settings 增加 OLLAMA_* / GITHUB_* 配置
2026-11-20 17:29:38 +08:00

175 lines
7.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "base_content.html" %}
{% load static %}
{% block title %}拾源 · 探索开源{% endblock %}
{% block description %}把一句话变成 GitHub 检索条件,找到能落地的开源项目,并把你的思考留在想法和仓库下面。{% endblock %}
{% block brand_sub %}MIND MAP · EXPLORE{% endblock %}
{% block footer %}© 2026 拾光<span class="dot"></span>向外探索 · 向内生长{% endblock %}
{% block content %}
<div class="ex" id="explore">
<header class="ex-hero">
<a class="ex-archive-link" href="{% url 'blog:explore_archive' %}">存档 · 历史想法 →</a>
<p class="ex-eyebrow"><span aria-hidden="true">✦</span>拾源 · EXPLORE</p>
<h1 class="ex-title">一句话,找到<br><em>能落地的开源项目</em></h1>
<p class="ex-sub">说出你的想法、方向,或者正卡住的问题。模型会把它拆成 GitHub 检索条件,再去仓库里找答案。</p>
<form class="ex-composer" id="exForm" autocomplete="off">
<label class="sr-only" for="exInput">描述你的想法</label>
<textarea id="exInput" rows="3" maxlength="500"
placeholder="例如:我想把散落的读书笔记自动整理成思维导图,最好能完全离线……"></textarea>
<div class="ex-composer-foot">
<span class="ex-count"><b id="exCharCount">0</b> / 500</span>
<button class="ex-submit" type="submit" id="exSubmit">
<span>开始探索</span><b aria-hidden="true">✦</b>
</button>
</div>
</form>
<p class="ex-error" id="exError" role="alert" hidden></p>
<div class="ex-samples">
<span class="ex-samples-label">试试</span>
<button type="button" class="ex-sample" data-q="把零散笔记自动整理成思维导图">笔记 → 思维导图</button>
<button type="button" class="ex-sample" data-q="给 Django 博客加一套评论和点赞系统">Django 博客评论</button>
<button type="button" class="ex-sample" data-q="离线识别发票表格并导出成 Excel">离线 OCR 表格</button>
<button type="button" class="ex-sample" data-q="我想找一个 C++ 的项目">C++ 项目</button>
</div>
<p class="ex-demo"><i aria-hidden="true"></i>本地模型 qwen3.5:9b · GitHub 搜索 · AI 解读 · 自动存档</p>
</header>
<section class="ex-stage" id="exStage" hidden>
<div class="ex-stepper" id="exStepper" aria-hidden="true">
<div class="ex-step" data-step="0"><i>1</i><span>理解想法</span></div>
<div class="ex-step" data-step="1"><i>2</i><span>提炼条件</span></div>
<div class="ex-step" data-step="2"><i>3</i><span>检索仓库</span></div>
<div class="ex-step" data-step="3"><i>4</i><span>AI 解读</span></div>
</div>
<p class="ex-thinking" id="exThinking" hidden>
<i aria-hidden="true"></i>模型正在提炼检索条件 · <b id="exElapsed">0.0</b>s
</p>
<div class="ex-keywords" id="exKeywords" hidden>
<div class="ex-kw-head">
<h2>提炼出的线索</h2>
<div class="ex-kw-actions">
<span id="exKwHint"></span>
<button type="button" class="ex-kw-again" id="exAgain">重提炼</button>
</div>
</div>
<div class="ex-chips" id="exChips"></div>
<form class="ex-kw-add" id="exKwForm">
<input id="exKwInput" type="text" maxlength="40"
placeholder="补充一个关键词,回车添加" aria-label="补充关键词">
<button type="submit" aria-label="添加关键词">+</button>
</form>
</div>
<section class="ex-query" id="exQuery" hidden>
<div class="ex-query-head">
<h2><span aria-hidden="true">✦</span>GitHub 检索条件</h2>
<div class="ex-query-side">
<span class="ex-query-meta" id="exQueryMeta"></span>
<button class="ex-new" id="exNew" type="button">+ 新想法</button>
</div>
</div>
<div class="ex-conditions" id="exConditions"></div>
<div class="ex-query-box">
<code id="exQueryText"></code>
<button type="button" class="ex-copy" id="exCopy">复制</button>
</div>
<div class="ex-query-foot">
<a class="ex-gh" id="exGithub" href="#" target="_blank" rel="noopener noreferrer">在 GitHub 中查看 ↗</a>
<span>语言、Star、Topic 会被拼进 GitHub 的搜索语法。</span>
</div>
</section>
<section class="ex-notes" id="exIdeaNotes" hidden>
<div class="ex-notes-head">
<h2><span aria-hidden="true">✦</span>关于这个想法,我的其他思考</h2>
<span class="ex-notes-count" id="exIdeaNoteCount"></span>
</div>
<div class="notes-list" id="exIdeaNoteList"></div>
<form class="note-form" id="exIdeaNoteForm">
<textarea id="exIdeaNoteInput" rows="2" maxlength="2000"
placeholder="记下你的判断、疑问或下一步……"></textarea>
<button type="submit">记下</button>
</form>
</section>
<div class="ex-toolbar" id="exToolbar" hidden>
<div class="ex-filters">
<label>数量
<select id="exCount">
<option value="4">4 个</option>
<option value="7">7 个</option>
<option value="10" selected>10 个</option>
</select>
</label>
<label>Star
<select id="exStars">
<option value="0">不限</option>
<option value="1000">1k+</option>
<option value="5000">5k+</option>
<option value="10000">10k+</option>
<option value="30000">30k+</option>
</select>
</label>
<label>语言
<select id="exLang">
<option value="all">全部</option>
<option value="C++">C++</option>
<option value="C">C</option>
<option value="C#">C#</option>
<option value="Python">Python</option>
<option value="JavaScript">JavaScript</option>
<option value="TypeScript">TypeScript</option>
<option value="Go">Go</option>
<option value="Rust">Rust</option>
<option value="Java">Java</option>
<option value="PHP">PHP</option>
<option value="Ruby">Ruby</option>
<option value="Shell">Shell</option>
</select>
</label>
<label>排序
<select id="exSort">
<option value="best">最相关</option>
<option value="stars">Star 最多</option>
<option value="updated">最近更新</option>
</select>
</label>
</div>
<div class="ex-toolbar-right">
<span class="ex-meta" id="exMeta" aria-live="polite"></span>
<button class="ex-reset" type="button" id="exReset">重置</button>
</div>
</div>
<p class="ex-inline-error" id="exSearchError" role="alert" hidden></p>
<div class="ex-results" id="exResults"></div>
<div class="ex-empty" id="exEmpty" hidden>
<p class="ex-empty-mark" aria-hidden="true">✦</p>
<h3>这组条件下没有仓库</h3>
<p>把 Star 门槛调低,或者换一个语言再试试。</p>
<button type="button" class="ex-reset" id="exEmptyReset">放宽条件</button>
</div>
<p class="ex-note">仓库来自 GitHub 搜索 API;AI 解读基于仓库简介生成,可能不够深入,克隆仓库做结构分析是下一步。想法、条件、仓库和思考都会入库,刷新后可用 ?idea= 恢复。</p>
</section>
</div>
{% endblock %}
{% block extra_css %}
<link rel="stylesheet" href="{% static 'blog/css/explore.css' %}">
{% endblock %}
{% block extra_js %}
<script src="{% static 'blog/js/explore.js' %}"></script>
{% endblock %}