Skip to content

Commit

Permalink
Fixes #9 Version 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
IJustDev committed Aug 2, 2019
1 parent 210b5bb commit 9bde9b1
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down Expand Up @@ -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",
Expand Down
15 changes: 13 additions & 2 deletions src/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { workspace, window } from 'vscode';
interface ConfigStorage {
token: string;
domain: string;
port: number;
owner: string;
repo: string;
ssl: boolean;
Expand Down Expand Up @@ -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');
Expand All @@ -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';
}
}
Binary file added versions/gitea-vscode-1.0.1.vsix
Binary file not shown.

0 comments on commit 9bde9b1

Please sign in to comment.