diff --git a/src/frontend/src/app/portal/daemonset/create-edit-daemonsettpl/create-edit-daemonsettpl.component.html b/src/frontend/src/app/portal/daemonset/create-edit-daemonsettpl/create-edit-daemonsettpl.component.html index bece37670..f36c50358 100644 --- a/src/frontend/src/app/portal/daemonset/create-edit-daemonsettpl/create-edit-daemonsettpl.component.html +++ b/src/frontend/src/app/portal/daemonset/create-edit-daemonsettpl/create-edit-daemonsettpl.component.html @@ -271,6 +271,15 @@

{{'DAEMONSET.CREATE_TMP' | translate} + +
diff --git a/src/frontend/src/app/portal/daemonset/create-edit-daemonsettpl/create-edit-daemonsettpl.component.ts b/src/frontend/src/app/portal/daemonset/create-edit-daemonsettpl/create-edit-daemonsettpl.component.ts index 417b5b57b..2cf1e0bcd 100644 --- a/src/frontend/src/app/portal/daemonset/create-edit-daemonsettpl/create-edit-daemonsettpl.component.ts +++ b/src/frontend/src/app/portal/daemonset/create-edit-daemonsettpl/create-edit-daemonsettpl.component.ts @@ -283,6 +283,7 @@ export class CreateEditDaemonSetTplComponent extends ContainerTpl implements OnI probe.httpGet = new HTTPGetAction(); probe.timeoutSeconds = 1; probe.periodSeconds = 10; + probe.initialDelaySeconds = 30; probe.failureThreshold = 10; } this.kubeResource.spec.template.spec.containers[i].readinessProbe = probe; diff --git a/src/frontend/src/app/portal/deployment/create-edit-deploymenttpl/create-edit-deploymenttpl.component.html b/src/frontend/src/app/portal/deployment/create-edit-deploymenttpl/create-edit-deploymenttpl.component.html index 56cce8b92..8d112367c 100644 --- a/src/frontend/src/app/portal/deployment/create-edit-deploymenttpl/create-edit-deploymenttpl.component.html +++ b/src/frontend/src/app/portal/deployment/create-edit-deploymenttpl/create-edit-deploymenttpl.component.html @@ -305,6 +305,15 @@

+ +

diff --git a/src/frontend/src/app/portal/deployment/create-edit-deploymenttpl/create-edit-deploymenttpl.component.ts b/src/frontend/src/app/portal/deployment/create-edit-deploymenttpl/create-edit-deploymenttpl.component.ts index 7e87c03ac..c528a9fb9 100644 --- a/src/frontend/src/app/portal/deployment/create-edit-deploymenttpl/create-edit-deploymenttpl.component.ts +++ b/src/frontend/src/app/portal/deployment/create-edit-deploymenttpl/create-edit-deploymenttpl.component.ts @@ -292,6 +292,7 @@ export class CreateEditDeploymentTplComponent extends ContainerTpl implements On probe.httpGet = new HTTPGetAction(); probe.timeoutSeconds = 1; probe.periodSeconds = 10; + probe.initialDelaySeconds = 30; probe.failureThreshold = 10; } this.kubeResource.spec.template.spec.containers[i].readinessProbe = probe; diff --git a/src/frontend/src/app/portal/ingress/create-edit-ingresstpl/create-edit-ingresstpl.component.html b/src/frontend/src/app/portal/ingress/create-edit-ingresstpl/create-edit-ingresstpl.component.html index 6d03ccdfc..dcdc64634 100644 --- a/src/frontend/src/app/portal/ingress/create-edit-ingresstpl/create-edit-ingresstpl.component.html +++ b/src/frontend/src/app/portal/ingress/create-edit-ingresstpl/create-edit-ingresstpl.component.html @@ -16,8 +16,15 @@

创建 Ingress 模版

- +
+
-
+
- {{svc.name}} - + - - - + + + + +
- - +
+
- - - {{secret.name}} - - +
+
+ + + + + + + +
diff --git a/src/frontend/src/app/portal/ingress/create-edit-ingresstpl/create-edit-ingresstpl.component.ts b/src/frontend/src/app/portal/ingress/create-edit-ingresstpl/create-edit-ingresstpl.component.ts index c626c9289..216b6368d 100644 --- a/src/frontend/src/app/portal/ingress/create-edit-ingresstpl/create-edit-ingresstpl.component.ts +++ b/src/frontend/src/app/portal/ingress/create-edit-ingresstpl/create-edit-ingresstpl.component.ts @@ -19,6 +19,7 @@ import { ServiceService } from '../../../../../lib/shared/client/v1/service.serv import { Service } from '../../../../../lib/shared/model/service'; import { SecretService } from '../../../shared/client/v1/secret.service'; import { Secret } from '../../../shared/model/v1/secret'; +import { IngressBackend, IngressPath, IngressRule } from '../../../shared/model/v1/kubernetes/ingress'; @Component({ @@ -160,19 +161,52 @@ export class CreateEditIngressTplComponent extends CreateEditResourceTemplate im } onAddPath(idx: number) { - this.kubeResource.spec.rules[idx].http.paths.push({backend: {serviceName: '', servicePort: 80}, path: '/'}); + this.kubeResource.spec.rules[idx].http.paths.push(this.defaultIngressPath()); + } + + defaultIngressPath() { + const ingressPath = new IngressPath(); + ingressPath.path = '/'; + ingressPath.backend = new IngressBackend(); + ingressPath.backend.servicePort = 80; + return ingressPath; } onDeletePath(i: number, j: number) { this.kubeResource.spec.rules[i].http.paths.splice(j, 1); } - onAddTLS() { + onAddTLS(event: Event) { + event.stopPropagation(); this.kubeResource.spec.tls.push({hosts: [''], secretName: ''}); } onDeleteTLS(i: number) { this.kubeResource.spec.tls.splice(i, 1); } + + onDeleteHost(i: number, j: number) { + this.kubeResource.spec.tls[i].hosts.splice(j, 1); + } + + onAddHost(i: number) { + this.kubeResource.spec.tls[i].hosts.push(''); + } + + onAddRule(event: Event) { + event.stopPropagation(); + const cngressRule = IngressRule.emptyObject(); + cngressRule.http.paths = []; + cngressRule.http.paths.push(this.defaultIngressPath()); + this.kubeResource.spec.rules.push(cngressRule); + } + + onDeleteRule(i: number) { + this.kubeResource.spec.rules.splice(i, 1); + } + + trackByFn(index, item) { + return index; + } } diff --git a/src/frontend/src/app/portal/statefulset/create-edit-statefulsettpl/create-edit-statefulsettpl.component.html b/src/frontend/src/app/portal/statefulset/create-edit-statefulsettpl/create-edit-statefulsettpl.component.html index 022faaae7..21f2bd49b 100644 --- a/src/frontend/src/app/portal/statefulset/create-edit-statefulsettpl/create-edit-statefulsettpl.component.html +++ b/src/frontend/src/app/portal/statefulset/create-edit-statefulsettpl/create-edit-statefulsettpl.component.html @@ -275,6 +275,16 @@

+ + +

diff --git a/src/frontend/src/app/portal/statefulset/create-edit-statefulsettpl/create-edit-statefulsettpl.component.ts b/src/frontend/src/app/portal/statefulset/create-edit-statefulsettpl/create-edit-statefulsettpl.component.ts index 1a8f0ba3f..4817452a5 100644 --- a/src/frontend/src/app/portal/statefulset/create-edit-statefulsettpl/create-edit-statefulsettpl.component.ts +++ b/src/frontend/src/app/portal/statefulset/create-edit-statefulsettpl/create-edit-statefulsettpl.component.ts @@ -268,6 +268,7 @@ export class CreateEditStatefulsettplComponent extends ContainerTpl implements O probe.httpGet = new HTTPGetAction(); probe.timeoutSeconds = 1; probe.periodSeconds = 10; + probe.initialDelaySeconds = 30; probe.failureThreshold = 10; } this.kubeResource.spec.template.spec.containers[i].readinessProbe = probe; diff --git a/src/frontend/src/app/shared/model/v1/kubernetes/ingress.ts b/src/frontend/src/app/shared/model/v1/kubernetes/ingress.ts index 5eb691ee9..c488ca56a 100644 --- a/src/frontend/src/app/shared/model/v1/kubernetes/ingress.ts +++ b/src/frontend/src/app/shared/model/v1/kubernetes/ingress.ts @@ -144,13 +144,13 @@ export class IntOrString { } export class IngressBackend { serviceName: string; - servicePort: IntOrString; + servicePort: number; static emptyObject(): IngressBackend { const result = new IngressBackend(); result.serviceName = ''; - result.servicePort = IntOrString.emptyObject(); + result.servicePort = 0; return result; } constructor(init?: IngressBackend) {