From 44d71cc184bc287e44cace58b9a9cf5b700bc122 Mon Sep 17 00:00:00 2001 From: Raphael Piccolo Date: Thu, 4 Apr 2024 12:30:39 +0200 Subject: [PATCH] up --- LICENSE.md | 1 + package.json | 6 +++++- src/extension.ts | 14 +++++++------- 3 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 LICENSE.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..7d2d43d --- /dev/null +++ b/LICENSE.md @@ -0,0 +1 @@ +soak \ No newline at end of file diff --git a/package.json b/package.json index 0b19048..5442c66 100644 --- a/package.json +++ b/package.json @@ -2,13 +2,17 @@ "name": "vscodestat", "displayName": "vscodestat", "description": "", - "version": "0.0.2", + "version": "1.0.1", "engines": { "vscode": "^1.87.0" }, "categories": [ "Other" ], + "repository": { + "type": "git", + "url": "ssh://git@gitea.raphaelpiccolo.com:10022/root/vscodestat.git" + }, "activationEvents": [ "onStartupFinished" ], diff --git a/src/extension.ts b/src/extension.ts index f2f4274..777e0cf 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -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) }); }); @@ -68,9 +68,9 @@ export function deactivate() { } * /root/docker/monitoringserver/controller/homeController.js * => monitoringserver */ -function extractProjectName(path) { +function extractProjectName(path: string) { const match = path.match(/\/root\/(docker|projects)\/([^/]+)/); - return match?.[1]; + return match?.[2]; } /* @@ -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); } }