0
0

打开git代码功能完成

This commit is contained in:
xubing
2025-11-25 21:13:41 +08:00
parent 23024a8461
commit 2577e3051b
7 changed files with 408 additions and 1093 deletions

View File

@@ -53,7 +53,7 @@ export class ConfigView extends BaseView {
<span class="editable" onclick="editConfigName('${config.id}', '${config.name}')">🔧 ${config.name}</span>
</td>
<td>
<span class="clickable" onclick="openConfigFile('${config.id}')">📄 ${config.fileName}</span>
<span class="clickable" onclick="openConfigFileInVSCode('${config.id}')">📄 ${config.fileName}</span>
</td>
<td>
<button class="btn-delete" onclick="deleteConfig('${config.id}')">删除</button>
@@ -191,16 +191,6 @@ export class ConfigView extends BaseView {
</div>
</div>
<!-- 配置文件编辑器 -->
<div class="config-editor" id="configEditor" style="display: none;">
<h3>📝 编辑配置文件</h3>
<textarea id="configContent" placeholder="在此编辑配置文件内容..."></textarea>
<div style="margin-top: 15px;">
<button class="btn-primary" onclick="saveConfigFile()">💾 保存到文件系统</button>
<button class="back-btn" onclick="closeEditor()">取消</button>
</div>
</div>
<script>
const vscode = acquireVsCodeApi();
let currentConfigId = null;
@@ -225,12 +215,11 @@ export class ConfigView extends BaseView {
);
}
function openConfigFile(configId) {
currentConfigId = configId;
document.getElementById('configEditor').style.display = 'block';
// 新功能:在 VSCode 中打开配置文件
function openConfigFileInVSCode(configId) {
console.log('📄 在 VSCode 中打开配置文件:', configId);
vscode.postMessage({
type: 'loadConfigFile',
type: 'openConfigFileInVSCode',
configId: configId
});
}
@@ -299,21 +288,6 @@ export class ConfigView extends BaseView {
});
}
function saveConfigFile() {
const content = document.getElementById('configContent').value;
vscode.postMessage({
type: 'saveConfigFile',
configId: currentConfigId,
content: content
});
closeEditor();
}
function closeEditor() {
document.getElementById('configEditor').style.display = 'none';
currentConfigId = null;
}
function goBackToContainers() {
vscode.postMessage({ type: 'goBackToContainers' });
}
@@ -524,10 +498,6 @@ export class ConfigView extends BaseView {
console.log('🌿 收到分支数据:', message.branches);
renderBranchSelection(message.branches, message.repoUrl);
}
if (message.type === 'configFileLoaded') {
document.getElementById('configContent').value = message.content;
}
});
// 初始化