diff --git a/README.md b/README.md index c5c45dc..363bd1e 100644 --- a/README.md +++ b/README.md @@ -26,9 +26,10 @@ Also do not push the .vscode folder to your repository and doublecheck this part ### The following details are needed - Authtoken +- Port (either 80 or 443) in case that you use docker please enter the exposed port - Domain in format: "example.com" -- Repository Owner (may be an organisation): "TestOrganisation" -- Repository Name "ExampleRepository" +- Repository owner (may be an organisation): "TestOrganisation" +- Repository name "ExampleRepository" When you've finished you can press the refresh button in the open issues section and you'll see the issues of the first 10 pages (only open issues). diff --git a/package.json b/package.json index 5432c1e..4233bcd 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "displayName": "Gitea-VSCode", "description": "Gitea Issue Tracker for vs-code", "publisher": "IJustDev", - "version": "1.0.0", + "version": "1.0.1", "engines": { "vscode": "^1.32.0" }, @@ -77,6 +77,12 @@ "default": "", "description": "The remote gitea instance's domain." }, + "gitea.port": { + "scope": "resource", + "type": "number", + "default": 80, + "description": "The remote gitea instance's port." + }, "gitea.owner": { "scope": "resource", "type": "string", diff --git a/src/Config.ts b/src/Config.ts index cb90d8e..8bac953 100644 --- a/src/Config.ts +++ b/src/Config.ts @@ -3,6 +3,7 @@ import { workspace, window } from 'vscode'; interface ConfigStorage { token: string; domain: string; + port: number; owner: string; repo: string; ssl: boolean; @@ -50,6 +51,14 @@ export class Config implements ConfigTypes { public set domain(value) { this.storage.update('domain', value); } + + public get port() { + return this.loadConfigValue('port', 'number'); + } + + public set port(value) { + this.storage.update('port', value); + } public get owner() { return this.loadConfigValue('owner', 'string'); @@ -76,7 +85,9 @@ export class Config implements ConfigTypes { } public get repoApiUrl() { - const prefix = this.ssl ? 'https' : 'http'; - return prefix + '://' + this.domain + '/api/v1/repos/' + this.owner + '/' + this.repo + '/issues'; + if (this.ssl || this.port === 443) { + return 'https://' + this.domain + '/api/v1/repos/' + this.owner + '/' + this.repo + '/issues'; + } + return 'http://' + this.domain + ':' + this.port + '/api/v1/repos/' + this.owner + '/' + this.repo + '/issues'; } } diff --git a/versions/gitea-vscode-1.0.1.vsix b/versions/gitea-vscode-1.0.1.vsix new file mode 100644 index 0000000..2e3b6e5 Binary files /dev/null and b/versions/gitea-vscode-1.0.1.vsix differ