import * as vscode from 'vscode' ; import { Kubectl } from '../../kubectl' ; import * as kuberesources from '../../kuberesources' ; import { Host } from '../../host' ; import { ClusterExplorerNode , ClusterExplorerGroupingFolderNode } from './node' ; import { FolderNode } from './node.folder' ; import { ResourceFolderNode } from './node.folder.resource' ; import { NODE_TYPES } from './explorer' ; export abstract class GroupingFolderNode extends FolderNode implements ClusterExplorerGroupingFolderNode { static of ( id , displayName , ... kinds ) { return new ResourceKindsGroupingFolder ( id , displayName , kinds ) ; } constructor ( id , displayName , contextValue ? ) { super ( NODE_TYPES . folder . grouping , id , displayName , contextValue ) ; } readonly nodeType = NODE_TYPES . folder . grouping ; } export const workloadsGroupingFolder = ( ) => GroupingFolderNode . of ( "workload" , "Workloads" , kuberesources . allKinds . deployment , kuberesources . allKinds . statefulSet , kuberesources . allKinds . daemonSet , kuberesources . allKinds . job , kuberesources . allKinds . cronjob , kuberesources . allKinds . pod ) ; class ResourceKindsGroupingFolder extends GroupingFolderNode { constructor ( id , displayName , private readonly kinds ) { super ( id , displayName ) ; } getChildren ( _kubectl , _host ) { return this . kinds . map ( ( k ) => ResourceFolderNode . create ( k ) ) ; } } export const configurationGroupingFolder = ( ) => GroupingFolderNode . of ( "config" , "Configuration" , kuberesources . allKinds . configMap , kuberesources . allKinds . secret ) ; export const networkGroupingFolder = ( ) => GroupingFolderNode . of ( "network" , "Network" , kuberesources . allKinds . service , kuberesources . allKinds . endpoint , kuberesources . allKinds . ingress ) ; export const storageGroupingFolder = ( ) => GroupingFolderNode . of ( "storage" , "Storage" , kuberesources . allKinds . persistentVolume , kuberesources . allKinds . persistentVolumeClaim , kuberesources . allKinds . storageClass ) ;