给项目页面、飞行器页面
This commit is contained in:
@@ -14,6 +14,7 @@ export class AircraftView extends BaseView {
|
||||
<span class="clickable" onclick="openAircraftConfig('${aircraft.id}', '${aircraft.projectId}')">配置容器</span>
|
||||
</td>
|
||||
<td>
|
||||
<button class="btn-upload" onclick="uploadAircraft('${aircraft.id}', '${aircraft.name}')" style="margin-right: 5px;">上传</button>
|
||||
<button class="btn-delete" onclick="deleteAircraft('${aircraft.id}')">删除</button>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -179,7 +180,6 @@ export class AircraftView extends BaseView {
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- 飞行器云仓库 -->
|
||||
<div class="config-section">
|
||||
<h3 class="section-title">🛫 飞行器云仓库</h3>
|
||||
<div class="url-input-section">
|
||||
@@ -242,6 +242,20 @@ export class AircraftView extends BaseView {
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// 新增上传功能
|
||||
function uploadAircraft(aircraftId, aircraftName) {
|
||||
showConfirmDialog(
|
||||
'上传飞行器仓库',
|
||||
'确定将此飞行器目录(包括所有子文件夹和文件)上传到一个新的 Git 仓库分支吗?',
|
||||
function() {
|
||||
vscode.postMessage({
|
||||
type: 'openRepoSelectForAircraftUpload',
|
||||
aircraftId: aircraftId
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// 飞行器名称编辑功能
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
@@ -436,4 +450,4 @@ export class AircraftView extends BaseView {
|
||||
</body>
|
||||
</html>`;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -72,6 +72,17 @@ export abstract class BaseView {
|
||||
border-radius: 2px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.btn-upload {
|
||||
background: var(--vscode-button-background);
|
||||
color: var(--vscode-button-foreground);
|
||||
padding: 4px 8px;
|
||||
border: none;
|
||||
border-radius: 2px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.btn-upload:hover {
|
||||
background: var(--vscode-button-hoverBackground);
|
||||
}
|
||||
.back-btn {
|
||||
background: var(--vscode-button-secondaryBackground);
|
||||
color: var(--vscode-button-secondaryForeground);
|
||||
@@ -469,6 +480,7 @@ export abstract class BaseView {
|
||||
showRepoSelectDialog(message.repos || []);
|
||||
} else if (message.type === 'showUploadRepoSelect') {
|
||||
// 新逻辑:上传代码用(仓库 + 分支)
|
||||
// 这里的 folderId/folderType 现在可能是 Project/Aircraft/Container 的 ID/Type
|
||||
showUploadRepoSelectDialog(message.repos || [], message.folderId, message.folderType);
|
||||
}
|
||||
});
|
||||
@@ -483,4 +495,4 @@ export abstract class BaseView {
|
||||
protected getStyles(): string {
|
||||
return this.getBaseStylesAndScripts();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@ export class ContainerView extends BaseView {
|
||||
<span class="clickable" onclick="openContainerConfig('${container.id}')">配置文件</span>
|
||||
</td>
|
||||
<td>
|
||||
<button class="btn-upload" onclick="uploadContainer('${container.id}', '${container.name}')" style="margin-right: 5px;">上传</button>
|
||||
<button class="btn-delete" onclick="deleteContainer('${container.id}')">删除</button>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -164,7 +165,6 @@ export class ContainerView extends BaseView {
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- 容器云仓库 -->
|
||||
<div class="config-section">
|
||||
<h3 class="section-title">📦 容器云仓库</h3>
|
||||
<div class="url-input-section">
|
||||
@@ -241,6 +241,20 @@ export class ContainerView extends BaseView {
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// 新增上传功能
|
||||
function uploadContainer(containerId, containerName) {
|
||||
showConfirmDialog(
|
||||
'上传容器仓库',
|
||||
'确定将此容器目录(包括所有子文件夹和文件)上传到一个新的 Git 仓库分支吗?',
|
||||
function() {
|
||||
vscode.postMessage({
|
||||
type: 'openRepoSelectForContainerUpload',
|
||||
containerId: containerId
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// ======== Git 仓库 & 分支树 - ContainerView 作用域 ========
|
||||
|
||||
@@ -403,4 +417,4 @@ export class ContainerView extends BaseView {
|
||||
</body>
|
||||
</html>`;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,7 @@ export class ProjectView extends BaseView {
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
${isConfigured ? `<button class="btn-upload" onclick="uploadProject('${project.id}', '${project.name}')" style="margin-right: 5px;">上传</button>` : ''}
|
||||
<button class="btn-delete" onclick="deleteProject('${project.id}')">删除</button>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -213,7 +214,6 @@ export class ProjectView extends BaseView {
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- 项目云仓库 -->
|
||||
<div class="config-section">
|
||||
<h3 class="section-title">📚 项目云仓库</h3>
|
||||
<div class="url-input-section">
|
||||
@@ -289,6 +289,20 @@ export class ProjectView extends BaseView {
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// 新增上传功能
|
||||
function uploadProject(projectId, projectName) {
|
||||
showConfirmDialog(
|
||||
'上传项目仓库',
|
||||
'确定将此项目目录(包括所有子文件夹和文件)上传到一个新的 Git 仓库分支吗?',
|
||||
function() {
|
||||
vscode.postMessage({
|
||||
type: 'openRepoSelectForProjectUpload',
|
||||
projectId: projectId
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// 项目名称编辑功能
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
@@ -483,4 +497,4 @@ export class ProjectView extends BaseView {
|
||||
</body>
|
||||
</html>`;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user