feat: 添加获取当前环境的功能以控制快速操作按钮的显示
This commit is contained in:
@ -18,6 +18,7 @@ import {
|
|||||||
getMessageAreaScript,
|
getMessageAreaScript,
|
||||||
} from "./messageArea";
|
} from "./messageArea";
|
||||||
import { getAgentCardStyles, getAgentCardScript } from "./agentCard";
|
import { getAgentCardStyles, getAgentCardScript } from "./agentCard";
|
||||||
|
import { getCurrentEnv } from "../config/settings";
|
||||||
/**
|
/**
|
||||||
* 获取 WebView 面板的 HTML 内容
|
* 获取 WebView 面板的 HTML 内容
|
||||||
*/
|
*/
|
||||||
@ -28,6 +29,10 @@ export function getWebviewContent(
|
|||||||
syIconUri?: string,
|
syIconUri?: string,
|
||||||
maxIconUri?: string
|
maxIconUri?: string
|
||||||
): string {
|
): string {
|
||||||
|
// 获取当前环境,只在 dev 和 test 环境下显示快速操作按钮
|
||||||
|
const currentEnv = getCurrentEnv();
|
||||||
|
const showQuickActions = currentEnv === 'dev' || currentEnv === 'test';
|
||||||
|
|
||||||
return `<!DOCTYPE html>
|
return `<!DOCTYPE html>
|
||||||
<html lang="zh-CN">
|
<html lang="zh-CN">
|
||||||
<head>
|
<head>
|
||||||
@ -397,12 +402,12 @@ export function getWebviewContent(
|
|||||||
<span id="statusText">思考中...</span>
|
<span id="statusText">思考中...</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <div class="quick-actions">
|
${showQuickActions ? `<div class="quick-actions">
|
||||||
<button class="quick-btn" onclick="quickAction('counter')">生成计数器</button>
|
<button class="quick-btn" onclick="quickAction('counter')">生成计数器</button>
|
||||||
<button class="quick-btn" onclick="quickAction('fsm')">生成状态机</button>
|
<button class="quick-btn" onclick="quickAction('fsm')">生成状态机</button>
|
||||||
<button class="quick-btn" onclick="quickAction('testbench')">生成测试平台</button>
|
<button class="quick-btn" onclick="quickAction('testbench')">生成测试平台</button>
|
||||||
<button class="quick-btn" onclick="quickAction('explore')">知识探索</button>
|
<button class="quick-btn" onclick="quickAction('explore')">知识探索</button>
|
||||||
</div> -->
|
</div>` : ''}
|
||||||
|
|
||||||
${getInputAreaContent(autoIconUri, liteIconUri, syIconUri, maxIconUri)}
|
${getInputAreaContent(autoIconUri, liteIconUri, syIconUri, maxIconUri)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user