- 增加了 LCSC API 集成,可利用 app_id、access_key 和 secret_key 获取产品详情。 - 实现了用于安全 API 请求的一次性和签名生成。 - 通过新端点提升包容量管理,更新插槽容量。 - 更新界面,支持 LCSC 产品直接导入袋口。 - 改进了 API 响应和用户输入验证的错误处理。 - 重构箱子渲染逻辑,以适应新的包包功能和展示产品详情。 - 为与 LCSC 产品信息相关的新 UI 元素添加了 CSS 样式。 - 更新了 AI 设置页面,包含了 LCSC API 配置选项。
85 lines
3.7 KiB
HTML
85 lines
3.7 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>AI参数设置</title>
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
|
|
</head>
|
|
<body>
|
|
<header class="hero slim">
|
|
<div>
|
|
<h1>AI参数设置</h1>
|
|
<p>在此修改硅基流动 API 和补货建议参数</p>
|
|
</div>
|
|
<div class="hero-actions">
|
|
<a class="btn btn-light" href="{{ url_for('types_page') }}">返回仓库概览</a>
|
|
</div>
|
|
</header>
|
|
|
|
<main class="container">
|
|
{% if error %}
|
|
<p class="alert">{{ error }}</p>
|
|
{% endif %}
|
|
{% if notice %}
|
|
<p class="notice">{{ notice }}</p>
|
|
{% endif %}
|
|
|
|
<section class="panel">
|
|
<form class="form-grid" method="post">
|
|
<h2 class="full">AI补货建议参数</h2>
|
|
<label>
|
|
API URL *
|
|
<input type="text" name="api_url" required value="{{ settings.api_url }}" placeholder="https://api.siliconflow.cn/v1/chat/completions">
|
|
</label>
|
|
<label>
|
|
模型名称 *
|
|
<input type="text" name="model" required value="{{ settings.model }}" placeholder="Qwen/Qwen2.5-7B-Instruct">
|
|
</label>
|
|
<label class="full">
|
|
API Key *
|
|
<input type="text" name="api_key" required value="{{ settings.api_key }}" placeholder="sk-...">
|
|
</label>
|
|
<label>
|
|
超时(秒)
|
|
<input type="number" name="timeout" min="5" value="{{ settings.timeout }}">
|
|
</label>
|
|
<label>
|
|
低库存阈值
|
|
<input type="number" name="restock_threshold" min="0" value="{{ settings.restock_threshold }}">
|
|
</label>
|
|
<label>
|
|
建议条目上限
|
|
<input type="number" name="restock_limit" min="1" value="{{ settings.restock_limit }}">
|
|
</label>
|
|
|
|
<h2 class="full">立创商品信息接口参数</h2>
|
|
<p class="hint full">固定 Base URL: <code>https://open-api.jlc.com</code></p>
|
|
<p class="hint full">固定请求路径: <code>/lcsc/openapi/sku/product/basic</code></p>
|
|
<label class="full">
|
|
app_id
|
|
<input type="text" name="lcsc_app_id" value="{{ settings.lcsc_app_id }}" placeholder="JOP appid">
|
|
</label>
|
|
<label>
|
|
access_key
|
|
<input type="text" name="lcsc_access_key" value="{{ settings.lcsc_access_key }}" placeholder="JOP accesskey">
|
|
</label>
|
|
<label>
|
|
secret_key
|
|
<input type="text" name="lcsc_secret_key" value="{{ settings.lcsc_secret_key }}" placeholder="JOP secretkey">
|
|
</label>
|
|
<label>
|
|
立创接口超时(秒)
|
|
<input type="number" name="lcsc_timeout" min="5" value="{{ settings.lcsc_timeout }}">
|
|
</label>
|
|
<p class="hint full">输入 C 编号(如 <code>C23186</code>)时,系统按 <code>productCode</code> 查询;输入纯数字时按 <code>productId</code> 查询。</p>
|
|
<div class="actions full">
|
|
<button class="btn" type="submit">保存参数</button>
|
|
<a class="btn btn-light" href="{{ url_for('types_page') }}">取消</a>
|
|
</div>
|
|
</form>
|
|
</section>
|
|
</main>
|
|
</body>
|
|
</html>
|