Skip to content

Commit

Permalink
Merge pull request #421 from BennieMeng/feature/create-template-time-…
Browse files Browse the repository at this point in the history
…change

frontend: update create-template time
  • Loading branch information
gaulzhw authored May 31, 2019
2 parents f8dc535 + 996933c commit f261f68
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/frontend/src/app/portal/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
</ng-container>
</div>
<p class="card-show-p">
<span *ngIf="clusters.length >= allowNumber" (click)="changeCard()">
<span *ngIf="!allowShowAll">{{'ACTION.FOLD' | translate}}</span>
<span *ngIf="allowShowAll">{{'ACTION.UNFOLD' | translate}}</span>
<span *ngIf="clusters.length >= allowNumber" (click)="changeCard()">
<span *ngIf="!allowShowAll">{{'ACTION.UNFOLD' | translate}}</span>
<span *ngIf="allowShowAll">{{'ACTION.FOLD' | translate}}</span>
<svg class="card-change-svg" width="12" height="12" xmlns="http://www.w3.org/2000/svg"
viewBox="0, 0, 20, 10" style="margin-left: 3px;transition: transform 250ms ease-in-out;">
<polyline points="3,2 10,10 17,2" style="fill: white;stroke: #377aec;stroke-width: 2;"></polyline>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export class CreateEditAutoscaletplComponent extends CreateEditResourceTemplate

this.template.id = undefined;
this.template.name = this.resource.name;
this.template.createTime = this.template.updateTime = new Date();
this.templateService.create(this.template, this.app.id).subscribe(
status => {
this.isSubmitOnGoing = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ export class CreateEditConfigMapTplComponent implements OnInit, AfterViewInit, O
const kubeConfigMap = this.getKubeConfigMapByForm();
this.configMapTpl.template = JSON.stringify(kubeConfigMap);
this.configMapTpl.id = undefined;
this.configMapTpl.createTime = this.configMapTpl.updateTime = new Date();
this.configMapTplService.create(this.configMapTpl, this.app.id).subscribe(
status => {
this.isSubmitOnGoing = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ export class CreateEditCronjobTplComponent extends ContainerTpl implements OnIni

this.cronjobTpl.id = undefined;
this.cronjobTpl.name = this.cronjob.name;
this.cronjobTpl.createTime = this.cronjobTpl.updateTime = new Date();
this.cronjobTplService.create(this.cronjobTpl, this.app.id).subscribe(
status => {
this.isSubmitOnGoing = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ export class CreateEditDaemonSetTplComponent extends ContainerTpl implements OnI
this.daemonSetTpl.template = JSON.stringify(newDaemonSet);
this.daemonSetTpl.id = undefined;
this.daemonSetTpl.name = this.daemonSet.name;
this.daemonSetTpl.createTime = this.daemonSetTpl.updateTime = new Date();
this.daemonSetTplService.create(this.daemonSetTpl, this.app.id).subscribe(
status => {
this.isSubmitOnGoing = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ export class CreateEditDeploymentTplComponent extends ContainerTpl implements On
this.deploymentTpl.template = JSON.stringify(newState);
this.deploymentTpl.id = undefined;
this.deploymentTpl.name = this.deployment.name;
this.deploymentTpl.createTime = this.deploymentTpl.updateTime = new Date();
this.deploymentTplService.create(this.deploymentTpl, this.app.id).subscribe(
status => {
this.isSubmitOnGoing = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export class CreateEditIngressTplComponent extends CreateEditResourceTemplate im

this.template.id = undefined;
this.template.name = this.resource.name;
this.template.createTime = this.template.updateTime = new Date();
this.templateService.create(this.template, this.app.id).subscribe(
status => {
this.isSubmitOnGoing = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ export class CreateEditPersistentVolumeClaimTplComponent implements OnInit, Afte
const kubePvc = this.getKubePvcByForm();
this.pvcTpl.template = JSON.stringify(kubePvc);
this.pvcTpl.id = undefined;
this.pvcTpl.createTime = this.pvcTpl.updateTime = new Date();
this.pvcTplService.create(this.pvcTpl, this.app.id).subscribe(
status => {
this.isSubmitOnGoing = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ export class CreateEditSecretTplComponent implements OnInit, AfterViewInit, OnDe
const kubeSecret = this.getKubeSecretByForm();
this.secretTpl.template = JSON.stringify(kubeSecret);
this.secretTpl.id = undefined;
this.secretTpl.createTime = this.secretTpl.updateTime = new Date();
this.secretTplService.create(this.secretTpl, this.app.id).subscribe(
status => {
this.isSubmitOnGoing = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ export class CreateEditStatefulsettplComponent extends ContainerTpl implements O
this.statefulsetTpl.template = JSON.stringify(newState);
this.statefulsetTpl.id = undefined;
this.statefulsetTpl.name = this.statefulset.name;
this.statefulsetTpl.createTime = this.statefulsetTpl.updateTime = new Date();
this.statefulsetTplService.create(this.statefulsetTpl, this.app.id).subscribe(
status => {
this.isSubmitOnGoing = false;
Expand Down
1 change: 1 addition & 0 deletions src/frontend/src/app/shared/model/v1/configmaptpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export class ConfigMapTpl {
user: string;
metaData: string;
createTime: Date;
updateTime?: Date;
configMap: ConfigMap;
clusters: string[];
status: PublishStatus[];
Expand Down
1 change: 1 addition & 0 deletions src/frontend/src/app/shared/model/v1/cronjobtpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export class CronjobTpl {
user: string;
metaData: string;
createTime: Date;
updateTime?: Date;
cronjob: Cronjob;
clusters: string[];
status: CronjobStatus[];
Expand Down
1 change: 1 addition & 0 deletions src/frontend/src/app/shared/model/v1/deploymenttpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export class DeploymentTpl {
deleted: boolean;
user: string;
createTime: Date;
updateTime?: Date;
deployment: Deployment;

status: DeploymentStatus[];
Expand Down
1 change: 1 addition & 0 deletions src/frontend/src/app/shared/model/v1/secrettpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export class SecretTpl {
deleted: boolean;
user: string;
createTime: Date;
updateTime: Date;
secret: Secret;
status: PublishStatus[];
metaData: string;
Expand Down

0 comments on commit f261f68

Please sign in to comment.