模型配置
<div class="ce-block" data-id="EkGccxEL6W" ><div class="ce-block__content" style="">
<h1 class="ce-header ce-header--left">模型配置</h1>
</div>
</div><div class="ce-block ce-block--focused" data-id="jZS4cfE1p1" >
<div class="ce-block__content">
<div class="ce-paragraph cdx-block ce-paragraph--left">OpenClaw 支持内置 Provider 和自定义 Provider,可按成本与效果组合使用。</div>
</div>
</div><div class="ce-block" data-id="HhZDytWbFE" >
<div class="ce-block__content" style="">
<h2 class="ce-header ce-header--left">常见内置 Provider</h2>
</div>
</div><div class="ce-block ce-block--focused" data-id="6PHjWJD9lT" >
<div class="ce-block__content">
<ul class="cdx-list-unordered"><li class="cdx-list__item"><code><mark style="background-color: rgb(227, 170, 0);">anthropic</mark></code>(Claude)</li><li class="cdx-list__item"><code><mark style="background-color: rgb(227, 170, 0);">openai</mark></code>(GPT)</li><li class="cdx-list__item"><code><mark style="background-color: rgb(227, 170, 0);">openrouter</mark></code></li><li class="cdx-list__item"><code><mark style="background-color: rgb(227, 170, 0);">minimax</mark></code></li><li class="cdx-list__item"><code><mark style="background-color: rgb(63, 81, 181);"><mark style="background-color: rgb(205, 220, 57);"><mark style="background-color: rgb(227, 170, 0);">zai</mark></mark></mark></code></li><li class="cdx-list__item"><code><mark style="background-color: rgb(255, 191, 0);">moonshot</mark></code></li><li class="cdx-list__item"><code><mark style="background-color: rgb(255, 191, 0);">ollama</mark></code></li></ul>
</div>
</div><div class="ce-block" data-id="6bWFSsGWxU" >
<div class="ce-block__content" style="">
<h2 class="ce-header ce-header--left">多模型与别名</h2>
</div>
</div><div class="ce-block ce-block--focused" data-id="v0MsbqmGbB" >
<div class="ce-block__content">
<div class="editorjs-codeFlask_Wrapper">
<div class="editorjs-codeFlask_Header">
<div class="editorjs-codeFlask_LangDisplay">javascript</div>
<button class="editorjs-codeFlask_CopyButton" title="复制代码" id="codeflask-copy-v0MsbqmGbB">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
</svg>
</button>
<button class="editorjs-codeFlask_Toggle" id="codeflask-Toggle-v0MsbqmGbB">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
</button>
</div>
<div class="editorjs-codeFlask_ContentContainer">
<div class="editorjs-codeFlask_Editor" id="codeflask-v0MsbqmGbB" >
</div>
</div>
<div class="editorjs-codeFlask_BottomButtonContainer" id="codeflask-bottomBtn-v0MsbqmGbB">
<button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="static/js/editorjs/tools/codeflask/codeflask150.min.js?L8J"></script>
<script type="application/javascript">
const editorElem1778072698gkXn2 = document.getElementById('codeflask-v0MsbqmGbB');
var isCollapsed1778072698gkXn2 = true;
const flask1778072698gkXn2 = new CodeFlask(editorElem1778072698gkXn2, {
language: 'javascript',
lineNumbers: true,
styleParent: this.shadowRoot,
rtl: false,
readonly: true
});
var code1778072698gkXn2 = `{
agents: {
defaults: {
models: {
"anthropic/claude-opus-4-6": { alias: "opus" },
"anthropic/claude-sonnet-4-5": { alias: "sonnet" },
"openai/gpt-5.2": { alias: "gpt" },
"deepseek/deepseek-chat": { alias: "ds" },
},
model: {
primary: "anthropic/claude-sonnet-4-5",
fallbacks: ["minimax/MiniMax-M2.1"],
},
},
},
}
`;
code1778072698gkXn2 = code1778072698gkXn2.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'");
flask1778072698gkXn2.addLanguage('javascript', Prism.languages['javascript']);
flask1778072698gkXn2.onUpdate((code) => {
// do something with code here.
// this will trigger whenever the code
// in the editor changes.
// console.log(code)
});
// flask.updateCode('');
// This will also trigger .onUpdate()
flask1778072698gkXn2.updateCode(code1778072698gkXn2);
const currentCode1778072698gkXn2 = flask1778072698gkXn2.getCode();
var coderow1778072698gkXn2 = parseInt('');
if (coderow1778072698gkXn2 === undefined || coderow1778072698gkXn2 !== coderow1778072698gkXn2 || coderow1778072698gkXn2 === 0) {
coderow1778072698gkXn2 = flask1778072698gkXn2.lineNumber;
}
if (coderow1778072698gkXn2 < 20) {
editorElem1778072698gkXn2.parentElement.style.height = '300px';
editorElem1778072698gkXn2.style.height = '300px';
} else if (coderow1778072698gkXn2 >= 20) {
editorElem1778072698gkXn2.parentElement.style.height = '500px';
editorElem1778072698gkXn2.style.height = '500px';
}
//console.log({currentCode1778072698gkXn2})
const copyBtn1778072698gkXn2 = document.getElementById('codeflask-copy-v0MsbqmGbB');
copyBtn1778072698gkXn2.addEventListener('click', function() {
try {
// 先检查 Clipboard API 是否可用
if (navigator.clipboard && navigator.clipboard.writeText) {
// 使用 Clipboard API 复制代码
navigator.clipboard.writeText(code1778072698gkXn2).then(function() {
// 复制成功提示
const originalText = copyBtn1778072698gkXn2.innerHTML;
copyBtn1778072698gkXn2.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';
// 一段时间后恢复原文本
setTimeout(function() {
copyBtn1778072698gkXn2.innerHTML = originalText;
}, 2000);
}).catch(function(err) {
// 复制失败处理
console.error('复制失败:', err);
// 降级方案:使用传统的复制方法
fallbackCopyTextToClipboard(code1778072698gkXn2);
});
} else {
// Clipboard API 不可用时直接使用降级方案
fallbackCopyTextToClipboard(code1778072698gkXn2);
}
// 提取降级方案为独立函数
function fallbackCopyTextToClipboard(text) {
const textArea = document.createElement('textarea');
textArea.value = text;
textArea.style.position = 'fixed';
textArea.style.opacity = '0';
document.body.appendChild(textArea);
textArea.select();
try {
document.execCommand('copy');
const originalText = copyBtn1778072698gkXn2.innerHTML;
copyBtn1778072698gkXn2.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';
setTimeout(function() {
copyBtn1778072698gkXn2.innerHTML = originalText;
}, 2000);
} catch (copyErr) {
console.error('传统复制方法也失败了:', copyErr);
} finally {
document.body.removeChild(textArea);
}
}
} catch (err) {
console.error('复制功能不可用:', err);
}
});
const bottomBtn1778072698gkXn2 = document.getElementById('codeflask-bottomBtn-v0MsbqmGbB');
const Toggle1778072698gkXn2 = document.getElementById('codeflask-Toggle-v0MsbqmGbB');
bottomBtn1778072698gkXn2.addEventListener('click', function() {
if (isCollapsed1778072698gkXn2) {
// 展开代码
isCollapsed1778072698gkXn2 = false;
const codeElement1778072698gkXn2 = editorElem1778072698gkXn2.querySelector('.codeflask__code');
if (codeElement1778072698gkXn2) {
const actualHeight1778072698gkXn2 = codeElement1778072698gkXn2.scrollHeight + 20;
editorElem1778072698gkXn2.parentElement.style.height = actualHeight1778072698gkXn2 + 'px';
editorElem1778072698gkXn2.style.height = actualHeight1778072698gkXn2 + 'px';
}
bottomBtn1778072698gkXn2.innerHTML = '<button class="editorjs-codeFlask_BottomToggle" title="折叠代码"><span class="toggle-icon">▲</span> 折叠</button>';
Toggle1778072698gkXn2.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>';
} else {
// 折叠代码
isCollapsed1778072698gkXn2 = true;
if (coderow1778072698gkXn2 < 20) {
editorElem1778072698gkXn2.parentElement.style.height = '300px';
editorElem1778072698gkXn2.style.height = '300px';
} else if (coderow1778072698gkXn2 >= 20) {
editorElem1778072698gkXn2.parentElement.style.height = '500px';
editorElem1778072698gkXn2.style.height = '500px';
}
bottomBtn1778072698gkXn2.innerHTML = '<button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>';
Toggle1778072698gkXn2.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>';
}
});
Toggle1778072698gkXn2.addEventListener('click', function() {
bottomBtn1778072698gkXn2.click();
});
</script><div class="ce-block ce-block--focused" data-id="FJqsoQmLrS" >
<div class="ce-block__content">
<div class="ce-paragraph cdx-block ce-paragraph--left">聊天中快速切换:</div>
</div>
</div><div class="ce-block ce-block--focused" data-id="g-5KIxVyhG" >
<div class="ce-block__content">
<div class="editorjs-codeFlask_Wrapper">
<div class="editorjs-codeFlask_Header">
<div class="editorjs-codeFlask_LangDisplay">javascript</div>
<button class="editorjs-codeFlask_CopyButton" title="复制代码" id="codeflask-copy-g-5KIxVyhG">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
</svg>
</button>
<button class="editorjs-codeFlask_Toggle" id="codeflask-Toggle-g-5KIxVyhG">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
</button>
</div>
<div class="editorjs-codeFlask_ContentContainer">
<div class="editorjs-codeFlask_Editor" id="codeflask-g-5KIxVyhG" >
</div>
</div>
<div class="editorjs-codeFlask_BottomButtonContainer" id="codeflask-bottomBtn-g-5KIxVyhG">
<button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="static/js/editorjs/tools/codeflask/codeflask150.min.js?L8J"></script>
<script type="application/javascript">
const editorElem1778072698MsJqa = document.getElementById('codeflask-g-5KIxVyhG');
var isCollapsed1778072698MsJqa = true;
const flask1778072698MsJqa = new CodeFlask(editorElem1778072698MsJqa, {
language: 'javascript',
lineNumbers: true,
styleParent: this.shadowRoot,
rtl: false,
readonly: true
});
var code1778072698MsJqa = `/model opus
/model gpt
/model ds
`;
code1778072698MsJqa = code1778072698MsJqa.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'");
flask1778072698MsJqa.addLanguage('javascript', Prism.languages['javascript']);
flask1778072698MsJqa.onUpdate((code) => {
// do something with code here.
// this will trigger whenever the code
// in the editor changes.
// console.log(code)
});
// flask.updateCode('');
// This will also trigger .onUpdate()
flask1778072698MsJqa.updateCode(code1778072698MsJqa);
const currentCode1778072698MsJqa = flask1778072698MsJqa.getCode();
var coderow1778072698MsJqa = parseInt('');
if (coderow1778072698MsJqa === undefined || coderow1778072698MsJqa !== coderow1778072698MsJqa || coderow1778072698MsJqa === 0) {
coderow1778072698MsJqa = flask1778072698MsJqa.lineNumber;
}
if (coderow1778072698MsJqa < 20) {
editorElem1778072698MsJqa.parentElement.style.height = '300px';
editorElem1778072698MsJqa.style.height = '300px';
} else if (coderow1778072698MsJqa >= 20) {
editorElem1778072698MsJqa.parentElement.style.height = '500px';
editorElem1778072698MsJqa.style.height = '500px';
}
//console.log({currentCode1778072698MsJqa})
const copyBtn1778072698MsJqa = document.getElementById('codeflask-copy-g-5KIxVyhG');
copyBtn1778072698MsJqa.addEventListener('click', function() {
try {
// 先检查 Clipboard API 是否可用
if (navigator.clipboard && navigator.clipboard.writeText) {
// 使用 Clipboard API 复制代码
navigator.clipboard.writeText(code1778072698MsJqa).then(function() {
// 复制成功提示
const originalText = copyBtn1778072698MsJqa.innerHTML;
copyBtn1778072698MsJqa.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';
// 一段时间后恢复原文本
setTimeout(function() {
copyBtn1778072698MsJqa.innerHTML = originalText;
}, 2000);
}).catch(function(err) {
// 复制失败处理
console.error('复制失败:', err);
// 降级方案:使用传统的复制方法
fallbackCopyTextToClipboard(code1778072698MsJqa);
});
} else {
// Clipboard API 不可用时直接使用降级方案
fallbackCopyTextToClipboard(code1778072698MsJqa);
}
// 提取降级方案为独立函数
function fallbackCopyTextToClipboard(text) {
const textArea = document.createElement('textarea');
textArea.value = text;
textArea.style.position = 'fixed';
textArea.style.opacity = '0';
document.body.appendChild(textArea);
textArea.select();
try {
document.execCommand('copy');
const originalText = copyBtn1778072698MsJqa.innerHTML;
copyBtn1778072698MsJqa.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';
setTimeout(function() {
copyBtn1778072698MsJqa.innerHTML = originalText;
}, 2000);
} catch (copyErr) {
console.error('传统复制方法也失败了:', copyErr);
} finally {
document.body.removeChild(textArea);
}
}
} catch (err) {
console.error('复制功能不可用:', err);
}
});
const bottomBtn1778072698MsJqa = document.getElementById('codeflask-bottomBtn-g-5KIxVyhG');
const Toggle1778072698MsJqa = document.getElementById('codeflask-Toggle-g-5KIxVyhG');
bottomBtn1778072698MsJqa.addEventListener('click', function() {
if (isCollapsed1778072698MsJqa) {
// 展开代码
isCollapsed1778072698MsJqa = false;
const codeElement1778072698MsJqa = editorElem1778072698MsJqa.querySelector('.codeflask__code');
if (codeElement1778072698MsJqa) {
const actualHeight1778072698MsJqa = codeElement1778072698MsJqa.scrollHeight + 20;
editorElem1778072698MsJqa.parentElement.style.height = actualHeight1778072698MsJqa + 'px';
editorElem1778072698MsJqa.style.height = actualHeight1778072698MsJqa + 'px';
}
bottomBtn1778072698MsJqa.innerHTML = '<button class="editorjs-codeFlask_BottomToggle" title="折叠代码"><span class="toggle-icon">▲</span> 折叠</button>';
Toggle1778072698MsJqa.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>';
} else {
// 折叠代码
isCollapsed1778072698MsJqa = true;
if (coderow1778072698MsJqa < 20) {
editorElem1778072698MsJqa.parentElement.style.height = '300px';
editorElem1778072698MsJqa.style.height = '300px';
} else if (coderow1778072698MsJqa >= 20) {
editorElem1778072698MsJqa.parentElement.style.height = '500px';
editorElem1778072698MsJqa.style.height = '500px';
}
bottomBtn1778072698MsJqa.innerHTML = '<button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>';
Toggle1778072698MsJqa.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>';
}
});
Toggle1778072698MsJqa.addEventListener('click', function() {
bottomBtn1778072698MsJqa.click();
});
</script><div class="ce-block" data-id="qeN2lJT5Sg" >
<div class="ce-block__content" style="">
<h2 class="ce-header ce-header--left">自定义 Provider(重点)</h2>
</div>
</div><div class="ce-block ce-block--focused" data-id="4NqPGcrJz4" >
<div class="ce-block__content">
<div class="editorjs-codeFlask_Wrapper">
<div class="editorjs-codeFlask_Header">
<div class="editorjs-codeFlask_LangDisplay">javascript</div>
<button class="editorjs-codeFlask_CopyButton" title="复制代码" id="codeflask-copy-4NqPGcrJz4">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
</svg>
</button>
<button class="editorjs-codeFlask_Toggle" id="codeflask-Toggle-4NqPGcrJz4">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
</button>
</div>
<div class="editorjs-codeFlask_ContentContainer">
<div class="editorjs-codeFlask_Editor" id="codeflask-4NqPGcrJz4" >
</div>
</div>
<div class="editorjs-codeFlask_BottomButtonContainer" id="codeflask-bottomBtn-4NqPGcrJz4">
<button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="static/js/editorjs/tools/codeflask/codeflask150.min.js?L8J"></script>
<script type="application/javascript">
const editorElem1778072698sPozW = document.getElementById('codeflask-4NqPGcrJz4');
var isCollapsed1778072698sPozW = true;
const flask1778072698sPozW = new CodeFlask(editorElem1778072698sPozW, {
language: 'javascript',
lineNumbers: true,
styleParent: this.shadowRoot,
rtl: false,
readonly: true
});
var code1778072698sPozW = `{
models: {
mode: "merge",
providers: {
"my-provider": {
baseUrl: "https://api.example.com/v1",
apiKey: "${MY_API_KEY}",
api: "openai-responses",
models: [{
id: "model-name",
name: "显示名称",
reasoning: false,
input: ["text"],
contextWindow: 128000,
maxTokens: 8192,
}],
},
},
},
}
`;
code1778072698sPozW = code1778072698sPozW.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'");
flask1778072698sPozW.addLanguage('javascript', Prism.languages['javascript']);
flask1778072698sPozW.onUpdate((code) => {
// do something with code here.
// this will trigger whenever the code
// in the editor changes.
// console.log(code)
});
// flask.updateCode('');
// This will also trigger .onUpdate()
flask1778072698sPozW.updateCode(code1778072698sPozW);
const currentCode1778072698sPozW = flask1778072698sPozW.getCode();
var coderow1778072698sPozW = parseInt('');
if (coderow1778072698sPozW === undefined || coderow1778072698sPozW !== coderow1778072698sPozW || coderow1778072698sPozW === 0) {
coderow1778072698sPozW = flask1778072698sPozW.lineNumber;
}
if (coderow1778072698sPozW < 20) {
editorElem1778072698sPozW.parentElement.style.height = '300px';
editorElem1778072698sPozW.style.height = '300px';
} else if (coderow1778072698sPozW >= 20) {
editorElem1778072698sPozW.parentElement.style.height = '500px';
editorElem1778072698sPozW.style.height = '500px';
}
//console.log({currentCode1778072698sPozW})
const copyBtn1778072698sPozW = document.getElementById('codeflask-copy-4NqPGcrJz4');
copyBtn1778072698sPozW.addEventListener('click', function() {
try {
// 先检查 Clipboard API 是否可用
if (navigator.clipboard && navigator.clipboard.writeText) {
// 使用 Clipboard API 复制代码
navigator.clipboard.writeText(code1778072698sPozW).then(function() {
// 复制成功提示
const originalText = copyBtn1778072698sPozW.innerHTML;
copyBtn1778072698sPozW.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';
// 一段时间后恢复原文本
setTimeout(function() {
copyBtn1778072698sPozW.innerHTML = originalText;
}, 2000);
}).catch(function(err) {
// 复制失败处理
console.error('复制失败:', err);
// 降级方案:使用传统的复制方法
fallbackCopyTextToClipboard(code1778072698sPozW);
});
} else {
// Clipboard API 不可用时直接使用降级方案
fallbackCopyTextToClipboard(code1778072698sPozW);
}
// 提取降级方案为独立函数
function fallbackCopyTextToClipboard(text) {
const textArea = document.createElement('textarea');
textArea.value = text;
textArea.style.position = 'fixed';
textArea.style.opacity = '0';
document.body.appendChild(textArea);
textArea.select();
try {
document.execCommand('copy');
const originalText = copyBtn1778072698sPozW.innerHTML;
copyBtn1778072698sPozW.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';
setTimeout(function() {
copyBtn1778072698sPozW.innerHTML = originalText;
}, 2000);
} catch (copyErr) {
console.error('传统复制方法也失败了:', copyErr);
} finally {
document.body.removeChild(textArea);
}
}
} catch (err) {
console.error('复制功能不可用:', err);
}
});
const bottomBtn1778072698sPozW = document.getElementById('codeflask-bottomBtn-4NqPGcrJz4');
const Toggle1778072698sPozW = document.getElementById('codeflask-Toggle-4NqPGcrJz4');
bottomBtn1778072698sPozW.addEventListener('click', function() {
if (isCollapsed1778072698sPozW) {
// 展开代码
isCollapsed1778072698sPozW = false;
const codeElement1778072698sPozW = editorElem1778072698sPozW.querySelector('.codeflask__code');
if (codeElement1778072698sPozW) {
const actualHeight1778072698sPozW = codeElement1778072698sPozW.scrollHeight + 20;
editorElem1778072698sPozW.parentElement.style.height = actualHeight1778072698sPozW + 'px';
editorElem1778072698sPozW.style.height = actualHeight1778072698sPozW + 'px';
}
bottomBtn1778072698sPozW.innerHTML = '<button class="editorjs-codeFlask_BottomToggle" title="折叠代码"><span class="toggle-icon">▲</span> 折叠</button>';
Toggle1778072698sPozW.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>';
} else {
// 折叠代码
isCollapsed1778072698sPozW = true;
if (coderow1778072698sPozW < 20) {
editorElem1778072698sPozW.parentElement.style.height = '300px';
editorElem1778072698sPozW.style.height = '300px';
} else if (coderow1778072698sPozW >= 20) {
editorElem1778072698sPozW.parentElement.style.height = '500px';
editorElem1778072698sPozW.style.height = '500px';
}
bottomBtn1778072698sPozW.innerHTML = '<button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>';
Toggle1778072698sPozW.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>';
}
});
Toggle1778072698sPozW.addEventListener('click', function() {
bottomBtn1778072698sPozW.click();
});
</script><div class="ce-block ce-block--focused" data-id="xC8ha6cHku" >
<div class="ce-block__content">
<div class="ce-paragraph cdx-block ce-paragraph--left">Codex 系列必须使用<span> </span><code><mark style="background-color: rgb(255, 191, 0);">openai-responses</mark></code>,不要误用<span> </span><code><mark style="background-color: rgb(255, 191, 0);">openai-completions</mark></code>。</div>
</div>
</div><div class="ce-block" data-id="zh-wiq4aPU" >
<div class="ce-block__content" style="">
<h2 class="ce-header ce-header--left">Token 与成本查看</h2>
</div>
</div><div class="ce-block ce-block--focused" data-id="JNUEw09BaU" >
<div class="ce-block__content">
<div class="editorjs-codeFlask_Wrapper">
<div class="editorjs-codeFlask_Header">
<div class="editorjs-codeFlask_LangDisplay">javascript</div>
<button class="editorjs-codeFlask_CopyButton" title="复制代码" id="codeflask-copy-JNUEw09BaU">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
</svg>
</button>
<button class="editorjs-codeFlask_Toggle" id="codeflask-Toggle-JNUEw09BaU">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
</button>
</div>
<div class="editorjs-codeFlask_ContentContainer">
<div class="editorjs-codeFlask_Editor" id="codeflask-JNUEw09BaU" >
</div>
</div>
<div class="editorjs-codeFlask_BottomButtonContainer" id="codeflask-bottomBtn-JNUEw09BaU">
<button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="static/js/editorjs/tools/codeflask/codeflask150.min.js?L8J"></script>
<script type="application/javascript">
const editorElem1778072698dbI4y = document.getElementById('codeflask-JNUEw09BaU');
var isCollapsed1778072698dbI4y = true;
const flask1778072698dbI4y = new CodeFlask(editorElem1778072698dbI4y, {
language: 'javascript',
lineNumbers: true,
styleParent: this.shadowRoot,
rtl: false,
readonly: true
});
var code1778072698dbI4y = `openclaw status
openclaw dashboard
`;
code1778072698dbI4y = code1778072698dbI4y.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'");
flask1778072698dbI4y.addLanguage('javascript', Prism.languages['javascript']);
flask1778072698dbI4y.onUpdate((code) => {
// do something with code here.
// this will trigger whenever the code
// in the editor changes.
// console.log(code)
});
// flask.updateCode('');
// This will also trigger .onUpdate()
flask1778072698dbI4y.updateCode(code1778072698dbI4y);
const currentCode1778072698dbI4y = flask1778072698dbI4y.getCode();
var coderow1778072698dbI4y = parseInt('');
if (coderow1778072698dbI4y === undefined || coderow1778072698dbI4y !== coderow1778072698dbI4y || coderow1778072698dbI4y === 0) {
coderow1778072698dbI4y = flask1778072698dbI4y.lineNumber;
}
if (coderow1778072698dbI4y < 20) {
editorElem1778072698dbI4y.parentElement.style.height = '300px';
editorElem1778072698dbI4y.style.height = '300px';
} else if (coderow1778072698dbI4y >= 20) {
editorElem1778072698dbI4y.parentElement.style.height = '500px';
editorElem1778072698dbI4y.style.height = '500px';
}
//console.log({currentCode1778072698dbI4y})
const copyBtn1778072698dbI4y = document.getElementById('codeflask-copy-JNUEw09BaU');
copyBtn1778072698dbI4y.addEventListener('click', function() {
try {
// 先检查 Clipboard API 是否可用
if (navigator.clipboard && navigator.clipboard.writeText) {
// 使用 Clipboard API 复制代码
navigator.clipboard.writeText(code1778072698dbI4y).then(function() {
// 复制成功提示
const originalText = copyBtn1778072698dbI4y.innerHTML;
copyBtn1778072698dbI4y.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';
// 一段时间后恢复原文本
setTimeout(function() {
copyBtn1778072698dbI4y.innerHTML = originalText;
}, 2000);
}).catch(function(err) {
// 复制失败处理
console.error('复制失败:', err);
// 降级方案:使用传统的复制方法
fallbackCopyTextToClipboard(code1778072698dbI4y);
});
} else {
// Clipboard API 不可用时直接使用降级方案
fallbackCopyTextToClipboard(code1778072698dbI4y);
}
// 提取降级方案为独立函数
function fallbackCopyTextToClipboard(text) {
const textArea = document.createElement('textarea');
textArea.value = text;
textArea.style.position = 'fixed';
textArea.style.opacity = '0';
document.body.appendChild(textArea);
textArea.select();
try {
document.execCommand('copy');
const originalText = copyBtn1778072698dbI4y.innerHTML;
copyBtn1778072698dbI4y.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';
setTimeout(function() {
copyBtn1778072698dbI4y.innerHTML = originalText;
}, 2000);
} catch (copyErr) {
console.error('传统复制方法也失败了:', copyErr);
} finally {
document.body.removeChild(textArea);
}
}
} catch (err) {
console.error('复制功能不可用:', err);
}
});
const bottomBtn1778072698dbI4y = document.getElementById('codeflask-bottomBtn-JNUEw09BaU');
const Toggle1778072698dbI4y = document.getElementById('codeflask-Toggle-JNUEw09BaU');
bottomBtn1778072698dbI4y.addEventListener('click', function() {
if (isCollapsed1778072698dbI4y) {
// 展开代码
isCollapsed1778072698dbI4y = false;
const codeElement1778072698dbI4y = editorElem1778072698dbI4y.querySelector('.codeflask__code');
if (codeElement1778072698dbI4y) {
const actualHeight1778072698dbI4y = codeElement1778072698dbI4y.scrollHeight + 20;
editorElem1778072698dbI4y.parentElement.style.height = actualHeight1778072698dbI4y + 'px';
editorElem1778072698dbI4y.style.height = actualHeight1778072698dbI4y + 'px';
}
bottomBtn1778072698dbI4y.innerHTML = '<button class="editorjs-codeFlask_BottomToggle" title="折叠代码"><span class="toggle-icon">▲</span> 折叠</button>';
Toggle1778072698dbI4y.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>';
} else {
// 折叠代码
isCollapsed1778072698dbI4y = true;
if (coderow1778072698dbI4y < 20) {
editorElem1778072698dbI4y.parentElement.style.height = '300px';
editorElem1778072698dbI4y.style.height = '300px';
} else if (coderow1778072698dbI4y >= 20) {
editorElem1778072698dbI4y.parentElement.style.height = '500px';
editorElem1778072698dbI4y.style.height = '500px';
}
bottomBtn1778072698dbI4y.innerHTML = '<button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>';
Toggle1778072698dbI4y.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>';
}
});
Toggle1778072698dbI4y.addEventListener('click', function() {
bottomBtn1778072698dbI4y.click();
});
</script><div class="ce-block ce-block--focused" data-id="qEv5rZmzZa" >
<div class="ce-block__content">
<div class="ce-paragraph cdx-block ce-paragraph--left">如需成本可视化,建议在消息前缀显示模型名:</div>
</div>
</div><div class="ce-block ce-block--focused" data-id="ljaZX7JvxJ" >
<div class="ce-block__content">
<div class="editorjs-codeFlask_Wrapper">
<div class="editorjs-codeFlask_Header">
<div class="editorjs-codeFlask_LangDisplay">javascript</div>
<button class="editorjs-codeFlask_CopyButton" title="复制代码" id="codeflask-copy-ljaZX7JvxJ">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
</svg>
</button>
<button class="editorjs-codeFlask_Toggle" id="codeflask-Toggle-ljaZX7JvxJ">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
</button>
</div>
<div class="editorjs-codeFlask_ContentContainer">
<div class="editorjs-codeFlask_Editor" id="codeflask-ljaZX7JvxJ" >
</div>
</div>
<div class="editorjs-codeFlask_BottomButtonContainer" id="codeflask-bottomBtn-ljaZX7JvxJ">
<button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="static/js/editorjs/tools/codeflask/codeflask150.min.js?L8J"></script>
<script type="application/javascript">
const editorElem1778072698M87L9 = document.getElementById('codeflask-ljaZX7JvxJ');
var isCollapsed1778072698M87L9 = true;
const flask1778072698M87L9 = new CodeFlask(editorElem1778072698M87L9, {
language: 'javascript',
lineNumbers: true,
styleParent: this.shadowRoot,
rtl: false,
readonly: true
});
var code1778072698M87L9 = `{
messages: {
responsePrefix: "[{model}]",
},
}`;
code1778072698M87L9 = code1778072698M87L9.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'");
flask1778072698M87L9.addLanguage('javascript', Prism.languages['javascript']);
flask1778072698M87L9.onUpdate((code) => {
// do something with code here.
// this will trigger whenever the code
// in the editor changes.
// console.log(code)
});
// flask.updateCode('');
// This will also trigger .onUpdate()
flask1778072698M87L9.updateCode(code1778072698M87L9);
const currentCode1778072698M87L9 = flask1778072698M87L9.getCode();
var coderow1778072698M87L9 = parseInt('');
if (coderow1778072698M87L9 === undefined || coderow1778072698M87L9 !== coderow1778072698M87L9 || coderow1778072698M87L9 === 0) {
coderow1778072698M87L9 = flask1778072698M87L9.lineNumber;
}
if (coderow1778072698M87L9 < 20) {
editorElem1778072698M87L9.parentElement.style.height = '300px';
editorElem1778072698M87L9.style.height = '300px';
} else if (coderow1778072698M87L9 >= 20) {
editorElem1778072698M87L9.parentElement.style.height = '500px';
editorElem1778072698M87L9.style.height = '500px';
}
//console.log({currentCode1778072698M87L9})
const copyBtn1778072698M87L9 = document.getElementById('codeflask-copy-ljaZX7JvxJ');
copyBtn1778072698M87L9.addEventListener('click', function() {
try {
// 先检查 Clipboard API 是否可用
if (navigator.clipboard && navigator.clipboard.writeText) {
// 使用 Clipboard API 复制代码
navigator.clipboard.writeText(code1778072698M87L9).then(function() {
// 复制成功提示
const originalText = copyBtn1778072698M87L9.innerHTML;
copyBtn1778072698M87L9.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';
// 一段时间后恢复原文本
setTimeout(function() {
copyBtn1778072698M87L9.innerHTML = originalText;
}, 2000);
}).catch(function(err) {
// 复制失败处理
console.error('复制失败:', err);
// 降级方案:使用传统的复制方法
fallbackCopyTextToClipboard(code1778072698M87L9);
});
} else {
// Clipboard API 不可用时直接使用降级方案
fallbackCopyTextToClipboard(code1778072698M87L9);
}
// 提取降级方案为独立函数
function fallbackCopyTextToClipboard(text) {
const textArea = document.createElement('textarea');
textArea.value = text;
textArea.style.position = 'fixed';
textArea.style.opacity = '0';
document.body.appendChild(textArea);
textArea.select();
try {
document.execCommand('copy');
const originalText = copyBtn1778072698M87L9.innerHTML;
copyBtn1778072698M87L9.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';
setTimeout(function() {
copyBtn1778072698M87L9.innerHTML = originalText;
}, 2000);
} catch (copyErr) {
console.error('传统复制方法也失败了:', copyErr);
} finally {
document.body.removeChild(textArea);
}
}
} catch (err) {
console.error('复制功能不可用:', err);
}
});
const bottomBtn1778072698M87L9 = document.getElementById('codeflask-bottomBtn-ljaZX7JvxJ');
const Toggle1778072698M87L9 = document.getElementById('codeflask-Toggle-ljaZX7JvxJ');
bottomBtn1778072698M87L9.addEventListener('click', function() {
if (isCollapsed1778072698M87L9) {
// 展开代码
isCollapsed1778072698M87L9 = false;
const codeElement1778072698M87L9 = editorElem1778072698M87L9.querySelector('.codeflask__code');
if (codeElement1778072698M87L9) {
const actualHeight1778072698M87L9 = codeElement1778072698M87L9.scrollHeight + 20;
editorElem1778072698M87L9.parentElement.style.height = actualHeight1778072698M87L9 + 'px';
editorElem1778072698M87L9.style.height = actualHeight1778072698M87L9 + 'px';
}
bottomBtn1778072698M87L9.innerHTML = '<button class="editorjs-codeFlask_BottomToggle" title="折叠代码"><span class="toggle-icon">▲</span> 折叠</button>';
Toggle1778072698M87L9.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>';
} else {
// 折叠代码
isCollapsed1778072698M87L9 = true;
if (coderow1778072698M87L9 < 20) {
editorElem1778072698M87L9.parentElement.style.height = '300px';
editorElem1778072698M87L9.style.height = '300px';
} else if (coderow1778072698M87L9 >= 20) {
editorElem1778072698M87L9.parentElement.style.height = '500px';
editorElem1778072698M87L9.style.height = '500px';
}
bottomBtn1778072698M87L9.innerHTML = '<button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>';
Toggle1778072698M87L9.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>';
}
});
Toggle1778072698M87L9.addEventListener('click', function() {
bottomBtn1778072698M87L9.click();
});
</script><style type="text/css">
.ce-block {
margin-top: 20px;
margin-bottom: 20px;
}
.ce-block__content,.ce-toolbar__content {
/* max-width:calc(100% - 50px) */
margin-left: auto;
margin-right: auto;
}
/**
* Plugin styles
*/
.ce-header {
position: relative;
padding: 1px 0px 1px 15px;
margin: 0;
line-height: 1.25em;
outline: none;
margin-bottom: 10px;
}
.ce-header p,
.ce-header div {
padding: 0 !important;
margin: 0 !important;
}
.ce-header::before {
content: "";
background-color: #3e8fe3;
width: 6px;
height: 100%;
position: absolute;
left: 0;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
/**
* Styles for Plugin icon in Toolbar
*/
.ce-header__icon {
}
.ce-header::before {
position: absolute;
content: attr(data-placeholder);
color: #707684;
font-weight: normal;
display: none;
cursor: text;
}
.ce-header:empty::before {
display: block;
}
.ce-header:empty:focus::before {
display: none;
}
/* FontSize */
h1.ce-header {
font-size: 2.0em;
}
h2.ce-header {
font-size: 1.7em;
}
h3.ce-header {
font-size: 1.4em;
}
h4.ce-header {
font-size: 1.15em;
}
h5.ce-header {
font-size: 0.95em;
}
h6.ce-header {
font-size: 0.8em;
}
/* Alignment*/
.ce-header--right {
text-align: right;
}
.ce-header--center {
text-align: center;
}
.ce-header--left {
text-align: left;
}
.ce-header--justify {
text-align: justify;
}
</style><style type="text/css">
.ce-block {
margin-bottom: 20px;
}
.ce-block__content,.ce-toolbar__content {
/* max-width:calc(100% - 50px) */
margin-left: auto;
margin-right: auto;
}
.ce-paragraph {
line-height: 1.6em;
outline: none;
text-indent: 2em;
font-size: 16px;
}
.ce-paragraph--right {
text-align: right;
}
.ce-paragraph--center {
text-align: center;
}
.ce-paragraph--left {
text-align: left;
}
.ce-paragraph--justify {
text-align: justify;
}
.ce-paragraph-text-indent {
text-align: justify;
}
.ce-paragraph:empty::before{
content: attr(data-placeholder);
color: #707684;
font-weight: normal;
opacity: 0;
}
/** Show placeholder at the first paragraph if Editor is empty */
.codex-editor--empty .ce-block:first-child .ce-paragraph:empty::before {
opacity: 1;
}
.codex-editor--toolbox-opened .ce-block:first-child .ce-paragraph:empty::before,
.codex-editor--empty .ce-block:first-child .ce-paragraph:empty:focus::before {
opacity: 0;
}
.ce-paragraph p:first-of-type{
margin-top: 0;
}
.ce-paragraph p:last-of-type{
margin-bottom: 0;
}
.svg-icon {
width: 1em;
height: 1em;
}
.svg-icon path,
.svg-icon polygon,
.svg-icon rect {
fill: #4691f6;
}
.svg-icon circle {
stroke: #4691f6;
stroke-width: 1;
}
</style><style type="text/css">
.ce-block {
margin-bottom: 20px;
}
.ce-block__content,.ce-toolbar__content {
/* max-width:calc(100% - 50px) */
margin-left: auto;
margin-right: auto;
}
.cdx-list {
margin:0;
outline:none;
display:block;
counter-reset:item;
padding:6px;
}
.cdx-list__item {
line-height:1.45em;
display:block;
padding-top:8px;
margin-left: 2em;
}
.cdx-list__item-children {
display:block;
}
.cdx-list__item {
outline:none
}
.cdx-list__item-content {
word-break:break-word;
white-space:pre-wrap;
grid-area:content;
padding-left:8px
}
.cdx-list__item:before {
counter-increment:item;
white-space:nowrap
}
.cdx-list-li-container {
display: flex;
}
.cdx-list-ordered .cdx-list__item:before {
/* content:counters(item,".",numeric) "." */
}
.cdx-list-ordered {
list-style-type: none;
margin-left: -15px;
counter-reset:item;
font-size: 16px;
}
.cdx-list-unordered {
font-size: 16px;
}
.cdx-list-unordered .cdx-list__item:before {
content:"•"
}
.cdx-list-checklist .cdx-list__item:before {
content:""
}
.cdx-list__settings .cdx-settings-button {
width:50%
}
.cdx-list__checkbox {
padding-top:calc((1.45em - 1.2em) / 2);
grid-area:checkbox;
width:1.2em;
height:1.2em;
display:flex;
cursor:pointer;
font-size: 16px;
}
.cdx-list__checkbox svg {
opacity:0;
height:1.2em;
width:1.2em;
left:-1px;
top:-1px;
position:absolute
}
@media (hover:hover) {
.cdx-list__checkbox:not(.cdx-list__checkbox--no-hover):hover .cdx-list__checkbox-check svg {
opacity:1
}
}.cdx-list__checkbox--checked-1 {
line-height:1.45em
}
@media (hover:hover) {
.cdx-list__checkbox--checked-1:not(.cdx-list__checkbox--checked-1--no-hover):hover .cdx-checklist__checkbox-check {
background:#0059AB;
border-color:#0059AB
}
}.cdx-list__checkbox--checked-1 .cdx-list__checkbox-check {
background:#369FFF;
border-color:#369FFF
}
.cdx-list__checkbox--checked-1 .cdx-list__checkbox-check svg {
opacity:1
}
.cdx-list__checkbox--checked-1 .cdx-list__checkbox-check svg path {
stroke:#fff
}
.cdx-list__checkbox--checked-1 .cdx-list__checkbox-check:before {
opacity:0;
visibility:visible;
transform:scale(2.5)
}
.cdx-list__checkbox-check {
cursor:pointer;
display:inline-block;
position:relative;
margin:0 auto;
width:1.2em;
height:1.2em;
box-sizing:border-box;
border-radius:5px;
border:1px solid #C9C9C9;
background:#fff
}
.cdx-list__checkbox-check:before {
content:"";
position:absolute;
top:0;
right:0;
bottom:0;
left:0;
border-radius:100%;
background-color:#369FFF;
visibility:hidden;
pointer-events:none;
transform:scale(1);
transition:transform .4s ease-out,opacity .4s
}
.cdx-list__checkbox-check--disabled {
pointer-events:none
}
.cdx-list-start-with-field {
background:#F8F8F8;
border:1px solid rgba(226,226,229,.2);
border-radius:6px;
padding:2px;
display:grid;
grid-template-columns:auto auto 1fr;
grid-template-rows:auto
}
.cdx-list-start-with-field--invalid {
background:#FFECED;
border:1px solid #E13F3F
}
.cdx-list-start-with-field--invalid .cdx-list-start-with-field__input {
color:#e13f3f
}
.cdx-list-start-with-field__input {
font-size:16px;
outline:none;
font-weight:500;
font-family:inherit;
border:0;
background:transparent;
margin:0;
padding:0;
line-height:22px;
min-width:calc(100% - 10px)
}
.cdx-list-start-with-field__input::placeholder {
color:#797979;
font-weight:500
}
</style><style type="text/css">
.ce-block {
margin-bottom: 20px;
}
.ce-block__content,.ce-toolbar__content {
/* max-width:calc(100% - 50px) */
margin-left: auto;
margin-right: auto;
position: relative;
}
/* 主容器 */
.editorjs-codeFlask_Wrapper {
border: 1px solid #dcdfe6;
border-radius: 5px;
background-color: #f6f8fa;
margin-bottom: 10px;
position: relative;
transition: all 0.3s ease;
width: 100%;
min-height: 100px;
overflow: hidden;
}
/* 标题栏 */
.editorjs-codeFlask_Header {
display: flex;
justify-content: flex-end;
align-items: center;
padding: 8px 12px;
background-color: #e9ecef;
border-bottom: 1px solid #dcdfe6;
position: relative;
z-index: 0; /* 从10降低到2 */
}
/* 语言显示 */
.editorjs-codeFlask_LangDisplay {
padding: 2px 8px;
background-color: #409eff;
color: white;
border-radius: 3px;
font-size: 12px;
font-weight: 500;
position: absolute;
left: 12px;
top: 50%;
transform: translateY(-50%);
}
/* 内容容器 - 禁止纵向滚动 */
.editorjs-codeFlask_ContentContainer {
position: relative;
min-height: 100px;
overflow-x: hidden; /* 禁止横向滚动 */
overflow-y: hidden;
transition: height 0.3s ease;
}
/* 编辑器容器 - 禁止纵向滚动 */
.editorjs-codeFlask_Editor {
position: relative;
min-height: 100px;
overflow-x: hidden; /* 禁止横向滚动 */
overflow-y: hidden;
transition: height 0.3s ease;
}
/* 底部按钮容器 - 优化为更简洁的样式 */
.editorjs-codeFlask_BottomButtonContainer {
display: flex;
justify-content: center;
align-items: center;
padding: 4px;
background-color: #f8f9fa;
border-top: 1px solid #e9ecef;
position: relative;
z-index: 0;
}
/* 底部横向折叠/展开按钮 - 优化样式,使其更融入设计 */
.editorjs-codeFlask_BottomToggle {
width: 100%;
background-color: transparent;
color: #606266;
border: none;
border-radius: 4px;
padding: 6px 12px;
font-size: 12px;
font-weight: 400;
cursor: pointer;
transition: all 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
gap: 4px;
text-align: center;
position: relative;
}
.editorjs-codeFlask_BottomToggle:hover {
background-color: #e9ecef;
color: #409eff;
}
.editorjs-codeFlask_BottomToggle:active {
background-color: #dee2e6;
}
.editorjs-codeFlask_BottomToggle .toggle-icon {
font-size: 11px;
transition: transform 0.3s ease;
}
/* 展开按钮(显示"展开"文本)上边缘添加渐变虚化效果 */
.editorjs-codeFlask_BottomToggle:has(span.toggle-icon:contains("▲"))::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 6px;
background: linear-gradient(to bottom, rgba(248, 249, 250, 0) 0%, rgba(248, 249, 250, 1) 100%);
pointer-events: none;
}
/* 展开按钮(显示"展开"文本)上边缘添加渐变虚化效果 */
/* 删除不被广泛支持的:contains()选择器 */
.editorjs-codeFlask_BottomToggle.expand-mode::before {
content: '';
position: absolute;
top: -60px;
left: 0;
right: 0;
height: 60px;
background: linear-gradient(to bottom, rgb(255 255 255 / 0%) 0%, rgba(248, 249, 250, 1) 100%);
pointer-events: none;
}
/* CodeFlask 主容器样式 */
.editorjs-codeFlask_Editor .codeflask {
position: relative;
background: #fafafa;
border-radius: 0 0 4px 4px;
min-height: 100px;
overflow-x: hidden; /* 禁止横向滚动 */
overflow-y: hidden;
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}
/* 行号容器 */
.editorjs-codeFlask_Editor .codeflask.codeflask--has-line-numbers:before {
content: '';
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 40px;
background-color: #f5f5f5;
border-right: 1px solid #e0e0e0;
z-index: 0;
}
/* 行号 */
.editorjs-codeFlask_Editor .codeflask__lines {
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 40px;
padding: 10px 0;
background-color: #f5f5f5;
border-right: 1px solid #e0e0e0;
z-index: 0;
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
font-size: 14px;
line-height: 21px;
color: #666;
text-align: right;
user-select: none;
overflow: hidden;
}
.editorjs-codeFlask_Editor .codeflask__lines__line {
padding-right: 8px;
}
/* 文本区域 - 输入框 */
.editorjs-codeFlask_Editor .codeflask__textarea {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
padding: 10px;
border: none;
background: transparent;
color: transparent;
caret-color: #333;
resize: none;
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
font-size: 14px;
line-height: 21px;
z-index: 1;
overflow-x: hidden; /* 禁止横向滚动 */
overflow-y: hidden;
white-space: pre-wrap; /* 自动换行 */
tab-size: 4;
outline: none;
}
/* 添加选中文本样式 */
.editorjs-codeFlask_Editor .codeflask__textarea::selection {
background-color: #b3d4fc;
color: #333;
}
.editorjs-codeFlask_Editor .codeflask__textarea::-moz-selection {
background-color: #b3d4fc;
color: #333;
}
/* 代码预览区域 */
.editorjs-codeFlask_Editor .codeflask__pre {
position: absolute;
top: 0;
left: 0;
width: 100%; /* 确保宽度不超出容器 */
height: 100%;
padding: 10px;
margin: 0;
border: none;
background: transparent;
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
font-size: 14px;
line-height: 21px;
z-index: 0;
overflow-x: hidden; /* 禁止横向滚动 */
overflow-y: hidden;
white-space: pre-wrap; /* 自动换行 */
pointer-events: none;
}
/* 代码高亮区域 */
.editorjs-codeFlask_Editor .codeflask__code {
display: block;
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
font-size: 14px;
line-height: 21px;
color: #333;
white-space: pre-wrap; /* 自动换行 */
tab-size: 4;
overflow: visible;
}
/* 语法高亮样式 - 确保Prism.js样式正确应用 */
.editorjs-codeFlask_Editor .codeflask__code {
background: transparent !important;
}
/* 通用语法高亮token样式 */
.editorjs-codeFlask_Editor .token.comment,
.editorjs-codeFlask_Editor .token.prolog,
.editorjs-codeFlask_Editor .token.doctype,
.editorjs-codeFlask_Editor .token.cdata {
color: #708090;
}
.editorjs-codeFlask_Editor .token.punctuation {
color: #999;
}
.editorjs-codeFlask_Editor .token.namespace {
opacity: 0.7;
}
.editorjs-codeFlask_Editor .token.property,
.editorjs-codeFlask_Editor .token.tag,
.editorjs-codeFlask_Editor .token.boolean,
.editorjs-codeFlask_Editor .token.number,
.editorjs-codeFlask_Editor .token.constant,
.editorjs-codeFlask_Editor .token.symbol,
.editorjs-codeFlask_Editor .token.deleted {
color: #905;
}
.editorjs-codeFlask_Editor .token.selector,
.editorjs-codeFlask_Editor .token.attr-name,
.editorjs-codeFlask_Editor .token.string,
.editorjs-codeFlask_Editor .token.char,
.editorjs-codeFlask_Editor .token.builtin,
.editorjs-codeFlask_Editor .token.inserted {
color: #690;
}
.editorjs-codeFlask_Editor .token.operator,
.editorjs-codeFlask_Editor .token.entity,
.editorjs-codeFlask_Editor .token.url,
.editorjs-codeFlask_Editor .language-css .token.string,
.editorjs-codeFlask_Editor .style .token.string {
color: #9a6e3a;
background: hsla(0, 0%, 100%, 0.5);
}
.editorjs-codeFlask_Editor .token.atrule,
.editorjs-codeFlask_Editor .token.attr-value,
.editorjs-codeFlask_Editor .token.keyword {
color: #07a;
}
.editorjs-codeFlask_Editor .token.function,
.editorjs-codeFlask_Editor .token.class-name {
color: #dd4a68;
}
.editorjs-codeFlask_Editor .token.regex,
.editorjs-codeFlask_Editor .token.important,
.editorjs-codeFlask_Editor .token.variable {
color: #e90;
}
/* 复制按钮样式 */
.editorjs-codeFlask_CopyButton {
background-color: #409eff;
color: white;
border: none;
border-radius: 3px;
padding: 6px 12px;
margin-right: 8px;
font-size: 12px;
cursor: pointer;
transition: background-color 0.2s ease;
display: flex;
align-items: center;
justify-content: center;
min-width: 28px;
height: 28px;
}
.editorjs-codeFlask_CopyButton:hover {
background-color: #66b1ff;
}
.editorjs-codeFlask_CopyButton.copied {
background-color: #67c23a;
}
/* 折叠/展开按钮样式 */
.editorjs-codeFlask_Toggle {
background-color: #909399;
color: white;
border: none;
border-radius: 3px;
padding: 0 8px;
font-size: 12px;
cursor: pointer;
transition: background-color 0.2s ease;
display: flex;
align-items: center;
justify-content: center;
min-width: 28px;
height: 28px;
font-weight: bold;
}
.editorjs-codeFlask_Toggle:hover {
background-color: #a6a9ad;
}
/* 响应式调整 */
@media (max-width: 768px) {
.editorjs-codeFlask_Header {
padding: 6px 8px;
}
.editorjs-codeFlask_Editor .codeflask__textarea,
.editorjs-codeFlask_Editor .codeflask__pre,
.editorjs-codeFlask_Editor .codeflask__code {
font-size: 13px;
line-height: 19px;
padding: 8px;
}
.editorjs-codeFlask_Editor .codeflask.codeflask--has-line-numbers:before {
width: 35px;
}
.editorjs-codeFlask_Editor .codeflask__lines {
width: 35px;
font-size: 12px;
}
}
/* 滚动条样式 - 完全隐藏纵向滚动条 */
.editorjs-codeFlask_Wrapper ::-webkit-scrollbar {
width: 0;/* 纵向滚动条宽度为0 */
height: 6px;/* 横向滚动条保持6px宽度 */
}
.editorjs-codeFlask_Wrapper ::-webkit-scrollbar-track {
background: transparent;
border-radius: 0;
}
.editorjs-codeFlask_Wrapper ::-webkit-scrollbar-thumb {
background: transparent;
border-radius: 0;
}
/* Firefox 滚动条隐藏 */
.editorjs-codeFlask_Wrapper {
scrollbar-width: none;/* Firefox 隐藏纵向滚动条 */
}
.editorjs-codeFlask_Wrapper ::-moz-scrollbar {
width: 0;
height: 6px;
}
/* 焦点状态 */
.editorjs-codeFlask_Wrapper:focus-within {
border-color: #409eff;
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}
/* 只读模式样式 */
.editorjs-codeFlask_Wrapper.readonly .editorjs-codeFlask_Header {
background-color: #f5f7fa;
}
.editorjs-codeFlask_Wrapper.readonly .editorjs-codeFlask_Editor .codeflask__textarea {
cursor: default;
}
/* 确保所有元素正确显示 */
.editorjs-codeFlask_Wrapper * {
box-sizing: border-box;
}
/* 修复行号对齐 */
.editorjs-codeFlask_Editor .codeflask--has-line-numbers .codeflask__textarea,
.editorjs-codeFlask_Editor .codeflask--has-line-numbers .codeflask__pre {
padding-left: 50px;
}
.editorjs-codeFlask_Editor .codeflask--has-line-numbers .codeflask__lines {
padding-top: 10px;
}
/* 语言显示元素 - 添加点击样式 */
.editorjs-codeFlask_LangDisplay {
padding: 2px 8px;
background-color: #409eff;
color: white;
border-radius: 3px;
font-size: 12px;
font-weight: 500;
position: absolute;
left: 12px;
top: 50%;
transform: translateY(-50%);
cursor: pointer;
transition: all 0.2s ease;
}
.editorjs-codeFlask_LangDisplay:hover {
background-color: #66b1ff;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
/* 语言选择弹窗 */
.editorjs-codeFlask_LanguagePopup {
background-color: white;
border: 1px solid #dcdfe6;
border-radius: 4px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
width: 250px;
max-height: 300px;
z-index: 1000;
overflow: hidden;
}
/* 搜索框 */
.editorjs-codeFlask_LanguageSearch {
width: 100%;
padding: 8px 12px;
border: none;
border-bottom: 1px solid #ebeef5;
font-size: 12px;
outline: none;
box-sizing: border-box;
}
/* 语言列表 */
.editorjs-codeFlask_LanguagesList {
max-height: 250px;
overflow-y: auto;
}
/* 语言选项 */
.editorjs-codeFlask_LanguageItem {
padding: 8px 12px;
font-size: 12px;
cursor: pointer;
transition: background-color 0.2s ease;
}
.editorjs-codeFlask_LanguageItem:hover {
background-color: #f5f7fa;
}
.editorjs-codeFlask_LanguageItem.selected {
background-color: #ecf5ff;
color: #409eff;
font-weight: 500;
}
/* 滚动条样式 */
.editorjs-codeFlask_LanguagesList::-webkit-scrollbar {
width: 6px;
}
.editorjs-codeFlask_LanguagesList::-webkit-scrollbar-track {
background-color: #f5f7fa;
}
.editorjs-codeFlask_LanguagesList::-webkit-scrollbar-thumb {
background-color: #c0c4cc;
border-radius: 3px;
}
.editorjs-codeFlask_LanguagesList::-webkit-scrollbar-thumb:hover {
background-color: #909399;
}
</style><style type="text/css">
.inline-code {
background: rgba(250, 239, 240, 0.78);
color: #b44437;
padding: 3px 4px;
border-radius: 5px;
margin: 0 1px;
font-family: inherit;
font-size: 0.86em;
font-weight: 500;
letter-spacing: 0.3px;
}
</style>
页:
[1]