Class: NamespaceStore#
Renderer.K8sApi.NamespaceStore
Hierarchy#
↳ NamespaceStore
Table of contents#
Constructors#
Properties#
- api
- bufferSize
- eventsBuffer
- failedLoading
- isLoaded
- isLoading
- items
- limit
- selectedItemsIds
- defaultContext
Accessors#
- allowedNamespaces
- context
- contextItems
- contextNamespaces
- contextReady
- hasAllContexts
- namespacesReady
- query
- selectedItems
- selectedNamespaces
Methods#
- [iterator]
- bindWatchEventsUpdater
- clearSelected
- create
- createItem
- defaultSorting
- filterItemsOnLoad
- getAllByNs
- getById
- getByLabel
- getByName
- getByPath
- getIndexById
- getItems
- getStatuses
- getTotalCount
- hasContext
- isSelected
- isSelectedAll
- load
- loadAll
- loadFromPath
- loadItem
- loadItems
- mergeItems
- onContextChange
- reloadAll
- remove
- removeItem
- removeSelectedItems
- reset
- resetOnError
- resetSelection
- select
- selectNamespaces
- sortItems
- subscribe
- toggleAll
- toggleContext
- toggleSelection
- toggleSelectionAll
- toggleSingle
- unselect
- update
- updateFromEventsBuffer
- updateItem
Constructors#
constructor#
• new NamespaceStore()
Overrides#
Properties#
api#
• api: NamespaceApi
Overrides#
bufferSize#
• Readonly bufferSize: number = 50000
Inherited from#
eventsBuffer#
• Protected eventsBuffer: IObservableArray<IKubeWatchEvent<KubeJsonApiData>>
Inherited from#
failedLoading#
• failedLoading: boolean = false
Inherited from#
isLoaded#
• isLoaded: boolean = false
Inherited from#
isLoading#
• isLoading: boolean = false
Inherited from#
items#
• items: IObservableArray<Namespace>
Inherited from#
limit#
• Optional Readonly limit: number
Inherited from#
selectedItemsIds#
• selectedItemsIds: ObservableMap<string, boolean>
Inherited from#
KubeObjectStore.selectedItemsIds
defaultContext#
▪ Static defaultContext: IObservableValue<ClusterContext>
Inherited from#
KubeObjectStore.defaultContext
Accessors#
allowedNamespaces#
• get allowedNamespaces(): string[]
Returns#
string[]
context#
• get context(): ClusterContext
Returns#
ClusterContext
contextItems#
• get contextItems(): T[]
Returns#
T[]
contextNamespaces#
• get contextNamespaces(): string[]
Returns#
string[]
contextReady#
• get contextReady(): Promisecancel: () => void }
Returns#
Promisecancel: () => void }
hasAllContexts#
• get hasAllContexts(): boolean
Returns#
boolean
namespacesReady#
• get namespacesReady(): Promisecancel: () => void }
Returns#
Promisecancel: () => void }
query#
• get query(): IKubeApiQueryParams
Returns#
IKubeApiQueryParams
selectedItems#
• get selectedItems(): Item[]
Returns#
Item[]
selectedNamespaces#
• get selectedNamespaces(): string[]
Returns#
string[]
Methods#
[iterator]#
▸ [iterator](): Generator<Namespace, void, undefined>
Returns#
Generator<Namespace, void, undefined>
Inherited from#
bindWatchEventsUpdater#
▸ Protected bindWatchEventsUpdater(delay?): void
Parameters#
| Name | Type | Default value |
|---|---|---|
delay |
number |
1000 |
Returns#
void
Inherited from#
KubeObjectStore.bindWatchEventsUpdater
clearSelected#
▸ clearSelected(namespaces?): void
Parameters#
| Name | Type |
|---|---|
namespaces? |
string | string[] |
Returns#
void
create#
▸ create(params, data?): Promise<Namespace>
Parameters#
| Name | Type |
|---|---|
params |
Object |
params.name |
string |
params.namespace? |
string |
data? |
Partial<Namespace> |
Returns#
Promise<Namespace>
Inherited from#
createItem#
▸ Protected createItem(params, data?): Promise<Namespace>
Parameters#
| Name | Type |
|---|---|
params |
Object |
params.name |
string |
params.namespace? |
string |
data? |
Partial<Namespace> |
Returns#
Promise<Namespace>
Inherited from#
defaultSorting#
▸ Protected defaultSorting(item): string
Parameters#
| Name | Type |
|---|---|
item |
Item |
Returns#
string
Inherited from#
KubeObjectStore.defaultSorting
filterItemsOnLoad#
▸ Protected filterItemsOnLoad(items): Namespace[]
Parameters#
| Name | Type |
|---|---|
items |
Namespace[] |
Returns#
Inherited from#
KubeObjectStore.filterItemsOnLoad
getAllByNs#
▸ getAllByNs(namespace, strict?): Namespace[]
Parameters#
| Name | Type | Default value |
|---|---|---|
namespace |
string | string[] |
undefined |
strict |
boolean |
false |
Returns#
Inherited from#
getById#
▸ getById(id): Namespace
Parameters#
| Name | Type |
|---|---|
id |
string |
Returns#
Inherited from#
getByLabel#
▸ getByLabel(labels): Namespace[]
Parameters#
| Name | Type |
|---|---|
labels |
string[] | { [label: string]: string; } |
Returns#
Inherited from#
getByName#
▸ getByName(name, namespace?): Namespace
Parameters#
| Name | Type |
|---|---|
name |
string |
namespace? |
string |
Returns#
Inherited from#
getByPath#
▸ getByPath(path): Namespace
Parameters#
| Name | Type |
|---|---|
path |
string |
Returns#
Inherited from#
getIndexById#
▸ getIndexById(id): number
Parameters#
| Name | Type |
|---|---|
id |
string |
Returns#
number
Inherited from#
getItems#
▸ getItems(): Namespace[]
Returns#
Inherited from#
getStatuses#
▸ Optional getStatuses(items): Record<string, number>
Parameters#
| Name | Type |
|---|---|
items |
Namespace[] |
Returns#
Record<string, number>
Inherited from#
getTotalCount#
▸ getTotalCount(): number
Returns#
number
Inherited from#
hasContext#
▸ hasContext(namespaces): boolean
Parameters#
| Name | Type |
|---|---|
namespaces |
string | string[] |
Returns#
boolean
isSelected#
▸ isSelected(item): boolean
Parameters#
| Name | Type |
|---|---|
item |
Namespace |
Returns#
boolean
Inherited from#
isSelectedAll#
▸ isSelectedAll(visibleItems?): boolean
Parameters#
| Name | Type |
|---|---|
visibleItems |
Namespace[] |
Returns#
boolean
Inherited from#
load#
▸ load(params): Promise<Namespace>
Parameters#
| Name | Type |
|---|---|
params |
Object |
params.name |
string |
params.namespace? |
string |
Returns#
Promise<Namespace>
Inherited from#
loadAll#
▸ loadAll(options?): Promise<void | Namespace[]>
Parameters#
| Name | Type |
|---|---|
options |
Object |
options.merge? |
boolean |
options.namespaces? |
string[] |
options.reqInit? |
RequestInit |
Returns#
Promise<void | Namespace[]>
Inherited from#
loadFromPath#
▸ loadFromPath(resourcePath): Promise<Namespace>
Parameters#
| Name | Type |
|---|---|
resourcePath |
string |
Returns#
Promise<Namespace>
Inherited from#
loadItem#
▸ Protected loadItem(params): Promise<Namespace>
Parameters#
| Name | Type |
|---|---|
params |
Object |
params.name |
string |
params.namespace? |
string |
Returns#
Promise<Namespace>
Inherited from#
loadItems#
▸ Protected loadItems(params): Promise<Namespace[]>
Parameters#
| Name | Type |
|---|---|
params |
KubeObjectStoreLoadingParams<Namespace> |
Returns#
Promise<Namespace[]>
Overrides#
mergeItems#
▸ Protected mergeItems(partialItems, __namedParameters?): Namespace[]
Parameters#
| Name | Type |
|---|---|
partialItems |
Namespace[] |
__namedParameters |
Object |
__namedParameters.filter |
|
__namedParameters.replace |
|
__namedParameters.sort |
|
__namedParameters.updateStore |
Returns#
Inherited from#
onContextChange#
▸ onContextChange(callback, opts?): IReactionDisposer
Parameters#
| Name | Type |
|---|---|
callback |
(namespaces: string[]) => void |
opts |
IReactionOptions |
Returns#
IReactionDisposer
reloadAll#
▸ reloadAll(opts?): Promise<void | Namespace[]>
Parameters#
| Name | Type |
|---|---|
opts |
Object |
opts.force? |
boolean |
opts.merge? |
boolean |
opts.namespaces? |
string[] |
Returns#
Promise<void | Namespace[]>
Inherited from#
remove#
▸ remove(item): Promise<void>
Parameters#
| Name | Type |
|---|---|
item |
Namespace |
Returns#
Promise<void>
Overrides#
removeItem#
▸ Protected removeItem(item, request): Promise<void>
Parameters#
| Name | Type |
|---|---|
item |
Namespace |
request |
() => Promise<any> |
Returns#
Promise<void>
Inherited from#
removeSelectedItems#
▸ removeSelectedItems(): Promise<void[]>
Returns#
Promise<void[]>
Inherited from#
KubeObjectStore.removeSelectedItems
reset#
▸ reset(): void
Returns#
void
Inherited from#
resetOnError#
▸ Protected resetOnError(error): void
Parameters#
| Name | Type |
|---|---|
error |
any |
Returns#
void
Inherited from#
resetSelection#
▸ resetSelection(): void
Returns#
void
Inherited from#
KubeObjectStore.resetSelection
select#
▸ select(item): void
Parameters#
| Name | Type |
|---|---|
item |
Namespace |
Returns#
void
Inherited from#
selectNamespaces#
▸ selectNamespaces(namespace): void
Parameters#
| Name | Type |
|---|---|
namespace |
string | string[] |
Returns#
void
sortItems#
▸ Protected sortItems(items?, sorting?, order?): Namespace[]
Return items sorted by the given ordering functions. If two elements of
items are sorted to the same "index" then the next sorting function is used
to determine where to place them relative to each other. Once the sorting
functions have been all exhausted then the order is unchanged (ie a stable sort).
Parameters#
| Name | Type | Description |
|---|---|---|
items |
Namespace[] | the items to be sorted (default: the current items in this store) |
sorting |
(item: Namespace) => any[] |
list of functions to determine sort order (default: sorting by name) |
order? |
"desc" | "asc" |
whether to sort from least to greatest ("asc" (default)) or vice-versa ("desc") |
Returns#
Inherited from#
subscribe#
▸ subscribe(): args: T) => void
Returns#
fn
▸ <T>(...args): void
A function that does nothing
Type parameters#
| Name | Type |
|---|---|
T |
T: any[] |
Parameters#
| Name | Type |
|---|---|
...args |
T |
Returns#
void
Overrides#
toggleAll#
▸ toggleAll(showAll?): void
Parameters#
| Name | Type |
|---|---|
showAll? |
boolean |
Returns#
void
toggleContext#
▸ toggleContext(namespaces): void
Parameters#
| Name | Type |
|---|---|
namespaces |
string | string[] |
Returns#
void
toggleSelection#
▸ toggleSelection(item): void
Parameters#
| Name | Type |
|---|---|
item |
Namespace |
Returns#
void
Inherited from#
KubeObjectStore.toggleSelection
toggleSelectionAll#
▸ toggleSelectionAll(visibleItems?): void
Parameters#
| Name | Type |
|---|---|
visibleItems |
Namespace[] |
Returns#
void
Inherited from#
KubeObjectStore.toggleSelectionAll
toggleSingle#
▸ toggleSingle(namespace): void
Parameters#
| Name | Type |
|---|---|
namespace |
string |
Returns#
void
unselect#
▸ unselect(item): void
Parameters#
| Name | Type |
|---|---|
item |
Namespace |
Returns#
void
Inherited from#
update#
▸ update(item, data): Promise<Namespace>
Parameters#
| Name | Type |
|---|---|
item |
Namespace |
data |
Partial<Namespace> |
Returns#
Promise<Namespace>
Inherited from#
updateFromEventsBuffer#
▸ Protected updateFromEventsBuffer(): void
Returns#
void
Inherited from#
KubeObjectStore.updateFromEventsBuffer
updateItem#
▸ Protected updateItem(item, request): Promise<Namespace>
Parameters#
| Name | Type |
|---|---|
item |
Namespace |
request |
() => Promise<Namespace> |
Returns#
Promise<Namespace>