tabby-group-server-stats 1.7.4 → 1.7.5

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.
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tabby-group-server-stats",
3
- "version": "1.7.4",
3
+ "version": "1.7.5",
4
4
  "description": "Tabby server monitoring: CPU, memory, disk, network and GPU metrics with grouped labels and hover details. Tabby 服务器监控:显存、磁盘、网络、自定义指标与多标签组。",
5
5
  "keywords": [
6
6
  "tabby-plugin",
@@ -54,7 +54,9 @@
54
54
  "PUBLISHING.zh-CN.md",
55
55
  "README.en.md",
56
56
  "presets.json",
57
- "docs/images"
57
+ "docs/images",
58
+ "docs/tutorial.zh-CN.pdf",
59
+ "docs/tutorial.en.pdf"
58
60
  ],
59
61
  "repository": {
60
62
  "type": "git",
@@ -1,16 +1,22 @@
1
1
  import { CustomMetric, CustomMetricGroup } from './metric-model';
2
- export type BuiltinMetricKey = 'cpu' | 'ram' | 'disk' | 'net';
2
+ export type BuiltinMetricKey = 'ram' | 'net' | 'load';
3
+ export type LegacyBuiltinMetricKey = 'cpu' | 'disk';
4
+ type StoredBuiltinMetricKey = BuiltinMetricKey | LegacyBuiltinMetricKey;
3
5
  export interface BuiltinDefinitions {
4
6
  cpu: CustomMetric;
5
7
  ram: CustomMetric;
6
8
  disk: CustomMetric;
7
9
  net: CustomMetricGroup;
10
+ load: CustomMetricGroup;
8
11
  }
9
12
  export interface BuiltinConfig {
10
- defaultMetrics?: Partial<Record<BuiltinMetricKey, boolean>>;
13
+ defaultMetrics?: Partial<Record<StoredBuiltinMetricKey, boolean>>;
11
14
  defaultMetricOverrides?: Partial<BuiltinDefinitions>;
12
15
  showDefaultIcons?: boolean;
13
- builtinOrder?: BuiltinMetricKey[];
16
+ builtinOrder?: StoredBuiltinMetricKey[];
17
+ builtinDefaultsVersion?: number;
18
+ customMetrics?: CustomMetric[];
19
+ metricGroups?: CustomMetricGroup[];
14
20
  }
15
21
  /** Keep disabled slots in the saved order; only the visible definitions are filtered. */
16
22
  export declare function normalizeBuiltinOrder(value?: readonly unknown[]): BuiltinMetricKey[];
@@ -19,8 +25,10 @@ export interface OrderedMetricItem {
19
25
  metric?: CustomMetric;
20
26
  group?: CustomMetricGroup;
21
27
  }
22
- /** Mix built-in singles and the network group before the unchanged custom item order. */
28
+ /** Mix built-in singles and groups before the unchanged custom item order. */
23
29
  export declare function orderBuiltinItems(metrics: CustomMetric[], groups: CustomMetricGroup[], order?: readonly unknown[]): OrderedMetricItem[];
30
+ /** Load is normalized by logical processor count, not the busy-CPU percentage. */
31
+ export declare function createCpuLoadCommand(minutes: 1 | 5, detail?: boolean): string;
24
32
  /** Each sample owns its shell variables; concurrent panes never share a temp file. */
25
33
  export declare function createCpuSampleCommand(counter?: 'busy' | 'iowait' | 'steal'): string;
26
34
  export declare function createNetworkRateCommand(direction: 'rx' | 'tx' | 'total'): string;
@@ -28,9 +36,12 @@ export declare function createNetworkDetailCommand(direction: 'rx' | 'tx' | 'tot
28
36
  /** Fresh objects are returned so settings drafts cannot mutate the factory defaults. */
29
37
  export declare function getBuiltinDefaults(): BuiltinDefinitions;
30
38
  /** Editing ignores legacy visibility switches so a disabled built-in can be configured. */
31
- export declare function getBuiltinDefinition<K extends BuiltinMetricKey>(key: K, conf?: BuiltinConfig): BuiltinDefinitions[K];
39
+ export declare function getBuiltinDefinition<K extends StoredBuiltinMetricKey>(key: K, conf?: BuiltinConfig): BuiltinDefinitions[K];
32
40
  /** UI and collection consume the same editable built-in definitions. */
33
41
  export declare function getBuiltinDefinitions(conf?: BuiltinConfig): {
34
42
  customMetrics: CustomMetric[];
35
43
  metricGroups: CustomMetricGroup[];
36
44
  };
45
+ /** One-time, lossless upgrade; the caller saves config only when this returns true. */
46
+ export declare function migrateLegacyBuiltinConfig(conf: BuiltinConfig): boolean;
47
+ export {};
@@ -4,6 +4,7 @@ import { AppService, ConfigService } from 'tabby-core';
4
4
  import { StatsService } from '../services/stats.service';
5
5
  import { CustomMetric, CustomMetricGroup } from '../config';
6
6
  import { BuiltinMetricKey } from '../builtin-metrics';
7
+ import { PaneGroupMode } from '../services/metric-scope.service';
7
8
  export declare class ServerStatsBottomBarComponent implements OnInit, OnDestroy {
8
9
  private statsService;
9
10
  private config;
@@ -13,6 +14,14 @@ export declare class ServerStatsBottomBarComponent implements OnInit, OnDestroy
13
14
  private sanitizer;
14
15
  visible: boolean;
15
16
  paneVisible: boolean;
17
+ menuOpen: boolean;
18
+ menuPosition: {
19
+ left: number;
20
+ top: number;
21
+ };
22
+ paneGroupMode: PaneGroupMode | undefined;
23
+ private paneToggle?;
24
+ private paneMenu?;
16
25
  loading: boolean;
17
26
  currentStats: any;
18
27
  customMetrics: CustomMetric[];
@@ -37,6 +46,17 @@ export declare class ServerStatsBottomBarComponent implements OnInit, OnDestroy
37
46
  private canDisplay;
38
47
  private isCurrentRequest;
39
48
  togglePaneVisibility(): void;
49
+ setPaneVisibility(visible: boolean): void;
50
+ setPaneGroupMode(mode: PaneGroupMode): void;
51
+ togglePaneMenu(event?: Event): void;
52
+ private positionPaneMenu;
53
+ private menuButtons;
54
+ private closePaneMenu;
55
+ onToggleKeydown(event: KeyboardEvent): void;
56
+ onMenuKeydown(event: KeyboardEvent): void;
57
+ onDocumentKeydown(event: KeyboardEvent): void;
58
+ onOutsideInteraction(event: Event): void;
59
+ onViewportResize(): void;
40
60
  renderExternalStats(stats: any | null): void;
41
61
  setExternalLoading(isLoading: boolean): void;
42
62
  hideExternal(): void;
@@ -21,6 +21,7 @@ export declare class MetricStripComponent implements OnInit, OnChanges, OnDestro
21
21
  session: any;
22
22
  autoDetailMetric: string | null;
23
23
  groupPopup?: ElementRef<HTMLElement>;
24
+ singlePopup?: ElementRef<HTMLElement>;
24
25
  carouselSlots?: QueryList<ElementRef<HTMLElement>>;
25
26
  private portal;
26
27
  private carouselWidths;
@@ -85,6 +86,9 @@ export declare class MetricStripComponent implements OnInit, OnChanges, OnDestro
85
86
  private updateCarousel;
86
87
  expanded(group: CustomMetricGroup, metric: CustomMetric): boolean;
87
88
  enterMetric(metric: CustomMetric): void;
89
+ enterSingle(metric: CustomMetric, event: Event): void;
90
+ keepSingle(metric: CustomMetric): void;
91
+ leaveSingle(metric: CustomMetric): void;
88
92
  leaveMetric(metric: CustomMetric): void;
89
93
  enterChild(group: CustomMetricGroup, metric: CustomMetric): void;
90
94
  enterGroup(group: CustomMetricGroup, event: Event): void;
@@ -98,6 +98,11 @@ export declare class ServerStatsSettingsComponent {
98
98
  get metricGroups(): CustomMetricGroup[];
99
99
  get metricEditorTitle(): string;
100
100
  private uiText;
101
+ openTutorial(): void;
102
+ private copyLabel;
103
+ private independentCopy;
104
+ copyGroup(index: number): void;
105
+ copyChild(index: number): void;
101
106
  groupModeLabel(mode: string): string;
102
107
  groupModeHelp(mode: string): string;
103
108
  private newId;
@@ -3,10 +3,12 @@ import { CustomMetric, CustomMetricGroup, ColorCondition } from './metric-model'
3
3
  export { CustomMetric, CustomMetricGroup, ColorCondition, ConditionOperator, MetricStatus, MetricResult, DisplayScope } from './metric-model';
4
4
  export { getSvgPresetPath, isSvgPreset, isUrlOrDataUri, isFaIcon, formatFontAwesomeIcon, TECH_ICON_PATHS, POPULAR_ICON_PRESETS, DEFAULT_METRIC_ICONS } from './icons/presets';
5
5
  export interface DefaultMetricsConfig {
6
- cpu: boolean;
7
6
  ram: boolean;
8
- disk: boolean;
9
7
  net: boolean;
8
+ load: boolean;
9
+ /** Retained only to migrate older editable definitions without data loss. */
10
+ cpu?: boolean;
11
+ disk?: boolean;
10
12
  }
11
13
  export declare function evaluateColor(value: any, rules?: ColorCondition[], defaultColor?: string): string;
12
14
  export declare class ServerStatsConfigProvider extends ConfigProvider {
@@ -16,6 +18,7 @@ export declare class ServerStatsConfigProvider extends ConfigProvider {
16
18
  enabled: boolean;
17
19
  displayMode: string;
18
20
  paneVisibility: Record<string, boolean>;
21
+ paneGroupModes: Record<string, string | boolean>;
19
22
  defaultInterval: number;
20
23
  debugLogging: boolean;
21
24
  location: {
@@ -28,12 +31,17 @@ export declare class ServerStatsConfigProvider extends ConfigProvider {
28
31
  layout: string;
29
32
  };
30
33
  defaultMetrics: {
31
- cpu: boolean;
32
34
  ram: boolean;
33
- disk: boolean;
34
35
  net: boolean;
36
+ load: boolean;
37
+ cpu: boolean;
38
+ disk: boolean;
39
+ };
40
+ builtinDefaultsVersion: number;
41
+ builtinOrder: string[];
42
+ defaultMetricOverrides: {
43
+ __nonStructural: boolean;
35
44
  };
36
- defaultMetricOverrides: {};
37
45
  showDefaultIcons: boolean;
38
46
  customMetrics: CustomMetric[];
39
47
  metricGroups: CustomMetricGroup[];
@@ -10,6 +10,9 @@ export declare function isNumericDisplayValue(value: string): boolean;
10
10
  export declare function formatNetworkRate(value: string): string;
11
11
  /** Use the requested capacity label, retaining the existing numbers and thresholds. */
12
12
  export declare function formatCapacityUnit(value: string): string;
13
+ /** Add grouping without rounding capacity readings or changing their precision. */
14
+ export declare function formatGroupedNumber(value: string): string;
15
+ export declare function isCapacityUnit(unit: string): boolean;
13
16
  export interface NumericRatio {
14
17
  numerator: string;
15
18
  denominator: string;
@@ -4,6 +4,7 @@ import { ScopeContext } from '../display-scope';
4
4
  /** A saved layout's origin, persisted in its recovery token, never inferred from titles. */
5
5
  export declare const LAYOUT_SCOPE_MARKER = "__tabbyGroupServerStatsLayoutProfileId";
6
6
  export declare const INSTANCE_VISIBILITY_MARKER = "__tabbyGroupServerStatsVisibilityId";
7
+ export type PaneGroupMode = 'overview' | 'carousel' | 'static';
7
8
  export declare class MetricScopeService implements OnDestroy {
8
9
  private config;
9
10
  private app;
@@ -32,7 +33,11 @@ export declare class MetricScopeService implements OnDestroy {
32
33
  /** A layout occurrence is stable across reopen; other panes own recovery-only IDs. */
33
34
  visibilityKey(session: any): string | undefined;
34
35
  isPaneVisible(session: any): boolean;
36
+ private panePreferenceKey;
37
+ private savePanePreference;
35
38
  setPaneVisible(session: any, visible: boolean): void;
39
+ getPaneGroupMode(session: any): PaneGroupMode | undefined;
40
+ setPaneGroupMode(session: any, mode: PaneGroupMode): void;
36
41
  /** Upgrade already restored layouts without guessing from a focused or sibling pane. */
37
42
  private rememberLegacyPanes;
38
43
  private paneTargetFor;
@@ -1,6 +1,6 @@
1
1
  import { ConfigService } from 'tabby-core';
2
2
  import { CustomMetric, CustomMetricGroup } from '../metric-model';
3
- import { MetricScopeService } from './metric-scope.service';
3
+ import { MetricScopeService, PaneGroupMode } from './metric-scope.service';
4
4
  import { Subject } from 'rxjs';
5
5
  export declare class StatsService {
6
6
  private config;
@@ -22,6 +22,8 @@ export declare class StatsService {
22
22
  private scopeContext;
23
23
  isPaneVisible(session: any): boolean;
24
24
  setPaneVisible(session: any, visible: boolean): void;
25
+ getPaneGroupMode(session: any): PaneGroupMode | undefined;
26
+ setPaneGroupMode(session: any, mode: PaneGroupMode): void;
25
27
  /** Disabled/out-of-scope commands never run. Unavailable items still refresh to detect recovery. */
26
28
  getVisibleConfig(session: any): {
27
29
  customMetrics: CustomMetric[];