Skip to content

Commit

Permalink
Merge latest updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
wknet123 committed Apr 20, 2017
2 parents b42f893 + 4d9aebd commit f4ef4ed
Show file tree
Hide file tree
Showing 33 changed files with 5,307 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ src/ui_ng/src/**/*.json
src/ui_ng/aot/**/*.js
src/ui_ng/aot/**/*.js.map
src/ui_ng/aot/**/*.json

**/*ngsummary.json
**/*ngfactory.ts
3 changes: 3 additions & 0 deletions src/ui_ng/lib/AUTHORS
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>
4,122 changes: 4,122 additions & 0 deletions src/ui_ng/lib/LICENSE

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/ui_ng/lib/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# harbor-angular
For publishing Harbor shared UI components.
64 changes: 64 additions & 0 deletions src/ui_ng/lib/angular-cli.json
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
}
}
}
1 change: 1 addition & 0 deletions src/ui_ng/lib/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './src/index';
60 changes: 60 additions & 0 deletions src/ui_ng/lib/package.json
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"
}
}
34 changes: 34 additions & 0 deletions src/ui_ng/lib/pkg/package.json
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"
}
}
18 changes: 18 additions & 0 deletions src/ui_ng/lib/rollup.config.js
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'
}
}
45 changes: 45 additions & 0 deletions src/ui_ng/lib/src/harbor-library.module.ts
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 }
]
};
}
}
4 changes: 4 additions & 0 deletions src/ui_ng/lib/src/index.ts
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';
64 changes: 64 additions & 0 deletions src/ui_ng/lib/src/service.config.ts
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;
}
14 changes: 14 additions & 0 deletions src/ui_ng/lib/src/service/RequestQueryParams.ts
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(); }
}
18 changes: 18 additions & 0 deletions src/ui_ng/lib/src/service/access-log.service.spec.ts
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();
}));
});
Loading

0 comments on commit f4ef4ed

Please sign in to comment.