代码提交
This commit is contained in:
@@ -72,6 +72,7 @@ public class ApiDocGenerator {
|
|||||||
.replace("{{GENERATE_TIME}}", LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")))
|
.replace("{{GENERATE_TIME}}", LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")))
|
||||||
.replace("{{STATS_BAR}}", buildStatsBar(docs.size(), totalClasses, totalMethods))
|
.replace("{{STATS_BAR}}", buildStatsBar(docs.size(), totalClasses, totalMethods))
|
||||||
.replace("{{SIDEBAR}}", buildSidebar(docs))
|
.replace("{{SIDEBAR}}", buildSidebar(docs))
|
||||||
|
.replace("{{SNAPSHOT_JS}}", resourceLoader.loadSnapshotJs())
|
||||||
.replace("{{CONTENT}}", buildContent(docs));
|
.replace("{{CONTENT}}", buildContent(docs));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,14 @@ public class HtmlResourceLoader {
|
|||||||
return loadResource(RESOURCE_BASE + "html2canvas.min.js");
|
return loadResource(RESOURCE_BASE + "html2canvas.min.js");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载快照导出 JS 脚本。
|
||||||
|
* 对应资源文件:resources/templates/apidoc/api-doc-snapshot.js
|
||||||
|
*/
|
||||||
|
public String loadSnapshotJs() {
|
||||||
|
return loadResource(RESOURCE_BASE + "api-doc-snapshot.js");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 从 classpath 读取资源文件内容。
|
* 从 classpath 读取资源文件内容。
|
||||||
* 所有资源必须以 UTF-8 编码。
|
* 所有资源必须以 UTF-8 编码。
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -39,6 +39,9 @@
|
|||||||
<script>
|
<script>
|
||||||
{{JS}}
|
{{JS}}
|
||||||
</script>
|
</script>
|
||||||
|
<script>
|
||||||
|
{{SNAPSHOT_JS}}
|
||||||
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -395,6 +395,7 @@ function openDubboDebug(card) {
|
|||||||
'<button class="dubbo-btn" onclick="copyDubboCurl()">📋 复制 cURL</button>' +
|
'<button class="dubbo-btn" onclick="copyDubboCurl()">📋 复制 cURL</button>' +
|
||||||
'<button class="dubbo-btn" onclick="copyDubboBody()">📄 复制请求体</button>' +
|
'<button class="dubbo-btn" onclick="copyDubboBody()">📄 复制请求体</button>' +
|
||||||
'<button class="dubbo-btn send" id="dubboSendBtn" onclick="sendDubboRequest()">▶ 发送请求</button>' +
|
'<button class="dubbo-btn send" id="dubboSendBtn" onclick="sendDubboRequest()">▶ 发送请求</button>' +
|
||||||
|
'<button class="dubbo-btn" style="background:#fff7e6;color:#d46b08;border-color:#ffd591" onclick="exportDebugSnapshot()">📸 导出快照</button>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'</div></div>';
|
'</div></div>';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user