Skip to content

Commit 59c78e8

Browse files
committed
Minor updates to Admin Cluster tabs
- Move log file filter/instance selection to top for more visibility - Tweak a few config dialogs / grid col headers for consistency / extra polish.
1 parent c04e7f2 commit 59c78e8

File tree

5 files changed

+31
-23
lines changed

5 files changed

+31
-23
lines changed

admin/tabs/cluster/instances/InstancesTabModel.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export class InstancesTabModel extends HoistModel {
149149
},
150150
{
151151
...usedHeapMb,
152-
headerName: 'Heap (MB)'
152+
headerName: 'Heap (mb)'
153153
},
154154
{
155155
...usedPctMax,
@@ -214,11 +214,12 @@ export class InstancesTabModel extends HoistModel {
214214
private async shutdownInstanceAsync(instance: PlainObject) {
215215
if (
216216
!(await XH.confirm({
217-
message: `Are you SURE you want to shutdown instance ${instance.name}?`,
217+
message: `Are you sure you wish to immediately terminate instance ${instance.name}?`,
218218
confirmProps: {
219219
icon: Icon.skull(),
220-
text: 'Shutdown Now',
220+
text: 'Yes, kill the instance',
221221
intent: 'danger',
222+
outlined: true,
222223
autoFocus: false
223224
}
224225
}))

admin/tabs/cluster/instances/logs/LogDisplay.ts

+12-14
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
*/
77
import {clock} from '@xh/hoist/cmp/clock';
88
import {grid} from '@xh/hoist/cmp/grid';
9-
import {code, filler, fragment, hspacer, label, placeholder} from '@xh/hoist/cmp/layout';
9+
import {filler, fragment, hspacer, label, placeholder} from '@xh/hoist/cmp/layout';
10+
import {loadingIndicator} from '@xh/hoist/cmp/loadingindicator';
1011
import {hoistCmp, uses, XH} from '@xh/hoist/core';
1112
import {button, modalToggleButton} from '@xh/hoist/desktop/cmp/button';
1213
import {gridFindField} from '@xh/hoist/desktop/cmp/grid';
1314
import {numberInput, switchInput, textInput} from '@xh/hoist/desktop/cmp/input';
14-
import {loadingIndicator} from '@xh/hoist/cmp/loadingindicator';
1515
import {panel} from '@xh/hoist/desktop/cmp/panel';
1616
import {toolbar, toolbarSep} from '@xh/hoist/desktop/cmp/toolbar';
1717
import {Icon} from '@xh/hoist/icon';
@@ -48,7 +48,7 @@ const tbar = hoistCmp.factory<LogDisplayModel>(({model}) => {
4848
numberInput({
4949
bind: 'startLine',
5050
min: 1,
51-
width: 80,
51+
width: 70,
5252
disabled: model.tail,
5353
displayWithCommas: true
5454
}),
@@ -57,13 +57,13 @@ const tbar = hoistCmp.factory<LogDisplayModel>(({model}) => {
5757
numberInput({
5858
bind: 'maxLines',
5959
min: 1,
60-
width: 80,
60+
width: 70,
6161
displayWithCommas: true
6262
}),
6363
'-',
6464
textInput({
6565
bind: 'pattern',
66-
placeholder: 'Filter',
66+
placeholder: 'Filter lines...',
6767
leftIcon: Icon.filter(),
6868
flex: 1,
6969
rightElement: fragment(
@@ -85,7 +85,7 @@ const tbar = hoistCmp.factory<LogDisplayModel>(({model}) => {
8585
})
8686
)
8787
}),
88-
gridFindField({flex: 1}),
88+
gridFindField({flex: 1, placeholder: 'Find lines...'}),
8989
'-',
9090
switchInput({
9191
bind: 'tail',
@@ -123,16 +123,14 @@ const bbar = hoistCmp.factory<LogDisplayModel>({
123123
}),
124124
filler(),
125125
Icon.clock(),
126-
code(
127-
clock({
128-
timezone: zone,
129-
format: 'HH:mm',
130-
suffix: fmtTimeZone(zone, offset)
131-
})
132-
),
126+
clock({
127+
timezone: zone,
128+
format: 'HH:mm',
129+
suffix: fmtTimeZone(zone, offset)
130+
}),
133131
fragment({
134132
omit: !logRootPath,
135-
items: [toolbarSep(), Icon.folder(), code(logRootPath)]
133+
items: [toolbarSep(), Icon.folder({className: 'xh-margin-right'}), logRootPath]
136134
})
137135
);
138136
}

admin/tabs/cluster/instances/logs/LogViewer.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* Copyright © 2025 Extremely Heavy Industries Inc.
66
*/
77
import {logLevelDialog} from '@xh/hoist/admin/tabs/cluster/instances/logs/levels/LogLevelDialog';
8-
import {grid} from '@xh/hoist/cmp/grid';
9-
import {hframe} from '@xh/hoist/cmp/layout';
8+
import {grid, gridCountLabel} from '@xh/hoist/cmp/grid';
9+
import {filler, hframe} from '@xh/hoist/cmp/layout';
1010
import {storeFilterField} from '@xh/hoist/cmp/store';
1111
import {creates, hoistCmp} from '@xh/hoist/core';
1212
import {errorMessage} from '@xh/hoist/cmp/error';
@@ -37,9 +37,8 @@ export const logViewer = hoistCmp.factory({
3737
side: 'left',
3838
defaultSize: 380
3939
},
40-
item: grid(),
41-
bbar: [
42-
storeFilterField({flex: 1}),
40+
tbar: [
41+
storeFilterField({flex: 1, placeholder: 'Filter files...'}),
4342
select({
4443
leftIcon: Icon.server(),
4544
bind: 'instanceOnly',
@@ -53,6 +52,8 @@ export const logViewer = hoistCmp.factory({
5352
]
5453
})
5554
],
55+
item: grid(),
56+
bbar: [filler(), gridCountLabel({unit: 'log file'})],
5657
mask: 'onLoad'
5758
}),
5859
logDisplay(),

admin/tabs/cluster/instances/logs/LogViewerModel.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {RecordActionSpec} from '@xh/hoist/data';
1313
import {compactDateRenderer, fmtNumber} from '@xh/hoist/format';
1414
import {Icon} from '@xh/hoist/icon';
1515
import {bindable, makeObservable, observable} from '@xh/hoist/mobx';
16+
import {pluralize} from '@xh/hoist/utils/js';
1617
import download from 'downloadjs';
1718
import {LogDisplayModel} from './LogDisplayModel';
1819

@@ -119,7 +120,13 @@ export class LogViewerModel extends BaseInstanceModel {
119120
if (!count) return;
120121

121122
const confirmed = await XH.confirm({
122-
message: `Delete ${count} log files on the server? This cannot be undone.`
123+
message: `Are you sure you want to delete ${pluralize('log file', count, true)}? This cannot be undone.`,
124+
confirmProps: {
125+
text: `Yes, delete the ${pluralize('file', count)}`,
126+
intent: 'danger',
127+
outlined: true,
128+
autoFocus: false
129+
}
123130
});
124131
if (!confirmed) return;
125132

admin/tabs/cluster/instances/memory/MemoryMonitorModel.ts

+1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ export class MemoryMonitorModel extends BaseInstanceModel {
131131
},
132132
{
133133
groupId: 'GC',
134+
headerName: 'Garbage Collection',
134135
headerAlign: 'center',
135136
children: [collectionCount, avgCollectionTime, pctCollectionTime]
136137
}

0 commit comments

Comments
 (0)