@xh/hoist 73.0.0-SNAPSHOT.1741880962992 → 73.0.0-SNAPSHOT.1741966377363

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Changelog
2
2
 
3
+ ## v73.0.0-SNAPSHOT - unreleased
4
+
3
5
  ## v72.2.0 - 2025-03-13
4
6
 
5
7
  ### 🎁 New Features
@@ -5,7 +5,6 @@
5
5
  * Copyright © 2025 Extremely Heavy Industries Inc.
6
6
  */
7
7
  import {HoistModel, LoadSpec, lookup, PlainObject, XH} from '@xh/hoist/core';
8
- import {StoreRecord} from '@xh/hoist/data';
9
8
  import {bindable} from '@xh/hoist/mobx';
10
9
  import {ServiceModel} from './ServiceModel';
11
10
 
@@ -14,7 +13,7 @@ export class DetailsModel extends HoistModel {
14
13
  parent: ServiceModel;
15
14
 
16
15
  @bindable.ref
17
- svcName: StoreRecord;
16
+ svcName: String;
18
17
 
19
18
  @bindable.ref
20
19
  stats: PlainObject;
@@ -11,6 +11,7 @@ import {errorMessage} from '@xh/hoist/cmp/error';
11
11
  import {panel} from '@xh/hoist/desktop/cmp/panel';
12
12
  import {jsonInput} from '@xh/hoist/desktop/cmp/input';
13
13
  import {Icon} from '@xh/hoist/icon';
14
+ import {isEmpty} from 'lodash';
14
15
 
15
16
  export const detailsPanel = hoistCmp.factory({
16
17
  model: creates(DetailsModel),
@@ -18,7 +19,7 @@ export const detailsPanel = hoistCmp.factory({
18
19
  render({model}) {
19
20
  const {svcName} = model;
20
21
  return panel({
21
- title: svcName ? `Stats: ${svcName}` : 'Stats',
22
+ title: svcName ?? 'Stats',
22
23
  mask: 'onLoad',
23
24
  icon: Icon.info(),
24
25
  compactHeader: true,
@@ -42,18 +43,22 @@ const stats = hoistCmp.factory<DetailsModel>({
42
43
  });
43
44
  }
44
45
 
45
- if (stats == null) return null;
46
-
47
- return panel(
48
- jsonInput({
49
- readonly: true,
50
- width: '100%',
51
- height: '100%',
52
- enableSearch: true,
53
- showFullscreenButton: false,
54
- editorProps: {lineNumbers: false},
55
- value: model.parent.fmtStats(stats)
56
- })
57
- );
46
+ return isEmpty(stats)
47
+ ? placeholder(
48
+ ...(loadModel.isPending
49
+ ? []
50
+ : [Icon.questionCircle(), 'This service does not report any admin stats.'])
51
+ )
52
+ : panel(
53
+ jsonInput({
54
+ readonly: true,
55
+ width: '100%',
56
+ height: '100%',
57
+ enableSearch: true,
58
+ showFullscreenButton: false,
59
+ editorProps: {lineNumbers: false},
60
+ value: model.parent.fmtStats(stats)
61
+ })
62
+ );
58
63
  }
59
64
  });
@@ -10,7 +10,7 @@ import {timestampNoYear} from '@xh/hoist/admin/columns';
10
10
  import {BaseInstanceModel} from '@xh/hoist/admin/tabs/cluster/instances/BaseInstanceModel';
11
11
  import {GridModel} from '@xh/hoist/cmp/grid';
12
12
  import {br, fragment} from '@xh/hoist/cmp/layout';
13
- import {LoadSpec, managed, XH} from '@xh/hoist/core';
13
+ import {LoadSpec, managed, PlainObject, XH} from '@xh/hoist/core';
14
14
  import {FilterLike, FilterTestFn, RecordActionSpec} from '@xh/hoist/data';
15
15
  import {Icon} from '@xh/hoist/icon';
16
16
  import {bindable, makeObservable} from '@xh/hoist/mobx';
@@ -52,15 +52,16 @@ export class ServiceModel extends BaseInstanceModel {
52
52
  selModel: 'multiple',
53
53
  enableExport: true,
54
54
  exportOptions: {filename: exportFilenameWithDate('services')},
55
+ groupBy: 'provider',
55
56
  store: {
56
57
  idSpec: 'name',
57
58
  processRawData: this.processRawData,
58
59
  fields: [
59
60
  {name: 'provider', type: 'string'},
60
61
  {name: 'name', type: 'string'},
61
- {name: 'displayName', type: 'string'},
62
+ {name: 'displayName', type: 'string', displayName: 'Service'},
62
63
  {name: 'initializedDate', type: 'date', displayName: 'Initialized'},
63
- {name: 'lastCachesCleared', type: 'date', displayName: 'Last Cleared'}
64
+ {name: 'lastCachesCleared', type: 'date', displayName: 'Caches Last Cleared'}
64
65
  ]
65
66
  },
66
67
  sortBy: ['provider', 'displayName'],
@@ -81,6 +82,7 @@ export class ServiceModel extends BaseInstanceModel {
81
82
  constructor() {
82
83
  super();
83
84
  makeObservable(this);
85
+
84
86
  this.addReaction({
85
87
  track: () => [this.textFilter, this.typeFilter],
86
88
  run: this.applyFilters,
@@ -91,6 +93,7 @@ export class ServiceModel extends BaseInstanceModel {
91
93
  async clearCachesAsync(entireCluster: boolean) {
92
94
  const {gridModel, instanceName, loadModel} = this,
93
95
  {selectedRecords} = gridModel;
96
+
94
97
  if (isEmpty(selectedRecords)) return;
95
98
 
96
99
  const cacheStr =
@@ -131,19 +134,24 @@ export class ServiceModel extends BaseInstanceModel {
131
134
  }
132
135
 
133
136
  override async doLoadAsync(loadSpec: LoadSpec) {
137
+ const {gridModel, instanceName: instance} = this;
134
138
  try {
135
139
  const data = await XH.fetchJson({
136
140
  url: 'serviceManagerAdmin/listServices',
137
- params: {instance: this.instanceName},
141
+ params: {instance},
138
142
  loadSpec
139
143
  });
140
- return this.gridModel.loadData(data);
144
+
145
+ if (!loadSpec.isStale) {
146
+ gridModel.loadData(data);
147
+ gridModel.preSelectFirstAsync();
148
+ }
141
149
  } catch (e) {
142
150
  this.handleLoadException(e, loadSpec);
143
151
  }
144
152
  }
145
153
 
146
- private processRawData(r) {
154
+ private processRawData(r: PlainObject) {
147
155
  const provider = r.name && r.name.startsWith('hoistCore') ? 'Hoist' : 'App';
148
156
  const displayName = lowerFirst(r.name.replace('hoistCore', ''));
149
157
  return {provider, displayName, ...r};
@@ -9,11 +9,11 @@ import {grid, gridCountLabel} from '@xh/hoist/cmp/grid';
9
9
  import {filler, hframe} from '@xh/hoist/cmp/layout';
10
10
  import {storeFilterField} from '@xh/hoist/cmp/store';
11
11
  import {creates, hoistCmp, uses} from '@xh/hoist/core';
12
- import {exportButton} from '@xh/hoist/desktop/cmp/button';
12
+ import {button, exportButton} from '@xh/hoist/desktop/cmp/button';
13
+ import {buttonGroupInput} from '@xh/hoist/desktop/cmp/input';
13
14
  import {panel} from '@xh/hoist/desktop/cmp/panel';
14
15
  import {recordActionBar} from '@xh/hoist/desktop/cmp/record';
15
16
  import {toolbar} from '@xh/hoist/desktop/cmp/toolbar';
16
- import {select} from '@xh/hoist/desktop/cmp/input';
17
17
  import {ServiceModel} from './ServiceModel';
18
18
 
19
19
  export const servicePanel = hoistCmp.factory({
@@ -52,15 +52,14 @@ const bbar = hoistCmp.factory({
52
52
  filler(),
53
53
  gridCountLabel({unit: 'service'}),
54
54
  '-',
55
- select({
56
- options: [
57
- {value: 'all', label: 'All'},
58
- {value: 'app', label: 'App Only'},
59
- {value: 'hoist', label: 'Hoist Only'}
60
- ],
61
- width: 125,
55
+ buttonGroupInput({
62
56
  bind: 'typeFilter',
63
- hideDropdownIndicator: true
57
+ outlined: true,
58
+ items: [
59
+ button({value: 'all', text: 'All'}),
60
+ button({value: 'app', text: 'App'}),
61
+ button({value: 'hoist', text: 'Hoist'})
62
+ ]
64
63
  }),
65
64
  storeFilterField({
66
65
  matchMode: 'any',
@@ -1,11 +1,10 @@
1
1
  import { HoistModel, LoadSpec, PlainObject } from '@xh/hoist/core';
2
- import { StoreRecord } from '@xh/hoist/data';
3
2
  import { ServiceModel } from './ServiceModel';
4
3
  export declare class DetailsModel extends HoistModel {
5
4
  parent: ServiceModel;
6
- svcName: StoreRecord;
5
+ svcName: String;
7
6
  stats: PlainObject;
8
- get selectedRecord(): StoreRecord;
7
+ get selectedRecord(): import("../../../../../data").StoreRecord;
9
8
  onLinked(): void;
10
9
  doLoadAsync(loadSpec: LoadSpec): Promise<void>;
11
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "73.0.0-SNAPSHOT.1741880962992",
3
+ "version": "73.0.0-SNAPSHOT.1741966377363",
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",