@xh/hoist 72.0.0-SNAPSHOT.1737676613505 → 72.0.0-SNAPSHOT.1737725354262

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,12 +17,11 @@ import {memoryMonitorPanel} from '@xh/hoist/admin/tabs/cluster/instances/memory/
17
17
  import {servicePanel} from '@xh/hoist/admin/tabs/cluster/instances/services/ServicePanel';
18
18
  import {webSocketPanel} from '@xh/hoist/admin/tabs/cluster/instances/websocket/WebSocketPanel';
19
19
  import {badge} from '@xh/hoist/cmp/badge';
20
- import {GridModel, numberCol} from '@xh/hoist/cmp/grid';
20
+ import {GridContextMenuSpec, GridModel, numberCol} from '@xh/hoist/cmp/grid';
21
21
  import {hbox} from '@xh/hoist/cmp/layout';
22
22
  import {getRelativeTimestamp} from '@xh/hoist/cmp/relativetimestamp';
23
23
  import {TabContainerModel, TabModel} from '@xh/hoist/cmp/tab';
24
24
  import {HoistModel, LoadSpec, lookup, managed, PlainObject, XH} from '@xh/hoist/core';
25
- import {RecordActionSpec} from '@xh/hoist/data';
26
25
  import {Icon} from '@xh/hoist/icon';
27
26
  import {makeObservable} from '@xh/hoist/mobx';
28
27
  import {Timer} from '@xh/hoist/utils/async';
@@ -38,15 +37,6 @@ export class InstancesTabModel extends HoistModel {
38
37
  @managed readonly tabContainerModel: TabContainerModel = this.createTabContainerModel();
39
38
  @managed readonly timer: Timer;
40
39
 
41
- shutdownAction: RecordActionSpec = {
42
- icon: Icon.skull(),
43
- text: 'Shutdown Instance',
44
- intent: 'danger',
45
- actionFn: ({record}) => this.shutdownInstanceAsync(record.data),
46
- displayFn: () => ({hidden: AppModel.readonly}),
47
- recordsRequired: 1
48
- };
49
-
50
40
  get instance(): PlainObject {
51
41
  return this.gridModel.selectedRecord?.data;
52
42
  }
@@ -182,10 +172,25 @@ export class InstancesTabModel extends HoistModel {
182
172
  rendererIsComplex: true
183
173
  }
184
174
  ],
185
- contextMenu: [this.shutdownAction, '-', ...GridModel.defaultContextMenu]
175
+ contextMenu: this.createContextMenu()
186
176
  });
187
177
  }
188
178
 
179
+ private createContextMenu(): GridContextMenuSpec {
180
+ return [
181
+ {
182
+ icon: Icon.skull(),
183
+ text: 'Shutdown Instance',
184
+ intent: 'danger',
185
+ actionFn: ({record}) => this.shutdownInstanceAsync(record.data),
186
+ displayFn: () => ({hidden: AppModel.readonly}),
187
+ recordsRequired: 1
188
+ },
189
+ '-',
190
+ ...GridModel.defaultContextMenu
191
+ ];
192
+ }
193
+
189
194
  private createTabContainerModel() {
190
195
  return new TabContainerModel({
191
196
  route: 'default.cluster.instances',
@@ -1,7 +1,6 @@
1
1
  import { GridModel } from '@xh/hoist/cmp/grid';
2
2
  import { TabContainerModel } from '@xh/hoist/cmp/tab';
3
3
  import { HoistModel, LoadSpec, PlainObject } from '@xh/hoist/core';
4
- import { RecordActionSpec } from '@xh/hoist/data';
5
4
  import { Timer } from '@xh/hoist/utils/async';
6
5
  import { ReactNode } from 'react';
7
6
  export declare class InstancesTabModel extends HoistModel {
@@ -12,7 +11,6 @@ export declare class InstancesTabModel extends HoistModel {
12
11
  readonly gridModel: GridModel;
13
12
  readonly tabContainerModel: TabContainerModel;
14
13
  readonly timer: Timer;
15
- shutdownAction: RecordActionSpec;
16
14
  get instance(): PlainObject;
17
15
  get instanceName(): string;
18
16
  get isMultiInstance(): boolean;
@@ -21,6 +19,7 @@ export declare class InstancesTabModel extends HoistModel {
21
19
  constructor();
22
20
  formatInstance(instance: PlainObject): ReactNode;
23
21
  private createGridModel;
22
+ private createContextMenu;
24
23
  private createTabContainerModel;
25
24
  private shutdownInstanceAsync;
26
25
  private get autoRefreshInterval();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "72.0.0-SNAPSHOT.1737676613505",
3
+ "version": "72.0.0-SNAPSHOT.1737725354262",
4
4
  "description": "Hoist add-on for building and deploying React Applications.",
5
5
  "repository": "github:xh/hoist-react",
6
6
  "homepage": "https://xh.io",