UI Modification: When New Robot

Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
AllForNothing 2019-07-19 14:08:22 +08:00
parent 6f62a44a17
commit bd5b195019
8 changed files with 62 additions and 47 deletions

View File

@ -44,42 +44,46 @@
{{'ROBOT_ACCOUNT.PERMISSIONS' | translate}} {{'ROBOT_ACCOUNT.PERMISSIONS' | translate}}
</label> </label>
</div> </div>
<div class="clr-col"> <div class="clr-col p-0">
<div class="form-group padding-left-120"> <table class="table table-noborder m-0 w-90">
<label>{{'ROBOT_ACCOUNT.PERMISSIONS_IMAGE' | translate}}</label> <tr>
<div class="radio-inline"> <th></th>
<input type="radio" name="image-permission" <th class="left">{{'ROBOT_ACCOUNT.PUSH' | translate}}</th>
id="image-permission-pull" <th class="left">{{'ROBOT_ACCOUNT.PULL' | translate}}</th>
value="pull" </tr>
[(ngModel)]="imagePermission"> <tr>
<label for="image-permission-pull">{{'ROBOT_ACCOUNT.PULL' | translate}}</label> <td class="left">
</div> <span>{{'ROBOT_ACCOUNT.PERMISSIONS_IMAGE' | translate}}</span>
<div class="radio-inline"> <clr-tooltip>
<input type="radio" name="image-permission" <clr-icon clrTooltipTrigger shape="info-circle" size="24"></clr-icon>
id="image-permission-push-and-pull" <clr-tooltip-content clrPosition="top-right" clrSize="lg" *clrIfOpen>
value="push-and-pull" <span>{{'ROBOT_ACCOUNT.PULL_IS_MUST' | translate}}</span>
[(ngModel)]="imagePermission"> </clr-tooltip-content>
<label for="image-permission-push-and-pull">{{'ROBOT_ACCOUNT.PUSH' | translate}} </clr-tooltip>
& {{'ROBOT_ACCOUNT.PULL' | translate}}</label> </td>
</div> <td>
</div> <input type="checkbox" name="image-permission-push"
<div class="form-group padding-left-120"> [(ngModel)]="imagePermissionPush" clrCheckbox>
<label>{{'ROBOT_ACCOUNT.PERMISSIONS_HELMCHART' | translate}}</label> </td>
<div class="checkbox-inline"> <td class="clr-form-control-disabled">
<input type="checkbox" id="helm-permission-push" <input disabled type="checkbox" name="image-permission-pull"
[checked]="robot.access.isPushChart" [(ngModel)]="imagePermissionPull" clrCheckbox>
</td>
</tr>
<tr>
<td class="left">{{'ROBOT_ACCOUNT.PERMISSIONS_HELMCHART' | translate}}</td>
<td>
<input type="checkbox"
[(ngModel)]="robot.access.isPushChart" [(ngModel)]="robot.access.isPushChart"
name="helm-permission"> name="helm-permission" clrCheckbox>
<label for="helm-permission-push">{{'ROBOT_ACCOUNT.PUSH' | translate}}</label> </td>
</div> <td>
<div class="checkbox-inline"> <input type="checkbox"
<input type="checkbox" id="helm-permission-pull"
[checked]="robot.access.isPullChart"
[(ngModel)]="robot.access.isPullChart" [(ngModel)]="robot.access.isPullChart"
name="helm-permission"> name="helm-permission" clrCheckbox>
<label for="helm-permission-pull">{{'ROBOT_ACCOUNT.PULL' | translate}}</label> </td>
</div> </tr>
</div> </table>
</div> </div>
</div> </div>
</section> </section>

View File

@ -42,5 +42,8 @@
} }
.padding-left-120{ .padding-left-120{
padding-left: 120px; padding-left: 126px;
}
.w-90{
width: 90%;
} }

View File

@ -38,7 +38,8 @@ export class AddRobotComponent implements OnInit, OnDestroy {
robotNameChecker: Subject<string> = new Subject<string>(); robotNameChecker: Subject<string> = new Subject<string>();
nameTooltipText = "ROBOT_ACCOUNT.ROBOT_NAME"; nameTooltipText = "ROBOT_ACCOUNT.ROBOT_NAME";
robotForm: NgForm; robotForm: NgForm;
imagePermission: string = "push-and-pull"; imagePermissionPush: boolean = true;
imagePermissionPull: boolean = true;
@Input() projectId: number; @Input() projectId: number;
@Input() projectName: string; @Input() projectName: string;
@Output() create = new EventEmitter<boolean>(); @Output() create = new EventEmitter<boolean>();
@ -99,6 +100,8 @@ export class AddRobotComponent implements OnInit, OnDestroy {
this.robot.name = ""; this.robot.name = "";
this.robot.description = ""; this.robot.description = "";
this.addRobotOpened = true; this.addRobotOpened = true;
this.imagePermissionPush = true;
this.imagePermissionPull = true;
this.isRobotNameValid = true; this.isRobotNameValid = true;
this.robot = new Robot(); this.robot = new Robot();
this.nameTooltipText = "ROBOT_ACCOUNT.ROBOT_NAME"; this.nameTooltipText = "ROBOT_ACCOUNT.ROBOT_NAME";
@ -118,12 +121,12 @@ export class AddRobotComponent implements OnInit, OnDestroy {
return; return;
} }
// set value to robot.access.isPullImage and robot.access.isPushOrPullImage when submit // set value to robot.access.isPullImage and robot.access.isPushOrPullImage when submit
if ( this.imagePermission === 'pull' ) { if ( this.imagePermissionPush && this.imagePermissionPull) {
this.robot.access.isPullImage = true;
this.robot.access.isPushOrPullImage = false;
} else {
this.robot.access.isPullImage = false; this.robot.access.isPullImage = false;
this.robot.access.isPushOrPullImage = true; this.robot.access.isPushOrPullImage = true;
} else {
this.robot.access.isPullImage = true;
this.robot.access.isPushOrPullImage = false;
} }
this.isSubmitOnGoing = true; this.isSubmitOnGoing = true;
this.robotService this.robotService

View File

@ -322,7 +322,8 @@
"CREATED_SUCCESS": "Created '{{param}}' successfully.", "CREATED_SUCCESS": "Created '{{param}}' successfully.",
"COPY_SUCCESS": "Copy token successfully of '{{param}}'", "COPY_SUCCESS": "Copy token successfully of '{{param}}'",
"DELETION_TITLE": "Confirm removal of robot accounts", "DELETION_TITLE": "Confirm removal of robot accounts",
"DELETION_SUMMARY": "Do you want to delete robot accounts {{param}}?" "DELETION_SUMMARY": "Do you want to delete robot accounts {{param}}?",
"PULL_IS_MUST" : "Pull permission is checked by default and can not be modified."
}, },
"GROUP": { "GROUP": {
"GROUP": "Group", "GROUP": "Group",

View File

@ -323,7 +323,8 @@
"CREATED_SUCCESS": "Created '{{param}}' successfully.", "CREATED_SUCCESS": "Created '{{param}}' successfully.",
"COPY_SUCCESS": "Copy token successfully of '{{param}}'", "COPY_SUCCESS": "Copy token successfully of '{{param}}'",
"DELETION_TITLE": "Confirm removal of robot accounts", "DELETION_TITLE": "Confirm removal of robot accounts",
"DELETION_SUMMARY": "Do you want to delete robot accounts {{param}}?" "DELETION_SUMMARY": "Do you want to delete robot accounts {{param}}?",
"PULL_IS_MUST" : "Pull permission is checked by default and can not be modified."
}, },
"GROUP": { "GROUP": {
"GROUP": "Group", "GROUP": "Group",

View File

@ -315,7 +315,8 @@
"CREATED_SUCCESS": "Created '{{param}}' successfully.", "CREATED_SUCCESS": "Created '{{param}}' successfully.",
"COPY_SUCCESS": "Copy token successfully of '{{param}}'", "COPY_SUCCESS": "Copy token successfully of '{{param}}'",
"DELETION_TITLE": "confirmer l'enlèvement des comptes du robot ", "DELETION_TITLE": "confirmer l'enlèvement des comptes du robot ",
"DELETION_SUMMARY": "Voulez-vous supprimer la règle {{param}}?" "DELETION_SUMMARY": "Voulez-vous supprimer la règle {{param}}?",
"PULL_IS_MUST" : "Pull permission is checked by default and can not be modified."
}, },
"GROUP": { "GROUP": {
"Group": "Group", "Group": "Group",

View File

@ -320,7 +320,8 @@
"CREATED_SUCCESS": "Created '{{param}}' successfully.", "CREATED_SUCCESS": "Created '{{param}}' successfully.",
"COPY_SUCCESS": "Copy token successfully of '{{param}}'", "COPY_SUCCESS": "Copy token successfully of '{{param}}'",
"DELETION_TITLE": "Confirmar a remoção do robô Contas", "DELETION_TITLE": "Confirmar a remoção do robô Contas",
"DELETION_SUMMARY": "Você quer remover a regra {{param}}?" "DELETION_SUMMARY": "Você quer remover a regra {{param}}?",
"PULL_IS_MUST" : "Pull permission is checked by default and can not be modified."
}, },
"GROUP": { "GROUP": {
"GROUP": "Grupo", "GROUP": "Grupo",

View File

@ -321,7 +321,8 @@
"CREATED_SUCCESS": "创建账户 '{{param}}' 成功。", "CREATED_SUCCESS": "创建账户 '{{param}}' 成功。",
"COPY_SUCCESS": "成功复制 '{{param}}' 的令牌", "COPY_SUCCESS": "成功复制 '{{param}}' 的令牌",
"DELETION_TITLE": "删除账户确认", "DELETION_TITLE": "删除账户确认",
"DELETION_SUMMARY": "你确认删除机器人账户 {{param}}?" "DELETION_SUMMARY": "你确认删除机器人账户 {{param}}?",
"PULL_IS_MUST" : "拉取权限默认选中且不可修改。"
}, },
"GROUP": { "GROUP": {
"GROUP": "组", "GROUP": "组",