feat: add pastable link for markdown endpoint
This commit is contained in:
@@ -629,6 +629,11 @@ def _build_endpoint_catalog(
|
||||
)
|
||||
markdown_row = {
|
||||
"url": f"{markdown_base}/chat",
|
||||
# Bare frontend root for the Obsidian companion plugin — its
|
||||
# settings field asks for the base, then appends ``/chat``,
|
||||
# ``/chat/stream`` itself. Curl + admin /chat tester want the
|
||||
# full ``url`` above; the plugin wants this.
|
||||
"base": markdown_base,
|
||||
"vault_path": str(markdown_fe.vault_path),
|
||||
"default_agent": markdown_fe.default_agent,
|
||||
"log_all_chats": markdown_fe.log_all_chats,
|
||||
|
||||
@@ -143,6 +143,7 @@
|
||||
<tr class="ep-row"
|
||||
data-kind="markdown"
|
||||
data-url="{{ endpoints.markdown.url }}"
|
||||
data-base="{{ endpoints.markdown.base }}"
|
||||
data-sample-agent="{{ endpoints.markdown.sample_agent }}">
|
||||
<td>
|
||||
<code>{{ endpoints.markdown.vault_path }}</code>
|
||||
@@ -158,9 +159,15 @@
|
||||
<span class="muted">— (request must set <code>agent</code> or frontmatter)</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td><code class="ep-url">{{ endpoints.markdown.url }}</code></td>
|
||||
<td>
|
||||
<code class="ep-url">{{ endpoints.markdown.url }}</code>
|
||||
<div class="muted" style="font-size:0.85em; margin-top:0.25rem;">
|
||||
plugin base: <code>{{ endpoints.markdown.base }}</code>
|
||||
</div>
|
||||
</td>
|
||||
<td class="ep-actions">
|
||||
<button type="button" data-action="copy-url">Copy URL</button>
|
||||
<button type="button" data-action="copy-base">Copy plugin base</button>
|
||||
<button type="button" data-action="copy-curl">Copy curl</button>
|
||||
<button type="button" data-action="toggle-curl" aria-expanded="false">▸ curl</button>
|
||||
</td>
|
||||
@@ -452,6 +459,9 @@
|
||||
const tok = currentToken() || PLACEHOLDER;
|
||||
if (action === "copy-url") {
|
||||
copyText(btn, url);
|
||||
} else if (action === "copy-base") {
|
||||
const base = row.getAttribute("data-base");
|
||||
if (base) copyText(btn, base);
|
||||
} else if (action === "copy-url-token") {
|
||||
const sep = url.indexOf("?") >= 0 ? "&" : "?";
|
||||
copyText(btn, url + sep + "token=" + encodeURIComponent(tok));
|
||||
|
||||
Reference in New Issue
Block a user