@deephaven/console 0.43.0 → 0.44.0
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/dist/Console.css +44 -0
- package/dist/Console.css.map +1 -0
- package/dist/Console.js +875 -0
- package/dist/Console.js.map +1 -0
- package/dist/ConsoleInput.css +42 -0
- package/dist/ConsoleInput.css.map +1 -0
- package/dist/ConsoleInput.js +442 -0
- package/dist/ConsoleInput.js.map +1 -0
- package/dist/ConsoleMenu.css +25 -0
- package/dist/ConsoleMenu.css.map +1 -0
- package/dist/ConsoleMenu.js +192 -0
- package/dist/ConsoleMenu.js.map +1 -0
- package/dist/ConsolePropTypes.js +10 -0
- package/dist/ConsolePropTypes.js.map +1 -0
- package/dist/ConsoleShortcuts.js +85 -0
- package/dist/ConsoleShortcuts.js.map +1 -0
- package/dist/ConsoleStatusBar.css +52 -0
- package/dist/ConsoleStatusBar.css.map +1 -0
- package/dist/ConsoleStatusBar.js +105 -0
- package/dist/ConsoleStatusBar.js.map +1 -0
- package/dist/HeapUsage.css +61 -0
- package/dist/HeapUsage.css.map +1 -0
- package/dist/HeapUsage.js +168 -0
- package/dist/HeapUsage.js.map +1 -0
- package/dist/StoragePropTypes.js +16 -0
- package/dist/StoragePropTypes.js.map +1 -0
- package/dist/command-history/CommandHistory.css +41 -0
- package/dist/command-history/CommandHistory.css.map +1 -0
- package/dist/command-history/CommandHistory.js +381 -0
- package/dist/command-history/CommandHistory.js.map +1 -0
- package/dist/command-history/CommandHistoryActions.css +10 -0
- package/dist/command-history/CommandHistoryActions.css.map +1 -0
- package/dist/command-history/CommandHistoryActions.js +47 -0
- package/dist/command-history/CommandHistoryActions.js.map +1 -0
- package/dist/command-history/CommandHistoryItem.css +61 -0
- package/dist/command-history/CommandHistoryItem.css.map +1 -0
- package/dist/command-history/CommandHistoryItem.js +50 -0
- package/dist/command-history/CommandHistoryItem.js.map +1 -0
- package/dist/command-history/CommandHistoryItemTooltip.css +37 -0
- package/dist/command-history/CommandHistoryItemTooltip.css.map +1 -0
- package/dist/command-history/CommandHistoryItemTooltip.js +159 -0
- package/dist/command-history/CommandHistoryItemTooltip.js.map +1 -0
- package/dist/command-history/CommandHistoryStorage.js +2 -0
- package/dist/command-history/CommandHistoryStorage.js.map +1 -0
- package/dist/command-history/CommandHistoryTypes.js +2 -0
- package/dist/command-history/CommandHistoryTypes.js.map +1 -0
- package/dist/command-history/CommandHistoryViewportUpdater.js +57 -0
- package/dist/command-history/CommandHistoryViewportUpdater.js.map +1 -0
- package/dist/command-history/index.js +7 -0
- package/dist/command-history/index.js.map +1 -0
- package/dist/common/Code.js +45 -0
- package/dist/common/Code.js.map +1 -0
- package/dist/common/ConsoleConstants.js +10 -0
- package/dist/common/ConsoleConstants.js.map +1 -0
- package/dist/common/ConsoleUtils.js +62 -0
- package/dist/common/ConsoleUtils.js.map +1 -0
- package/dist/common/ObjectIcon.js +33 -0
- package/dist/common/ObjectIcon.js.map +1 -0
- package/dist/common/index.js +5 -0
- package/dist/common/index.js.map +1 -0
- package/dist/console-history/ConsoleHistory.css +42 -0
- package/dist/console-history/ConsoleHistory.css.map +1 -0
- package/dist/console-history/ConsoleHistory.js +42 -0
- package/dist/console-history/ConsoleHistory.js.map +1 -0
- package/dist/console-history/ConsoleHistoryItem.css +87 -0
- package/dist/console-history/ConsoleHistoryItem.css.map +1 -0
- package/dist/console-history/ConsoleHistoryItem.js +139 -0
- package/dist/console-history/ConsoleHistoryItem.js.map +1 -0
- package/dist/console-history/ConsoleHistoryItemResult.js +22 -0
- package/dist/console-history/ConsoleHistoryItemResult.js.map +1 -0
- package/dist/console-history/ConsoleHistoryResultErrorMessage.js +142 -0
- package/dist/console-history/ConsoleHistoryResultErrorMessage.js.map +1 -0
- package/dist/console-history/ConsoleHistoryResultInProgress.css +27 -0
- package/dist/console-history/ConsoleHistoryResultInProgress.css.map +1 -0
- package/dist/console-history/ConsoleHistoryResultInProgress.js +66 -0
- package/dist/console-history/ConsoleHistoryResultInProgress.js.map +1 -0
- package/dist/console-history/ConsoleHistoryTypes.js +2 -0
- package/dist/console-history/ConsoleHistoryTypes.js.map +1 -0
- package/dist/console-history/index.js +6 -0
- package/dist/console-history/index.js.map +1 -0
- package/dist/csv/CsvFormats.js +134 -0
- package/dist/csv/CsvFormats.js.map +1 -0
- package/dist/csv/CsvInputBar.css +36 -0
- package/dist/csv/CsvInputBar.css.map +1 -0
- package/dist/csv/CsvInputBar.js +342 -0
- package/dist/csv/CsvInputBar.js.map +1 -0
- package/dist/csv/CsvOverlay.css +57 -0
- package/dist/csv/CsvOverlay.css.map +1 -0
- package/dist/csv/CsvOverlay.js +244 -0
- package/dist/csv/CsvOverlay.js.map +1 -0
- package/dist/csv/CsvParser.js +268 -0
- package/dist/csv/CsvParser.js.map +1 -0
- package/dist/csv/CsvTypeParser.js +235 -0
- package/dist/csv/CsvTypeParser.js.map +1 -0
- package/dist/csv/NewTableColumnTypes.js +16 -0
- package/dist/csv/NewTableColumnTypes.js.map +1 -0
- package/dist/declaration.d.js +2 -0
- package/dist/declaration.d.js.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/log/LogLevel.js +11 -0
- package/dist/log/LogLevel.js.map +1 -0
- package/dist/log/LogLevelMenuItem.css +38 -0
- package/dist/log/LogLevelMenuItem.css.map +1 -0
- package/dist/log/LogLevelMenuItem.js +32 -0
- package/dist/log/LogLevelMenuItem.js.map +1 -0
- package/dist/log/LogView.css +65 -0
- package/dist/log/LogView.css.map +1 -0
- package/dist/log/LogView.js +487 -0
- package/dist/log/LogView.js.map +1 -0
- package/dist/monaco/MonacoProviders.js +314 -0
- package/dist/monaco/MonacoProviders.js.map +1 -0
- package/dist/monaco/MonacoTheme.module.css +54 -0
- package/dist/monaco/MonacoTheme.module.css.map +1 -0
- package/dist/monaco/MonacoUtils.js +423 -0
- package/dist/monaco/MonacoUtils.js.map +1 -0
- package/dist/monaco/index.js +4 -0
- package/dist/monaco/index.js.map +1 -0
- package/dist/monaco/lang/Language.js +2 -0
- package/dist/monaco/lang/Language.js.map +1 -0
- package/dist/monaco/lang/db.js +152 -0
- package/dist/monaco/lang/db.js.map +1 -0
- package/dist/monaco/lang/groovy.js +229 -0
- package/dist/monaco/lang/groovy.js.map +1 -0
- package/dist/monaco/lang/log.js +64 -0
- package/dist/monaco/lang/log.js.map +1 -0
- package/dist/monaco/lang/python.js +234 -0
- package/dist/monaco/lang/python.js.map +1 -0
- package/dist/monaco/lang/scala.js +264 -0
- package/dist/monaco/lang/scala.js.map +1 -0
- package/dist/notebook/Editor.css +6 -0
- package/dist/notebook/Editor.css.map +1 -0
- package/dist/notebook/Editor.js +130 -0
- package/dist/notebook/Editor.js.map +1 -0
- package/dist/notebook/ScriptEditor.css +8 -0
- package/dist/notebook/ScriptEditor.css.map +1 -0
- package/dist/notebook/ScriptEditor.d.ts.map +1 -1
- package/dist/notebook/ScriptEditor.js +311 -0
- package/dist/notebook/ScriptEditor.js.map +1 -0
- package/dist/notebook/ScriptEditorUtils.d.ts +7 -0
- package/dist/notebook/ScriptEditorUtils.d.ts.map +1 -1
- package/dist/notebook/ScriptEditorUtils.js +52 -0
- package/dist/notebook/ScriptEditorUtils.js.map +1 -0
- package/package.json +12 -12
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
|
+
import React, { PureComponent } from 'react';
|
|
5
|
+
import classNames from 'classnames';
|
|
6
|
+
import { Tooltip } from '@deephaven/components';
|
|
7
|
+
import { CanceledPromiseError, Pending } from '@deephaven/utils';
|
|
8
|
+
import ConsoleMenu from "./ConsoleMenu.js";
|
|
9
|
+
import "./ConsoleStatusBar.css";
|
|
10
|
+
export class ConsoleStatusBar extends PureComponent {
|
|
11
|
+
constructor(props) {
|
|
12
|
+
super(props);
|
|
13
|
+
_defineProperty(this, "pending", void 0);
|
|
14
|
+
this.handleCommandStarted = this.handleCommandStarted.bind(this);
|
|
15
|
+
this.handleCommandCompleted = this.handleCommandCompleted.bind(this);
|
|
16
|
+
this.pending = new Pending();
|
|
17
|
+
this.state = {
|
|
18
|
+
isDisconnected: false,
|
|
19
|
+
isCommandRunning: false
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
componentDidMount() {
|
|
23
|
+
this.startListening();
|
|
24
|
+
}
|
|
25
|
+
componentWillUnmount() {
|
|
26
|
+
this.stopListening();
|
|
27
|
+
this.cancelPendingPromises();
|
|
28
|
+
}
|
|
29
|
+
startListening() {
|
|
30
|
+
var {
|
|
31
|
+
dh,
|
|
32
|
+
session
|
|
33
|
+
} = this.props;
|
|
34
|
+
session.addEventListener(dh.IdeSession.EVENT_COMMANDSTARTED, this.handleCommandStarted);
|
|
35
|
+
}
|
|
36
|
+
stopListening() {
|
|
37
|
+
var {
|
|
38
|
+
dh,
|
|
39
|
+
session
|
|
40
|
+
} = this.props;
|
|
41
|
+
session.removeEventListener(dh.IdeSession.EVENT_COMMANDSTARTED, this.handleCommandStarted);
|
|
42
|
+
}
|
|
43
|
+
cancelPendingPromises() {
|
|
44
|
+
this.pending.cancel();
|
|
45
|
+
}
|
|
46
|
+
handleCommandStarted(event) {
|
|
47
|
+
var {
|
|
48
|
+
result
|
|
49
|
+
} = event.detail;
|
|
50
|
+
this.pending.add(result).then(() => this.handleCommandCompleted(null)).catch(error => this.handleCommandCompleted(error));
|
|
51
|
+
this.setState({
|
|
52
|
+
isCommandRunning: true
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
handleCommandCompleted(error) {
|
|
56
|
+
// Don't update state if the promise was canceled
|
|
57
|
+
if (!(error instanceof CanceledPromiseError)) {
|
|
58
|
+
this.setState({
|
|
59
|
+
isCommandRunning: this.pending.pending.length > 0
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
render() {
|
|
64
|
+
var {
|
|
65
|
+
children,
|
|
66
|
+
dh,
|
|
67
|
+
openObject,
|
|
68
|
+
overflowActions,
|
|
69
|
+
objects
|
|
70
|
+
} = this.props;
|
|
71
|
+
var {
|
|
72
|
+
isDisconnected,
|
|
73
|
+
isCommandRunning
|
|
74
|
+
} = this.state;
|
|
75
|
+
var statusIconClass = null;
|
|
76
|
+
var tooltipText = null;
|
|
77
|
+
if (isDisconnected) {
|
|
78
|
+
statusIconClass = 'console-status-icon-disconnected';
|
|
79
|
+
tooltipText = 'Worker is disconnected';
|
|
80
|
+
} else if (isCommandRunning) {
|
|
81
|
+
// Connected, Pending
|
|
82
|
+
statusIconClass = 'console-status-icon-pending';
|
|
83
|
+
tooltipText = 'Worker is busy';
|
|
84
|
+
} else {
|
|
85
|
+
// Connected, Idle
|
|
86
|
+
statusIconClass = 'console-status-icon-idle';
|
|
87
|
+
tooltipText = 'Worker is idle';
|
|
88
|
+
}
|
|
89
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
90
|
+
className: "console-pane-status-bar"
|
|
91
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
92
|
+
className: classNames('console-status-icon', statusIconClass)
|
|
93
|
+
}), /*#__PURE__*/React.createElement(Tooltip, null, tooltipText)), children, /*#__PURE__*/React.createElement(ConsoleMenu, {
|
|
94
|
+
dh: dh,
|
|
95
|
+
overflowActions: overflowActions,
|
|
96
|
+
openObject: openObject,
|
|
97
|
+
objects: objects
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
_defineProperty(ConsoleStatusBar, "defaultProps", {
|
|
102
|
+
children: null
|
|
103
|
+
});
|
|
104
|
+
export default ConsoleStatusBar;
|
|
105
|
+
//# sourceMappingURL=ConsoleStatusBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConsoleStatusBar.js","names":["React","PureComponent","classNames","Tooltip","CanceledPromiseError","Pending","ConsoleMenu","ConsoleStatusBar","constructor","props","handleCommandStarted","bind","handleCommandCompleted","pending","state","isDisconnected","isCommandRunning","componentDidMount","startListening","componentWillUnmount","stopListening","cancelPendingPromises","dh","session","addEventListener","IdeSession","EVENT_COMMANDSTARTED","removeEventListener","cancel","event","result","detail","add","then","catch","error","setState","length","render","children","openObject","overflowActions","objects","statusIconClass","tooltipText"],"sources":["../src/ConsoleStatusBar.tsx"],"sourcesContent":["import React, { PureComponent, ReactElement, ReactNode } from 'react';\nimport classNames from 'classnames';\nimport type {\n dh as DhType,\n IdeSession,\n VariableDefinition,\n} from '@deephaven/jsapi-types';\nimport { DropdownAction, Tooltip } from '@deephaven/components';\nimport { CanceledPromiseError, Pending } from '@deephaven/utils';\nimport ConsoleMenu from './ConsoleMenu';\nimport './ConsoleStatusBar.scss';\n\ninterface ConsoleStatusBarProps {\n children: ReactNode;\n dh: DhType;\n session: IdeSession;\n openObject: (object: VariableDefinition) => void;\n objects: VariableDefinition[];\n overflowActions: () => DropdownAction[];\n}\n\ninterface ConsoleStatusBarState {\n isDisconnected: boolean;\n isCommandRunning: boolean;\n}\n\nexport class ConsoleStatusBar extends PureComponent<\n ConsoleStatusBarProps,\n ConsoleStatusBarState\n> {\n static defaultProps = {\n children: null,\n };\n\n constructor(props: ConsoleStatusBarProps) {\n super(props);\n\n this.handleCommandStarted = this.handleCommandStarted.bind(this);\n this.handleCommandCompleted = this.handleCommandCompleted.bind(this);\n\n this.pending = new Pending();\n\n this.state = {\n isDisconnected: false,\n isCommandRunning: false,\n };\n }\n\n componentDidMount(): void {\n this.startListening();\n }\n\n componentWillUnmount(): void {\n this.stopListening();\n this.cancelPendingPromises();\n }\n\n pending: Pending;\n\n startListening(): void {\n const { dh, session } = this.props;\n session.addEventListener(\n dh.IdeSession.EVENT_COMMANDSTARTED,\n this.handleCommandStarted\n );\n }\n\n stopListening(): void {\n const { dh, session } = this.props;\n session.removeEventListener(\n dh.IdeSession.EVENT_COMMANDSTARTED,\n this.handleCommandStarted\n );\n }\n\n cancelPendingPromises(): void {\n this.pending.cancel();\n }\n\n handleCommandStarted(event: CustomEvent): void {\n const { result } = event.detail;\n\n this.pending\n .add(result)\n .then(() => this.handleCommandCompleted(null))\n .catch(error => this.handleCommandCompleted(error));\n\n this.setState({\n isCommandRunning: true,\n });\n }\n\n handleCommandCompleted(error: unknown): void {\n // Don't update state if the promise was canceled\n if (!(error instanceof CanceledPromiseError)) {\n this.setState({\n isCommandRunning: this.pending.pending.length > 0,\n });\n }\n }\n\n render(): ReactElement {\n const { children, dh, openObject, overflowActions, objects } = this.props;\n const { isDisconnected, isCommandRunning } = this.state;\n\n let statusIconClass = null;\n let tooltipText = null;\n\n if (isDisconnected) {\n statusIconClass = 'console-status-icon-disconnected';\n tooltipText = 'Worker is disconnected';\n } else if (isCommandRunning) {\n // Connected, Pending\n statusIconClass = 'console-status-icon-pending';\n tooltipText = 'Worker is busy';\n } else {\n // Connected, Idle\n statusIconClass = 'console-status-icon-idle';\n tooltipText = 'Worker is idle';\n }\n\n return (\n <div className=\"console-pane-status-bar\">\n <div>\n <div className={classNames('console-status-icon', statusIconClass)} />\n <Tooltip>{tooltipText}</Tooltip>\n </div>\n {children}\n <ConsoleMenu\n dh={dh}\n overflowActions={overflowActions}\n openObject={openObject}\n objects={objects}\n />\n </div>\n );\n }\n}\n\nexport default ConsoleStatusBar;\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAiC,OAAO;AACrE,OAAOC,UAAU,MAAM,YAAY;AAMnC,SAAyBC,OAAO,QAAQ,uBAAuB;AAC/D,SAASC,oBAAoB,EAA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EAAG;MACP,eAAe,EAAEmB,eAAgB;MACjC,UAAU,EAAED,UAAW;MACvB,OAAO,EAAEE;IAAQ,EACjB,CACE;EAEV;AACF;AAAC,gBA/GYnC,gBAAgB,kBAIL;EACpBgC,QAAQ,EAAE;AACZ,CAAC;AA2GH,eAAehC,gBAAgB"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/* stylelint-disable scss/at-import-no-partial-leading-underscore */
|
|
2
|
+
.max-memory {
|
|
3
|
+
position: relative;
|
|
4
|
+
color: #c0bfbf;
|
|
5
|
+
background-color: #211f22;
|
|
6
|
+
border: #1a171a;
|
|
7
|
+
width: 4.25rem;
|
|
8
|
+
vertical-align: middle;
|
|
9
|
+
text-align: center;
|
|
10
|
+
user-select: none;
|
|
11
|
+
z-index: 1;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.total-memory,
|
|
15
|
+
.used-memory {
|
|
16
|
+
position: absolute;
|
|
17
|
+
inset: 0;
|
|
18
|
+
margin: 1px;
|
|
19
|
+
z-index: -1;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.total-memory {
|
|
23
|
+
background-color: #403e41;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.used-memory {
|
|
27
|
+
background-color: #5b5a5c;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.heap-overflow {
|
|
31
|
+
background-color: #f95d84;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.heap-tooltip {
|
|
35
|
+
padding: 0.25rem;
|
|
36
|
+
width: 200px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.heap-usage-info-row {
|
|
40
|
+
display: flex;
|
|
41
|
+
color: #f0f0ee;
|
|
42
|
+
padding: 0.25rem;
|
|
43
|
+
justify-content: space-between;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.heap-plot {
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.heading-bottom-border {
|
|
52
|
+
border-bottom: 1px solid #211f22;
|
|
53
|
+
margin-bottom: 0.25rem;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.heap-utilisation-text {
|
|
57
|
+
margin-top: 0.25rem;
|
|
58
|
+
color: #929192;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/*# sourceMappingURL=HeapUsage.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../../node_modules/@deephaven/components/scss/custom.scss","../src/HeapUsage.scss","../../../node_modules/@deephaven/components/scss/bootstrap_overrides.scss","../../../node_modules/@deephaven/components/scss/new_variables.scss"],"names":[],"mappings":"AAAA;ACEA;EACE;EACA,OCgBS;EDfT,kBCsBS;EDrBT,QCQe;EDPf;EACA;EACA;EACA;EACA;;;AAGF;AAAA;EAEE;EACA;EACA;EACA;;;AAGF;EACE,kBCCS;;;ADEX;EACE,kBCLS;;;ADQX;EACE,kBC5BI;;;AD+BN;EACE,SEjCS;EFkCT;;;AAGF;EACE;EACA,OC5Be;ED6Bf,SExCS;EFyCT;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA,eEnDS;;;AFsDX;EACE,YEvDS;EFwDT,OCrCS","file":"HeapUsage.css","sourcesContent":["/* stylelint-disable scss/at-import-no-partial-leading-underscore */\n// Consumers should be able to resolve bootstrap/ to node_modules/bootstrap\n\n//Make bootstrap functions available for use in overrides\n@import 'bootstrap/scss/_functions.scss';\n@import './bootstrap_overrides.scss';\n\n//_variable imports come after bootstrap default overrides,\n// makes all other variables and mixins from bootstrap available\n/// with just importing customer.scss\n@import 'bootstrap/scss/_variables.scss';\n@import 'bootstrap/scss/_mixins.scss';\n\n//New variables come after imports\n@import './new_variables.scss';\n","@import '@deephaven/components/scss/custom.scss';\n\n.max-memory {\n position: relative;\n color: $gray-300;\n background-color: $gray-900;\n border: $black;\n width: 4.25rem;\n vertical-align: middle;\n text-align: center;\n user-select: none;\n z-index: 1;\n}\n\n.total-memory,\n.used-memory {\n position: absolute;\n inset: 0;\n margin: 1px;\n z-index: -1;\n}\n\n.total-memory {\n background-color: $gray-700;\n}\n\n.used-memory {\n background-color: $gray-500;\n}\n\n.heap-overflow {\n background-color: $red;\n}\n\n.heap-tooltip {\n padding: $spacer-1;\n width: 200px;\n}\n\n.heap-usage-info-row {\n display: flex;\n color: $foreground;\n padding: $spacer-1;\n justify-content: space-between;\n}\n\n.heap-plot {\n display: flex;\n align-items: center;\n}\n\n.heading-bottom-border {\n border-bottom: 1px solid $gray-900;\n margin-bottom: $spacer-1;\n}\n\n.heap-utilisation-text {\n margin-top: $spacer-1;\n color: $gray-400;\n}\n","// Styling overrides for bootstrap\n\n// Override / set color variables\n$red: #f95d84;\n$orange: #f37e3f;\n$yellow: #fcd65b;\n$green: #9edc6f;\n$blue: #76d9e4;\n$purple: #aa9af4;\n\n//Define some UI colors\n$interfacegray: #2d2a2e;\n$interfaceblue: #4878ea;\n$interfacewhite: #f0f0ee; //same as gray-200\n$interfaceblack: #1a171a;\n\n//Define our Gray scale\n$white: $interfacewhite;\n$gray-100: #fcfcfa;\n$gray-200: $interfacewhite;\n$gray-300: #c0bfbf;\n$gray-400: #929192;\n$gray-500: #5b5a5c;\n$gray-600: #555356;\n$gray-700: #403e41;\n$gray-800: #373438;\n$gray-850: #322f33;\n$gray-900: #211f22;\n$black: $interfaceblack;\n$content-bg: $interfacegray;\n$background: $interfaceblack;\n$foreground: $interfacewhite;\n\n//Load colors into map\n$colors: ();\n$colors: map-merge(\n (\n 'red': $red,\n 'orange': $orange,\n 'yellow': $yellow,\n 'green': $green,\n 'blue': $blue,\n 'purple': $purple,\n 'white': $white,\n 'black': $black,\n ),\n $colors\n);\n\n//Set default colors\n$body-bg: $black;\n$body-color: $interfacewhite;\n\n// Set brand colors\n$primary: $interfaceblue;\n$primary-hover: darken($primary, 8%);\n$primary-dark: mix($primary, $content-bg, 25%);\n$primary-light: scale-color($primary, $lightness: -25%);\n$secondary: $gray-500;\n$secondary-hover: darken($secondary, 8%);\n$success: $green;\n$info: $yellow;\n$warning: $orange;\n$danger: $red;\n$danger-hover: darken($danger, 8%);\n$light: $gray-100;\n$mid: $gray-400; //Added a mid color, useful for input styling\n$dark: $gray-800;\n$green-dark: scale-color($green, $lightness: -45%, $saturation: -10%);\n\n$theme-colors: () !default;\n$theme-colors: map-merge(\n (\n 'primary': $primary,\n 'primary-hover': $primary-hover,\n 'primary-light': $primary-light,\n 'primary-dark': $primary-dark,\n 'secondary': $secondary,\n 'success': $success,\n 'info': $info,\n 'warning': $warning,\n 'danger': $danger,\n 'light': $light,\n 'dark': $dark,\n 'mid': $mid,\n 'content-bg': $interfacegray,\n 'background': $interfaceblack,\n 'foreground': $interfacewhite,\n ),\n $theme-colors\n);\n\n$component-active-bg: $primary;\n$theme-color-interval: 9%;\n$yiq-contrasted-threshold: 180;\n\n// Override fonts\n$font-family-sans-serif: 'Fira Sans', -apple-system, blinkmacsystemfont,\n 'Segoe UI', 'Roboto', 'Helvetica Neue', arial, sans-serif; //fira sans then native system ui fallbacks\n$font-family-monospace: 'Fira Mono', menlo, monaco, consolas, 'Liberation Mono',\n 'Courier New', monospace;\n$font-family-base: $font-family-sans-serif;\n\n$headings-font-weight: 400;\n\n//Text overides\n$text-muted: $gray-400;\n\n//Style Selection highlight color\n//so browsers add alpha to your color by default, ignoring opacity 1\n//by setting rgba with 0.99 it tricks browser into thinking there is alpha applied\n$text-select-color: $primary-hover;\n$text-select-color-editor: lighten(\n $gray-700,\n 15%\n); //we lighten it abit to account for that 0.01 loss, and because it needs some anyways.\n\n//Grid variables, same value as default just making easily accessible\n$grid-gutter-width: 30px;\n\n//Visual Overrides\n$border-radius: 4px;\n$box-shadow: 0 0.1rem 1rem rgba($black, 45%); //because our UI is so dark, we need darker default shadows\n$box-shadow-900: 0 0.1rem 1rem rgba(0, 0, 0, 45%); //darkest shadow for $black popups over $black UI\n\n//Override Btn\n$btn-border-radius: 4rem;\n$btn-padding-x: 1.5rem;\n$btn-transition: color 0.12s ease-in-out, background-color 0.12s ease-in-out,\n border-color 0.12s ease-in-out, box-shadow 0.12s ease-in-out; //default 0.15 is too long\n$btn-border-width: 2px;\n\n//Override Inputs\n$input-bg: $gray-600;\n$input-disabled-bg: $gray-800;\n$input-color: $foreground;\n$input-border-color: $gray-400;\n$input-placeholder-color: $gray-400;\n$input-focus-border-color: rgba($primary, 85%);\n\n$input-btn-focus-width: 0.2rem;\n$input-btn-focus-color: rgba($component-active-bg, 35%);\n$input-btn-focus-box-shadow: 0 0 0 $input-btn-focus-width $input-btn-focus-color;\n\n//checkbox\n$custom-control-indicator-bg: $gray-600;\n$custom-control-indicator-bg-size: 75% 75%;\n$custom-control-indicator-disabled-bg: $gray-800;\n$custom-control-indicator-checked-disabled-bg: $gray-800;\n$custom-control-label-disabled-color: $gray-400;\n\n//Custom Select\n$custom-select-indicator-color: $gray-400;\n$custom-select-bg-size: 16px 16px;\n//dhSort icon encoded\n$custom-select-indicator: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='#{$custom-select-indicator-color}' d='M4 7l-.4-.8 4-3.7h.8l4 3.7-.4.8H4zm0 2l-.4.8 4 3.7h.8l4-3.7L12 9H4z'/%3E%3C/svg%3E\"),\n '#',\n '%23'\n);\n$custom-select-focus-box-shadow: $input-btn-focus-box-shadow;\n$custom-select-disabled-color: darken($gray-400, 5%);\n$custom-select-disabled-bg: $gray-800;\n\n//modal\n$modal-content-bg: $gray-200;\n$modal-content-border-width: 0;\n$modal-md: 550px;\n\n// Toast notification\n$toast-bg: $primary-dark;\n$toast-color: $foreground;\n$toast-error-bg: mix($danger, $content-bg, 15%);\n$toast-error-color: $foreground;\n\n//tooltips\n$tooltip-bg: $gray-700;\n$tooltip-color: $foreground;\n$tooltip-box-shadow: 0 0.1rem 1.5rem 0.1rem rgba($black, 80%);\n\n//drowdowns\n$dropdown-bg: $gray-600;\n$dropdown-link-color: $foreground;\n$dropdown-link-hover-color: $foreground;\n$dropdown-link-hover-bg: $primary;\n$dropdown-divider-bg: $gray-700;\n\n//context menus\n$contextmenu-bg: $gray-600;\n$contextmenu-color: $foreground;\n$contextmenu-disabled-color: $text-muted;\n$contextmenu-keyboard-selected-bg: rgba($primary, 50%);\n$contextmenu-selected-bg: $primary;\n$contextmenu-selected-color: $foreground;\n\n//links\n$link-color: $gray-400;\n$link-hover-color: $foreground;\n\n//progress-bar\n$progress-bg: $gray-600;\n$progress-border-radius: 1rem;\n\n// Set global options\n$enable-shadows: false;\n$enable-gradients: false;\n$enable-print-styles: false; //I don't think anyone should expect to \"print\" this app.\n\n// Transition times\n$transition: 0.15s;\n$transition-mid: 0.2s;\n$transition-long: 0.3s;\n$transition-slow: 0.6s;\n\n//form-validation icon, uses vsWarning icon encoded here as svg\n$form-feedback-icon-invalid-color: theme-color('danger');\n$form-feedback-icon-invalid: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cg fill='none'%3E%3Cg fill='#{$form-feedback-icon-invalid-color}'%3E%3Cpath d='M7.56 1h.88l6.54 12.26-.44.74H1.44L1 13.26 7.56 1zM8 2.28 2.28 13H13.7L8 2.28zM8.625 12v-1h-1.25v1h1.25zm-1.25-2V6h1.25v4h-1.25z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E \"),\n '#',\n '%23'\n);\n","//Set of spacer variables from the spacer map\n$spacer-0: map-get($spacers, 0); //0\n$spacer-1: map-get($spacers, 1);\n$spacer-2: map-get($spacers, 2);\n$spacer-3: map-get($spacers, 3);\n$spacer-4: map-get($spacers, 4);\n$spacer-5: map-get($spacers, 5);\n\n//Marching Ants for golden layout dropzone and drag and drop\n//top bottom, left right.\n//create 4 background images that are 50% color 1, 50% color 2 using graidents, two veritical, two horizontal\n//size them to ant-size and thickness\n//position those images along the egdes and make top/bottom repeat-x and left/right repeat-y\n//then offest each of those background positions by ant-size in animation to make them march.\n$ant-size: 8px;\n$ant-thickness: 1px;\n\n@mixin ants-base($color-1: black, $color-2: white) {\n background-image: linear-gradient(to right, $color-2 50%, $color-1 50%),\n linear-gradient(to right, $color-2 50%, $color-1 50%),\n linear-gradient(to bottom, $color-2 50%, $color-1 50%),\n linear-gradient(to bottom, $color-2 50%, $color-1 50%);\n background-size: $ant-size $ant-thickness, $ant-size $ant-thickness,\n $ant-thickness $ant-size, $ant-thickness $ant-size;\n background-position: 0 top, 0 bottom, left 0, right 0;\n background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;\n animation: march 0.5s;\n animation-timing-function: linear;\n animation-iteration-count: infinite;\n}\n\n@mixin drag-stack($pseudo-element) {\n &::#{$pseudo-element} {\n content: ' ';\n background: $primary;\n box-shadow: $box-shadow;\n border-radius: $border-radius;\n position: absolute;\n height: 100%;\n width: 100%;\n @content;\n }\n}\n\n$focus-bg-transparency: 0.12;\n$hover-bg-transparency: 0.14;\n$active-bg-transparency: 0.28;\n$exception-transparency: 0.13;\n"]}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
2
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
3
|
+
import React, { useEffect, useState, useRef } from 'react';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import { Tooltip } from '@deephaven/components';
|
|
6
|
+
import { Plot, ChartTheme } from '@deephaven/chart';
|
|
7
|
+
import Log from '@deephaven/log';
|
|
8
|
+
import "./HeapUsage.css";
|
|
9
|
+
var log = Log.module('HeapUsage');
|
|
10
|
+
function HeapUsage(_ref) {
|
|
11
|
+
var _timestamps2;
|
|
12
|
+
var {
|
|
13
|
+
connection,
|
|
14
|
+
defaultUpdateInterval,
|
|
15
|
+
hoverUpdateInterval,
|
|
16
|
+
bgMonitoring = true,
|
|
17
|
+
monitorDuration
|
|
18
|
+
} = _ref;
|
|
19
|
+
var [memoryUsage, setMemoryUsage] = useState({
|
|
20
|
+
freeMemory: 0,
|
|
21
|
+
maximumHeapSize: 999,
|
|
22
|
+
totalHeapSize: 0
|
|
23
|
+
});
|
|
24
|
+
var [isOpen, setIsOpen] = useState(false);
|
|
25
|
+
var historyUsage = useRef({
|
|
26
|
+
timestamps: [],
|
|
27
|
+
usages: []
|
|
28
|
+
});
|
|
29
|
+
useEffect(function setUsageUpdateInterval() {
|
|
30
|
+
var fetchAndUpdate = /*#__PURE__*/function () {
|
|
31
|
+
var _ref2 = _asyncToGenerator(function* () {
|
|
32
|
+
try {
|
|
33
|
+
var newUsage = yield connection.getWorkerHeapInfo();
|
|
34
|
+
setMemoryUsage(newUsage);
|
|
35
|
+
if (bgMonitoring || isOpen) {
|
|
36
|
+
var currentUsage = (newUsage.totalHeapSize - newUsage.freeMemory) / newUsage.maximumHeapSize;
|
|
37
|
+
var currentTime = Date.now();
|
|
38
|
+
var {
|
|
39
|
+
timestamps: _timestamps,
|
|
40
|
+
usages: _usages
|
|
41
|
+
} = historyUsage.current;
|
|
42
|
+
while (_timestamps.length !== 0 && currentTime - _timestamps[0] > monitorDuration * 1.5) {
|
|
43
|
+
_timestamps.shift();
|
|
44
|
+
_usages.shift();
|
|
45
|
+
}
|
|
46
|
+
_timestamps.push(currentTime);
|
|
47
|
+
_usages.push(currentUsage);
|
|
48
|
+
} else {
|
|
49
|
+
historyUsage.current = {
|
|
50
|
+
timestamps: [],
|
|
51
|
+
usages: []
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
} catch (e) {
|
|
55
|
+
log.warn('Unable to get heap usage', e);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
return function fetchAndUpdate() {
|
|
59
|
+
return _ref2.apply(this, arguments);
|
|
60
|
+
};
|
|
61
|
+
}();
|
|
62
|
+
fetchAndUpdate();
|
|
63
|
+
var updateUsage = setInterval(fetchAndUpdate, isOpen ? hoverUpdateInterval : defaultUpdateInterval);
|
|
64
|
+
return () => {
|
|
65
|
+
clearInterval(updateUsage);
|
|
66
|
+
};
|
|
67
|
+
}, [isOpen, hoverUpdateInterval, connection, defaultUpdateInterval, monitorDuration, bgMonitoring]);
|
|
68
|
+
var toDecimalPlace = (num, dec) => Math.round(num * 10 ** dec) / 10 ** dec;
|
|
69
|
+
var decimalPlace = 2;
|
|
70
|
+
var GbToByte = 1024 ** 3;
|
|
71
|
+
var {
|
|
72
|
+
freeMemory,
|
|
73
|
+
totalHeapSize,
|
|
74
|
+
maximumHeapSize
|
|
75
|
+
} = memoryUsage;
|
|
76
|
+
var freeMemoryGB = toDecimalPlace(freeMemory / GbToByte, decimalPlace);
|
|
77
|
+
var totalHeapGB = toDecimalPlace(totalHeapSize / GbToByte, decimalPlace);
|
|
78
|
+
var maxHeapGB = toDecimalPlace(maximumHeapSize / GbToByte, decimalPlace);
|
|
79
|
+
var inUseGB = totalHeapGB - freeMemoryGB;
|
|
80
|
+
var getRow = function getRow(text, size) {
|
|
81
|
+
var bottomBorder = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
82
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
83
|
+
className: classNames("heap-usage-info-row", {
|
|
84
|
+
'heading-bottom-border': bottomBorder
|
|
85
|
+
})
|
|
86
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
87
|
+
className: "font-weight-bold"
|
|
88
|
+
}, text), /*#__PURE__*/React.createElement("div", null, size));
|
|
89
|
+
};
|
|
90
|
+
var {
|
|
91
|
+
timestamps,
|
|
92
|
+
usages
|
|
93
|
+
} = historyUsage.current;
|
|
94
|
+
var lastTimestamp = (_timestamps2 = timestamps[timestamps.length - 1]) !== null && _timestamps2 !== void 0 ? _timestamps2 : 0;
|
|
95
|
+
var totalPercentage = totalHeapSize / maximumHeapSize;
|
|
96
|
+
var usedPercentage = (totalHeapSize - freeMemory) / maximumHeapSize;
|
|
97
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
98
|
+
className: "max-memory"
|
|
99
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
100
|
+
className: "total-memory",
|
|
101
|
+
style: {
|
|
102
|
+
width: "calc(".concat(totalPercentage * 100, "% - ").concat(totalPercentage * 2, "px")
|
|
103
|
+
}
|
|
104
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
105
|
+
className: classNames('used-memory', {
|
|
106
|
+
'heap-overflow': (totalHeapSize - freeMemory) / maximumHeapSize > 0.95
|
|
107
|
+
}),
|
|
108
|
+
style: {
|
|
109
|
+
width: "calc(".concat(usedPercentage * 100, "% - ").concat(usedPercentage * 2, "px")
|
|
110
|
+
}
|
|
111
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
112
|
+
className: "memory-text"
|
|
113
|
+
}, maxHeapGB.toFixed(1), " GB")), /*#__PURE__*/React.createElement(Tooltip, {
|
|
114
|
+
onEntered: () => setIsOpen(true),
|
|
115
|
+
onExited: () => setIsOpen(false),
|
|
116
|
+
interactive: true
|
|
117
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
118
|
+
className: "heap-tooltip"
|
|
119
|
+
}, getRow('In use:', "".concat(inUseGB.toFixed(decimalPlace), " of ").concat(maxHeapGB.toFixed(decimalPlace), " GB"), true), getRow('Free:', "".concat(freeMemoryGB.toFixed(decimalPlace), " GB")), getRow('Total:', "".concat(totalHeapGB.toFixed(decimalPlace), " GB")), getRow('Max:', "".concat(maxHeapGB.toFixed(decimalPlace), " GB")), /*#__PURE__*/React.createElement("div", {
|
|
120
|
+
className: "heap-plot"
|
|
121
|
+
}, /*#__PURE__*/React.createElement(Plot, {
|
|
122
|
+
data: [{
|
|
123
|
+
x: [...timestamps],
|
|
124
|
+
y: [...usages],
|
|
125
|
+
type: 'scatter',
|
|
126
|
+
mode: 'lines'
|
|
127
|
+
}],
|
|
128
|
+
config: {
|
|
129
|
+
staticPlot: true,
|
|
130
|
+
responsive: true
|
|
131
|
+
},
|
|
132
|
+
style: {
|
|
133
|
+
width: '196px',
|
|
134
|
+
height: '100px'
|
|
135
|
+
},
|
|
136
|
+
layout: {
|
|
137
|
+
margin: {
|
|
138
|
+
l: 2,
|
|
139
|
+
t: 2,
|
|
140
|
+
r: 2,
|
|
141
|
+
b: 2
|
|
142
|
+
},
|
|
143
|
+
plot_bgcolor: 'transparent',
|
|
144
|
+
paper_bgcolor: 'transparent',
|
|
145
|
+
colorway: ['#4878ea'],
|
|
146
|
+
xaxis: {
|
|
147
|
+
dtick: Math.round(monitorDuration / 6),
|
|
148
|
+
gridcolor: ChartTheme.linecolor,
|
|
149
|
+
range: [lastTimestamp - monitorDuration, lastTimestamp],
|
|
150
|
+
linecolor: ChartTheme.linecolor,
|
|
151
|
+
linewidth: 2,
|
|
152
|
+
mirror: true
|
|
153
|
+
},
|
|
154
|
+
yaxis: {
|
|
155
|
+
dtick: 0.2,
|
|
156
|
+
gridcolor: ChartTheme.linecolor,
|
|
157
|
+
range: [0, 1],
|
|
158
|
+
linecolor: ChartTheme.linecolor,
|
|
159
|
+
linewidth: 2,
|
|
160
|
+
mirror: true
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
164
|
+
className: "heap-utilisation-text"
|
|
165
|
+
}, "% utilization over ", Math.round(monitorDuration / 1000 / 60), " min."))));
|
|
166
|
+
}
|
|
167
|
+
export default HeapUsage;
|
|
168
|
+
//# sourceMappingURL=HeapUsage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeapUsage.js","names":["React","useEffect","useState","useRef","classNames","Tooltip","Plot","ChartTheme","Log","log","module","HeapUsage","connection","defaultUpdateInterval","hoverUpdateInterval","bgMonitoring","monitorDuration","memoryUsage","setMemoryUsage","freeMemory","maximumHeapSize","totalHeapSize","isOpen","setIsOpen","historyUsage","timestamps","usages","setUsageUpdateInterval","fetchAndUpdate","newUsage","getWorkerHeapInfo","currentUsage","currentTime","Date","now","current","length","shift","push","e","warn","updateUsage","setInterval","clearInterval","toDecimalPlace","num","dec","Math","round","decimalPlace","GbToByte","freeMemoryGB","totalHeapGB","maxHeapGB","inUseGB","getRow","text","size","bottomBorder","lastTimestamp","totalPercentage","usedPercentage","width","toFixed","x","y","type","mode","staticPlot","responsive","height","margin","l","t","r","b","plot_bgcolor","paper_bgcolor","colorway","xaxis","dtick","gridcolor","linecolor","range","linewidth","mirror","yaxis"],"sources":["../src/HeapUsage.tsx"],"sourcesContent":["import React, { useEffect, useState, ReactElement, useRef } from 'react';\nimport classNames from 'classnames';\nimport { Tooltip } from '@deephaven/components';\nimport type { QueryConnectable } from '@deephaven/jsapi-types';\nimport { Plot, ChartTheme } from '@deephaven/chart';\nimport Log from '@deephaven/log';\nimport './HeapUsage.scss';\n\nconst log = Log.module('HeapUsage');\n\ninterface HeapUsageProps {\n connection: QueryConnectable;\n defaultUpdateInterval: number;\n hoverUpdateInterval: number;\n bgMonitoring?: boolean;\n\n // in millis\n monitorDuration: number;\n}\n\nfunction HeapUsage({\n connection,\n defaultUpdateInterval,\n hoverUpdateInterval,\n bgMonitoring = true,\n monitorDuration,\n}: HeapUsageProps): ReactElement {\n const [memoryUsage, setMemoryUsage] = useState({\n freeMemory: 0,\n maximumHeapSize: 999,\n totalHeapSize: 0,\n });\n\n const [isOpen, setIsOpen] = useState(false);\n\n const historyUsage = useRef<{ timestamps: number[]; usages: number[] }>({\n timestamps: [],\n usages: [],\n });\n\n useEffect(\n function setUsageUpdateInterval() {\n const fetchAndUpdate = async () => {\n try {\n const newUsage = await connection.getWorkerHeapInfo();\n setMemoryUsage(newUsage);\n\n if (bgMonitoring || isOpen) {\n const currentUsage =\n (newUsage.totalHeapSize - newUsage.freeMemory) /\n newUsage.maximumHeapSize;\n const currentTime = Date.now();\n\n const { timestamps, usages } = historyUsage.current;\n while (\n timestamps.length !== 0 &&\n currentTime - timestamps[0] > monitorDuration * 1.5\n ) {\n timestamps.shift();\n usages.shift();\n }\n\n timestamps.push(currentTime);\n usages.push(currentUsage);\n } else {\n historyUsage.current = { timestamps: [], usages: [] };\n }\n } catch (e) {\n log.warn('Unable to get heap usage', e);\n }\n };\n fetchAndUpdate();\n\n const updateUsage = setInterval(\n fetchAndUpdate,\n isOpen ? hoverUpdateInterval : defaultUpdateInterval\n );\n return () => {\n clearInterval(updateUsage);\n };\n },\n [\n isOpen,\n hoverUpdateInterval,\n connection,\n defaultUpdateInterval,\n monitorDuration,\n bgMonitoring,\n ]\n );\n\n const toDecimalPlace = (num: number, dec: number) =>\n Math.round(num * 10 ** dec) / 10 ** dec;\n\n const decimalPlace = 2;\n const GbToByte = 1024 ** 3;\n\n const { freeMemory, totalHeapSize, maximumHeapSize } = memoryUsage;\n\n const freeMemoryGB = toDecimalPlace(freeMemory / GbToByte, decimalPlace);\n const totalHeapGB = toDecimalPlace(totalHeapSize / GbToByte, decimalPlace);\n const maxHeapGB = toDecimalPlace(maximumHeapSize / GbToByte, decimalPlace);\n const inUseGB = totalHeapGB - freeMemoryGB;\n\n const getRow = (text: string, size: string, bottomBorder = false) => (\n <div\n className={classNames(`heap-usage-info-row`, {\n 'heading-bottom-border': bottomBorder,\n })}\n >\n <div className=\"font-weight-bold\">{text}</div>\n <div>{size}</div>\n </div>\n );\n\n const { timestamps, usages } = historyUsage.current;\n\n const lastTimestamp = timestamps[timestamps.length - 1] ?? 0;\n\n const totalPercentage = totalHeapSize / maximumHeapSize;\n const usedPercentage = (totalHeapSize - freeMemory) / maximumHeapSize;\n\n return (\n <>\n <div className=\"max-memory\">\n <div\n className=\"total-memory\"\n style={{\n width: `calc(${totalPercentage * 100}% - ${totalPercentage * 2}px`,\n }}\n />\n <div\n className={classNames('used-memory', {\n 'heap-overflow':\n (totalHeapSize - freeMemory) / maximumHeapSize > 0.95,\n })}\n style={{\n width: `calc(${usedPercentage * 100}% - ${usedPercentage * 2}px`,\n }}\n />\n <div className=\"memory-text\">{maxHeapGB.toFixed(1)} GB</div>\n </div>\n\n <Tooltip\n onEntered={() => setIsOpen(true)}\n onExited={() => setIsOpen(false)}\n interactive\n >\n <div className=\"heap-tooltip\">\n {getRow(\n 'In use:',\n `${inUseGB.toFixed(decimalPlace)} of ${maxHeapGB.toFixed(\n decimalPlace\n )} GB`,\n true\n )}\n {getRow('Free:', `${freeMemoryGB.toFixed(decimalPlace)} GB`)}\n {getRow('Total:', `${totalHeapGB.toFixed(decimalPlace)} GB`)}\n {getRow('Max:', `${maxHeapGB.toFixed(decimalPlace)} GB`)}\n <div className=\"heap-plot\">\n <Plot\n data={[\n {\n x: [...timestamps],\n y: [...usages],\n type: 'scatter',\n mode: 'lines',\n },\n ]}\n config={{ staticPlot: true, responsive: true }}\n style={{\n width: '196px',\n height: '100px',\n }}\n layout={{\n margin: { l: 2, t: 2, r: 2, b: 2 },\n plot_bgcolor: 'transparent',\n paper_bgcolor: 'transparent',\n colorway: ['#4878ea'],\n xaxis: {\n dtick: Math.round(monitorDuration / 6),\n gridcolor: ChartTheme.linecolor,\n range: [lastTimestamp - monitorDuration, lastTimestamp],\n linecolor: ChartTheme.linecolor,\n linewidth: 2,\n mirror: true,\n },\n yaxis: {\n dtick: 0.2,\n gridcolor: ChartTheme.linecolor,\n range: [0, 1],\n linecolor: ChartTheme.linecolor,\n linewidth: 2,\n mirror: true,\n },\n }}\n />\n </div>\n <div className=\"heap-utilisation-text\">\n % utilization over {Math.round(monitorDuration / 1000 / 60)} min.\n </div>\n </div>\n </Tooltip>\n </>\n );\n}\n\nexport default HeapUsage;\n"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,EAAgBC,MAAM,QAAQ,OAAO;AAC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Ae,EAAE2C,aAAa,CAAC;QACvDuB,SAAS,EAAE3E,UAAU,CAAC2E,SAAS;QAC/BE,SAAS,EAAE,CAAC;QACZC,MAAM,EAAE;MACV,CAAC;MACDC,KAAK,EAAE;QACLN,KAAK,EAAE,GAAG;QACVC,SAAS,EAAE1E,UAAU,CAAC2E,SAAS;QAC/BC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QACbD,SAAS,EAAE3E,UAAU,CAAC2E,SAAS;QAC/BE,SAAS,EAAE,CAAC;QACZC,MAAM,EAAE;MACV;IACF;EAAE,EACF,CACE,eACN;IAAK,SAAS,EAAC;EAAuB,GAAC,qBAClB,EAACtC,IAAI,CAACC,KAAK,CAAChC,eAAe,GAAG,IAAI,GAAG,EAAE,CAAC,EAAC,OAC9D,CAAM,CACF,CACE,CACT;AAEP;AAEA,eAAeL,SAAS"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
var CommandHistoryStorage = PropTypes.shape({
|
|
3
|
+
addItem: PropTypes.func.isRequired,
|
|
4
|
+
updateItem: PropTypes.func.isRequired,
|
|
5
|
+
getTable: PropTypes.func.isRequired
|
|
6
|
+
});
|
|
7
|
+
var CommandHistoryTable = PropTypes.shape({
|
|
8
|
+
size: PropTypes.number.isRequired,
|
|
9
|
+
getSnapshot: PropTypes.func.isRequired
|
|
10
|
+
});
|
|
11
|
+
var StoragePropTypes = Object.freeze({
|
|
12
|
+
CommandHistoryStorage,
|
|
13
|
+
CommandHistoryTable
|
|
14
|
+
});
|
|
15
|
+
export default StoragePropTypes;
|
|
16
|
+
//# sourceMappingURL=StoragePropTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StoragePropTypes.js","names":["PropTypes","CommandHistoryStorage","shape","addItem","func","isRequired","updateItem","getTable","CommandHistoryTable","size","number","getSnapshot","StoragePropTypes","Object","freeze"],"sources":["../src/StoragePropTypes.ts"],"sourcesContent":["import PropTypes from 'prop-types';\n\nconst CommandHistoryStorage = PropTypes.shape({\n addItem: PropTypes.func.isRequired,\n updateItem: PropTypes.func.isRequired,\n getTable: PropTypes.func.isRequired,\n});\n\nconst CommandHistoryTable = PropTypes.shape({\n size: PropTypes.number.isRequired,\n getSnapshot: PropTypes.func.isRequired,\n});\n\nconst StoragePropTypes = Object.freeze({\n CommandHistoryStorage,\n CommandHistoryTable,\n});\n\nexport default StoragePropTypes;\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,YAAY;AAElC,IAAMC,qBAAqB,GAAGD,SAAS,CAACE,KAAK,CAAC;EAC5CC,OAAO,EAAEH,SAAS,CAACI,IAAI,CAACC,UAAU;EAClCC,UAAU,EAAEN,SAAS,CAACI,IAAI,CAACC,UAAU;EACrCE,QAAQ,EAAEP,SAAS,CAACI,IAAI,CAACC;AAC3B,CAAC,CAAC;AAEF,IAAMG,mBAAmB,GAAGR,SAAS,CAACE,KAAK,CAAC;EAC1CO,IAAI,EAAET,SAAS,CAACU,MAAM,CAACL,UAAU;EACjCM,WAAW,EAAEX,SAAS,CAACI,IAAI,CAACC;AAC9B,CAAC,CAAC;AAEF,IAAMO,gBAAgB,GAAGC,MAAM,CAACC,MAAM,CAAC;EACrCb,qBAAqB;EACrBO;AACF,CAAC,CAAC;AAEF,eAAeI,gBAAgB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/* stylelint-disable scss/at-import-no-partial-leading-underscore */
|
|
2
|
+
.command-history {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
position: relative;
|
|
6
|
+
height: 100%;
|
|
7
|
+
width: 100%;
|
|
8
|
+
}
|
|
9
|
+
.command-history .command-history-list {
|
|
10
|
+
flex-grow: 1;
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
width: 100%;
|
|
13
|
+
height: 100%;
|
|
14
|
+
background-color: #211f22;
|
|
15
|
+
color: #929192;
|
|
16
|
+
padding: 0;
|
|
17
|
+
}
|
|
18
|
+
.command-history .command-history-list .item-list-scroll-pane {
|
|
19
|
+
border: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.command-history-search-bar {
|
|
23
|
+
background: #2d2a2e;
|
|
24
|
+
border-bottom: 2px solid #1a171a;
|
|
25
|
+
width: 100%;
|
|
26
|
+
padding: 0.25rem 0.25rem 0 0.25rem;
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-wrap: wrap;
|
|
29
|
+
flex-shrink: 0;
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
}
|
|
32
|
+
.command-history-search-bar .search-group {
|
|
33
|
+
flex-grow: 1;
|
|
34
|
+
margin-right: 0.25rem;
|
|
35
|
+
margin-bottom: 0.25rem;
|
|
36
|
+
}
|
|
37
|
+
.command-history-search-bar .search-group input {
|
|
38
|
+
background-color: #373438;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/*# sourceMappingURL=CommandHistory.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../../../node_modules/@deephaven/components/scss/custom.scss","../../src/command-history/CommandHistory.scss","../../../../node_modules/@deephaven/components/scss/bootstrap_overrides.scss","../../../../node_modules/@deephaven/components/scss/new_variables.scss"],"names":[],"mappings":"AAAA;ACOA;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA,kBCQO;EDPP,OCCO;EDAP;;AACA;EACE;;;AAKN;EACE,YClBc;EDmBd;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA,cEtCO;EFuCP,eEvCO;;AFwCP;EACE,kBClBK","file":"CommandHistory.css","sourcesContent":["/* stylelint-disable scss/at-import-no-partial-leading-underscore */\n// Consumers should be able to resolve bootstrap/ to node_modules/bootstrap\n\n//Make bootstrap functions available for use in overrides\n@import 'bootstrap/scss/_functions.scss';\n@import './bootstrap_overrides.scss';\n\n//_variable imports come after bootstrap default overrides,\n// makes all other variables and mixins from bootstrap available\n/// with just importing customer.scss\n@import 'bootstrap/scss/_variables.scss';\n@import 'bootstrap/scss/_mixins.scss';\n\n//New variables come after imports\n@import './new_variables.scss';\n","@import '@deephaven/components/scss/custom.scss';\n\n$command-history-bg: $gray-900;\n$command-history-color: $text-muted;\n$command-history-search-bg: $gray-800;\n$command-history-search-toolbar-bg: $content-bg;\n\n.command-history {\n display: flex;\n flex-direction: column;\n position: relative;\n height: 100%;\n width: 100%;\n\n .command-history-list {\n flex-grow: 1;\n overflow: hidden;\n width: 100%;\n height: 100%;\n background-color: $command-history-bg;\n color: $command-history-color;\n padding: 0;\n .item-list-scroll-pane {\n border: none;\n }\n }\n}\n\n.command-history-search-bar {\n background: $command-history-search-toolbar-bg;\n border-bottom: 2px solid $background;\n width: 100%;\n padding: $spacer-1 $spacer-1 0 $spacer-1;\n display: flex;\n flex-wrap: wrap;\n flex-shrink: 0;\n overflow: hidden;\n\n .search-group {\n flex-grow: 1;\n margin-right: $spacer-1;\n margin-bottom: $spacer-1;\n input {\n background-color: $command-history-search-bg;\n }\n }\n}\n","// Styling overrides for bootstrap\n\n// Override / set color variables\n$red: #f95d84;\n$orange: #f37e3f;\n$yellow: #fcd65b;\n$green: #9edc6f;\n$blue: #76d9e4;\n$purple: #aa9af4;\n\n//Define some UI colors\n$interfacegray: #2d2a2e;\n$interfaceblue: #4878ea;\n$interfacewhite: #f0f0ee; //same as gray-200\n$interfaceblack: #1a171a;\n\n//Define our Gray scale\n$white: $interfacewhite;\n$gray-100: #fcfcfa;\n$gray-200: $interfacewhite;\n$gray-300: #c0bfbf;\n$gray-400: #929192;\n$gray-500: #5b5a5c;\n$gray-600: #555356;\n$gray-700: #403e41;\n$gray-800: #373438;\n$gray-850: #322f33;\n$gray-900: #211f22;\n$black: $interfaceblack;\n$content-bg: $interfacegray;\n$background: $interfaceblack;\n$foreground: $interfacewhite;\n\n//Load colors into map\n$colors: ();\n$colors: map-merge(\n (\n 'red': $red,\n 'orange': $orange,\n 'yellow': $yellow,\n 'green': $green,\n 'blue': $blue,\n 'purple': $purple,\n 'white': $white,\n 'black': $black,\n ),\n $colors\n);\n\n//Set default colors\n$body-bg: $black;\n$body-color: $interfacewhite;\n\n// Set brand colors\n$primary: $interfaceblue;\n$primary-hover: darken($primary, 8%);\n$primary-dark: mix($primary, $content-bg, 25%);\n$primary-light: scale-color($primary, $lightness: -25%);\n$secondary: $gray-500;\n$secondary-hover: darken($secondary, 8%);\n$success: $green;\n$info: $yellow;\n$warning: $orange;\n$danger: $red;\n$danger-hover: darken($danger, 8%);\n$light: $gray-100;\n$mid: $gray-400; //Added a mid color, useful for input styling\n$dark: $gray-800;\n$green-dark: scale-color($green, $lightness: -45%, $saturation: -10%);\n\n$theme-colors: () !default;\n$theme-colors: map-merge(\n (\n 'primary': $primary,\n 'primary-hover': $primary-hover,\n 'primary-light': $primary-light,\n 'primary-dark': $primary-dark,\n 'secondary': $secondary,\n 'success': $success,\n 'info': $info,\n 'warning': $warning,\n 'danger': $danger,\n 'light': $light,\n 'dark': $dark,\n 'mid': $mid,\n 'content-bg': $interfacegray,\n 'background': $interfaceblack,\n 'foreground': $interfacewhite,\n ),\n $theme-colors\n);\n\n$component-active-bg: $primary;\n$theme-color-interval: 9%;\n$yiq-contrasted-threshold: 180;\n\n// Override fonts\n$font-family-sans-serif: 'Fira Sans', -apple-system, blinkmacsystemfont,\n 'Segoe UI', 'Roboto', 'Helvetica Neue', arial, sans-serif; //fira sans then native system ui fallbacks\n$font-family-monospace: 'Fira Mono', menlo, monaco, consolas, 'Liberation Mono',\n 'Courier New', monospace;\n$font-family-base: $font-family-sans-serif;\n\n$headings-font-weight: 400;\n\n//Text overides\n$text-muted: $gray-400;\n\n//Style Selection highlight color\n//so browsers add alpha to your color by default, ignoring opacity 1\n//by setting rgba with 0.99 it tricks browser into thinking there is alpha applied\n$text-select-color: $primary-hover;\n$text-select-color-editor: lighten(\n $gray-700,\n 15%\n); //we lighten it abit to account for that 0.01 loss, and because it needs some anyways.\n\n//Grid variables, same value as default just making easily accessible\n$grid-gutter-width: 30px;\n\n//Visual Overrides\n$border-radius: 4px;\n$box-shadow: 0 0.1rem 1rem rgba($black, 45%); //because our UI is so dark, we need darker default shadows\n$box-shadow-900: 0 0.1rem 1rem rgba(0, 0, 0, 45%); //darkest shadow for $black popups over $black UI\n\n//Override Btn\n$btn-border-radius: 4rem;\n$btn-padding-x: 1.5rem;\n$btn-transition: color 0.12s ease-in-out, background-color 0.12s ease-in-out,\n border-color 0.12s ease-in-out, box-shadow 0.12s ease-in-out; //default 0.15 is too long\n$btn-border-width: 2px;\n\n//Override Inputs\n$input-bg: $gray-600;\n$input-disabled-bg: $gray-800;\n$input-color: $foreground;\n$input-border-color: $gray-400;\n$input-placeholder-color: $gray-400;\n$input-focus-border-color: rgba($primary, 85%);\n\n$input-btn-focus-width: 0.2rem;\n$input-btn-focus-color: rgba($component-active-bg, 35%);\n$input-btn-focus-box-shadow: 0 0 0 $input-btn-focus-width $input-btn-focus-color;\n\n//checkbox\n$custom-control-indicator-bg: $gray-600;\n$custom-control-indicator-bg-size: 75% 75%;\n$custom-control-indicator-disabled-bg: $gray-800;\n$custom-control-indicator-checked-disabled-bg: $gray-800;\n$custom-control-label-disabled-color: $gray-400;\n\n//Custom Select\n$custom-select-indicator-color: $gray-400;\n$custom-select-bg-size: 16px 16px;\n//dhSort icon encoded\n$custom-select-indicator: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='#{$custom-select-indicator-color}' d='M4 7l-.4-.8 4-3.7h.8l4 3.7-.4.8H4zm0 2l-.4.8 4 3.7h.8l4-3.7L12 9H4z'/%3E%3C/svg%3E\"),\n '#',\n '%23'\n);\n$custom-select-focus-box-shadow: $input-btn-focus-box-shadow;\n$custom-select-disabled-color: darken($gray-400, 5%);\n$custom-select-disabled-bg: $gray-800;\n\n//modal\n$modal-content-bg: $gray-200;\n$modal-content-border-width: 0;\n$modal-md: 550px;\n\n// Toast notification\n$toast-bg: $primary-dark;\n$toast-color: $foreground;\n$toast-error-bg: mix($danger, $content-bg, 15%);\n$toast-error-color: $foreground;\n\n//tooltips\n$tooltip-bg: $gray-700;\n$tooltip-color: $foreground;\n$tooltip-box-shadow: 0 0.1rem 1.5rem 0.1rem rgba($black, 80%);\n\n//drowdowns\n$dropdown-bg: $gray-600;\n$dropdown-link-color: $foreground;\n$dropdown-link-hover-color: $foreground;\n$dropdown-link-hover-bg: $primary;\n$dropdown-divider-bg: $gray-700;\n\n//context menus\n$contextmenu-bg: $gray-600;\n$contextmenu-color: $foreground;\n$contextmenu-disabled-color: $text-muted;\n$contextmenu-keyboard-selected-bg: rgba($primary, 50%);\n$contextmenu-selected-bg: $primary;\n$contextmenu-selected-color: $foreground;\n\n//links\n$link-color: $gray-400;\n$link-hover-color: $foreground;\n\n//progress-bar\n$progress-bg: $gray-600;\n$progress-border-radius: 1rem;\n\n// Set global options\n$enable-shadows: false;\n$enable-gradients: false;\n$enable-print-styles: false; //I don't think anyone should expect to \"print\" this app.\n\n// Transition times\n$transition: 0.15s;\n$transition-mid: 0.2s;\n$transition-long: 0.3s;\n$transition-slow: 0.6s;\n\n//form-validation icon, uses vsWarning icon encoded here as svg\n$form-feedback-icon-invalid-color: theme-color('danger');\n$form-feedback-icon-invalid: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cg fill='none'%3E%3Cg fill='#{$form-feedback-icon-invalid-color}'%3E%3Cpath d='M7.56 1h.88l6.54 12.26-.44.74H1.44L1 13.26 7.56 1zM8 2.28 2.28 13H13.7L8 2.28zM8.625 12v-1h-1.25v1h1.25zm-1.25-2V6h1.25v4h-1.25z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E \"),\n '#',\n '%23'\n);\n","//Set of spacer variables from the spacer map\n$spacer-0: map-get($spacers, 0); //0\n$spacer-1: map-get($spacers, 1);\n$spacer-2: map-get($spacers, 2);\n$spacer-3: map-get($spacers, 3);\n$spacer-4: map-get($spacers, 4);\n$spacer-5: map-get($spacers, 5);\n\n//Marching Ants for golden layout dropzone and drag and drop\n//top bottom, left right.\n//create 4 background images that are 50% color 1, 50% color 2 using graidents, two veritical, two horizontal\n//size them to ant-size and thickness\n//position those images along the egdes and make top/bottom repeat-x and left/right repeat-y\n//then offest each of those background positions by ant-size in animation to make them march.\n$ant-size: 8px;\n$ant-thickness: 1px;\n\n@mixin ants-base($color-1: black, $color-2: white) {\n background-image: linear-gradient(to right, $color-2 50%, $color-1 50%),\n linear-gradient(to right, $color-2 50%, $color-1 50%),\n linear-gradient(to bottom, $color-2 50%, $color-1 50%),\n linear-gradient(to bottom, $color-2 50%, $color-1 50%);\n background-size: $ant-size $ant-thickness, $ant-size $ant-thickness,\n $ant-thickness $ant-size, $ant-thickness $ant-size;\n background-position: 0 top, 0 bottom, left 0, right 0;\n background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;\n animation: march 0.5s;\n animation-timing-function: linear;\n animation-iteration-count: infinite;\n}\n\n@mixin drag-stack($pseudo-element) {\n &::#{$pseudo-element} {\n content: ' ';\n background: $primary;\n box-shadow: $box-shadow;\n border-radius: $border-radius;\n position: absolute;\n height: 100%;\n width: 100%;\n @content;\n }\n}\n\n$focus-bg-transparency: 0.12;\n$hover-bg-transparency: 0.14;\n$active-bg-transparency: 0.28;\n$exception-transparency: 0.13;\n"]}
|