From 88783af85100b228806d48525be495c269448daa Mon Sep 17 00:00:00 2001 From: Steven Zou Date: Mon, 27 Mar 2017 12:51:23 +0800 Subject: [PATCH] merge latest ui code to dev --- src/ui_ng/angular-cli.json | 65 +++++++++ src/ui_ng/package.json | 123 +++++++++--------- .../base/navigator/navigator.component.html | 6 +- .../app/base/navigator/navigator.component.ts | 4 + .../src/app/log/recent-log.component.css | 2 +- .../src/app/log/recent-log.component.html | 4 +- .../about-dialog/about-dialog.component.css | 23 ---- .../about-dialog/about-dialog.component.html | 22 ++-- .../confirmation-dialog.component.html | 2 +- src/ui_ng/src/i18n/lang/en-lang.json | 24 ++-- src/ui_ng/src/i18n/lang/zh-lang.json | 22 +++- 11 files changed, 179 insertions(+), 118 deletions(-) create mode 100644 src/ui_ng/angular-cli.json diff --git a/src/ui_ng/angular-cli.json b/src/ui_ng/angular-cli.json new file mode 100644 index 000000000..a33a2dbf0 --- /dev/null +++ b/src/ui_ng/angular-cli.json @@ -0,0 +1,65 @@ +{ + "project": { + "version": "1.0.0-beta.20-4", + "name": "clarity-seed" + }, + "apps": [{ + "root": "src", + "outDir": "dist", + "assets": [ + "images", + "favicon.ico" + ], + "index": "index.html", + "main": "main.ts", + "test": "test.ts", + "tsconfig": "tsconfig.json", + "prefix": "app", + "mobile": false, + "styles": [ + "../node_modules/clarity-icons/clarity-icons.min.css", + "../node_modules/clarity-ui/clarity-ui.min.css", + "styles.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" + ], + "environments": { + "source": "environments/environment.ts", + "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 + } + } +} \ No newline at end of file diff --git a/src/ui_ng/package.json b/src/ui_ng/package.json index 689096846..542105af1 100644 --- a/src/ui_ng/package.json +++ b/src/ui_ng/package.json @@ -1,63 +1,62 @@ { - "name": "clarity-seed", - "version": "0.8.0", - "description": "Angular-CLI starter for a Clarity project", - "angular-cli": {}, - "scripts": { - "start": "ng serve --host 0.0.0.0 --proxy-config proxy.config.json", - "lint": "tslint \"src/**/*.ts\"", - "test": "ng test --single-run", - "pree2e": "webdriver-manager update", - "e2e": "protractor" - }, - "private": true, - "dependencies": { - "@angular/common": "^2.4.1", - "@angular/compiler": "^2.4.1", - "@angular/core": "^2.4.9", - "@angular/forms": "^2.4.1", - "@angular/http": "^2.4.1", - "@angular/platform-browser": "^2.4.1", - "@angular/platform-browser-dynamic": "^2.4.1", - "@angular/router": "^3.4.1", - "@ngx-translate/core": "^6.0.0", - "@ngx-translate/http-loader": "0.0.3", - "@webcomponents/custom-elements": "1.0.0-alpha.3", - "angular2-cookie": "^1.2.6", - "clarity-angular": "0.8.7", - "clarity-icons": "0.8.7", - "clarity-ui": "0.8.7", - "core-js": "^2.4.1", - "fs": "0.0.1-security", - "mutationobserver-shim": "^0.3.2", - "rxjs": "^5.0.1", - "ts-helpers": "^1.1.1", - "web-animations-js": "^2.2.1", - "zone.js": "^0.7.2" - }, - "devDependencies": { - "@angular/cli": "^1.0.0-rc.1", - "@angular/compiler-cli": "^2.4.1", - "@types/core-js": "^0.9.34", - "@types/jasmine": "^2.2.30", - "@types/node": "^6.0.42", - "@angular/cli": "^1.0.0-rc.2", - "bootstrap": "4.0.0-alpha.5", - "codelyzer": "~1.0.0-beta.3", - "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", - "ts-node": "1.2.1", - "tslint": "^4.1.1", - "typescript": "~2.0.3", - "typings": "^1.4.0", - "webdriver-manager": "10.2.5" - } -} + "name": "harbor", + "version": "0.6.0", + "description": "Harbor UI with Clarity", + "angular-cli": {}, + "scripts": { + "start": "ng serve --ssl 1 --ssl-key --ssl-cert --host 0.0.0.0 --proxy-config proxy.config.json", + "lint": "tslint \"src/**/*.ts\"", + "test": "ng test --single-run", + "pree2e": "webdriver-manager update", + "e2e": "protractor" + }, + "private": true, + "dependencies": { + "@angular/common": "^2.4.1", + "@angular/compiler": "^2.4.1", + "@angular/core": "^2.4.1", + "@angular/forms": "^2.4.1", + "@angular/http": "^2.4.1", + "@angular/platform-browser": "^2.4.1", + "@angular/platform-browser-dynamic": "^2.4.1", + "@angular/router": "^3.4.1", + "@ngx-translate/core": "^6.0.0", + "@ngx-translate/http-loader": "0.0.3", + "@webcomponents/custom-elements": "1.0.0-alpha.3", + "angular2-cookie": "^1.2.6", + "clarity-angular": "0.8.7", + "clarity-icons": "0.8.7", + "clarity-ui": "0.8.7", + "core-js": "^2.4.1", + "fs": "0.0.1-security", + "mutationobserver-shim": "^0.3.2", + "rxjs": "^5.0.1", + "ts-helpers": "^1.1.1", + "web-animations-js": "^2.2.1", + "zone.js": "^0.7.2" + }, + "devDependencies": { + "@angular/compiler-cli": "^2.4.1", + "@types/core-js": "^0.9.34", + "@types/jasmine": "^2.2.30", + "@types/node": "^6.0.42", + "angular-cli": "^1.0.0-beta.24", + "bootstrap": "4.0.0-alpha.5", + "codelyzer": "~1.0.0-beta.3", + "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", + "ts-node": "1.2.1", + "tslint": "^4.1.1", + "typescript": "~2.2.1", + "typings": "^1.4.0", + "webdriver-manager": "10.2.5" + } +} \ No newline at end of file diff --git a/src/ui_ng/src/app/base/navigator/navigator.component.html b/src/ui_ng/src/app/base/navigator/navigator.component.html index ee914559e..46db50d5e 100644 --- a/src/ui_ng/src/app/base/navigator/navigator.component.html +++ b/src/ui_ng/src/app/base/navigator/navigator.component.html @@ -2,12 +2,12 @@
- Harbor + {{ appTitle | translate}}
- Management - Registry + {{'APP_TITLE.MGMT' | translate}} + {{'APP_TITLE.REG' | translate}}
diff --git a/src/ui_ng/src/app/base/navigator/navigator.component.ts b/src/ui_ng/src/app/base/navigator/navigator.component.ts index 01c869736..68a639ea3 100644 --- a/src/ui_ng/src/app/base/navigator/navigator.component.ts +++ b/src/ui_ng/src/app/base/navigator/navigator.component.ts @@ -27,6 +27,7 @@ export class NavigatorComponent implements OnInit { @Output() showPwdChangeModal = new EventEmitter(); private selectedLang: string = enLang; + private appTitle: string = 'APP_TITLE.HARBOR'; constructor( private session: SessionService, @@ -44,6 +45,9 @@ export class NavigatorComponent implements OnInit { //Keep in cookie for next use this.cookie.put("harbor-lang", langChange.lang); }); + if (this.appConfigService.isIntegrationMode()) { + this.appTitle = 'APP_TITLE.VIC'; + } } public get isSessionValid(): boolean { diff --git a/src/ui_ng/src/app/log/recent-log.component.css b/src/ui_ng/src/app/log/recent-log.component.css index 2d08305e0..78a60e959 100644 --- a/src/ui_ng/src/app/log/recent-log.component.css +++ b/src/ui_ng/src/app/log/recent-log.component.css @@ -25,7 +25,7 @@ } .log-select { - width: 180px; + width: 130px; display: inline-block; top: 1px; } diff --git a/src/ui_ng/src/app/log/recent-log.component.html b/src/ui_ng/src/app/log/recent-log.component.html index 890890eee..768f5ec45 100644 --- a/src/ui_ng/src/app/log/recent-log.component.html +++ b/src/ui_ng/src/app/log/recent-log.component.html @@ -1,7 +1,5 @@
-

{{'SIDE_NAV.LOGS' | translate}} - {{logNumber}} -

+

{{'SIDE_NAV.LOGS' | translate}}

diff --git a/src/ui_ng/src/app/shared/about-dialog/about-dialog.component.css b/src/ui_ng/src/app/shared/about-dialog/about-dialog.component.css index 4a2236d0e..cb14978a2 100644 --- a/src/ui_ng/src/app/shared/about-dialog/about-dialog.component.css +++ b/src/ui_ng/src/app/shared/about-dialog/about-dialog.component.css @@ -2,36 +2,13 @@ margin-left: 24px !important; } -.about-text-link { - font-family: "Proxima Nova Light"; - font-size: 14px; - color: #007CBB; - line-height: 24px; -} - -.about-copyright-text { - font-family: "Proxima Nova Light"; - font-size: 13px; - color: #565656; - line-height: 16px; -} - -.about-product-title { - font-family: "Metropolis Light"; - font-size: 28px; - color: #000000; - line-height: 36px; -} - .about-version { - font-family: "Metropolis"; font-size: 14px; color: #565656; font-weight: 500; } .about-build { - font-family: "Metropolis"; font-size: 14px; color: #565656; } \ No newline at end of file diff --git a/src/ui_ng/src/app/shared/about-dialog/about-dialog.component.html b/src/ui_ng/src/app/shared/about-dialog/about-dialog.component.html index 2a676ff92..d194e5bca 100644 --- a/src/ui_ng/src/app/shared/about-dialog/about-dialog.component.html +++ b/src/ui_ng/src/app/shared/about-dialog/about-dialog.component.html @@ -1,20 +1,22 @@ \ No newline at end of file diff --git a/src/ui_ng/src/i18n/lang/en-lang.json b/src/ui_ng/src/i18n/lang/en-lang.json index d1efbb68b..f5166409f 100644 --- a/src/ui_ng/src/i18n/lang/en-lang.json +++ b/src/ui_ng/src/i18n/lang/en-lang.json @@ -1,4 +1,10 @@ { + "APP_TITLE": { + "HARBOR": "Harbor", + "VIC": "vSphere Integrated Containers", + "MGMT": "Management", + "REG": "Registry" + }, "SIGN_IN": { "REMEMBER": "Remember me", "INVALID_MSG": "Invalid user name or password", @@ -22,7 +28,9 @@ "CLOSE": "CLOSE", "TEST_LDAP": "TEST LDAP SERVER", "MORE_INFO": "More info...", - "YES": "YES" + "YES": "YES", + "NO": "NO", + "NEGATIVE": "NEGATIVE" }, "TOOLTIP": { "EMAIL": "Email should be a valid email address like name@example.com", @@ -317,7 +325,7 @@ "RESET_OK": "Password has been successfully reset. Click OK to login with new password" }, "RECENT_LOG": { - "SUB_TITLE": "Show recent", + "SUB_TITLE": "Show", "SUB_TITLE_SUFIX": "logs" }, "CONFIG": { @@ -327,7 +335,7 @@ "EMAIL": "Email", "SYSTEM": "System Settings", "CONFIRM_TITLE": "Confirm to cancel", - "CONFIRM_SUMMARY": "Some changes are not saved yet, do you really want to discard?", + "CONFIRM_SUMMARY": "Some changes have not been saved. Do you want to discard them?", "SAVE_SUCCESS": "Configurations have been successfully saved", "MAIL_SERVER": "Email Server", "MAIL_SERVER_PORT": "Email Server Port", @@ -336,11 +344,11 @@ "MAIL_FROM": "Email From", "MAIL_SSL": "Email SSL", "SSL_TOOLTIP": "Enable SSL for email server connection", - "VERIFY_REMOTE_CERT": "Verify Remote Certificate", + "VERIFY_REMOTE_CERT": "Verify Remote Cert", "TOKEN_EXPIRATION": "Token Expiration (Minutes)", - "AUTH_MODE": "Authentication", - "PRO_CREATION_RESTRICTION": "Project Creation Restriction", - "SELF_REGISTRATION": "Self Registration", + "AUTH_MODE": "Auth Mode", + "PRO_CREATION_RESTRICTION": "Project Creation", + "SELF_REGISTRATION": "Allow Self-Registration", "AUTH_MODE_DB": "Database", "AUTH_MODE_LDAP": "LDAP", "SCOPE_BASE": "Base", @@ -351,7 +359,7 @@ "TOOLTIP": { "SELF_REGISTRATION": "Enable sign up", "VERIFY_REMOTE_CERT": "Determine whether the image replication should verify the certificate of a remote Habor registry. Uncheck this box when the remote registry uses a self-signed or untrusted certificate.", - "AUTH_MODE": "By default the auth mode is db_auth, i.e. the credentials are stored in a local database. Set it to ldap_auth if you want to verify a user's credentials against an LDAP server.", + "AUTH_MODE": "By default the auth mode is database, i.e. the credentials are stored in a local database. Set it to LDAP if you want to verify a user's credentials against an LDAP server.", "LDAP_SEARCH_DN": "A user's DN who has the permission to search the LDAP/AD server. If your LDAP/AD server does not support anonymous search, you should configure this DN and ldap_search_pwd.", "LDAP_BASE_DN": "The base DN from which to look up a user in LDAP/AD", "LDAP_UID": "The attribute used in a search to match a user. It could be uid, cn, email, sAMAccountName or other attributes depending on your LDAP/AD", diff --git a/src/ui_ng/src/i18n/lang/zh-lang.json b/src/ui_ng/src/i18n/lang/zh-lang.json index 3250b2369..65228f3d8 100644 --- a/src/ui_ng/src/i18n/lang/zh-lang.json +++ b/src/ui_ng/src/i18n/lang/zh-lang.json @@ -1,4 +1,10 @@ { + "APP_TITLE": { + "HARBOR": "Harbor", + "VIC": "vSphere Integrated Containers", + "MGMT": "Management", + "REG": "Registry" + }, "SIGN_IN": { "REMEMBER": "记住我", "INVALID_MSG": "用户名或者密码不正确", @@ -22,7 +28,9 @@ "CLOSE": "关闭", "TEST_LDAP": "测试LDAP服务器", "MORE_INFO": "更多信息...", - "YES": "确定" + "YES": "确定", + "NO": "否", + "NEGATIVE": "否" }, "TOOLTIP": { "EMAIL": "请使用正确的邮箱地址,比如name@example.com", @@ -317,12 +325,12 @@ "RESET_OK": "密码重置成功,点击确定按钮前往登录页登录" }, "RECENT_LOG": { - "SUB_TITLE": "显示最近", - "SUB_TITLE_SUFIX": "条日志记录" + "SUB_TITLE": "显示", + "SUB_TITLE_SUFIX": "条日志" }, "CONFIG": { "TITLE": "配置", - "AUTH": "认证", + "AUTH": "认证模式", "REPLICATION": "复制", "EMAIL": "邮箱", "SYSTEM": "系统设置", @@ -339,8 +347,8 @@ "VERIFY_REMOTE_CERT": "验证远程证书", "TOKEN_EXPIRATION": "令牌过期时间(分钟)", "AUTH_MODE": "认证模式", - "PRO_CREATION_RESTRICTION": "项目创建限制", - "SELF_REGISTRATION": "自注册", + "PRO_CREATION_RESTRICTION": "项目创建", + "SELF_REGISTRATION": "允许自注册", "AUTH_MODE_DB": "数据库", "AUTH_MODE_LDAP": "LDAP", "SCOPE_BASE": "基础", @@ -351,7 +359,7 @@ "TOOLTIP": { "SELF_REGISTRATION": "激活注册功能", "VERIFY_REMOTE_CERT": "确定镜像复制是否要验证远程Harbor镜像库的证书。如果远程镜像库使用的是自签或者非信任证书不要勾选此选项。", - "AUTH_MODE": "默认认证模式为本地认证,比如用户凭证存储在本地数据库。如果使用LDAP服务来认证用户则设置为LDAP服务。", + "AUTH_MODE": "默认认证模式为数据库认证,比如用户凭证存储在本地数据库。如果使用LDAP服务来认证用户则设置为LDAP服务。", "LDAP_SEARCH_DN": "有权搜索LDAP服务器的用户的DN。如果LDAP服务器不支持匿名搜索,则需要配置此DN之和搜索密码。", "LDAP_BASE_DN": "用来在LDAP和AD中搜寻用户的基础DN。", "LDAP_UID": "在搜索中用来匹配用户的属性,可以是uid,cn,email,sAMAccountName或者其它LDAP/AD服务器支持的属性。",