forked from goharbor/harbor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
13b240e
commit 30254f0
Showing
33 changed files
with
5,306 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,4 +30,5 @@ src/ui_ng/typings/ | |
**/ssl/ | ||
**/proxy.config.json | ||
**/npm*.log | ||
|
||
**/*ngsummary.json | ||
**/*ngfactory.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# This file lists all individuals having contributed content to the repository. | ||
|
||
Steven zou <szou@vmware.com> |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# harbor-angular | ||
For publishing Harbor shared UI components. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
"project": { | ||
"version": "0.1.0", | ||
"name": "harbor-ui" | ||
}, | ||
"apps": [{ | ||
"root": ".", | ||
"outDir": "../dist", | ||
"assets": [ | ||
"images", | ||
"favicon.ico" | ||
], | ||
"index": "index.html", | ||
"main": "index.ts", | ||
"test": "test.ts", | ||
"tsconfig": "tsconfig.json", | ||
"prefix": "", | ||
"mobile": false, | ||
"styles": [ | ||
"node_modules/clarity-icons/clarity-icons.min.css", | ||
"node_modules/clarity-ui/clarity-ui.min.css" | ||
], | ||
"scripts": [ | ||
"node_modules/core-js/client/shim.min.js", | ||
"node_modules/mutationobserver-shim/dist/mutationobserver.min.js", | ||
"node_modules/@webcomponents/custom-elements/custom-elements.min.js", | ||
"node_modules/clarity-icons/clarity-icons.min.js", | ||
"node_modules/web-animations-js/web-animations.min.js" | ||
], | ||
"environmentSource": "environments/environment.ts", | ||
"environments": { | ||
"dev": "environments/environment.ts", | ||
"prod": "environments/environment.prod.ts" | ||
} | ||
}], | ||
"addons": [], | ||
"packages": [], | ||
"e2e": { | ||
"protractor": { | ||
"config": "./protractor.config.js" | ||
} | ||
}, | ||
"test": { | ||
"karma": { | ||
"config": "./karma.conf.js" | ||
} | ||
}, | ||
"defaults": { | ||
"styleExt": "scss", | ||
"prefixInterfaces": false, | ||
"inline": { | ||
"style": false, | ||
"template": false | ||
}, | ||
"spec": { | ||
"class": false, | ||
"component": true, | ||
"directive": true, | ||
"module": false, | ||
"pipe": true, | ||
"service": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './src/index'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{ | ||
"name": "harbor-ui", | ||
"version": "0.1.0", | ||
"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", | ||
"lint": "tslint \"src/**/*.ts\"", | ||
"test": "ng test --single-run", | ||
"pree2e": "webdriver-manager update", | ||
"e2e": "protractor", | ||
"cleanup": "rimraf dist/bundles dist/src dist/index.d.ts dist/index.metadata.json dist/index.js dist/index.js.map dist/LICENSE dist/AUTHORS", | ||
"copy": "copyfiles -f LICENSE AUTHORS pkg/package.json dist", | ||
"transpile": "ngc", | ||
"package": "rollup -c", | ||
"minify": "uglifyjs dist/bundles/harborui.umd.js --screw-ie8 --compress --mangle --comments --output dist/bundles/harborui.umd.min.js", | ||
"build": "npm run cleanup && npm run transpile && npm run package && npm run minify && npm run copy" | ||
}, | ||
"private": true, | ||
"dependencies": { | ||
"@angular/common": "^4.0.0", | ||
"@angular/compiler": "^4.0.0", | ||
"@angular/core": "^4.0.0", | ||
"@angular/http": "^4.0.0", | ||
"clarity-angular": "^0.8.14", | ||
"clarity-icons": "^0.8.14", | ||
"clarity-ui": "^0.8.14", | ||
"core-js": "^2.4.1", | ||
"rxjs": "^5.0.1", | ||
"ts-helpers": "^1.1.1", | ||
"zone.js": "^0.7.2" | ||
}, | ||
"devDependencies": { | ||
"@angular/cli": "^1.0.0", | ||
"@angular/compiler-cli": "^2.4.1", | ||
"@types/core-js": "^0.9.41", | ||
"@types/jasmine": "~2.2.30", | ||
"@types/node": "^6.0.42", | ||
"bootstrap": "4.0.0-alpha.5", | ||
"codelyzer": "~2.0.0-beta.4", | ||
"enhanced-resolve": "^3.0.0", | ||
"jasmine-core": "2.4.1", | ||
"jasmine-spec-reporter": "2.5.0", | ||
"karma": "1.2.0", | ||
"karma-cli": "^1.0.1", | ||
"karma-jasmine": "^1.0.2", | ||
"karma-mocha-reporter": "^2.2.1", | ||
"karma-phantomjs-launcher": "^1.0.0", | ||
"karma-remap-istanbul": "^0.2.1", | ||
"protractor": "^4.0.9", | ||
"rollup": "^0.41.6", | ||
"ts-node": "1.2.1", | ||
"tslint": "^4.1.1", | ||
"typescript": "~2.0.3", | ||
"typings": "^1.4.0", | ||
"uglify-js": "^2.8.22", | ||
"webdriver-manager": "10.2.5", | ||
"rimraf": "^2.6.1", | ||
"copyfiles": "^1.2.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "harbor-ui", | ||
"version": "0.1.0", | ||
"description": "Harbor shared UI components based on Clarity and Angular4", | ||
"author": "Harbor", | ||
"module": "index.js", | ||
"main": "bundles/harborui.umd.min.js", | ||
"jsnext:main": "index.js", | ||
"typings": "index.d.ts", | ||
"keywords": [ | ||
"Harbor", | ||
"Clarity", | ||
"Angular4" | ||
], | ||
"license": "Apache 2.0", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/vmware/harbor.git" | ||
}, | ||
"homepage": "https://github.com/vmware/harbor#readme", | ||
"peerDependencies": { | ||
"@angular/common": "^4.0.0", | ||
"@angular/compiler": "^4.0.0", | ||
"@angular/core": "^4.0.0", | ||
"@angular/http": "^4.0.0", | ||
"clarity-angular": "^0.8.14", | ||
"clarity-icons": "^0.8.14", | ||
"clarity-ui": "^0.8.14", | ||
"core-js": "^2.4.1", | ||
"rxjs": "^5.0.1", | ||
"ts-helpers": "^1.1.1", | ||
"zone.js": "^0.7.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export default { | ||
entry: 'dist/index.js', | ||
dest: 'dist/bundles/harborui.umd.js', | ||
sourceMap: false, | ||
format: 'umd', | ||
moduleName: 'harborui', | ||
globals: { | ||
'@angular/core': 'ng.core', | ||
'rxjs/Observable': 'Rx', | ||
'rxjs/ReplaySubject': 'Rx', | ||
'rxjs/add/operator/map': 'Rx.Observable.prototype', | ||
'rxjs/add/operator/mergeMap': 'Rx.Observable.prototype', | ||
'rxjs/add/operator/catch': 'Rx.Observable.prototype', | ||
'rxjs/add/operator/toPromise': 'Rx.Observable.prototype', | ||
'rxjs/add/observable/of': 'Rx.Observable', | ||
'rxjs/add/observable/throw': 'Rx.Observable' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { NgModule, ModuleWithProviders, Provider } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { SYSTEMINFO_DIRECTIVES } from './system/index'; | ||
import { SERVICE_CONFIG, IServiceConfig } from './service.config'; | ||
|
||
export const DefaultServiceConfig: IServiceConfig = { | ||
systemInfoEndpoint: "/api/system", | ||
repositoryBaseEndpoint: "", | ||
logBaseEndpoint: "", | ||
targetBaseEndpoint: "", | ||
replicationRuleEndpoint:"", | ||
replicationJobEndpoint: "" | ||
}; | ||
|
||
export interface HarborModuleConfig { | ||
config?: Provider | ||
} | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule | ||
], | ||
declarations: [SYSTEMINFO_DIRECTIVES], | ||
exports: [SYSTEMINFO_DIRECTIVES] | ||
}) | ||
|
||
export class HarborLibraryModule { | ||
static forRoot(config: HarborModuleConfig = {}): ModuleWithProviders { | ||
return { | ||
ngModule: HarborLibraryModule, | ||
providers: [ | ||
config.config || { provide: SERVICE_CONFIG, useValue: DefaultServiceConfig } | ||
] | ||
}; | ||
} | ||
|
||
static forChild(config: HarborModuleConfig = {}): ModuleWithProviders { | ||
return { | ||
ngModule: HarborLibraryModule, | ||
providers: [ | ||
config.config || { provide: SERVICE_CONFIG, useValue: DefaultServiceConfig } | ||
] | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export * from './harbor-library.module'; | ||
export * from './system/index'; | ||
export * from './service.config'; | ||
export * from './service/index'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { OpaqueToken } from '@angular/core'; | ||
|
||
export let SERVICE_CONFIG = new OpaqueToken("service.config"); | ||
|
||
export interface IServiceConfig { | ||
systemInfoEndpoint: string; | ||
|
||
/** | ||
* The base endpoint of the service used to handle the repositories of registry and/or tags of repository. | ||
* The endpoints of repository or tag(s) will be built based on this endpoint. | ||
* E.g: | ||
* If the base endpoint is '/api/repositories', | ||
* the repository endpoint will be '/api/repositories/:repo_id', | ||
* the tag(s) endpoint will be '/api/repositories/:repo_id/tags[/:tag_id]'. | ||
* | ||
* | ||
* @type {string} | ||
* @memberOf IServiceConfig | ||
*/ | ||
repositoryBaseEndpoint: string; | ||
|
||
/** | ||
* The base endpoint of the service used to handle the recent access logs. | ||
* | ||
* @type {string} | ||
* @memberOf IServiceConfig | ||
*/ | ||
logBaseEndpoint: string; | ||
|
||
/** | ||
* The base endpoint of the service used to handle the registry targets. | ||
* Registry target related endpoints will be built based on this endpoint. | ||
* E.g: | ||
* If the base endpoint is '/api/endpoints', | ||
* the endpoint for registry target will be '/api/endpoints/:endpoint_id', | ||
* the endpoint for pinging registry target will be '/api/endpoints/:endpoint_id/ping'. | ||
* | ||
* @type {string} | ||
* @memberOf IServiceConfig | ||
*/ | ||
targetBaseEndpoint: string; | ||
|
||
/** | ||
* The base endpoint of the service used to handle the replication rules. | ||
* Replication rule related endpoints will be built based on this endpoint. | ||
* E.g: | ||
* If the base endpoint is '/api/replication/rules', | ||
* the endpoint for rule will be '/api/replication/rules/:rule_id'. | ||
* | ||
* @type {string} | ||
* @memberOf IServiceConfig | ||
*/ | ||
replicationRuleEndpoint: string; | ||
|
||
|
||
/** | ||
* The base endpoint of the service used to handle the replication jobs. | ||
* | ||
* | ||
* @type {string} | ||
* @memberOf IServiceConfig | ||
*/ | ||
replicationJobEndpoint: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { URLSearchParams } from '@angular/http'; | ||
|
||
/** | ||
* Wrap the class 'URLSearchParams' for future extending requirements. | ||
* Currently no extra methods provided. | ||
* | ||
* @export | ||
* @class RequestQueryParams | ||
* @extends {URLSearchParams} | ||
*/ | ||
export class RequestQueryParams extends URLSearchParams { | ||
|
||
constructor() { super(); } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { TestBed, inject } from '@angular/core/testing'; | ||
|
||
import { AccessLogService, AccessLogDefaultService } from './access-log.service'; | ||
|
||
describe('AccessLogService', () => { | ||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
providers: [{ | ||
provide: AccessLogService, | ||
useClass: AccessLogDefaultService | ||
}] | ||
}); | ||
}); | ||
|
||
it('should ...', inject([AccessLogDefaultService], (service: AccessLogService) => { | ||
expect(service).toBeTruthy(); | ||
})); | ||
}); |
Oops, something went wrong.