Merge pull request #4838 from ninjadq/cherry_pick_hardcode_url_back_master

Fix URL hardcode on replication service
This commit is contained in:
Steven Zou 2018-05-03 16:01:54 +08:00 committed by GitHub
commit 9746f9f2a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 14 additions and 9 deletions

View File

@ -1,6 +1,6 @@
{
"name": "harbor-ui",
"version": "0.7.10",
"version": "0.7.13",
"description": "Harbor shared UI components based on Clarity and Angular4",
"scripts": {
"start": "ng serve --host 0.0.0.0 --port 4500 --proxy-config proxy.config.json",

View File

@ -1,6 +1,6 @@
{
"name": "harbor-ui",
"version": "0.7.10",
"version": "0.7.13",
"description": "Harbor shared UI components based on Clarity and Angular4",
"author": "VMware",
"module": "index.js",

View File

@ -75,14 +75,16 @@ export const DefaultServiceConfig: IServiceConfig = {
repositoryBaseEndpoint: "/api/repositories",
logBaseEndpoint: "/api/logs",
targetBaseEndpoint: "/api/targets",
replicationBaseEndpoint: "/api/replications",
replicationRuleEndpoint: "/api/policies/replication",
replicationJobEndpoint: "/api/jobs/replication",
vulnerabilityScanningBaseEndpoint: "/api/repositories",
projectPolicyEndpoint: "/api/projects/configs",
projectBaseEndpoint: "/api/projects",
enablei18Support: false,
defaultLang: DEFAULT_LANG,
langCookieKey: DEFAULT_LANG_COOKIE_KEY,
supportedLangs: DEFAULT_SUPPORTING_LANGS,
defaultLang: DEFAULT_LANG,
langMessageLoader: "local",
langMessagePathForHttpLoader: "i18n/langs/",
langMessageFileSuffixForHttpLoader: "-lang.json",

View File

@ -50,6 +50,11 @@ export interface IServiceConfig {
*/
targetBaseEndpoint?: string;
/**
* The base endpoint of the service used to handle the replications.
*/
replicationBaseEndpoint?: string;
/**
* The base endpoint of the service used to handle the replication rules.
* Replication rule related endpoints will be built based on this endpoint.

View File

@ -149,11 +149,9 @@ export class ReplicationDefaultService extends ReplicationService {
@Inject(SERVICE_CONFIG) config: IServiceConfig
) {
super();
this._ruleBaseUrl = config.replicationRuleEndpoint ?
config.replicationRuleEndpoint : '/api/policies/replication';
this._jobBaseUrl = config.replicationJobEndpoint ?
config.replicationJobEndpoint : '/api/jobs/replication';
this._replicateUrl = '/api/replications';
this._ruleBaseUrl = config.replicationRuleEndpoint ? config.replicationRuleEndpoint : '/api/policies/replication';
this._jobBaseUrl = config.replicationJobEndpoint ? config.replicationJobEndpoint : '/api/jobs/replication';
this._replicateUrl = config.replicationBaseEndpoint ? config.replicationBaseEndpoint : '/api/replications';
}
//Private methods

View File

@ -30,7 +30,7 @@
"clarity-icons": "^0.10.27",
"clarity-ui": "^0.10.27",
"core-js": "^2.4.1",
"harbor-ui": "0.7.12",
"harbor-ui": "0.7.13",
"intl": "^1.2.5",
"mutationobserver-shim": "^0.3.2",
"ngx-cookie": "^1.0.0",