Modify some issues of test ping registry and edit registry

Signed-off-by: FangyuanCheng <fangyuanc@vmware.com>
This commit is contained in:
FangyuanCheng 2019-04-22 15:05:51 +08:00
parent 4e8d4fca85
commit 8cf0d58f1f
14 changed files with 45 additions and 14 deletions

View File

@ -46,7 +46,7 @@
translate }}</label>
<label class="col-md-8" for="destination_url" aria-haspopup="true" role="tooltip" [class.invalid]="targetEndpoint.errors && (targetEndpoint.dirty || targetEndpoint.touched)"
[class.valid]="targetEndpoint.valid" class="tooltip tooltip-validation tooltip-sm tooltip-bottom-left">
<input type="text" id="destination_url" [disabled]="testOngoing || editDisabled || controlEnabled" [readonly]="!editable" [(ngModel)]="target.url"
<input type="text" id="destination_url" [disabled]="testOngoing" [readonly]="!editable" [(ngModel)]="target.url"
size="25" name="endpointUrl" #targetEndpoint="ngModel" required placeholder="http(s)://192.168.1.1">
<span class="tooltip-content" *ngIf="targetEndpoint.errors && targetEndpoint.errors.required && (targetEndpoint.dirty || targetEndpoint.touched)">
{{ 'DESTINATION.URL_IS_REQUIRED' | translate }}

View File

@ -28,11 +28,11 @@ import { TranslateService } from "@ngx-translate/core";
import { EndpointService } from "../service/endpoint.service";
import { ErrorHandler } from "../error-handler/index";
import { InlineAlertComponent } from "../inline-alert/inline-alert.component";
import { Endpoint } from "../service/interface";
import { Endpoint, PingEndpoint } from "../service/interface";
import { clone, compareValue, isEmptyObject } from "../utils";
const FAKE_PASSWORD = "rjGcfuRu";
const DOCKERHUB_URL = "https://registry-1.docker.io";
const DOCKERHUB_URL = "https://hub.docker.com";
@Component({
selector: "hbr-create-edit-endpoint",
templateUrl: "./create-edit-endpoint.component.html",
@ -124,6 +124,18 @@ export class CreateEditEndpointComponent
};
}
initPingEndpoint(): PingEndpoint {
return {
access_key: "",
access_secret: "",
description: "",
insecure: false,
name: "",
type: "harbor",
url: ""
};
}
open(): void {
this.createEditDestinationOpened = true;
}
@ -199,19 +211,20 @@ export class CreateEditEndpointComponent
let selectValue = this.targetForm.controls.adapter.value;
if (selectValue === 'dockerHub') {
this.targetForm.controls.endpointUrl.setValue(DOCKERHUB_URL);
this.controlEnabled = true;
} else {
this.targetForm.controls.endpointUrl.setValue("");
this.controlEnabled = false;
}
}
testConnection() {
let payload: Endpoint = this.initEndpoint();
let payload: PingEndpoint = this.initPingEndpoint();
if (!this.endpointId) {
payload.name = this.target.name;
payload.description = this.target.description;
payload.type = this.target.type;
payload.url = this.target.url;
payload.credential.access_key = this.target.credential.access_key;
payload.credential.access_secret = this.target.credential.access_secret;
payload.access_key = this.target.credential.access_key;
payload.access_secret = this.target.credential.access_secret;
payload.insecure = this.target.insecure;
} else {
let changes: { [key: string]: any } = this.getChanges();

View File

@ -59,7 +59,7 @@
</label>
<div class="select inline-block" *ngIf="supportedFilters[i]?.style==='radio'">
<select formControlName="value" #selectedValue id="{{i}}" name="{{supportedFilters[i]?.type}}">
<option value=""></option>
<option value="">-- {{'REPLICATION.PLEASE_SELECT' | translate}} --</option>
<option *ngFor="let value of supportedFilters[i]?.values;" value="{{value}}">{{value}}</option>
</select>
</div>

View File

@ -12,7 +12,7 @@
<clr-dg-column class="col-width">{{'REPLICATION.REPLICATION_MODE' | translate}}</clr-dg-column>
<clr-dg-column class="min-width">{{'REPLICATION.DESTINATION_NAMESPACE' | translate}}</clr-dg-column>
<clr-dg-column [clrDgField]="'trigger'">{{'REPLICATION.REPLICATION_TRIGGER' | translate}}</clr-dg-column>
<clr-dg-column [clrDgField]="'override'" class="status-width">{{'REPLICATION.OVERRIDE' | translate}}</clr-dg-column>
<clr-dg-column class="status-width">{{'REPLICATION.OVERRIDE' | translate}}</clr-dg-column>
<clr-dg-column [clrDgField]="'description'">{{'REPLICATION.DESCRIPTION' | translate}}</clr-dg-column>
<clr-dg-placeholder>{{'REPLICATION.PLACEHOLDER' | translate }}</clr-dg-placeholder>
<clr-dg-row *clrDgItems="let p of changedRules; let i=index" [clrDgItem]="p" [style.backgroundColor]="(projectScope && withReplicationJob && selectedId === p.id) ? '#eee' : ''">

View File

@ -92,7 +92,7 @@
</div>
</div>
<clr-datagrid [(clrDgSelected)]="selectedRow" [clrDgLoading]="loading">
<clr-dg-column>{{'REPLICATION.TASK_ID'| translate}}</clr-dg-column>
<clr-dg-column [clrDgSortBy]="'id'">{{'REPLICATION.TASK_ID'| translate}}</clr-dg-column>
<clr-dg-column [clrDgField]="'resource_type'" class="resource-width">{{'REPLICATION.RESOURCE_TYPE' | translate}}</clr-dg-column>
<clr-dg-column [clrDgField]="'src_resource'">{{'REPLICATION.SOURCE' | translate}}</clr-dg-column>
<clr-dg-column [clrDgField]="'dst_resource'">{{'REPLICATION.DESTINATION' | translate}}</clr-dg-column>

View File

@ -50,7 +50,7 @@
(click)="openStopExecutionsDialog(selectedRow)">{{'REPLICATION.STOPJOB' | translate}}</button>
</div>
</clr-dg-action-bar>
<clr-dg-column [clrDgField]="'id'">{{'REPLICATION.ID' | translate}}</clr-dg-column>
<clr-dg-column [clrDgSortBy]="'id'">{{'REPLICATION.ID' | translate}}</clr-dg-column>
<clr-dg-column [clrDgField]="'trigger'">{{'REPLICATION.REPLICATION_TRIGGER' | translate}}</clr-dg-column>
<clr-dg-column [clrDgSortBy]="creationTimeComparator">{{'REPLICATION.CREATION_TIME' | translate}}</clr-dg-column>
<clr-dg-column>{{'REPLICATION.DURATION' | translate}}</clr-dg-column>

View File

@ -70,6 +70,9 @@
}
clr-datagrid {
::ng-deep .datagrid {
min-height: 115px;
}
::ng-deep .datagrid-table {
position: static;
}

View File

@ -9,7 +9,7 @@ import {
HTTP_GET_OPTIONS
} from "../utils";
import { RequestQueryParams } from "./RequestQueryParams";
import { Endpoint, ReplicationRule } from "./interface";
import { Endpoint, ReplicationRule, PingEndpoint } from "./interface";
import { catchError, map } from "rxjs/operators";
@ -112,7 +112,7 @@ export abstract class EndpointService {
* @memberOf EndpointService
*/
abstract pingEndpoint(
endpoint: Endpoint
endpoint: PingEndpoint
): Observable<any>;
/**

View File

@ -87,6 +87,16 @@ export interface Endpoint extends Base {
url: string;
}
export interface PingEndpoint extends Base {
access_key?: string;
access_secret?: string;
description: string;
insecure: boolean;
name: string;
type: string;
url: string;
}
export interface Filter {
type: string;
style: string;

View File

@ -350,6 +350,7 @@
"CURRENT": "current",
"FILTER_PLACEHOLDER": "Filter Tasks",
"STOP_TITLE": "Confirm Stop Executions",
"PLEASE_SELECT": "select an option",
"STOP_SUCCESS": "Stop Execution {{param}} Successful",
"STOP_SUMMARY": "Do you want to stop the executions {{param}}?",
"TASK_ID":"Task ID",

View File

@ -348,6 +348,7 @@
"CURRENT": "current",
"FILTER_PLACEHOLDER": "Filter Tasks",
"STOP_TITLE": "Confirme Stop Executions",
"PLEASE_SELECT": "select an option",
"STOP_SUCCESS": "Stop Execution {{param}} Successful",
"STOP_SUMMARY": "De que desea detener las ejecuciones {{param}}?",
"TASK_ID":"Task ID",

View File

@ -333,6 +333,7 @@
"CURRENT": "current",
"FILTER_PLACEHOLDER": "Filter Tasks",
"STOP_TITLE": "Confirmer arrêter les exécutions",
"PLEASE_SELECT": "select an option",
"STOP_SUCCESS": "Stop Execution {{param}} Successful",
"STOP_SUMMARY": "Voulez-vous arrêter les exécutions {{param}}?",
"TASK_ID":"Task ID",

View File

@ -347,6 +347,7 @@
"CURRENT": "current",
"FILTER_PLACEHOLDER": "Filter Tasks",
"STOP_TITLE": "Confirme as execuções de parada",
"PLEASE_SELECT": "select an option",
"STOP_SUCCESS": "Stop Execution {{param}} Successful",
"STOP_SUMMARY": "Você quer parar as execuções? {{param}}?",
"TASK_ID":"Task ID",

View File

@ -348,6 +348,7 @@
"CURRENT": "当前仓库",
"FILTER_PLACEHOLDER": "过滤任务",
"STOP_TITLE": "确认停止任务",
"PLEASE_SELECT": "请选择",
"STOP_SUCCESS": "停止任务 {{param}} 成功",
"STOP_SUMMARY": "确认停止任务{{param}}?",
"TASK_ID":"任务ID",