-
Notifications
You must be signed in to change notification settings - Fork 831
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #254 from wilhelmguo/feature/add_kubernetes_pod_re…
…source Feature/add kubernetes pod resource
- Loading branch information
Showing
30 changed files
with
3,563 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/frontend/src/app/admin/kubernetes/pod/kube-pod.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<div class="clr-row"> | ||
<div class="clr-col-lg-12 clr-col-md-12 clr-col-sm-12 clr-col-xs-12"> | ||
<div class="table-search"> | ||
<div class="table-search-left"> | ||
<button class="wayne-button normal" (click)="createResource()"> | ||
{{'ADMIN.KUBERNETES.POD.CREATE' | translate}} | ||
</button> | ||
<button class="wayne-button normal" (click)="retrieveResource()"> | ||
{{'ADMIN.KUBERNETES.ACTION.REFRESH' | translate}} | ||
</button> | ||
<wayne-filter-box (confirm)="onConfirmEvent()" (cancel)="onCancelEvent()"> | ||
<wayne-checkbox-group [(ngModel)]="showList"> | ||
<wayne-checkbox value="name">{{'ADMIN.KUBERNETES.POD.LIST.NAME' | translate}}</wayne-checkbox> | ||
<wayne-checkbox value="label">{{'ADMIN.KUBERNETES.POD.LIST.LABEL' | translate}}</wayne-checkbox> | ||
<wayne-checkbox value="images">{{'ADMIN.KUBERNETES.POD.LIST.IMAGES' | translate}}</wayne-checkbox> | ||
<wayne-checkbox value="status"> {{'ADMIN.KUBERNETES.POD.LIST.STATUS' | translate}}</wayne-checkbox> | ||
<wayne-checkbox value="podIP">{{'ADMIN.KUBERNETES.POD.LIST.PODIP' | translate}}</wayne-checkbox> | ||
<wayne-checkbox value="node">{{'ADMIN.KUBERNETES.POD.LIST.NODE' | translate}}</wayne-checkbox> | ||
<wayne-checkbox value="restartCount">{{'ADMIN.KUBERNETES.POD.LIST.RESTARTCOUNT' | translate}}</wayne-checkbox> | ||
<wayne-checkbox value="age">{{'ADMIN.KUBERNETES.POD.LIST.AGE' | translate}}</wayne-checkbox> | ||
</wayne-checkbox-group> | ||
</wayne-filter-box> | ||
<label for="namespace_name" class="clr-col-md-3">{{'ADMIN.KUBERNETES.LABEL.NAMESPACE' | translate}}</label> | ||
<wayne-select [(ngModel)]="namespace" (change)="retrieveResource()" | ||
searchable | ||
name="namespace_name" | ||
[placeholder]="'PLACEHOLDER.CHOOSE' | translate" | ||
style="margin-left: 12px;"> | ||
<wayne-option *ngFor="let ns of namespaces" [value]="ns">{{ns}}</wayne-option> | ||
</wayne-select> | ||
</div> | ||
</div> | ||
|
||
<wayne-list-pod | ||
[resources]="resources" | ||
[showState]="showState" | ||
(delete)="onDeleteResourceEvent($event)" | ||
(edit)="onEditResourceEvent($event)" | ||
[page]="pageState.page" | ||
(paginate)="retrieveResource($event)"> | ||
</wayne-list-pod> | ||
</div> | ||
</div> | ||
<deletion-dialog (outputObj)="confirmDeleteEvent($event)"></deletion-dialog> | ||
<wayne-ace-editor (createOutputObj)="onCreateResourceEvent($event)" (outputObj)="onSaveResourceEvent($event)"></wayne-ace-editor> | ||
<wayne-float-window value="{{ cluster }}"> | ||
<wayne-float-window-item *ngFor="let cluster of clusters" [value]="cluster" | ||
(click)="jumpToHref(cluster)"></wayne-float-window-item> | ||
</wayne-float-window> |
63 changes: 63 additions & 0 deletions
63
src/frontend/src/app/admin/kubernetes/pod/kube-pod.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core'; | ||
import { ActivatedRoute, Router } from '@angular/router'; | ||
import { ConfirmationDialogService } from '../../../shared/confirmation-dialog/confirmation-dialog.service'; | ||
import { MessageHandlerService } from '../../../shared/message-handler/message-handler.service'; | ||
import { ClusterService } from '../../../shared/client/v1/cluster.service'; | ||
import { AuthService } from '../../../shared/auth/auth.service'; | ||
import { AceEditorComponent } from '../../../shared/ace-editor/ace-editor.component'; | ||
import { ListPodComponent } from './list-pod/list-pod.component'; | ||
import { KubernetesClient } from '../../../shared/client/v1/kubernetes/kubernetes'; | ||
import { KubeResourcePod } from '../../../shared/shared.const'; | ||
import { KubernetesNamespacedResource } from '../../../shared/base/kubernetes-namespaced/kubernetes-namespaced-resource'; | ||
import { DeletionDialogComponent } from '../../../shared/deletion-dialog/deletion-dialog.component'; | ||
|
||
const showState = { | ||
'name': {hidden: false}, | ||
'label': {hidden: false}, | ||
'images': {hidden: false}, | ||
'status': {hidden: false}, | ||
'podIP': {hidden: false}, | ||
'node': {hidden: false}, | ||
'restartCount': {hidden: false}, | ||
'age': {hidden: false}, | ||
}; | ||
|
||
@Component({ | ||
selector: 'wayne-kube-pod', | ||
templateUrl: './kube-pod.component.html' | ||
}) | ||
|
||
export class KubePodComponent extends KubernetesNamespacedResource implements OnInit, OnDestroy { | ||
@ViewChild(ListPodComponent) | ||
listResourceComponent: ListPodComponent; | ||
|
||
@ViewChild(AceEditorComponent) | ||
aceEditorModal: AceEditorComponent; | ||
|
||
@ViewChild(DeletionDialogComponent) | ||
deletionDialogComponent: DeletionDialogComponent; | ||
|
||
constructor(public kubernetesClient: KubernetesClient, | ||
public route: ActivatedRoute, | ||
public router: Router, | ||
public clusterService: ClusterService, | ||
public authService: AuthService, | ||
public messageHandlerService: MessageHandlerService) { | ||
super(kubernetesClient, route, router, clusterService, authService, messageHandlerService); | ||
super.registResourceType('pod'); | ||
super.registKubeResource(KubeResourcePod); | ||
super.registShowSate(showState); | ||
} | ||
|
||
ngOnInit() { | ||
super.ngOnInit(); | ||
} | ||
|
||
ngOnDestroy(): void { | ||
super.ngOnDestroy(); | ||
} | ||
|
||
|
||
|
||
|
||
} |
29 changes: 29 additions & 0 deletions
29
src/frontend/src/app/admin/kubernetes/pod/kube-pod.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { SharedModule } from '../../../shared/shared.module'; | ||
import { ReactiveFormsModule } from '@angular/forms'; | ||
import { KubePodComponent } from './kube-pod.component'; | ||
import { ListPodComponent } from './list-pod/list-pod.component'; | ||
import { KubernetesClient } from '../../../shared/client/v1/kubernetes/kubernetes'; | ||
import { DeletionDialogModule } from '../../../shared/deletion-dialog/deletion-dialog.module'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
SharedModule, | ||
ReactiveFormsModule, | ||
DeletionDialogModule | ||
], | ||
providers: [ | ||
KubernetesClient | ||
], | ||
exports: [ | ||
KubePodComponent, | ||
ListPodComponent | ||
], | ||
declarations: [ | ||
KubePodComponent, | ||
ListPodComponent | ||
] | ||
}) | ||
|
||
export class KubePodModule { | ||
} |
Oops, something went wrong.