Files
abot/admin/dashboard/templates/api_docs.html

86 lines
3.6 KiB
HTML

{% extends "base.html" %}
{% block title %}接口文档 - 机器人管理后台{% endblock %}
{% block content %}
<div class="page-shell docs-page">
<div class="page-hero">
<div class="page-hero-copy">
<div class="page-eyebrow">Developer Workspace</div>
<h1>接口文档</h1>
<p>把文档入口纳入统一的控制台壳层,让开发工具页也具备一致的使用体验。</p>
</div>
<div class="page-hero-actions">
<el-button type="primary" plain @click="reloadIframe"><i class="el-icon-refresh"></i> 刷新文档</el-button>
<el-button type="primary" @click="openInNewTab"><i class="el-icon-top-right"></i> 新窗口打开</el-button>
</div>
</div>
<el-card class="iframe-shell-card" shadow="hover">
<div slot="header" class="workspace-header">
<div>
<h3>API 文档面板</h3>
<p>在控制台中直接浏览接口说明,方便排查与对接。</p>
</div>
<div class="iframe-url">{{ src_url }}</div>
</div>
<div class="iframe-shell">
<iframe ref="docsFrame" src="{{ src_url }}" frameborder="0"></iframe>
</div>
</el-card>
</div>
{% endblock %}
{% block scripts %}
<script>
new Vue({
el: '#app',
mixins: [baseApp],
data() {
return {
currentView: '13',
showTimeRangeSelector: false,
frameUrl: '{{ src_url }}'
}
},
mounted() {
this.currentView = '13';
},
methods: {
reloadIframe() {
if (this.$refs.docsFrame) {
this.$refs.docsFrame.src = this.frameUrl;
}
},
openInNewTab() {
window.open(this.frameUrl, '_blank');
}
}
});
</script>
<style>
.page-shell { display: flex; flex-direction: column; gap: 16px; }
.page-hero {
display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding: 24px 26px; border-radius: 24px;
background: linear-gradient(135deg, rgba(15,118,110,0.10), rgba(14,165,233,0.08), rgba(255,255,255,0.9));
border: 1px solid rgba(101, 121, 113, 0.16); box-shadow: 0 18px 40px rgba(21, 33, 27, 0.06);
}
.page-hero-actions { display: flex; align-items: center; gap: 12px; }
.page-eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #0b5e57; font-weight: 700; margin-bottom: 8px; }
.page-hero-copy h1 { font-size: 30px; line-height: 1.1; margin-bottom: 10px; color: #15211b; }
.page-hero-copy p { color: #4f6258; font-size: 14px; }
.workspace-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.workspace-header h3 { font-size: 18px; margin-bottom: 4px; }
.workspace-header p { font-size: 13px; color: #4f6258; }
.iframe-url {
max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px;
color: #74897f; padding: 8px 12px; border-radius: 999px; background: rgba(247,251,248,0.9); border: 1px solid rgba(101,121,113,0.12);
}
.iframe-shell-card { height: calc(100vh - 230px); }
.iframe-shell-card .el-card__body { height: calc(100% - 73px); }
.iframe-shell { height: 100%; border-radius: 18px; overflow: hidden; border: 1px solid rgba(101,121,113,0.12); background: rgba(247,251,248,0.82); }
.iframe-shell iframe { width: 100%; height: 100%; border: none; display: block; background: #fff; }
</style>
{% endblock %}