Compare commits
No commits in common. "67070c82bca9ec3614ead3f6c088f6b075e31be2" and "7f42bb0ebd7fad11f861276cdfd5fdcf120d48cd" have entirely different histories.
67070c82bc
...
7f42bb0ebd
@ -1 +0,0 @@
|
||||
soak
|
@ -6,10 +6,6 @@
|
||||
"categories": [
|
||||
"Other"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@gitea.raphaelpiccolo.com:10022/root/vscodestat.git"
|
||||
},
|
||||
"main": "./out/extension.js",
|
||||
"scripts": {
|
||||
"compile": "tsc -p ./",
|
||||
@ -45,6 +41,9 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"activationEvents": [
|
||||
"onStartupFinished"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@types/mocha": "^10.0.6",
|
||||
"@types/node": "20.x",
|
||||
|
@ -40,7 +40,7 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
const filePath = editor.document.fileName;
|
||||
console.log('Opened file:', filePath);
|
||||
|
||||
// vscode.window.showInformationMessage(`Opened file: ${filePath}`);
|
||||
vscode.window.showInformationMessage(`Opened file: ${filePath}`);
|
||||
await makeHttpRequest({ event: 'open', project: extractProjectName(filePath) });
|
||||
}
|
||||
});
|
||||
@ -50,7 +50,7 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
const filePath = document.fileName;
|
||||
console.log('Saved file:', filePath);
|
||||
|
||||
// vscode.window.showInformationMessage(`Saved file: ${filePath}`);
|
||||
vscode.window.showInformationMessage(`Saved file: ${filePath}`);
|
||||
await makeHttpRequest({ event: 'save', project: extractProjectName(filePath) });
|
||||
});
|
||||
|
||||
@ -70,7 +70,7 @@ export function deactivate() { }
|
||||
*/
|
||||
function extractProjectName(path: string) {
|
||||
const match = path.match(/\/root\/(docker|projects)\/([^/]+)/);
|
||||
return match?.[2];
|
||||
return match?.[1];
|
||||
}
|
||||
|
||||
/*
|
||||
@ -83,7 +83,7 @@ async function makeHttpRequest(json: Object) {
|
||||
return;
|
||||
}
|
||||
|
||||
// vscode.window.showInformationMessage('Calling URL: ' + url);
|
||||
vscode.window.showInformationMessage('Calling URL: ' + url);
|
||||
const rawResponse = await fetch(url, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
@ -95,9 +95,9 @@ async function makeHttpRequest(json: Object) {
|
||||
const content = await rawResponse.json();
|
||||
|
||||
console.log(content);
|
||||
// vscode.window.showInformationMessage('HTTP request successful.');
|
||||
vscode.window.showInformationMessage('HTTP request successful.');
|
||||
} catch (error:any) {
|
||||
console.error('Error making HTTP request:', error);
|
||||
// vscode.window.showErrorMessage('Error making HTTP request: ' + error.message);
|
||||
vscode.window.showErrorMessage('Error making HTTP request: ' + error.message);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user