sdk_generate/web/templates/index.html

95 lines
3.9 KiB
HTML
Raw Permalink 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.

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>SDK 生成器</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🚀</text></svg>" />
<link rel="stylesheet" href="/static/css/style.css" />
</head>
<body>
<div class="container">
<!-- 头部 -->
<header class="header">
<h1>🚀 SDK 生成器</h1>
<p class="subtitle">上传 API 文档,自动生成 Go SDK</p>
</header>
<!-- 上传区域 -->
<section class="upload-section">
<div class="upload-zone" id="uploadZone">
<div class="upload-icon">📄</div>
<p class="upload-text">拖拽文档到此处,或点击上传</p>
<p class="upload-hint">支持 .md .txt .doc .docx .pdf</p>
<input type="file" id="fileInput" accept=".md,.txt,.doc,.docx,.pdf" />
</div>
<div class="file-info" id="fileInfo" style="display:none;">
<span class="file-name" id="fileName"></span>
<span class="file-size" id="fileSize"></span>
<button class="btn-remove" id="removeFile"></button>
</div>
</section>
<!-- 配置区域 -->
<section class="config-section">
<div class="form-group">
<label for="sdkName">SDK 名称 <span class="required">*</span></label>
<input type="text" id="sdkName" placeholder="例如marketing-sdk" value="my-sdk" required />
<small>将作为 Go 模块名和包名</small>
</div>
<div class="form-group">
<label for="llmModel">大模型名称 <span class="required">*</span></label>
<input type="text" id="llmModel" placeholder="例如doubao-seed-evolving" value="doubao-seed-evolving" required />
<small>请输入完整的大模型标识符</small>
</div>
<div class="form-group">
<label for="apiKey">API Key <span class="required">*</span></label>
<input type="password" id="apiKey" placeholder="请输入 API Key" required />
</div>
<div class="form-group">
<label for="baseUrl">Base URL <span class="required">*</span></label>
<input type="text" id="baseUrl" placeholder="https://ark.cn-beijing.volces.com/api/v3" value="https://ark.cn-beijing.volces.com/api/v3" required />
</div>
</section>
<!-- 操作按钮 -->
<section class="action-section">
<button class="btn-generate" id="generateBtn" disabled>
<span class="btn-text">生成 SDK</span>
<span class="btn-spinner" style="display:none;"></span>
</button>
</section>
<!-- 进度区域 -->
<section class="progress-section" id="progressSection" style="display:none;">
<div class="progress-bar">
<div class="progress-fill" id="progressFill" style="width: 0%;"></div>
</div>
<div class="progress-status" id="progressStatus">准备中...</div>
<div class="progress-logs" id="progressLogs"></div>
</section>
<!-- 结果区域 -->
<section class="result-section" id="resultSection" style="display:none;">
<div class="result-header">
<span class="result-icon"></span>
<span class="result-title">生成完成!</span>
</div>
<!-- 文件列表隐藏 -->
<div class="result-files" id="resultFiles" style="display:none;"></div>
<div class="result-actions">
<button class="btn-download" id="downloadBtn">📥 下载 SDK</button>
<button class="btn-view-repo" id="viewRepoBtn" style="display:none;">📂 查看代码仓库</button>
</div>
<div class="result-error" id="resultError" style="display:none;"></div>
</section>
</div>
<script src="/static/js/app.js"></script>
</body>
</html>