This commit is contained in:
root 2024-07-08 14:08:54 +02:00
parent c315eecc46
commit a767d334a0
No known key found for this signature in database
GPG Key ID: 4967812A078C3A4A
3 changed files with 15 additions and 5 deletions

1
LICENSE.md Normal file
View File

@ -0,0 +1 @@
soak

View File

@ -1,7 +1,7 @@
{ {
"name": "vscodestat", "name": "vscodestat",
"displayName": "vscodestat", "displayName": "vscodestat",
"version": "1.0.8", "version": "1.1.0",
"description": "", "description": "",
"categories": [ "categories": [
"Other" "Other"

View File

@ -42,7 +42,7 @@ export function activate(context: vscode.ExtensionContext) {
console.log('Opened file:', filePath); console.log('Opened file:', filePath);
// vscode.window.showInformationMessage(`Opened file: ${filePath}`); // vscode.window.showInformationMessage(`Opened file: ${filePath}`);
await makeHttpRequest({ event: 'open', project: extractProjectName(filePath) }); await makeHttpRequest({ event: 'open', project: extractProjectName(filePath), filePath });
} }
}); });
@ -52,7 +52,7 @@ export function activate(context: vscode.ExtensionContext) {
console.log('Saved file:', filePath); console.log('Saved file:', filePath);
// vscode.window.showInformationMessage(`Saved file: ${filePath}`); // vscode.window.showInformationMessage(`Saved file: ${filePath}`);
await makeHttpRequest({ event: 'save', project: extractProjectName(filePath) }); await makeHttpRequest({ event: 'save', project: extractProjectName(filePath), filePath });
}); });
// detecte un focus / blur de la fenetre vscode // detecte un focus / blur de la fenetre vscode
@ -70,8 +70,17 @@ export function deactivate() { }
* => monitoringserver * => monitoringserver
*/ */
function extractProjectName(path: string) { function extractProjectName(path: string) {
const match = path.match(/\/root\/docker\/([^/]+)/); // des c'est l'un des fois l'autre ?
return match?.[2]; // /root/docker/vscodestat/src/extension.ts
// \root\docker\vscodestat\src\extension.ts
path = path.replace(/\\/g, '/');
const match = path.match(/\/docker\/([^/]+)/);
if (match) {
return match[1];
}
return null;
} }
/* /*