style: remove the unuseful comments
This commit is contained in:
@@ -474,54 +474,6 @@ header("Allow: GET, POST, OPTIONS, PUT, DELETE");
|
|||||||
|
|
||||||
// ===================================== Projects ===========================
|
// ===================================== Projects ===========================
|
||||||
|
|
||||||
// function loadProjects() {
|
|
||||||
// // clear old data
|
|
||||||
// const tableBody = document.getElementById('projectsTable').getElementsByTagName('tbody')[0];
|
|
||||||
// tableBody.innerHTML = '';
|
|
||||||
|
|
||||||
// // load new data
|
|
||||||
// var table = document.getElementById('projectsTable');
|
|
||||||
// url = "https://www.devstar.cn/api/devcontainer/user"
|
|
||||||
// token = USERTOKEN
|
|
||||||
|
|
||||||
// fetch(url, {
|
|
||||||
// method: 'GET', // 或者 'POST', 根据API要求
|
|
||||||
// headers: {
|
|
||||||
// 'Content-Type': 'application/json',
|
|
||||||
// 'Authorization': 'token ' + token
|
|
||||||
// },
|
|
||||||
// })
|
|
||||||
// .then(response => {
|
|
||||||
// if (!response.ok) {
|
|
||||||
// throw new Error('Network response was not ok when loading projects' + response.statusText);
|
|
||||||
// }
|
|
||||||
// return response.json();
|
|
||||||
// })
|
|
||||||
// .then(data => {
|
|
||||||
// var projects = data.data.devContainers;
|
|
||||||
// projects.forEach((project, index) => {
|
|
||||||
// var row = tableBody.insertRow(-1);
|
|
||||||
// var cell1 = row.insertCell(0);
|
|
||||||
// var cell2 = row.insertCell(1);
|
|
||||||
// var cell3 = row.insertCell(2);
|
|
||||||
|
|
||||||
// devContainerHost = project.devContainerHost;
|
|
||||||
// devContainerPort = project.devContainerPort;
|
|
||||||
// devContainerUsername = project.devContainerUsername;
|
|
||||||
// devContainerPassword = project.devContainerPassword;
|
|
||||||
// devContainerWorkDir = project.devContainerWorkDir;
|
|
||||||
|
|
||||||
// cell1.textContent = project.devContainerName;
|
|
||||||
// cell2.textContent = project.devContainerWorkDir;
|
|
||||||
// cell3.innerHTML = `<button onclick="openProject('${devContainerHost}',
|
|
||||||
// '${devContainerPort}', '${devContainerUsername}', '${devContainerPassword}', '${devContainerWorkDir}')">Open Project</button>`; // 动态创建按钮并附加事件
|
|
||||||
// });
|
|
||||||
// })
|
|
||||||
// .catch(error => {
|
|
||||||
// console.error('There has been a problem with your fetch operation:', error);
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
async function openProject(repoId) {
|
async function openProject(repoId) {
|
||||||
// TODO: check if container exist
|
// TODO: check if container exist
|
||||||
await hasDevContainer(repoId)
|
await hasDevContainer(repoId)
|
||||||
|
Reference in New Issue
Block a user