parent
139bf0f3d7
commit
afc792f554
10
package.json
10
package.json
@ -82,6 +82,16 @@
|
|||||||
"description": "The remote gitea instance's url. Should not end with a slash.",
|
"description": "The remote gitea instance's url. Should not end with a slash.",
|
||||||
"pattern": "^(https|http)://"
|
"pattern": "^(https|http)://"
|
||||||
},
|
},
|
||||||
|
"gitea.baseURL": {
|
||||||
|
"scope": "resource",
|
||||||
|
"type": "string",
|
||||||
|
"default": "",
|
||||||
|
"examples": [
|
||||||
|
"/gitea"
|
||||||
|
],
|
||||||
|
"description": "The base url of the Gitea instance.",
|
||||||
|
"pattern": ""
|
||||||
|
},
|
||||||
"gitea.owner": {
|
"gitea.owner": {
|
||||||
"scope": "resource",
|
"scope": "resource",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
@ -6,6 +6,7 @@ interface ConfigStorage {
|
|||||||
owner: string;
|
owner: string;
|
||||||
repo: string;
|
repo: string;
|
||||||
sslVerify: boolean;
|
sslVerify: boolean;
|
||||||
|
baseURL: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ConfigTypes extends ConfigStorage {
|
export interface ConfigTypes extends ConfigStorage {
|
||||||
@ -51,6 +52,14 @@ export class Config implements ConfigTypes {
|
|||||||
return this.loadConfigValue('instanceURL', 'string');
|
return this.loadConfigValue('instanceURL', 'string');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get baseURL(): string {
|
||||||
|
return this.loadConfigValue('baseURL', 'string');
|
||||||
|
}
|
||||||
|
|
||||||
|
public set baseURL(value) {
|
||||||
|
this.storage.update('baseURL', 'string');
|
||||||
|
}
|
||||||
|
|
||||||
public get owner() {
|
public get owner() {
|
||||||
return this.loadConfigValue('owner', 'string');
|
return this.loadConfigValue('owner', 'string');
|
||||||
}
|
}
|
||||||
@ -67,8 +76,12 @@ export class Config implements ConfigTypes {
|
|||||||
this.storage.update('repo', value);
|
this.storage.update('repo', value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public get repoApiUrl() {
|
public get repoApiUrl(): string {
|
||||||
return this.instanceURL.replace(/\/$/, "") + '/api/v1/repos/' + this.owner + '/' + this.repo + '/issues';
|
return this.instanceURL.replace(/\/$/, "") +
|
||||||
|
this.baseURL.replace(/\/$/, "") +
|
||||||
|
'/api/v1/repos/' +
|
||||||
|
this.owner +
|
||||||
|
'/' + this.repo + '/issues';
|
||||||
}
|
}
|
||||||
|
|
||||||
public set sslVerify(value) {
|
public set sslVerify(value) {
|
||||||
|
Loading…
Reference in New Issue
Block a user