@jfvilas/kwirth-plugin-tasklist 0.1.0 → 0.1.1
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/README.md +18 -5
- package/front.js +536 -211
- package/package.json +1 -1
package/front.js
CHANGED
|
@@ -1300,7 +1300,7 @@
|
|
|
1300
1300
|
}
|
|
1301
1301
|
return node;
|
|
1302
1302
|
}
|
|
1303
|
-
var
|
|
1303
|
+
var React20 = __toESM2(require_react());
|
|
1304
1304
|
var import_prop_types3 = __toESM2(require_prop_types());
|
|
1305
1305
|
var import_react_dom3 = __toESM2(require_react_dom());
|
|
1306
1306
|
var log2 = typeof process !== "undefined" && process.env.DRAGGABLE_DEBUG ? console.log.bind(console) : function noop2() {
|
|
@@ -1319,7 +1319,7 @@
|
|
|
1319
1319
|
}
|
|
1320
1320
|
};
|
|
1321
1321
|
var dragEventFor2 = eventsFor2.mouse;
|
|
1322
|
-
var DraggableCore2 = class extends
|
|
1322
|
+
var DraggableCore2 = class extends React20.Component {
|
|
1323
1323
|
constructor() {
|
|
1324
1324
|
super(...arguments);
|
|
1325
1325
|
this.dragging = false;
|
|
@@ -1466,7 +1466,7 @@
|
|
|
1466
1466
|
return null;
|
|
1467
1467
|
}
|
|
1468
1468
|
render() {
|
|
1469
|
-
return
|
|
1469
|
+
return React20.cloneElement(React20.Children.only(this.props.children), {
|
|
1470
1470
|
// Note: mouseMove handler is attached to document so it will still function
|
|
1471
1471
|
// when the user drags quickly and leaves the bounds of the element.
|
|
1472
1472
|
onMouseDown: this.onMouseDown,
|
|
@@ -2111,7 +2111,7 @@
|
|
|
2111
2111
|
"use strict";
|
|
2112
2112
|
exports.__esModule = true;
|
|
2113
2113
|
exports.default = void 0;
|
|
2114
|
-
var
|
|
2114
|
+
var React20 = _interopRequireWildcard(require_react());
|
|
2115
2115
|
var _reactDraggable = require_cjs();
|
|
2116
2116
|
var _utils = require_utils();
|
|
2117
2117
|
var _propTypes = require_propTypes();
|
|
@@ -2186,7 +2186,7 @@
|
|
|
2186
2186
|
}
|
|
2187
2187
|
return ("string" === r2 ? String : Number)(t);
|
|
2188
2188
|
}
|
|
2189
|
-
var Resizable2 = class extends
|
|
2189
|
+
var Resizable2 = class extends React20.Component {
|
|
2190
2190
|
constructor() {
|
|
2191
2191
|
super(...arguments);
|
|
2192
2192
|
this.handleRefs = {};
|
|
@@ -2299,7 +2299,7 @@
|
|
|
2299
2299
|
renderResizeHandle(handleAxis, ref) {
|
|
2300
2300
|
const handle = this.props.handle;
|
|
2301
2301
|
if (!handle) {
|
|
2302
|
-
return /* @__PURE__ */
|
|
2302
|
+
return /* @__PURE__ */ React20.createElement("span", {
|
|
2303
2303
|
className: "react-resizable-handle react-resizable-handle-" + handleAxis,
|
|
2304
2304
|
ref
|
|
2305
2305
|
});
|
|
@@ -2313,16 +2313,16 @@
|
|
|
2313
2313
|
}, isDOMElement ? {} : {
|
|
2314
2314
|
handleAxis
|
|
2315
2315
|
});
|
|
2316
|
-
return /* @__PURE__ */
|
|
2316
|
+
return /* @__PURE__ */ React20.cloneElement(handle, props);
|
|
2317
2317
|
}
|
|
2318
2318
|
render() {
|
|
2319
2319
|
const _this$props2 = this.props, children = _this$props2.children, className = _this$props2.className, draggableOpts = _this$props2.draggableOpts, width = _this$props2.width, height = _this$props2.height, handle = _this$props2.handle, handleSize = _this$props2.handleSize, lockAspectRatio = _this$props2.lockAspectRatio, axis = _this$props2.axis, minConstraints = _this$props2.minConstraints, maxConstraints = _this$props2.maxConstraints, onResize = _this$props2.onResize, onResizeStop = _this$props2.onResizeStop, onResizeStart = _this$props2.onResizeStart, resizeHandles = _this$props2.resizeHandles, transformScale = _this$props2.transformScale, p = _objectWithoutPropertiesLoose(_this$props2, _excluded);
|
|
2320
2320
|
return (0, _utils.cloneElement)(children, _objectSpread(_objectSpread({}, p), {}, {
|
|
2321
2321
|
className: (className ? className + " " : "") + "react-resizable",
|
|
2322
|
-
children: [...
|
|
2322
|
+
children: [...React20.Children.toArray(children.props.children), ...resizeHandles.map((handleAxis) => {
|
|
2323
2323
|
var _this$handleRefs$hand;
|
|
2324
|
-
const ref = (_this$handleRefs$hand = this.handleRefs[handleAxis]) != null ? _this$handleRefs$hand : this.handleRefs[handleAxis] = /* @__PURE__ */
|
|
2325
|
-
return /* @__PURE__ */
|
|
2324
|
+
const ref = (_this$handleRefs$hand = this.handleRefs[handleAxis]) != null ? _this$handleRefs$hand : this.handleRefs[handleAxis] = /* @__PURE__ */ React20.createRef();
|
|
2325
|
+
return /* @__PURE__ */ React20.createElement(_reactDraggable.DraggableCore, _extends({}, draggableOpts, {
|
|
2326
2326
|
nodeRef: ref,
|
|
2327
2327
|
key: "resizableHandle-" + handleAxis,
|
|
2328
2328
|
onStop: this.resizeHandler("onResizeStop", handleAxis),
|
|
@@ -2353,7 +2353,7 @@
|
|
|
2353
2353
|
"use strict";
|
|
2354
2354
|
exports.__esModule = true;
|
|
2355
2355
|
exports.default = void 0;
|
|
2356
|
-
var
|
|
2356
|
+
var React20 = _interopRequireWildcard(require_react());
|
|
2357
2357
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
2358
2358
|
var _Resizable = _interopRequireDefault(require_Resizable());
|
|
2359
2359
|
var _propTypes2 = require_propTypes();
|
|
@@ -2431,7 +2431,7 @@
|
|
|
2431
2431
|
}
|
|
2432
2432
|
return t;
|
|
2433
2433
|
}
|
|
2434
|
-
var ResizableBox = class extends
|
|
2434
|
+
var ResizableBox = class extends React20.Component {
|
|
2435
2435
|
constructor() {
|
|
2436
2436
|
super(...arguments);
|
|
2437
2437
|
this.state = {
|
|
@@ -2463,7 +2463,7 @@
|
|
|
2463
2463
|
}
|
|
2464
2464
|
render() {
|
|
2465
2465
|
const _this$props = this.props, handle = _this$props.handle, handleSize = _this$props.handleSize, onResize = _this$props.onResize, onResizeStart = _this$props.onResizeStart, onResizeStop = _this$props.onResizeStop, draggableOpts = _this$props.draggableOpts, minConstraints = _this$props.minConstraints, maxConstraints = _this$props.maxConstraints, lockAspectRatio = _this$props.lockAspectRatio, axis = _this$props.axis, width = _this$props.width, height = _this$props.height, resizeHandles = _this$props.resizeHandles, style = _this$props.style, transformScale = _this$props.transformScale, props = _objectWithoutPropertiesLoose(_this$props, _excluded);
|
|
2466
|
-
return /* @__PURE__ */
|
|
2466
|
+
return /* @__PURE__ */ React20.createElement(_Resizable.default, {
|
|
2467
2467
|
axis,
|
|
2468
2468
|
draggableOpts,
|
|
2469
2469
|
handle,
|
|
@@ -2478,7 +2478,7 @@
|
|
|
2478
2478
|
resizeHandles,
|
|
2479
2479
|
transformScale,
|
|
2480
2480
|
width: this.state.width
|
|
2481
|
-
}, /* @__PURE__ */
|
|
2481
|
+
}, /* @__PURE__ */ React20.createElement("div", _extends({}, props, {
|
|
2482
2482
|
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
2483
2483
|
width: this.state.width + "px",
|
|
2484
2484
|
height: this.state.height + "px"
|
|
@@ -2522,7 +2522,7 @@
|
|
|
2522
2522
|
var TasklistSetup = () => null;
|
|
2523
2523
|
|
|
2524
2524
|
// src/front/TasklistTabContent.tsx
|
|
2525
|
-
var
|
|
2525
|
+
var import_react18 = __toESM(require_react(), 1);
|
|
2526
2526
|
var import_kwirth_common_front = __toESM(require_kwirth_common_front(), 1);
|
|
2527
2527
|
var import_material2 = __toESM(require_material(), 1);
|
|
2528
2528
|
|
|
@@ -2554,6 +2554,7 @@
|
|
|
2554
2554
|
return EProcessColumn2;
|
|
2555
2555
|
})(EProcessColumn || {});
|
|
2556
2556
|
var TASK_MANAGER_WINDOW = "taskmanager";
|
|
2557
|
+
var CONTROL_PANEL_WINDOW = "controlpanel";
|
|
2557
2558
|
|
|
2558
2559
|
// src/front/TasklistSession.ts
|
|
2559
2560
|
var HISTORY_POINTS = 120;
|
|
@@ -2590,10 +2591,16 @@
|
|
|
2590
2591
|
this.compact = false;
|
|
2591
2592
|
// the desktop's windows: the Task Manager's, the Notepads open, and which is in front of which (the last, active)
|
|
2592
2593
|
this.taskManager = { maximized: false, minimized: false };
|
|
2593
|
-
|
|
2594
|
-
|
|
2594
|
+
/*
|
|
2595
|
+
Closed — as the desktop starts (D24), or with its own close button —: off the desktop and the taskbar, asking
|
|
2596
|
+
the cluster nothing; Start opens it.
|
|
2597
|
+
*/
|
|
2598
|
+
this.taskManagerOpen = false;
|
|
2599
|
+
// the Control Panel: closed until Start opens it
|
|
2600
|
+
this.controlPanel = { maximized: false, minimized: false };
|
|
2601
|
+
this.controlPanelOpen = false;
|
|
2595
2602
|
this.notepads = [];
|
|
2596
|
-
this.zOrder = [
|
|
2603
|
+
this.zOrder = [];
|
|
2597
2604
|
this.notepadSequence = 0;
|
|
2598
2605
|
this.listeners = /* @__PURE__ */ new Set();
|
|
2599
2606
|
this.asking = false;
|
|
@@ -2607,7 +2614,11 @@
|
|
|
2607
2614
|
this.changed = () => {
|
|
2608
2615
|
for (const listener of this.listeners) listener();
|
|
2609
2616
|
};
|
|
2610
|
-
|
|
2617
|
+
/*
|
|
2618
|
+
The instance exists: one snapshot, which the desktop needs even with the Task Manager closed (the key's
|
|
2619
|
+
permissions say whether Run... is on; the namespaces fill Create New Task). The rest come at the Update Speed
|
|
2620
|
+
once the Task Manager is open.
|
|
2621
|
+
*/
|
|
2611
2622
|
this.connected = () => {
|
|
2612
2623
|
void this.refresh();
|
|
2613
2624
|
};
|
|
@@ -2677,7 +2688,16 @@
|
|
|
2677
2688
|
};
|
|
2678
2689
|
// ─── the desktop's windows ────────────────────────────────────────────────────────────────────
|
|
2679
2690
|
// A window's frame; none for a window that is not on the desktop (a closed Task Manager, a closed Notepad).
|
|
2680
|
-
this.frameOf = (id) =>
|
|
2691
|
+
this.frameOf = (id) => {
|
|
2692
|
+
switch (id) {
|
|
2693
|
+
case TASK_MANAGER_WINDOW:
|
|
2694
|
+
return this.taskManagerOpen ? this.taskManager : void 0;
|
|
2695
|
+
case CONTROL_PANEL_WINDOW:
|
|
2696
|
+
return this.controlPanelOpen ? this.controlPanel : void 0;
|
|
2697
|
+
default:
|
|
2698
|
+
return this.notepads.find((n) => n.id === id)?.frame;
|
|
2699
|
+
}
|
|
2700
|
+
};
|
|
2681
2701
|
// The window in front: the last of the z-order that is not minimised.
|
|
2682
2702
|
this.activeWindow = () => [...this.zOrder].reverse().find((id) => this.frameOf(id)?.minimized === false);
|
|
2683
2703
|
// A move, a resize, a maximise or a minimise of a window. Restoring one brings it to the front.
|
|
@@ -2717,6 +2737,22 @@
|
|
|
2717
2737
|
this.changed();
|
|
2718
2738
|
void this.refresh();
|
|
2719
2739
|
};
|
|
2740
|
+
// Start → Control Panel: in front if it is open; opened, where it was left, if not.
|
|
2741
|
+
this.openControlPanel = () => {
|
|
2742
|
+
if (this.controlPanelOpen) {
|
|
2743
|
+
this.activate(CONTROL_PANEL_WINDOW);
|
|
2744
|
+
return;
|
|
2745
|
+
}
|
|
2746
|
+
this.controlPanelOpen = true;
|
|
2747
|
+
this.controlPanel.minimized = false;
|
|
2748
|
+
this.zOrder = [...this.zOrder, CONTROL_PANEL_WINDOW];
|
|
2749
|
+
this.changed();
|
|
2750
|
+
};
|
|
2751
|
+
this.closeControlPanel = () => {
|
|
2752
|
+
this.controlPanelOpen = false;
|
|
2753
|
+
this.zOrder = this.zOrder.filter((w) => w !== CONTROL_PANEL_WINDOW);
|
|
2754
|
+
this.changed();
|
|
2755
|
+
};
|
|
2720
2756
|
// A new Notepad on the desktop, in front, a little down and right of the last one opened (as Windows cascades them).
|
|
2721
2757
|
this.openNotepad = (title, text, readOnly, yaml2, save) => {
|
|
2722
2758
|
const id = `notepad-${++this.notepadSequence}`;
|
|
@@ -2813,9 +2849,92 @@
|
|
|
2813
2849
|
};
|
|
2814
2850
|
|
|
2815
2851
|
// src/front/window/TaskManagerWindow.tsx
|
|
2816
|
-
var
|
|
2852
|
+
var import_react17 = __toESM(require_react(), 1);
|
|
2817
2853
|
|
|
2818
2854
|
// src/front/window/Taskbar.tsx
|
|
2855
|
+
var import_react6 = __toESM(require_react(), 1);
|
|
2856
|
+
|
|
2857
|
+
// src/front/luna/LunaIcons.tsx
|
|
2858
|
+
var import_react3 = __toESM(require_react(), 1);
|
|
2859
|
+
var WindowIcon = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 16 16", className: "tl-title-icon" }, /* @__PURE__ */ import_react3.default.createElement("rect", { x: "1", y: "1.5", width: "14", height: "10", rx: "1", fill: "#dfe8f6", stroke: "#26457c" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "2.5", y: "3", width: "11", height: "7", fill: "#0b1b0b" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "4", y: "7", width: "2", height: "2.5", fill: "#1ee81e" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "7", y: "5", width: "2", height: "4.5", fill: "#1ee81e" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "10", y: "4", width: "2", height: "5.5", fill: "#1ee81e" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "5", y: "12", width: "6", height: "1.5", fill: "#7d8aa3" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "3.5", y: "13.5", width: "9", height: "1.5", rx: ".5", fill: "#b4bfd1", stroke: "#5d6a82", strokeWidth: ".5" }));
|
|
2860
|
+
var ApplicationIcon = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 16 16" }, /* @__PURE__ */ import_react3.default.createElement("rect", { x: "1.5", y: "2.5", width: "13", height: "11", rx: "1", fill: "#fff", stroke: "#3c5a8c" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "1.5", y: "2.5", width: "13", height: "3", rx: "1", fill: "#2f6be0" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "3", y: "7", width: "5", height: "1", fill: "#9aaac5" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "3", y: "9", width: "8", height: "1", fill: "#9aaac5" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "3", y: "11", width: "6", height: "1", fill: "#9aaac5" }));
|
|
2861
|
+
var NotepadIcon = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 16 16", className: "tl-title-icon" }, /* @__PURE__ */ import_react3.default.createElement("rect", { x: "3", y: "1.5", width: "11", height: "13", rx: ".8", fill: "#fff", stroke: "#5a6f99", strokeWidth: ".8" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "3", y: "1.5", width: "11", height: "2.4", fill: "#3f7ad8" }), [6, 8, 10, 12].map((y) => /* @__PURE__ */ import_react3.default.createElement("rect", { key: y, x: "5", y, width: "7", height: ".7", fill: "#9aaac5" })), [4.5, 7, 9.5, 12].map((y) => /* @__PURE__ */ import_react3.default.createElement("circle", { key: y, cx: "3", cy: y, r: ".9", fill: "none", stroke: "#55606f", strokeWidth: ".6" })));
|
|
2862
|
+
var ProcessIcon = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 32 32", style: { width: 32, height: 32 } }, /* @__PURE__ */ import_react3.default.createElement("rect", { x: "3", y: "5", width: "26", height: "22", rx: "2", fill: "#fff", stroke: "#3c5a8c", strokeWidth: "1.5" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "3", y: "5", width: "26", height: "5", rx: "2", fill: "#2f6be0" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "7", y: "14", width: "4", height: "4", fill: "#3c9a3c" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "14", y: "14", width: "4", height: "4", fill: "#3c9a3c" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "21", y: "14", width: "4", height: "4", fill: "#3c9a3c" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "7", y: "20", width: "18", height: "2", fill: "#9aaac5" }));
|
|
2863
|
+
var WarningIcon = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 32 32" }, /* @__PURE__ */ import_react3.default.createElement("path", { d: "M16 2.5 L30.5 28.5 H1.5 Z", fill: "#fcd226", stroke: "#8a6b00", strokeWidth: "1.2", strokeLinejoin: "round" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "14.4", y: "10", width: "3.2", height: "11", rx: "1.2", fill: "#000" }), /* @__PURE__ */ import_react3.default.createElement("circle", { cx: "16", cy: "24.5", r: "1.9", fill: "#000" }));
|
|
2864
|
+
var ErrorIcon = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 32 32" }, /* @__PURE__ */ import_react3.default.createElement("circle", { cx: "16", cy: "16", r: "14", fill: "#e0301e", stroke: "#8c1206", strokeWidth: "1.2" }), /* @__PURE__ */ import_react3.default.createElement("path", { d: "M10 10 L22 22 M22 10 L10 22", stroke: "#fff", strokeWidth: "3.4", strokeLinecap: "round" }));
|
|
2865
|
+
var InfoIcon = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 32 32" }, /* @__PURE__ */ import_react3.default.createElement("circle", { cx: "16", cy: "16", r: "14", fill: "#fff", stroke: "#2a5ec8", strokeWidth: "2" }), /* @__PURE__ */ import_react3.default.createElement("circle", { cx: "16", cy: "9.5", r: "2.2", fill: "#2a5ec8" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "14", y: "13.5", width: "4", height: "11", rx: "1", fill: "#2a5ec8" }));
|
|
2866
|
+
var RunIcon = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 32 32" }, /* @__PURE__ */ import_react3.default.createElement("rect", { x: "3", y: "6", width: "22", height: "18", rx: "2", fill: "#fff", stroke: "#3c5a8c", strokeWidth: "1.5" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "3", y: "6", width: "22", height: "4", rx: "2", fill: "#2f6be0" }), /* @__PURE__ */ import_react3.default.createElement("path", { d: "M17 18 L29 18 L25 14 M29 18 L25 22", stroke: "#3c9a3c", strokeWidth: "2.4", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }));
|
|
2867
|
+
var heptagon = (cx, cy, r2) => Array.from({ length: 7 }, (_, i) => {
|
|
2868
|
+
const a = -Math.PI / 2 + i * 2 * Math.PI / 7;
|
|
2869
|
+
return `${(cx + r2 * Math.cos(a)).toFixed(2)},${(cy + r2 * Math.sin(a)).toFixed(2)}`;
|
|
2870
|
+
}).join(" ");
|
|
2871
|
+
var KubernetesLogo = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 32 32", className: "tl-start-logo" }, /* @__PURE__ */ import_react3.default.createElement("polygon", { points: heptagon(16, 16.6, 15), fill: "#326ce5", stroke: "#fff", strokeWidth: "1.2", strokeLinejoin: "round" }), /* @__PURE__ */ import_react3.default.createElement("circle", { cx: "16", cy: "16.6", r: "7", fill: "none", stroke: "#fff", strokeWidth: "1.9" }), Array.from({ length: 7 }, (_, i) => {
|
|
2872
|
+
const a = -Math.PI / 2 + i * 2 * Math.PI / 7;
|
|
2873
|
+
return /* @__PURE__ */ import_react3.default.createElement(
|
|
2874
|
+
"line",
|
|
2875
|
+
{
|
|
2876
|
+
key: i,
|
|
2877
|
+
x1: 16 + 2.2 * Math.cos(a),
|
|
2878
|
+
y1: 16.6 + 2.2 * Math.sin(a),
|
|
2879
|
+
x2: 16 + 10.5 * Math.cos(a),
|
|
2880
|
+
y2: 16.6 + 10.5 * Math.sin(a),
|
|
2881
|
+
stroke: "#fff",
|
|
2882
|
+
strokeWidth: "1.9",
|
|
2883
|
+
strokeLinecap: "round"
|
|
2884
|
+
}
|
|
2885
|
+
);
|
|
2886
|
+
}), /* @__PURE__ */ import_react3.default.createElement("circle", { cx: "16", cy: "16.6", r: "2.2", fill: "#fff" }));
|
|
2887
|
+
var TrayCpuIcon = ({ cpu }) => {
|
|
2888
|
+
const lit = Math.round(Math.min(100, Math.max(0, cpu)) / 100 * 12);
|
|
2889
|
+
return /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 16 16", className: "tl-tray-icon" }, /* @__PURE__ */ import_react3.default.createElement("rect", { x: "1", y: "1", width: "14", height: "14", fill: "#000", stroke: "#7d8aa3", strokeWidth: ".8" }), Array.from({ length: 12 }, (_, i) => /* @__PURE__ */ import_react3.default.createElement("rect", { key: i, x: "4", y: 13.6 - i, width: "8", height: ".6", fill: i < lit ? "#1ee81e" : "#0b5d23" })));
|
|
2890
|
+
};
|
|
2891
|
+
var ComputerIcon = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 24 24", className: "tl-sm-icon" }, /* @__PURE__ */ import_react3.default.createElement("rect", { x: "2.5", y: "3", width: "19", height: "13", rx: "1.2", fill: "#dfe8f6", stroke: "#3b5a8f" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "4.2", y: "4.7", width: "15.6", height: "9.6", fill: "#2f6be0" }), /* @__PURE__ */ import_react3.default.createElement("path", { d: "M4.2 4.7h15.6v3.5L4.2 12z", fill: "#5d92f0" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "9", y: "16", width: "6", height: "2.5", fill: "#8a96ab" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "5.5", y: "18.5", width: "13", height: "2.5", rx: "1", fill: "#c3cbd8", stroke: "#5d6a82", strokeWidth: ".6" }));
|
|
2892
|
+
var UsersIcon = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 24 24", className: "tl-sm-icon" }, /* @__PURE__ */ import_react3.default.createElement("circle", { cx: "15.5", cy: "8", r: "3.6", fill: "#f2c79a", stroke: "#8a5a2b", strokeWidth: ".7" }), /* @__PURE__ */ import_react3.default.createElement("path", { d: "M9.5 21c0-4 2.7-6.5 6-6.5s6 2.5 6 6.5z", fill: "#3b8a3b", stroke: "#1f5a1f", strokeWidth: ".7" }), /* @__PURE__ */ import_react3.default.createElement("circle", { cx: "8.5", cy: "9", r: "3.6", fill: "#f7d4ad", stroke: "#8a5a2b", strokeWidth: ".7" }), /* @__PURE__ */ import_react3.default.createElement("path", { d: "M2.5 22c0-4 2.7-6.5 6-6.5s6 2.5 6 6.5z", fill: "#2f6be0", stroke: "#1d438f", strokeWidth: ".7" }));
|
|
2893
|
+
var HelpIcon = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 24 24", className: "tl-sm-icon" }, /* @__PURE__ */ import_react3.default.createElement("circle", { cx: "12", cy: "12", r: "10", fill: "#2f6be0", stroke: "#1d438f" }), /* @__PURE__ */ import_react3.default.createElement("path", { d: "M9 9.3a3 3 0 1 1 4.4 2.7c-.9.5-1.4 1-1.4 2.2", fill: "none", stroke: "#fff", strokeWidth: "2.2", strokeLinecap: "round" }), /* @__PURE__ */ import_react3.default.createElement("circle", { cx: "12", cy: "17.6", r: "1.3", fill: "#fff" }));
|
|
2894
|
+
var LogOffIcon = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 24 24", className: "tl-sm-foot-icon" }, /* @__PURE__ */ import_react3.default.createElement("rect", { x: "1", y: "1", width: "22", height: "22", rx: "3", fill: "#f0a030", stroke: "#fff", strokeWidth: "1.2" }), /* @__PURE__ */ import_react3.default.createElement("circle", { cx: "9", cy: "9", r: "3.6", fill: "none", stroke: "#fff", strokeWidth: "2" }), /* @__PURE__ */ import_react3.default.createElement("path", { d: "M11.6 11.6l6.5 6.5M15.5 15.5l1.8-1.8M17.3 17.3l1.8-1.8", stroke: "#fff", strokeWidth: "2", strokeLinecap: "round" }));
|
|
2895
|
+
var TurnOffIcon = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 24 24", className: "tl-sm-foot-icon" }, /* @__PURE__ */ import_react3.default.createElement("rect", { x: "1", y: "1", width: "22", height: "22", rx: "3", fill: "#e0441e", stroke: "#fff", strokeWidth: "1.2" }), /* @__PURE__ */ import_react3.default.createElement("path", { d: "M8.2 7.5a6 6 0 1 0 7.6 0", fill: "none", stroke: "#fff", strokeWidth: "2.2", strokeLinecap: "round" }), /* @__PURE__ */ import_react3.default.createElement("path", { d: "M12 4.5v7", stroke: "#fff", strokeWidth: "2.2", strokeLinecap: "round" }));
|
|
2896
|
+
var ControlPanelIcon = ({ title }) => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 24 24", className: title ? "tl-title-icon" : "tl-sm-icon" }, /* @__PURE__ */ import_react3.default.createElement("rect", { x: "2", y: "3", width: "20", height: "17", rx: "1.5", fill: "#fff", stroke: "#3b5a8f" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "2", y: "3", width: "20", height: "4", rx: "1.5", fill: "#2f6be0" }), /* @__PURE__ */ import_react3.default.createElement("path", { d: "M6 11h8M6 15h12", stroke: "#9aaac5", strokeWidth: "1.6" }), /* @__PURE__ */ import_react3.default.createElement("circle", { cx: "17", cy: "11", r: "2", fill: "#3c9a3c" }));
|
|
2897
|
+
var GreenArrow = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 16 16", className: "tl-sm-arrow" }, /* @__PURE__ */ import_react3.default.createElement("rect", { x: ".5", y: ".5", width: "15", height: "15", rx: "2", fill: "#3c9a3c", stroke: "#2a6e2a" }), /* @__PURE__ */ import_react3.default.createElement("path", { d: "M6 3.5l5 4.5-5 4.5z", fill: "#fff" }));
|
|
2898
|
+
var CheckMark = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 9 9" }, /* @__PURE__ */ import_react3.default.createElement("path", { d: "M1 4.5 L3.5 7 L8 1.5", stroke: "#21a121", strokeWidth: "2", fill: "none" }));
|
|
2899
|
+
var MenuCheck = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 10 10", className: "tl-menu-check" }, /* @__PURE__ */ import_react3.default.createElement("path", { d: "M1.5 5 L4 7.5 L8.5 2", stroke: "currentColor", strokeWidth: "1.8", fill: "none" }));
|
|
2900
|
+
var MenuRadio = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 10 10", className: "tl-menu-check" }, /* @__PURE__ */ import_react3.default.createElement("circle", { cx: "5", cy: "5", r: "2.5", fill: "currentColor" }));
|
|
2901
|
+
var MinimizeGlyph = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 13 13" }, /* @__PURE__ */ import_react3.default.createElement("rect", { x: "3", y: "9", width: "6", height: "2", fill: "#fff" }));
|
|
2902
|
+
var MaximizeGlyph = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 13 13" }, /* @__PURE__ */ import_react3.default.createElement("rect", { x: "2.5", y: "2.5", width: "8", height: "8", fill: "none", stroke: "#fff", strokeWidth: "1" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "2", y: "2", width: "9", height: "2", fill: "#fff" }));
|
|
2903
|
+
var RestoreGlyph = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 13 13" }, /* @__PURE__ */ import_react3.default.createElement("rect", { x: "4.5", y: "1.5", width: "7", height: "6", fill: "none", stroke: "#fff" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "4", y: "1", width: "8", height: "2", fill: "#fff" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "1.5", y: "5.5", width: "7", height: "6", fill: "#1f5bd8", stroke: "#fff" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "1", y: "5", width: "8", height: "2", fill: "#fff" }));
|
|
2904
|
+
var CloseGlyph = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 13 13" }, /* @__PURE__ */ import_react3.default.createElement("path", { d: "M3 3 L10 10 M10 3 L3 10", stroke: "#fff", strokeWidth: "2" }));
|
|
2905
|
+
|
|
2906
|
+
// src/front/Format.ts
|
|
2907
|
+
var thousands = (n) => Math.round(n).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
2908
|
+
var kilobytes = (bytes2) => bytes2 === void 0 ? "" : `${thousands(bytes2 / 1024)} K`;
|
|
2909
|
+
var kilobytesBare = (bytes2) => bytes2 === void 0 ? "" : thousands(bytes2 / 1024);
|
|
2910
|
+
var cpuColumn = (percent2) => {
|
|
2911
|
+
if (percent2 === void 0) return "";
|
|
2912
|
+
const n = Math.min(100, Math.max(0, Math.round(percent2)));
|
|
2913
|
+
return n < 10 ? `0${n}` : String(n);
|
|
2914
|
+
};
|
|
2915
|
+
var cpuTime = (seconds) => {
|
|
2916
|
+
if (seconds === void 0) return "";
|
|
2917
|
+
const s = Math.floor(seconds);
|
|
2918
|
+
const h = Math.floor(s / 3600);
|
|
2919
|
+
const m = Math.floor(s % 3600 / 60);
|
|
2920
|
+
return `${h}:${String(m).padStart(2, "0")}:${String(s % 60).padStart(2, "0")}`;
|
|
2921
|
+
};
|
|
2922
|
+
var percent = (value) => value === void 0 ? "--" : `${Math.round(value)}%`;
|
|
2923
|
+
var megabytes = (bytes2) => `${Math.round(bytes2 / 1024 / 1024)}M`;
|
|
2924
|
+
var meterBytes = (bytes2) => bytes2 >= 10 * 1024 ** 3 ? `${(bytes2 / 1024 ** 3).toFixed(1)} GB` : `${Math.round(bytes2 / 1024 / 1024)} MB`;
|
|
2925
|
+
var utilisation = (value) => {
|
|
2926
|
+
if (value === void 0) return "0 %";
|
|
2927
|
+
if (value === 0) return "0 %";
|
|
2928
|
+
return value < 1 ? `${value.toFixed(2)} %` : `${Math.round(value)} %`;
|
|
2929
|
+
};
|
|
2930
|
+
var linkSpeed = (bps) => bps >= 1e9 ? `${bps / 1e9} Gbps` : `${bps / 1e6} Mbps`;
|
|
2931
|
+
var NETWORK_SCALES = [1, 5, 10, 25, 50, 100];
|
|
2932
|
+
var networkScale = (values) => {
|
|
2933
|
+
const peak = Math.max(0, ...values);
|
|
2934
|
+
return NETWORK_SCALES.find((s) => peak <= s) ?? 100;
|
|
2935
|
+
};
|
|
2936
|
+
|
|
2937
|
+
// src/front/window/StartMenu.tsx
|
|
2819
2938
|
var import_react5 = __toESM(require_react(), 1);
|
|
2820
2939
|
|
|
2821
2940
|
// src/front/luna/LunaControls.tsx
|
|
@@ -2842,7 +2961,7 @@
|
|
|
2842
2961
|
}
|
|
2843
2962
|
|
|
2844
2963
|
// node_modules/react-draggable/build/cjs/chunk-ACOTSM7X.mjs
|
|
2845
|
-
var
|
|
2964
|
+
var React4 = __toESM(require_react(), 1);
|
|
2846
2965
|
var import_prop_types2 = __toESM(require_prop_types(), 1);
|
|
2847
2966
|
var import_react_dom2 = __toESM(require_react_dom(), 1);
|
|
2848
2967
|
function findInArray(array, callback) {
|
|
@@ -3187,7 +3306,7 @@
|
|
|
3187
3306
|
}
|
|
3188
3307
|
};
|
|
3189
3308
|
var dragEventFor = eventsFor.mouse;
|
|
3190
|
-
var DraggableCore = class extends
|
|
3309
|
+
var DraggableCore = class extends React4.Component {
|
|
3191
3310
|
constructor() {
|
|
3192
3311
|
super(...arguments);
|
|
3193
3312
|
this.dragging = false;
|
|
@@ -3334,7 +3453,7 @@
|
|
|
3334
3453
|
return null;
|
|
3335
3454
|
}
|
|
3336
3455
|
render() {
|
|
3337
|
-
return
|
|
3456
|
+
return React4.cloneElement(React4.Children.only(this.props.children), {
|
|
3338
3457
|
// Note: mouseMove handler is attached to document so it will still function
|
|
3339
3458
|
// when the user drags quickly and leaves the bounds of the element.
|
|
3340
3459
|
onMouseDown: this.onMouseDown,
|
|
@@ -3778,48 +3897,6 @@
|
|
|
3778
3897
|
scale: 1
|
|
3779
3898
|
};
|
|
3780
3899
|
|
|
3781
|
-
// src/front/luna/LunaIcons.tsx
|
|
3782
|
-
var import_react3 = __toESM(require_react(), 1);
|
|
3783
|
-
var WindowIcon = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 16 16", className: "tl-title-icon" }, /* @__PURE__ */ import_react3.default.createElement("rect", { x: "1", y: "1.5", width: "14", height: "10", rx: "1", fill: "#dfe8f6", stroke: "#26457c" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "2.5", y: "3", width: "11", height: "7", fill: "#0b1b0b" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "4", y: "7", width: "2", height: "2.5", fill: "#1ee81e" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "7", y: "5", width: "2", height: "4.5", fill: "#1ee81e" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "10", y: "4", width: "2", height: "5.5", fill: "#1ee81e" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "5", y: "12", width: "6", height: "1.5", fill: "#7d8aa3" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "3.5", y: "13.5", width: "9", height: "1.5", rx: ".5", fill: "#b4bfd1", stroke: "#5d6a82", strokeWidth: ".5" }));
|
|
3784
|
-
var ApplicationIcon = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 16 16" }, /* @__PURE__ */ import_react3.default.createElement("rect", { x: "1.5", y: "2.5", width: "13", height: "11", rx: "1", fill: "#fff", stroke: "#3c5a8c" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "1.5", y: "2.5", width: "13", height: "3", rx: "1", fill: "#2f6be0" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "3", y: "7", width: "5", height: "1", fill: "#9aaac5" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "3", y: "9", width: "8", height: "1", fill: "#9aaac5" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "3", y: "11", width: "6", height: "1", fill: "#9aaac5" }));
|
|
3785
|
-
var NotepadIcon = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 16 16", className: "tl-title-icon" }, /* @__PURE__ */ import_react3.default.createElement("rect", { x: "3", y: "1.5", width: "11", height: "13", rx: ".8", fill: "#fff", stroke: "#5a6f99", strokeWidth: ".8" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "3", y: "1.5", width: "11", height: "2.4", fill: "#3f7ad8" }), [6, 8, 10, 12].map((y) => /* @__PURE__ */ import_react3.default.createElement("rect", { key: y, x: "5", y, width: "7", height: ".7", fill: "#9aaac5" })), [4.5, 7, 9.5, 12].map((y) => /* @__PURE__ */ import_react3.default.createElement("circle", { key: y, cx: "3", cy: y, r: ".9", fill: "none", stroke: "#55606f", strokeWidth: ".6" })));
|
|
3786
|
-
var ProcessIcon = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 32 32", style: { width: 32, height: 32 } }, /* @__PURE__ */ import_react3.default.createElement("rect", { x: "3", y: "5", width: "26", height: "22", rx: "2", fill: "#fff", stroke: "#3c5a8c", strokeWidth: "1.5" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "3", y: "5", width: "26", height: "5", rx: "2", fill: "#2f6be0" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "7", y: "14", width: "4", height: "4", fill: "#3c9a3c" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "14", y: "14", width: "4", height: "4", fill: "#3c9a3c" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "21", y: "14", width: "4", height: "4", fill: "#3c9a3c" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "7", y: "20", width: "18", height: "2", fill: "#9aaac5" }));
|
|
3787
|
-
var WarningIcon = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 32 32" }, /* @__PURE__ */ import_react3.default.createElement("path", { d: "M16 2.5 L30.5 28.5 H1.5 Z", fill: "#fcd226", stroke: "#8a6b00", strokeWidth: "1.2", strokeLinejoin: "round" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "14.4", y: "10", width: "3.2", height: "11", rx: "1.2", fill: "#000" }), /* @__PURE__ */ import_react3.default.createElement("circle", { cx: "16", cy: "24.5", r: "1.9", fill: "#000" }));
|
|
3788
|
-
var ErrorIcon = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 32 32" }, /* @__PURE__ */ import_react3.default.createElement("circle", { cx: "16", cy: "16", r: "14", fill: "#e0301e", stroke: "#8c1206", strokeWidth: "1.2" }), /* @__PURE__ */ import_react3.default.createElement("path", { d: "M10 10 L22 22 M22 10 L10 22", stroke: "#fff", strokeWidth: "3.4", strokeLinecap: "round" }));
|
|
3789
|
-
var InfoIcon = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 32 32" }, /* @__PURE__ */ import_react3.default.createElement("circle", { cx: "16", cy: "16", r: "14", fill: "#fff", stroke: "#2a5ec8", strokeWidth: "2" }), /* @__PURE__ */ import_react3.default.createElement("circle", { cx: "16", cy: "9.5", r: "2.2", fill: "#2a5ec8" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "14", y: "13.5", width: "4", height: "11", rx: "1", fill: "#2a5ec8" }));
|
|
3790
|
-
var RunIcon = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 32 32" }, /* @__PURE__ */ import_react3.default.createElement("rect", { x: "3", y: "6", width: "22", height: "18", rx: "2", fill: "#fff", stroke: "#3c5a8c", strokeWidth: "1.5" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "3", y: "6", width: "22", height: "4", rx: "2", fill: "#2f6be0" }), /* @__PURE__ */ import_react3.default.createElement("path", { d: "M17 18 L29 18 L25 14 M29 18 L25 22", stroke: "#3c9a3c", strokeWidth: "2.4", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }));
|
|
3791
|
-
var heptagon = (cx, cy, r2) => Array.from({ length: 7 }, (_, i) => {
|
|
3792
|
-
const a = -Math.PI / 2 + i * 2 * Math.PI / 7;
|
|
3793
|
-
return `${(cx + r2 * Math.cos(a)).toFixed(2)},${(cy + r2 * Math.sin(a)).toFixed(2)}`;
|
|
3794
|
-
}).join(" ");
|
|
3795
|
-
var KubernetesLogo = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 32 32", className: "tl-start-logo" }, /* @__PURE__ */ import_react3.default.createElement("polygon", { points: heptagon(16, 16.6, 15), fill: "#326ce5", stroke: "#fff", strokeWidth: "1.2", strokeLinejoin: "round" }), /* @__PURE__ */ import_react3.default.createElement("circle", { cx: "16", cy: "16.6", r: "7", fill: "none", stroke: "#fff", strokeWidth: "1.9" }), Array.from({ length: 7 }, (_, i) => {
|
|
3796
|
-
const a = -Math.PI / 2 + i * 2 * Math.PI / 7;
|
|
3797
|
-
return /* @__PURE__ */ import_react3.default.createElement(
|
|
3798
|
-
"line",
|
|
3799
|
-
{
|
|
3800
|
-
key: i,
|
|
3801
|
-
x1: 16 + 2.2 * Math.cos(a),
|
|
3802
|
-
y1: 16.6 + 2.2 * Math.sin(a),
|
|
3803
|
-
x2: 16 + 10.5 * Math.cos(a),
|
|
3804
|
-
y2: 16.6 + 10.5 * Math.sin(a),
|
|
3805
|
-
stroke: "#fff",
|
|
3806
|
-
strokeWidth: "1.9",
|
|
3807
|
-
strokeLinecap: "round"
|
|
3808
|
-
}
|
|
3809
|
-
);
|
|
3810
|
-
}), /* @__PURE__ */ import_react3.default.createElement("circle", { cx: "16", cy: "16.6", r: "2.2", fill: "#fff" }));
|
|
3811
|
-
var TrayCpuIcon = ({ cpu }) => {
|
|
3812
|
-
const lit = Math.round(Math.min(100, Math.max(0, cpu)) / 100 * 12);
|
|
3813
|
-
return /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 16 16", className: "tl-tray-icon" }, /* @__PURE__ */ import_react3.default.createElement("rect", { x: "1", y: "1", width: "14", height: "14", fill: "#000", stroke: "#7d8aa3", strokeWidth: ".8" }), Array.from({ length: 12 }, (_, i) => /* @__PURE__ */ import_react3.default.createElement("rect", { key: i, x: "4", y: 13.6 - i, width: "8", height: ".6", fill: i < lit ? "#1ee81e" : "#0b5d23" })));
|
|
3814
|
-
};
|
|
3815
|
-
var CheckMark = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 9 9" }, /* @__PURE__ */ import_react3.default.createElement("path", { d: "M1 4.5 L3.5 7 L8 1.5", stroke: "#21a121", strokeWidth: "2", fill: "none" }));
|
|
3816
|
-
var MenuCheck = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 10 10", className: "tl-menu-check" }, /* @__PURE__ */ import_react3.default.createElement("path", { d: "M1.5 5 L4 7.5 L8.5 2", stroke: "currentColor", strokeWidth: "1.8", fill: "none" }));
|
|
3817
|
-
var MenuRadio = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 10 10", className: "tl-menu-check" }, /* @__PURE__ */ import_react3.default.createElement("circle", { cx: "5", cy: "5", r: "2.5", fill: "currentColor" }));
|
|
3818
|
-
var MinimizeGlyph = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 13 13" }, /* @__PURE__ */ import_react3.default.createElement("rect", { x: "3", y: "9", width: "6", height: "2", fill: "#fff" }));
|
|
3819
|
-
var MaximizeGlyph = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 13 13" }, /* @__PURE__ */ import_react3.default.createElement("rect", { x: "2.5", y: "2.5", width: "8", height: "8", fill: "none", stroke: "#fff", strokeWidth: "1" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "2", y: "2", width: "9", height: "2", fill: "#fff" }));
|
|
3820
|
-
var RestoreGlyph = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 13 13" }, /* @__PURE__ */ import_react3.default.createElement("rect", { x: "4.5", y: "1.5", width: "7", height: "6", fill: "none", stroke: "#fff" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "4", y: "1", width: "8", height: "2", fill: "#fff" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "1.5", y: "5.5", width: "7", height: "6", fill: "#1f5bd8", stroke: "#fff" }), /* @__PURE__ */ import_react3.default.createElement("rect", { x: "1", y: "5", width: "8", height: "2", fill: "#fff" }));
|
|
3821
|
-
var CloseGlyph = () => /* @__PURE__ */ import_react3.default.createElement("svg", { viewBox: "0 0 13 13" }, /* @__PURE__ */ import_react3.default.createElement("path", { d: "M3 3 L10 10 M10 3 L3 10", stroke: "#fff", strokeWidth: "2" }));
|
|
3822
|
-
|
|
3823
3900
|
// src/front/luna/LunaControls.tsx
|
|
3824
3901
|
var Button = ({ label, onClick, disabled, autoFocus, testId }) => /* @__PURE__ */ import_react4.default.createElement("button", { type: "button", className: "tl-button", onClick, disabled, autoFocus, "data-testid": testId }, label);
|
|
3825
3902
|
var Checkbox = ({ label, checked, onChange, disabled, testId }) => /* @__PURE__ */ import_react4.default.createElement(
|
|
@@ -4129,69 +4206,85 @@
|
|
|
4129
4206
|
return /* @__PURE__ */ import_react4.default.createElement("div", { className: "tl-screen", "data-testid": testId }, /* @__PURE__ */ import_react4.default.createElement("canvas", { ref }), /* @__PURE__ */ import_react4.default.createElement("div", { className: "tl-meter-text" }, text));
|
|
4130
4207
|
};
|
|
4131
4208
|
|
|
4132
|
-
// src/front/
|
|
4133
|
-
var
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4209
|
+
// src/front/window/StartMenu.tsx
|
|
4210
|
+
var StartMenu = (props) => {
|
|
4211
|
+
const [allPrograms, setAllPrograms] = (0, import_react5.useState)(false);
|
|
4212
|
+
const choose = (action) => () => {
|
|
4213
|
+
props.onClose();
|
|
4214
|
+
action();
|
|
4215
|
+
};
|
|
4216
|
+
const program = (icon, name, line, onClick, testId) => /* @__PURE__ */ import_react5.default.createElement("div", { className: "tl-sm-item tl-sm-program", role: "menuitem", "aria-label": name, "data-testid": testId, onClick: choose(onClick) }, /* @__PURE__ */ import_react5.default.createElement("span", { className: "tl-sm-big" }, icon), /* @__PURE__ */ import_react5.default.createElement("span", null, /* @__PURE__ */ import_react5.default.createElement("b", null, name), /* @__PURE__ */ import_react5.default.createElement("br", null), /* @__PURE__ */ import_react5.default.createElement("span", { className: "tl-sm-line" }, line)));
|
|
4217
|
+
const place = (icon, name, onClick, bold = false) => /* @__PURE__ */ import_react5.default.createElement(
|
|
4218
|
+
"div",
|
|
4219
|
+
{
|
|
4220
|
+
className: "tl-sm-item tl-sm-place" + (onClick ? "" : " tl-disabled"),
|
|
4221
|
+
role: "menuitem",
|
|
4222
|
+
"aria-label": name,
|
|
4223
|
+
"aria-disabled": !onClick,
|
|
4224
|
+
onClick: onClick ? choose(onClick) : void 0
|
|
4225
|
+
},
|
|
4226
|
+
/* @__PURE__ */ import_react5.default.createElement("span", { className: "tl-sm-slot" }, icon),
|
|
4227
|
+
/* @__PURE__ */ import_react5.default.createElement("span", { style: { fontWeight: bold ? 700 : 400 } }, name)
|
|
4228
|
+
);
|
|
4229
|
+
const programs = [
|
|
4230
|
+
{ label: "Task Manager", onClick: choose(props.onTaskManager) },
|
|
4231
|
+
{ label: "Notepad", onClick: choose(props.onNotepad) }
|
|
4232
|
+
];
|
|
4233
|
+
return /* @__PURE__ */ import_react5.default.createElement("div", { className: "tl-sm", "data-testid": "tl-start-menu", role: "menu", onMouseDown: (e) => e.stopPropagation(), onContextMenu: (e) => e.preventDefault() }, /* @__PURE__ */ import_react5.default.createElement("div", { className: "tl-sm-head" }, /* @__PURE__ */ import_react5.default.createElement("span", { className: "tl-sm-picture" }, /* @__PURE__ */ import_react5.default.createElement(KubernetesLogo, null)), /* @__PURE__ */ import_react5.default.createElement("span", { className: "tl-sm-user", "data-testid": "tl-start-user" }, props.userName)), /* @__PURE__ */ import_react5.default.createElement("div", { className: "tl-sm-body" }, /* @__PURE__ */ import_react5.default.createElement("div", { className: "tl-sm-left" }, program(/* @__PURE__ */ import_react5.default.createElement(WindowIcon, null), "Task Manager", "Processes and performance", props.onTaskManager, "tl-sm-taskmanager"), program(/* @__PURE__ */ import_react5.default.createElement(NotepadIcon, null), "Notepad", "Logs and YAML", props.onNotepad, "tl-sm-notepad"), /* @__PURE__ */ import_react5.default.createElement("div", { className: "tl-sm-fill" }), /* @__PURE__ */ import_react5.default.createElement("div", { className: "tl-sm-sep" }), /* @__PURE__ */ import_react5.default.createElement(
|
|
4234
|
+
"div",
|
|
4235
|
+
{
|
|
4236
|
+
className: "tl-sm-item tl-sm-all" + (allPrograms ? " tl-open" : ""),
|
|
4237
|
+
role: "menuitem",
|
|
4238
|
+
"aria-label": "All Programs",
|
|
4239
|
+
onMouseEnter: () => setAllPrograms(true),
|
|
4240
|
+
onMouseLeave: () => setAllPrograms(false),
|
|
4241
|
+
onClick: () => setAllPrograms(!allPrograms)
|
|
4242
|
+
},
|
|
4243
|
+
/* @__PURE__ */ import_react5.default.createElement("b", null, "All Programs"),
|
|
4244
|
+
/* @__PURE__ */ import_react5.default.createElement(GreenArrow, null),
|
|
4245
|
+
allPrograms && /* @__PURE__ */ import_react5.default.createElement(PopupMenu, { items: programs, x: 190, bottom: -4, onClose: props.onClose, testId: "tl-sm-programs" })
|
|
4246
|
+
)), /* @__PURE__ */ import_react5.default.createElement("div", { className: "tl-sm-right" }, place(/* @__PURE__ */ import_react5.default.createElement(ComputerIcon, null), "My Cluster", props.onMyCluster, true), place(/* @__PURE__ */ import_react5.default.createElement(UsersIcon, null), "My Namespaces", props.onMyNamespaces, true), /* @__PURE__ */ import_react5.default.createElement("div", { className: "tl-sm-sep" }), place(/* @__PURE__ */ import_react5.default.createElement(ControlPanelIcon, null), "Control Panel", props.onControlPanel), /* @__PURE__ */ import_react5.default.createElement("div", { className: "tl-sm-sep" }), place(/* @__PURE__ */ import_react5.default.createElement(RunIcon, null), "Run...", props.canRun ? props.onRun : void 0), place(/* @__PURE__ */ import_react5.default.createElement("span", { className: "tl-sm-icon tl-sm-logo" }, /* @__PURE__ */ import_react5.default.createElement(KubernetesLogo, null)), "About KubernetesXP", props.onAbout), place(/* @__PURE__ */ import_react5.default.createElement(HelpIcon, null), "Help and Support", void 0))), /* @__PURE__ */ import_react5.default.createElement("div", { className: "tl-sm-foot" }, /* @__PURE__ */ import_react5.default.createElement("span", { className: "tl-sm-button tl-disabled", role: "button", "aria-label": "Log Off", "aria-disabled": "true" }, /* @__PURE__ */ import_react5.default.createElement(LogOffIcon, null), "Log Off"), /* @__PURE__ */ import_react5.default.createElement(
|
|
4247
|
+
"span",
|
|
4248
|
+
{
|
|
4249
|
+
className: "tl-sm-button" + (props.canTurnOff ? "" : " tl-disabled"),
|
|
4250
|
+
role: "button",
|
|
4251
|
+
"aria-label": "Turn Off Computer",
|
|
4252
|
+
"aria-disabled": !props.canTurnOff,
|
|
4253
|
+
onClick: props.canTurnOff ? choose(props.onTurnOff) : void 0
|
|
4254
|
+
},
|
|
4255
|
+
/* @__PURE__ */ import_react5.default.createElement(TurnOffIcon, null),
|
|
4256
|
+
"Turn Off Computer"
|
|
4257
|
+
)));
|
|
4161
4258
|
};
|
|
4162
4259
|
|
|
4163
4260
|
// src/front/window/Taskbar.tsx
|
|
4164
4261
|
var TASKBAR_HEIGHT = 30;
|
|
4165
|
-
var Taskbar = ({ session, onAbout }) => {
|
|
4166
|
-
const [startOpen, setStartOpen] = (0,
|
|
4167
|
-
const [, setMinute] = (0,
|
|
4168
|
-
(0,
|
|
4262
|
+
var Taskbar = ({ session, userName, onAbout, onRun, onTurnOff }) => {
|
|
4263
|
+
const [startOpen, setStartOpen] = (0, import_react6.useState)(false);
|
|
4264
|
+
const [, setMinute] = (0, import_react6.useState)(0);
|
|
4265
|
+
(0, import_react6.useEffect)(() => {
|
|
4169
4266
|
const timer = setInterval(() => setMinute((m) => m + 1), 15e3);
|
|
4170
4267
|
return () => clearInterval(timer);
|
|
4171
4268
|
}, []);
|
|
4172
|
-
(0,
|
|
4269
|
+
(0, import_react6.useEffect)(() => {
|
|
4173
4270
|
if (!startOpen) return;
|
|
4174
4271
|
const close = () => setStartOpen(false);
|
|
4175
4272
|
window.addEventListener("mousedown", close);
|
|
4176
4273
|
return () => window.removeEventListener("mousedown", close);
|
|
4177
4274
|
}, [startOpen]);
|
|
4178
|
-
const
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
{ label: "About KubernetesXP", onClick: onAbout },
|
|
4183
|
-
{},
|
|
4184
|
-
{ label: "Log Off", disabled: true },
|
|
4185
|
-
{ label: "Turn Off Computer...", disabled: true }
|
|
4186
|
-
];
|
|
4275
|
+
const taskManagerOn = (tab) => () => {
|
|
4276
|
+
session.openTaskManager();
|
|
4277
|
+
session.setState({ tab });
|
|
4278
|
+
};
|
|
4187
4279
|
const windows = [
|
|
4188
|
-
...session.taskManagerOpen ? [{ id: TASK_MANAGER_WINDOW, title: "Task Manager", icon: /* @__PURE__ */
|
|
4189
|
-
...session.
|
|
4280
|
+
...session.taskManagerOpen ? [{ id: TASK_MANAGER_WINDOW, title: "Task Manager", icon: /* @__PURE__ */ import_react6.default.createElement(WindowIcon, null) }] : [],
|
|
4281
|
+
...session.controlPanelOpen ? [{ id: CONTROL_PANEL_WINDOW, title: "Control Panel", icon: /* @__PURE__ */ import_react6.default.createElement(ControlPanelIcon, { title: true }) }] : [],
|
|
4282
|
+
...session.notepads.map((n) => ({ id: n.id, title: `${n.title} - Notepad`, icon: /* @__PURE__ */ import_react6.default.createElement(NotepadIcon, null) }))
|
|
4190
4283
|
];
|
|
4191
4284
|
const active = session.activeWindow();
|
|
4192
4285
|
const cpu = session.snapshot?.metrics?.cpu;
|
|
4193
|
-
const
|
|
4194
|
-
return /* @__PURE__ */
|
|
4286
|
+
const clock2 = (/* @__PURE__ */ new Date()).toLocaleTimeString([], { hour: "numeric", minute: "2-digit" });
|
|
4287
|
+
return /* @__PURE__ */ import_react6.default.createElement("div", { className: "tl-taskbar", "data-testid": "tl-taskbar", onContextMenu: (e) => e.preventDefault() }, /* @__PURE__ */ import_react6.default.createElement(
|
|
4195
4288
|
"div",
|
|
4196
4289
|
{
|
|
4197
4290
|
className: "tl-start" + (startOpen ? " tl-pressed" : ""),
|
|
@@ -4203,9 +4296,25 @@
|
|
|
4203
4296
|
setStartOpen(!startOpen);
|
|
4204
4297
|
}
|
|
4205
4298
|
},
|
|
4206
|
-
/* @__PURE__ */
|
|
4207
|
-
/* @__PURE__ */
|
|
4208
|
-
), startOpen && /* @__PURE__ */
|
|
4299
|
+
/* @__PURE__ */ import_react6.default.createElement(KubernetesLogo, null),
|
|
4300
|
+
/* @__PURE__ */ import_react6.default.createElement("span", { className: "tl-start-text" }, "start")
|
|
4301
|
+
), startOpen && /* @__PURE__ */ import_react6.default.createElement(
|
|
4302
|
+
StartMenu,
|
|
4303
|
+
{
|
|
4304
|
+
userName,
|
|
4305
|
+
canRun: session.canEnd,
|
|
4306
|
+
canTurnOff: !!onTurnOff,
|
|
4307
|
+
onTaskManager: session.openTaskManager,
|
|
4308
|
+
onNotepad: () => session.openNotepad("Untitled", "", false, false),
|
|
4309
|
+
onMyCluster: taskManagerOn("performance" /* PERFORMANCE */),
|
|
4310
|
+
onMyNamespaces: taskManagerOn("users" /* USERS */),
|
|
4311
|
+
onControlPanel: session.openControlPanel,
|
|
4312
|
+
onRun,
|
|
4313
|
+
onAbout,
|
|
4314
|
+
onTurnOff: () => onTurnOff?.(),
|
|
4315
|
+
onClose: () => setStartOpen(false)
|
|
4316
|
+
}
|
|
4317
|
+
), /* @__PURE__ */ import_react6.default.createElement("div", { className: "tl-tasks" }, windows.map((w) => /* @__PURE__ */ import_react6.default.createElement(
|
|
4209
4318
|
"div",
|
|
4210
4319
|
{
|
|
4211
4320
|
key: w.id,
|
|
@@ -4218,12 +4327,12 @@
|
|
|
4218
4327
|
onClick: () => session.toggleFromTaskbar(w.id)
|
|
4219
4328
|
},
|
|
4220
4329
|
w.icon,
|
|
4221
|
-
/* @__PURE__ */
|
|
4222
|
-
))), /* @__PURE__ */
|
|
4330
|
+
/* @__PURE__ */ import_react6.default.createElement("span", { className: "tl-task-text" }, w.title)
|
|
4331
|
+
))), /* @__PURE__ */ import_react6.default.createElement("div", { className: "tl-tray" }, session.taskManagerOpen && /* @__PURE__ */ import_react6.default.createElement("span", { title: `CPU Usage: ${percent(cpu)}`, "data-testid": "tl-tray-cpu" }, /* @__PURE__ */ import_react6.default.createElement(TrayCpuIcon, { cpu: cpu ?? 0 })), /* @__PURE__ */ import_react6.default.createElement("span", { className: "tl-clock" }, clock2)));
|
|
4223
4332
|
};
|
|
4224
4333
|
|
|
4225
4334
|
// src/front/window/ProcessesTab.tsx
|
|
4226
|
-
var
|
|
4335
|
+
var import_react7 = __toESM(require_react(), 1);
|
|
4227
4336
|
|
|
4228
4337
|
// src/front/window/ListState.ts
|
|
4229
4338
|
var listState = (session, list, defaultSort) => ({
|
|
@@ -4301,7 +4410,7 @@
|
|
|
4301
4410
|
{ label: "Properties", isDefault: true, disabled: idle, onClick: () => onProperties(p) }
|
|
4302
4411
|
];
|
|
4303
4412
|
};
|
|
4304
|
-
return /* @__PURE__ */
|
|
4413
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, /* @__PURE__ */ import_react7.default.createElement(
|
|
4305
4414
|
ListView,
|
|
4306
4415
|
{
|
|
4307
4416
|
columns,
|
|
@@ -4321,15 +4430,15 @@
|
|
|
4321
4430
|
if (p) onContextMenu(menuFor(p), x, y);
|
|
4322
4431
|
}
|
|
4323
4432
|
}
|
|
4324
|
-
), /* @__PURE__ */
|
|
4433
|
+
), /* @__PURE__ */ import_react7.default.createElement("div", { className: "tl-buttons", style: { justifyContent: "space-between", alignItems: "center" } }, /* @__PURE__ */ import_react7.default.createElement(Checkbox, { label: "Show processes from all users", checked: session.state.allUsers, onChange: (allUsers) => session.setState({ allUsers }), testId: "tl-all-users" }), /* @__PURE__ */ import_react7.default.createElement(Button, { label: "End Process", onClick: () => onEndProcess(selected), disabled: selected.length === 0, testId: "tl-end-process" })));
|
|
4325
4434
|
};
|
|
4326
4435
|
|
|
4327
4436
|
// src/front/window/ApplicationsTab.tsx
|
|
4328
|
-
var
|
|
4437
|
+
var import_react8 = __toESM(require_react(), 1);
|
|
4329
4438
|
var applicationKey = (a) => `${a.kind}/${a.namespace}/${a.name}`;
|
|
4330
4439
|
var statusOf = (a) => a.readyReplicas >= a.replicas ? "Running" : "Not Responding";
|
|
4331
4440
|
var COLUMNS2 = [
|
|
4332
|
-
{ key: "task", label: "Task", width: 300, text: (a) => /* @__PURE__ */
|
|
4441
|
+
{ key: "task", label: "Task", width: 300, text: (a) => /* @__PURE__ */ import_react8.default.createElement("span", { className: "tl-cell-icon" }, /* @__PURE__ */ import_react8.default.createElement(ApplicationIcon, null), a.name, " - ", a.namespace), sortValue: (a) => a.name },
|
|
4333
4442
|
{ key: "controller", label: "Controller", width: 90, text: (a) => a.kind, sortValue: (a) => a.kind },
|
|
4334
4443
|
{ key: "status", label: "Status", width: 100, text: statusOf, sortValue: statusOf }
|
|
4335
4444
|
];
|
|
@@ -4353,7 +4462,7 @@
|
|
|
4353
4462
|
{},
|
|
4354
4463
|
{ label: "Edit...", disabled: !session.canEnd, onClick: () => onEdit(a) }
|
|
4355
4464
|
];
|
|
4356
|
-
return /* @__PURE__ */
|
|
4465
|
+
return /* @__PURE__ */ import_react8.default.createElement(import_react8.default.Fragment, null, /* @__PURE__ */ import_react8.default.createElement(
|
|
4357
4466
|
ListView,
|
|
4358
4467
|
{
|
|
4359
4468
|
columns: COLUMNS2,
|
|
@@ -4371,11 +4480,11 @@
|
|
|
4371
4480
|
if (a) onContextMenu(menuFor(a), x, y);
|
|
4372
4481
|
}
|
|
4373
4482
|
}
|
|
4374
|
-
), /* @__PURE__ */
|
|
4483
|
+
), /* @__PURE__ */ import_react8.default.createElement("div", { className: "tl-buttons" }, /* @__PURE__ */ import_react8.default.createElement(Button, { label: "End Task", onClick: () => selected && onEndTask(selected), disabled: !selected, testId: "tl-end-task" }), /* @__PURE__ */ import_react8.default.createElement(Button, { label: "Switch To", onClick: () => selected && onSwitchTo(selected), disabled: !selected, testId: "tl-switch-to" }), /* @__PURE__ */ import_react8.default.createElement(Button, { label: "New Task...", onClick: onNewTask, disabled: !session.canEnd, testId: "tl-new-task-button" })));
|
|
4375
4484
|
};
|
|
4376
4485
|
|
|
4377
4486
|
// src/front/window/PerformanceTab.tsx
|
|
4378
|
-
var
|
|
4487
|
+
var import_react9 = __toESM(require_react(), 1);
|
|
4379
4488
|
var CPU_LINE = "#00ff00";
|
|
4380
4489
|
var MEMORY_LINE = "#ffff00";
|
|
4381
4490
|
var performanceFigures = (session) => {
|
|
@@ -4404,11 +4513,11 @@
|
|
|
4404
4513
|
const nodes = snapshot?.nodes ?? [];
|
|
4405
4514
|
const perCpu = session.state.graphPerCpu && nodes.length > 0;
|
|
4406
4515
|
const columns = Math.ceil(Math.sqrt(nodes.length || 1));
|
|
4407
|
-
return /* @__PURE__ */
|
|
4516
|
+
return /* @__PURE__ */ import_react9.default.createElement("div", { className: "tl-perf" }, /* @__PURE__ */ import_react9.default.createElement("div", { className: "tl-perf-row tl-grow" }, /* @__PURE__ */ import_react9.default.createElement("div", { className: "tl-perf-meter" }, /* @__PURE__ */ import_react9.default.createElement(GroupBox, { label: "CPU Usage" }, /* @__PURE__ */ import_react9.default.createElement(Meter, { value: cpu ?? 0, max: 100, text: percent(cpu), testId: "tl-cpu-meter" }))), /* @__PURE__ */ import_react9.default.createElement("div", { className: "tl-perf-history" }, /* @__PURE__ */ import_react9.default.createElement(GroupBox, { label: "CPU Usage History" }, perCpu ? /* @__PURE__ */ import_react9.default.createElement("div", { className: "tl-graphs", style: { gridTemplateColumns: `repeat(${columns}, 1fr)` }, "data-testid": "tl-cpu-graphs" }, nodes.map((n) => /* @__PURE__ */ import_react9.default.createElement("div", { key: n.name, className: "tl-graph-cell" }, /* @__PURE__ */ import_react9.default.createElement(Graph, { lines: [{ values: session.history.nodeCpu[n.name] ?? [], colour: CPU_LINE }], max: 100, points: HISTORY_POINTS, ticks: session.ticks })))) : /* @__PURE__ */ import_react9.default.createElement(Graph, { lines: [{ values: session.history.cpu, colour: CPU_LINE }], max: 100, points: HISTORY_POINTS, ticks: session.ticks, testId: "tl-cpu-history" })))), /* @__PURE__ */ import_react9.default.createElement("div", { className: "tl-perf-row tl-grow" }, /* @__PURE__ */ import_react9.default.createElement("div", { className: "tl-perf-meter" }, /* @__PURE__ */ import_react9.default.createElement(GroupBox, { label: "PF Usage" }, /* @__PURE__ */ import_react9.default.createElement(Meter, { value: f.memoryUsed ?? 0, max: memoryMax, text: f.memoryUsed === void 0 ? "--" : meterBytes(f.memoryUsed), testId: "tl-pf-meter" }))), /* @__PURE__ */ import_react9.default.createElement("div", { className: "tl-perf-history" }, /* @__PURE__ */ import_react9.default.createElement(GroupBox, { label: "Page File Usage History" }, /* @__PURE__ */ import_react9.default.createElement(Graph, { lines: [{ values: session.history.memory, colour: MEMORY_LINE }], max: memoryMax, points: HISTORY_POINTS, ticks: session.ticks, testId: "tl-pf-history" })))), /* @__PURE__ */ import_react9.default.createElement("div", { className: "tl-perf-totals" }, /* @__PURE__ */ import_react9.default.createElement(GroupBox, { label: "Totals" }, /* @__PURE__ */ import_react9.default.createElement(Field, { label: "Handles", value: "" }), /* @__PURE__ */ import_react9.default.createElement(Field, { label: "Threads", value: String(f.threads), testId: "tl-threads" }), /* @__PURE__ */ import_react9.default.createElement(Field, { label: "Processes", value: String(f.processes), testId: "tl-processes-total" })), /* @__PURE__ */ import_react9.default.createElement(GroupBox, { label: "Physical Memory (K)" }, /* @__PURE__ */ import_react9.default.createElement(Field, { label: "Total", value: kilobytesBare(f.physicalTotal), testId: "tl-physical-total" }), /* @__PURE__ */ import_react9.default.createElement(Field, { label: "Available", value: kilobytesBare(f.physicalAvailable) }), /* @__PURE__ */ import_react9.default.createElement(Field, { label: "System Cache", value: kilobytesBare(f.systemCache) })), /* @__PURE__ */ import_react9.default.createElement(GroupBox, { label: "Commit Charge (K)" }, /* @__PURE__ */ import_react9.default.createElement(Field, { label: "Total", value: kilobytesBare(f.commitTotal), testId: "tl-commit-total" }), /* @__PURE__ */ import_react9.default.createElement(Field, { label: "Limit", value: kilobytesBare(f.commitLimit) }), /* @__PURE__ */ import_react9.default.createElement(Field, { label: "Peak", value: kilobytesBare(f.commitPeak) })), /* @__PURE__ */ import_react9.default.createElement(GroupBox, { label: "Kernel Memory (K)" }, /* @__PURE__ */ import_react9.default.createElement(Field, { label: "Total", value: "" }), /* @__PURE__ */ import_react9.default.createElement(Field, { label: "Paged", value: "" }), /* @__PURE__ */ import_react9.default.createElement(Field, { label: "Nonpaged", value: "" }))));
|
|
4408
4517
|
};
|
|
4409
4518
|
|
|
4410
4519
|
// src/front/window/NetworkingTab.tsx
|
|
4411
|
-
var
|
|
4520
|
+
var import_react10 = __toESM(require_react(), 1);
|
|
4412
4521
|
var stateOf = (n) => n.ready ? "Operational" : "Disconnected";
|
|
4413
4522
|
var COLUMNS3 = [
|
|
4414
4523
|
{ key: "adapter", label: "Adapter Name", width: 170, text: (n) => n.name, sortValue: (n) => n.name },
|
|
@@ -4418,11 +4527,11 @@
|
|
|
4418
4527
|
];
|
|
4419
4528
|
var NetworkingTab = ({ session }) => {
|
|
4420
4529
|
const nodes = session.snapshot?.nodes ?? [];
|
|
4421
|
-
return /* @__PURE__ */
|
|
4530
|
+
return /* @__PURE__ */ import_react10.default.createElement("div", { className: "tl-net" }, /* @__PURE__ */ import_react10.default.createElement("div", { className: "tl-net-graphs", "data-testid": "tl-network-graphs" }, nodes.length === 0 && /* @__PURE__ */ import_react10.default.createElement("div", { className: "tl-empty" }, "No network adapters: seeing the cluster's nodes needs the 'cluster' scope."), nodes.map((n) => {
|
|
4422
4531
|
const values = session.history.nodeNetwork[n.name] ?? [];
|
|
4423
4532
|
const scale = networkScale(values);
|
|
4424
|
-
return /* @__PURE__ */
|
|
4425
|
-
})), /* @__PURE__ */
|
|
4533
|
+
return /* @__PURE__ */ import_react10.default.createElement("div", { key: n.name, className: "tl-net-graph" }, /* @__PURE__ */ import_react10.default.createElement("div", { className: "tl-graph-label" }, n.name), /* @__PURE__ */ import_react10.default.createElement("div", { className: "tl-graph-row" }, /* @__PURE__ */ import_react10.default.createElement("div", { className: "tl-net-axis" }, /* @__PURE__ */ import_react10.default.createElement("span", null, scale, " %"), /* @__PURE__ */ import_react10.default.createElement("span", null, scale / 2, " %"), /* @__PURE__ */ import_react10.default.createElement("span", null, "0 %")), /* @__PURE__ */ import_react10.default.createElement(Graph, { lines: [{ values, colour: "#00ff00" }], max: scale, points: HISTORY_POINTS, ticks: session.ticks })));
|
|
4534
|
+
})), /* @__PURE__ */ import_react10.default.createElement(
|
|
4426
4535
|
ListView,
|
|
4427
4536
|
{
|
|
4428
4537
|
columns: COLUMNS3,
|
|
@@ -4437,7 +4546,7 @@
|
|
|
4437
4546
|
};
|
|
4438
4547
|
|
|
4439
4548
|
// src/front/window/UsersTab.tsx
|
|
4440
|
-
var
|
|
4549
|
+
var import_react11 = __toESM(require_react(), 1);
|
|
4441
4550
|
var COLUMNS4 = [
|
|
4442
4551
|
{ key: "user", label: "User", width: 170, text: (u) => u.name, sortValue: (u) => u.name },
|
|
4443
4552
|
{ key: "id", label: "ID", width: 40, right: true, text: (u) => String(u.id), sortValue: (u) => u.id },
|
|
@@ -4455,7 +4564,7 @@
|
|
|
4455
4564
|
{ label: "Disconnect", disabled: true },
|
|
4456
4565
|
{ label: "Log Off", disabled: !session.isAdmin, onClick: () => onLogOff(u) }
|
|
4457
4566
|
];
|
|
4458
|
-
return /* @__PURE__ */
|
|
4567
|
+
return /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, /* @__PURE__ */ import_react11.default.createElement(
|
|
4459
4568
|
ListView,
|
|
4460
4569
|
{
|
|
4461
4570
|
columns: COLUMNS4,
|
|
@@ -4469,20 +4578,20 @@
|
|
|
4469
4578
|
if (u) onContextMenu(menuFor(u), x, y);
|
|
4470
4579
|
}
|
|
4471
4580
|
}
|
|
4472
|
-
), /* @__PURE__ */
|
|
4581
|
+
), /* @__PURE__ */ import_react11.default.createElement("div", { className: "tl-buttons" }, /* @__PURE__ */ import_react11.default.createElement(Button, { label: "Disconnect", disabled: true }), /* @__PURE__ */ import_react11.default.createElement(Button, { label: "Logoff", onClick: () => selected && onLogOff(selected), disabled: !selected || !session.isAdmin, testId: "tl-logoff" }), /* @__PURE__ */ import_react11.default.createElement(Button, { label: "Send Message...", disabled: true })));
|
|
4473
4582
|
};
|
|
4474
4583
|
|
|
4475
4584
|
// src/front/window/Dialogs.tsx
|
|
4476
|
-
var
|
|
4585
|
+
var import_react12 = __toESM(require_react(), 1);
|
|
4477
4586
|
|
|
4478
4587
|
// package.json
|
|
4479
|
-
var version = "0.1.
|
|
4588
|
+
var version = "0.1.1";
|
|
4480
4589
|
|
|
4481
4590
|
// src/front/window/Dialogs.tsx
|
|
4482
4591
|
var PropertiesDialog = ({ process: process2, onClose }) => {
|
|
4483
|
-
const [tab, setTab] = (0,
|
|
4484
|
-
const [selected, setSelected] = (0,
|
|
4485
|
-
const [widths, setWidths] = (0,
|
|
4592
|
+
const [tab, setTab] = (0, import_react12.useState)("general" /* GENERAL */);
|
|
4593
|
+
const [selected, setSelected] = (0, import_react12.useState)([]);
|
|
4594
|
+
const [widths, setWidths] = (0, import_react12.useState)({});
|
|
4486
4595
|
const columns = [
|
|
4487
4596
|
{ key: "name", label: "Name", width: 80, text: (c) => c.name, sortValue: (c) => c.name },
|
|
4488
4597
|
{ key: "image", label: "Image", width: 100, text: (c) => c.image, sortValue: (c) => c.image },
|
|
@@ -4492,8 +4601,8 @@
|
|
|
4492
4601
|
{ key: "cpu", label: "CPU", width: 35, right: true, text: (c) => cpuColumn(c.cpu), sortValue: (c) => c.cpu ?? -1 },
|
|
4493
4602
|
{ key: "mem", label: "Mem Usage", width: 75, right: true, text: (c) => kilobytes(c.memory), sortValue: (c) => c.memory ?? -1 }
|
|
4494
4603
|
];
|
|
4495
|
-
const [sort, setSort] = (0,
|
|
4496
|
-
return /* @__PURE__ */
|
|
4604
|
+
const [sort, setSort] = (0, import_react12.useState)({ column: "name", descending: false });
|
|
4605
|
+
return /* @__PURE__ */ import_react12.default.createElement(Dialog, { title: `${process2.name} Properties`, onClose, testId: "tl-properties" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "tl-props" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "tl-body" }, /* @__PURE__ */ import_react12.default.createElement(TabStrip, { tabs: [{ id: "general" /* GENERAL */, label: "General" }, { id: "containers" /* CONTAINERS */, label: "Containers" }], selected: tab, onSelect: setTab }), /* @__PURE__ */ import_react12.default.createElement("div", { className: "tl-tabpanel" }, tab === "general" /* GENERAL */ && /* @__PURE__ */ import_react12.default.createElement("div", { className: "tl-props-general" }, /* @__PURE__ */ import_react12.default.createElement(ProcessIcon, null), /* @__PURE__ */ import_react12.default.createElement("span", { style: { alignSelf: "center" } }, process2.name), /* @__PURE__ */ import_react12.default.createElement("span", { className: "tl-props-sep" }), /* @__PURE__ */ import_react12.default.createElement("span", null, "Type:"), /* @__PURE__ */ import_react12.default.createElement("span", null, "Pod"), /* @__PURE__ */ import_react12.default.createElement("span", null, "User:"), /* @__PURE__ */ import_react12.default.createElement("span", null, process2.namespace), /* @__PURE__ */ import_react12.default.createElement("span", null, "Computer:"), /* @__PURE__ */ import_react12.default.createElement("span", null, process2.node || "(not scheduled)"), /* @__PURE__ */ import_react12.default.createElement("span", null, "PID:"), /* @__PURE__ */ import_react12.default.createElement("span", null, process2.pid), /* @__PURE__ */ import_react12.default.createElement("span", { className: "tl-props-sep" }), /* @__PURE__ */ import_react12.default.createElement("span", null, "Status:"), /* @__PURE__ */ import_react12.default.createElement("span", null, process2.phase), /* @__PURE__ */ import_react12.default.createElement("span", null, "Started:"), /* @__PURE__ */ import_react12.default.createElement("span", null, process2.startTime ? new Date(process2.startTime).toLocaleString() : ""), /* @__PURE__ */ import_react12.default.createElement("span", null, "Parent:"), /* @__PURE__ */ import_react12.default.createElement("span", null, process2.owner ? `${process2.owner.kind} ${process2.owner.name}` : "(none)"), /* @__PURE__ */ import_react12.default.createElement("span", { className: "tl-props-sep" }), /* @__PURE__ */ import_react12.default.createElement("span", null, "Threads:"), /* @__PURE__ */ import_react12.default.createElement("span", null, process2.containers.length, " container(s)"), /* @__PURE__ */ import_react12.default.createElement("span", null, "Mem Usage:"), /* @__PURE__ */ import_react12.default.createElement("span", null, kilobytes(process2.memory)), /* @__PURE__ */ import_react12.default.createElement("span", null, "Peak:"), /* @__PURE__ */ import_react12.default.createElement("span", null, kilobytes(process2.peakMemory))), tab === "containers" /* CONTAINERS */ && /* @__PURE__ */ import_react12.default.createElement(
|
|
4497
4606
|
ListView,
|
|
4498
4607
|
{
|
|
4499
4608
|
columns,
|
|
@@ -4507,12 +4616,12 @@
|
|
|
4507
4616
|
onSort: setSort,
|
|
4508
4617
|
testId: "tl-containers"
|
|
4509
4618
|
}
|
|
4510
|
-
))), /* @__PURE__ */
|
|
4619
|
+
))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "tl-buttons" }, /* @__PURE__ */ import_react12.default.createElement(Button, { label: "OK", onClick: onClose, autoFocus: true }), /* @__PURE__ */ import_react12.default.createElement(Button, { label: "Cancel", onClick: onClose }))));
|
|
4511
4620
|
};
|
|
4512
4621
|
var SelectColumnsDialog = ({ columns, onOk, onClose }) => {
|
|
4513
|
-
const [chosen, setChosen] = (0,
|
|
4622
|
+
const [chosen, setChosen] = (0, import_react12.useState)(columns);
|
|
4514
4623
|
const toggle = (c, on) => setChosen(Object.values(EProcessColumn).filter((x) => x === c ? on : chosen.includes(x)));
|
|
4515
|
-
return /* @__PURE__ */
|
|
4624
|
+
return /* @__PURE__ */ import_react12.default.createElement(Dialog, { title: "Select Columns", onClose, testId: "tl-select-columns" }, /* @__PURE__ */ import_react12.default.createElement("div", { style: { width: 300 } }, /* @__PURE__ */ import_react12.default.createElement("div", null, "Select the columns that will appear on the Process page of the Task Manager."), /* @__PURE__ */ import_react12.default.createElement("div", { className: "tl-columns-list" }, Object.values(EProcessColumn).map((c) => /* @__PURE__ */ import_react12.default.createElement(
|
|
4516
4625
|
Checkbox,
|
|
4517
4626
|
{
|
|
4518
4627
|
key: c,
|
|
@@ -4521,10 +4630,10 @@
|
|
|
4521
4630
|
disabled: c === "imagename" /* IMAGE_NAME */,
|
|
4522
4631
|
onChange: (on) => toggle(c, on)
|
|
4523
4632
|
}
|
|
4524
|
-
))), /* @__PURE__ */
|
|
4633
|
+
))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "tl-buttons" }, /* @__PURE__ */ import_react12.default.createElement(Button, { label: "OK", onClick: () => {
|
|
4525
4634
|
onOk(chosen);
|
|
4526
4635
|
onClose();
|
|
4527
|
-
}, autoFocus: true }), /* @__PURE__ */
|
|
4636
|
+
}, autoFocus: true }), /* @__PURE__ */ import_react12.default.createElement(Button, { label: "Cancel", onClick: onClose }))));
|
|
4528
4637
|
};
|
|
4529
4638
|
var nameOfImage = (image) => {
|
|
4530
4639
|
const last = image.split("/").pop() ?? "";
|
|
@@ -4532,16 +4641,16 @@
|
|
|
4532
4641
|
return `${base || "task"}-${Math.random().toString(36).slice(2, 7)}`;
|
|
4533
4642
|
};
|
|
4534
4643
|
var CreateNewTaskDialog = ({ users, onOk, onClose }) => {
|
|
4535
|
-
const [image, setImage] = (0,
|
|
4536
|
-
const [name, setName] = (0,
|
|
4537
|
-
const [namespace, setNamespace] = (0,
|
|
4644
|
+
const [image, setImage] = (0, import_react12.useState)("");
|
|
4645
|
+
const [name, setName] = (0, import_react12.useState)("");
|
|
4646
|
+
const [namespace, setNamespace] = (0, import_react12.useState)(users.find((u) => u.name === "default")?.name ?? users[0]?.name ?? "");
|
|
4538
4647
|
const ok = () => {
|
|
4539
4648
|
if (image.trim()) {
|
|
4540
4649
|
onOk({ image: image.trim(), name: name.trim() || nameOfImage(image.trim()), namespace });
|
|
4541
4650
|
onClose();
|
|
4542
4651
|
}
|
|
4543
4652
|
};
|
|
4544
|
-
return /* @__PURE__ */
|
|
4653
|
+
return /* @__PURE__ */ import_react12.default.createElement(Dialog, { title: "Create New Task", onClose, testId: "tl-new-task" }, /* @__PURE__ */ import_react12.default.createElement("div", { style: { width: 360 } }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "tl-message" }, /* @__PURE__ */ import_react12.default.createElement(RunIcon, null), /* @__PURE__ */ import_react12.default.createElement("div", null, "Type the name of a container image, and Kubernetes will run it for you as a new process.")), /* @__PURE__ */ import_react12.default.createElement("div", { className: "tl-form" }, /* @__PURE__ */ import_react12.default.createElement("span", null, "Open:"), /* @__PURE__ */ import_react12.default.createElement(
|
|
4545
4654
|
"input",
|
|
4546
4655
|
{
|
|
4547
4656
|
className: "tl-input",
|
|
@@ -4554,7 +4663,7 @@
|
|
|
4554
4663
|
},
|
|
4555
4664
|
placeholder: "busybox:1.36"
|
|
4556
4665
|
}
|
|
4557
|
-
), /* @__PURE__ */
|
|
4666
|
+
), /* @__PURE__ */ import_react12.default.createElement("span", null, "Name:"), /* @__PURE__ */ import_react12.default.createElement("input", { className: "tl-input", value: name, onChange: (e) => setName(e.target.value), "aria-label": "Name", placeholder: "(from the image)" }), /* @__PURE__ */ import_react12.default.createElement("span", null, "User:"), /* @__PURE__ */ import_react12.default.createElement("select", { className: "tl-input", value: namespace, onChange: (e) => setNamespace(e.target.value), "aria-label": "User" }, users.map((u) => /* @__PURE__ */ import_react12.default.createElement("option", { key: u.name, value: u.name }, u.name)))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "tl-buttons" }, /* @__PURE__ */ import_react12.default.createElement(Button, { label: "OK", onClick: ok, disabled: !image.trim() || !namespace }), /* @__PURE__ */ import_react12.default.createElement(Button, { label: "Cancel", onClick: onClose }), /* @__PURE__ */ import_react12.default.createElement(Button, { label: "Browse...", disabled: true }))));
|
|
4558
4667
|
};
|
|
4559
4668
|
var SHUT_DOWN_TITLES = {
|
|
4560
4669
|
["standby" /* STAND_BY */]: "Stand By",
|
|
@@ -4567,17 +4676,17 @@
|
|
|
4567
4676
|
["restart" /* RESTART */]: "The computer (node) will be uncordoned: new processes can be scheduled on it again."
|
|
4568
4677
|
};
|
|
4569
4678
|
var ShutDownDialog = ({ action, nodes, onOk, onClose }) => {
|
|
4570
|
-
const [node, setNode] = (0,
|
|
4571
|
-
return /* @__PURE__ */
|
|
4679
|
+
const [node, setNode] = (0, import_react12.useState)(nodes[0]?.name ?? "");
|
|
4680
|
+
return /* @__PURE__ */ import_react12.default.createElement(Dialog, { title: SHUT_DOWN_TITLES[action], onClose, testId: "tl-shut-down" }, /* @__PURE__ */ import_react12.default.createElement("div", { style: { width: 340 } }, /* @__PURE__ */ import_react12.default.createElement("div", null, SHUT_DOWN_TEXT[action]), /* @__PURE__ */ import_react12.default.createElement("div", { className: "tl-form" }, /* @__PURE__ */ import_react12.default.createElement("span", null, "Computer:"), /* @__PURE__ */ import_react12.default.createElement("select", { className: "tl-input", value: node, onChange: (e) => setNode(e.target.value), "aria-label": "Computer" }, nodes.map((n) => /* @__PURE__ */ import_react12.default.createElement("option", { key: n.name, value: n.name }, n.name, n.unschedulable ? " (cordoned)" : "")))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "tl-buttons" }, /* @__PURE__ */ import_react12.default.createElement(Button, { label: "OK", onClick: () => {
|
|
4572
4681
|
onOk(node);
|
|
4573
4682
|
onClose();
|
|
4574
|
-
}, disabled: !node }), /* @__PURE__ */
|
|
4683
|
+
}, disabled: !node }), /* @__PURE__ */ import_react12.default.createElement(Button, { label: "Cancel", onClick: onClose, autoFocus: true }))));
|
|
4575
4684
|
};
|
|
4576
|
-
var AboutDialog = ({ cluster, onClose }) => /* @__PURE__ */
|
|
4577
|
-
var AboutKubernetesXPDialog = ({ cluster, onClose }) => /* @__PURE__ */
|
|
4685
|
+
var AboutDialog = ({ cluster, onClose }) => /* @__PURE__ */ import_react12.default.createElement(Dialog, { title: "About Task Manager", onClose, testId: "tl-about" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "tl-about" }, /* @__PURE__ */ import_react12.default.createElement(WindowIcon, null), /* @__PURE__ */ import_react12.default.createElement("div", null, /* @__PURE__ */ import_react12.default.createElement("div", { style: { fontWeight: 700 } }, "Task Manager"), /* @__PURE__ */ import_react12.default.createElement("div", null, "Part of KubernetesXP ", version, "."), /* @__PURE__ */ import_react12.default.createElement("div", { style: { marginTop: 8 } }, "This computer is the cluster ", /* @__PURE__ */ import_react12.default.createElement("b", null, cluster), ": its pods are the processes, its Deployments, StatefulSets and DaemonSets the applications, its nodes the CPUs and network adapters, and its namespaces the users."))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "tl-buttons" }, /* @__PURE__ */ import_react12.default.createElement(Button, { label: "OK", onClick: onClose, autoFocus: true })));
|
|
4686
|
+
var AboutKubernetesXPDialog = ({ cluster, onClose }) => /* @__PURE__ */ import_react12.default.createElement(Dialog, { title: "About KubernetesXP", onClose, testId: "tl-about-kxp" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "tl-about" }, /* @__PURE__ */ import_react12.default.createElement("span", { className: "tl-about-logo" }, /* @__PURE__ */ import_react12.default.createElement(KubernetesLogo, null)), /* @__PURE__ */ import_react12.default.createElement("div", null, /* @__PURE__ */ import_react12.default.createElement("div", { style: { fontWeight: 700, fontSize: 13 } }, "KubernetesXP"), /* @__PURE__ */ import_react12.default.createElement("div", null, "Version ", version), /* @__PURE__ */ import_react12.default.createElement("div", { style: { marginTop: 8 } }, "A small XP desktop over the cluster ", /* @__PURE__ */ import_react12.default.createElement("b", null, cluster), ", inside Kwirth: the Task Manager and Notepad, a taskbar and a Start menu."), /* @__PURE__ */ import_react12.default.createElement("div", { style: { marginTop: 8 } }, "A Kwirth plugin by jfvilas, under the MIT licence. Its font is Wine's Tahoma replacement (LGPL-2.1)."), /* @__PURE__ */ import_react12.default.createElement("div", { style: { marginTop: 8, color: "#716f64" } }, "Not affiliated with Microsoft. Kubernetes is a trademark of The Linux Foundation, used here to name it."))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "tl-buttons" }, /* @__PURE__ */ import_react12.default.createElement(Button, { label: "OK", onClick: onClose, autoFocus: true })));
|
|
4578
4687
|
|
|
4579
4688
|
// src/front/window/NotepadWindow.tsx
|
|
4580
|
-
var
|
|
4689
|
+
var import_react14 = __toESM(require_react(), 1);
|
|
4581
4690
|
var import_react_codemirror = __toESM(require_react_codemirror(), 1);
|
|
4582
4691
|
var import_state = __toESM(require_state(), 1);
|
|
4583
4692
|
var import_view = __toESM(require_view(), 1);
|
|
@@ -4586,7 +4695,7 @@
|
|
|
4586
4695
|
var import_commands = __toESM(require_commands(), 1);
|
|
4587
4696
|
|
|
4588
4697
|
// src/front/luna/LunaWindow.tsx
|
|
4589
|
-
var
|
|
4698
|
+
var import_react13 = __toESM(require_react(), 1);
|
|
4590
4699
|
var import_react_resizable = __toESM(require_react_resizable(), 1);
|
|
4591
4700
|
|
|
4592
4701
|
// src/front/window/Placement.ts
|
|
@@ -4626,18 +4735,18 @@
|
|
|
4626
4735
|
const { frame, desktopWidth, desktopHeight, onFrame } = props;
|
|
4627
4736
|
const maximized = frame.maximized;
|
|
4628
4737
|
const [x, y, w, h] = maximized ? [0, 0, desktopWidth, desktopHeight] : placementOf(frame, props.firstWidth, props.firstHeight, desktopWidth, desktopHeight);
|
|
4629
|
-
const titleRef = (0,
|
|
4738
|
+
const titleRef = (0, import_react13.useRef)(null);
|
|
4630
4739
|
const drag = (_e, d) => {
|
|
4631
4740
|
const [x0, y0, w0, h0] = placementOf(frame, props.firstWidth, props.firstHeight, desktopWidth, desktopHeight);
|
|
4632
4741
|
onFrame({ x: Math.max(0, Math.min(desktopWidth - w0, x0 + d.deltaX)), y: Math.max(0, Math.min(desktopHeight - h0, y0 + d.deltaY)), width: w0, height: h0 });
|
|
4633
4742
|
};
|
|
4634
|
-
const resizeStart = (0,
|
|
4743
|
+
const resizeStart = (0, import_react13.useRef)([0, 0, 0, 0]);
|
|
4635
4744
|
const resize = (_e, data) => {
|
|
4636
4745
|
const [nx, ny, nw, nh] = resizedPlacement(resizeStart.current, data.handle, data.size.width, data.size.height, desktopWidth, desktopHeight);
|
|
4637
4746
|
onFrame({ x: nx, y: ny, width: nw, height: nh });
|
|
4638
4747
|
};
|
|
4639
4748
|
const classes = "tl-window" + (maximized ? " tl-max" : "") + (props.compact ? " tl-compact" : "") + (props.active ? "" : " tl-inactive");
|
|
4640
|
-
return /* @__PURE__ */
|
|
4749
|
+
return /* @__PURE__ */ import_react13.default.createElement(
|
|
4641
4750
|
import_react_resizable.Resizable,
|
|
4642
4751
|
{
|
|
4643
4752
|
width: w,
|
|
@@ -4647,9 +4756,9 @@
|
|
|
4647
4756
|
resizeStart.current = [x, y, w, h];
|
|
4648
4757
|
},
|
|
4649
4758
|
onResize: resize,
|
|
4650
|
-
handle: (axis, ref) => /* @__PURE__ */
|
|
4759
|
+
handle: (axis, ref) => /* @__PURE__ */ import_react13.default.createElement("span", { ref, className: `tl-resize tl-resize-${axis}`, "data-testid": `tl-resize-${axis}` })
|
|
4651
4760
|
},
|
|
4652
|
-
/* @__PURE__ */
|
|
4761
|
+
/* @__PURE__ */ import_react13.default.createElement(
|
|
4653
4762
|
"div",
|
|
4654
4763
|
{
|
|
4655
4764
|
className: classes,
|
|
@@ -4657,7 +4766,7 @@
|
|
|
4657
4766
|
onMouseDownCapture: props.onActivate,
|
|
4658
4767
|
style: { left: x, top: y, width: w, height: h, zIndex: props.zIndex, display: frame.minimized ? "none" : void 0 }
|
|
4659
4768
|
},
|
|
4660
|
-
/* @__PURE__ */
|
|
4769
|
+
/* @__PURE__ */ import_react13.default.createElement(DraggableCore, { nodeRef: titleRef, onDrag: drag, cancel: ".tl-caption", disabled: maximized || !props.desktop, offsetParent: props.desktop ?? void 0 }, /* @__PURE__ */ import_react13.default.createElement("div", { className: "tl-title", ref: titleRef, onDoubleClick: () => onFrame({ maximized: !maximized }) }, props.icon, /* @__PURE__ */ import_react13.default.createElement("span", { className: "tl-title-text" }, props.title), /* @__PURE__ */ import_react13.default.createElement("span", { className: "tl-caption", "aria-label": "Minimize", role: "button", onClick: () => onFrame({ minimized: true }) }, /* @__PURE__ */ import_react13.default.createElement(MinimizeGlyph, null)), /* @__PURE__ */ import_react13.default.createElement(
|
|
4661
4770
|
"span",
|
|
4662
4771
|
{
|
|
4663
4772
|
className: "tl-caption",
|
|
@@ -4665,8 +4774,8 @@
|
|
|
4665
4774
|
role: "button",
|
|
4666
4775
|
onClick: () => onFrame({ maximized: !maximized })
|
|
4667
4776
|
},
|
|
4668
|
-
maximized ? /* @__PURE__ */
|
|
4669
|
-
), props.onClose ? /* @__PURE__ */
|
|
4777
|
+
maximized ? /* @__PURE__ */ import_react13.default.createElement(RestoreGlyph, null) : /* @__PURE__ */ import_react13.default.createElement(MaximizeGlyph, null)
|
|
4778
|
+
), props.onClose ? /* @__PURE__ */ import_react13.default.createElement("span", { className: "tl-caption tl-close", "aria-label": "Close", role: "button", onClick: props.onClose }, /* @__PURE__ */ import_react13.default.createElement(CloseGlyph, null)) : /* @__PURE__ */ import_react13.default.createElement("span", { className: "tl-caption tl-close tl-disabled", "aria-label": "Close", "aria-disabled": "true" }, /* @__PURE__ */ import_react13.default.createElement(CloseGlyph, null)))),
|
|
4670
4779
|
props.children
|
|
4671
4780
|
)
|
|
4672
4781
|
);
|
|
@@ -4674,13 +4783,13 @@
|
|
|
4674
4783
|
|
|
4675
4784
|
// src/front/window/NotepadWindow.tsx
|
|
4676
4785
|
var NotepadWindow = ({ session, notepad, desktop, desktopWidth, desktopHeight, zIndex }) => {
|
|
4677
|
-
const [wrap, setWrap] = (0,
|
|
4678
|
-
const [message, setMessage] = (0,
|
|
4679
|
-
const viewRef = (0,
|
|
4786
|
+
const [wrap, setWrap] = (0, import_react14.useState)(false);
|
|
4787
|
+
const [message, setMessage] = (0, import_react14.useState)();
|
|
4788
|
+
const viewRef = (0, import_react14.useRef)();
|
|
4680
4789
|
const { id, readOnly } = notepad;
|
|
4681
4790
|
const dirty = notepad.text !== notepad.saved;
|
|
4682
4791
|
const close = () => session.closeNotepad(id);
|
|
4683
|
-
const extensions = (0,
|
|
4792
|
+
const extensions = (0, import_react14.useMemo)(() => [
|
|
4684
4793
|
// readOnly keeps the document as it is; editable keeps the caret and the keyboard out, as a log's window should
|
|
4685
4794
|
import_state.EditorState.readOnly.of(readOnly),
|
|
4686
4795
|
import_view.EditorView.editable.of(!readOnly),
|
|
@@ -4701,11 +4810,11 @@
|
|
|
4701
4810
|
session.setNotepadText(id, text, true);
|
|
4702
4811
|
return true;
|
|
4703
4812
|
}
|
|
4704
|
-
setMessage(/* @__PURE__ */
|
|
4813
|
+
setMessage(/* @__PURE__ */ import_react14.default.createElement(
|
|
4705
4814
|
MessageBox,
|
|
4706
4815
|
{
|
|
4707
4816
|
title: "Notepad",
|
|
4708
|
-
icon: /* @__PURE__ */
|
|
4817
|
+
icon: /* @__PURE__ */ import_react14.default.createElement(ErrorIcon, null),
|
|
4709
4818
|
lines: ["The changes could not be saved.", error],
|
|
4710
4819
|
onClose: () => setMessage(void 0),
|
|
4711
4820
|
buttons: [{ label: "OK", onClick: () => setMessage(void 0) }],
|
|
@@ -4719,11 +4828,11 @@
|
|
|
4719
4828
|
close();
|
|
4720
4829
|
return;
|
|
4721
4830
|
}
|
|
4722
|
-
setMessage(/* @__PURE__ */
|
|
4831
|
+
setMessage(/* @__PURE__ */ import_react14.default.createElement(
|
|
4723
4832
|
MessageBox,
|
|
4724
4833
|
{
|
|
4725
4834
|
title: "Notepad",
|
|
4726
|
-
icon: /* @__PURE__ */
|
|
4835
|
+
icon: /* @__PURE__ */ import_react14.default.createElement(WarningIcon, null),
|
|
4727
4836
|
lines: [`The text in the ${notepad.title} file has changed.`, "Do you want to save the changes?"],
|
|
4728
4837
|
onClose: () => setMessage(void 0),
|
|
4729
4838
|
testId: "tl-notepad-ask",
|
|
@@ -4779,11 +4888,11 @@
|
|
|
4779
4888
|
{ label: "View", items: [{ label: "Status Bar", disabled: true }] },
|
|
4780
4889
|
{ label: "Help", items: [{ label: "Help Topics", disabled: true }] }
|
|
4781
4890
|
];
|
|
4782
|
-
return /* @__PURE__ */
|
|
4891
|
+
return /* @__PURE__ */ import_react14.default.createElement(
|
|
4783
4892
|
LunaWindow,
|
|
4784
4893
|
{
|
|
4785
4894
|
title: `${notepad.title} - Notepad`,
|
|
4786
|
-
icon: /* @__PURE__ */
|
|
4895
|
+
icon: /* @__PURE__ */ import_react14.default.createElement(NotepadIcon, null),
|
|
4787
4896
|
frame: notepad.frame,
|
|
4788
4897
|
firstWidth: NOTEPAD_WIDTH,
|
|
4789
4898
|
firstHeight: NOTEPAD_HEIGHT,
|
|
@@ -4797,7 +4906,7 @@
|
|
|
4797
4906
|
onClose: exit,
|
|
4798
4907
|
testId: "tl-notepad"
|
|
4799
4908
|
},
|
|
4800
|
-
/* @__PURE__ */
|
|
4909
|
+
/* @__PURE__ */ import_react14.default.createElement("div", { className: "tl-frame tl-notepad" }, /* @__PURE__ */ import_react14.default.createElement(MenuBar, { entries: menus }), /* @__PURE__ */ import_react14.default.createElement(
|
|
4801
4910
|
"div",
|
|
4802
4911
|
{
|
|
4803
4912
|
className: "tl-notepad-text",
|
|
@@ -4810,7 +4919,7 @@
|
|
|
4810
4919
|
}
|
|
4811
4920
|
}
|
|
4812
4921
|
},
|
|
4813
|
-
/* @__PURE__ */
|
|
4922
|
+
/* @__PURE__ */ import_react14.default.createElement(
|
|
4814
4923
|
import_react_codemirror.default,
|
|
4815
4924
|
{
|
|
4816
4925
|
value: notepad.text,
|
|
@@ -4827,6 +4936,120 @@
|
|
|
4827
4936
|
);
|
|
4828
4937
|
};
|
|
4829
4938
|
|
|
4939
|
+
// src/front/window/ControlPanelWindow.tsx
|
|
4940
|
+
var import_react16 = __toESM(require_react(), 1);
|
|
4941
|
+
|
|
4942
|
+
// src/front/luna/ControlPanelIcons.tsx
|
|
4943
|
+
var import_react15 = __toESM(require_react(), 1);
|
|
4944
|
+
var BLUE = "#2f6be0";
|
|
4945
|
+
var DARK = "#1d438f";
|
|
4946
|
+
var LINE = "#3b5a8f";
|
|
4947
|
+
var PAPER = "#fff";
|
|
4948
|
+
var FOLDER = "#f5cf55";
|
|
4949
|
+
var FOLDER_DARK = "#c79a1e";
|
|
4950
|
+
var GREEN = "#3c9a3c";
|
|
4951
|
+
var GREY = "#b8c0cc";
|
|
4952
|
+
var monitor = (screen = BLUE) => /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement("rect", { x: "3", y: "4", width: "26", height: "18", rx: "1.5", fill: "#dfe8f6", stroke: LINE }), /* @__PURE__ */ import_react15.default.createElement("rect", { x: "5.5", y: "6.5", width: "21", height: "13", fill: screen }), /* @__PURE__ */ import_react15.default.createElement("rect", { x: "12", y: "22", width: "8", height: "3", fill: "#8a96ab" }), /* @__PURE__ */ import_react15.default.createElement("rect", { x: "8", y: "25", width: "16", height: "3", rx: "1", fill: "#c3cbd8", stroke: "#5d6a82", strokeWidth: ".6" }));
|
|
4953
|
+
var folder = (badge) => /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement("path", { d: "M2 9h10l2 2h16v16H2z", fill: FOLDER, stroke: FOLDER_DARK }), /* @__PURE__ */ import_react15.default.createElement("path", { d: "M2 13h28v14H2z", fill: "#fbe08a", stroke: FOLDER_DARK }), badge);
|
|
4954
|
+
var globe = (badge) => /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement("circle", { cx: "16", cy: "16", r: "12", fill: "#4aa3e8", stroke: DARK }), /* @__PURE__ */ import_react15.default.createElement("path", { d: "M9 10c3 1 4 4 2 6s1 5 3 6M20 6c-2 3 0 5 3 5s3 4 1 6", fill: "none", stroke: GREEN, strokeWidth: "3", strokeLinecap: "round" }), badge);
|
|
4955
|
+
var clock = (x = 16, y = 16, r2 = 12) => /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement("circle", { cx: x, cy: y, r: r2, fill: PAPER, stroke: LINE, strokeWidth: "1.5" }), /* @__PURE__ */ import_react15.default.createElement("path", { d: `M${x} ${y - r2 * 0.6}V${y}l${r2 * 0.45} ${r2 * 0.3}`, fill: "none", stroke: DARK, strokeWidth: "2", strokeLinecap: "round" }));
|
|
4956
|
+
var APPLET_GLYPHS = {
|
|
4957
|
+
accessibility: /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement("circle", { cx: "16", cy: "16", r: "13", fill: GREEN, stroke: "#1f5a1f" }), /* @__PURE__ */ import_react15.default.createElement("circle", { cx: "16", cy: "8.5", r: "2.4", fill: PAPER }), /* @__PURE__ */ import_react15.default.createElement("path", { d: "M9 13h14M16 13v6l-4 6M16 19l4 6", fill: "none", stroke: PAPER, strokeWidth: "2.4", strokeLinecap: "round" })),
|
|
4958
|
+
hardware: /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement("rect", { x: "6", y: "8", width: "20", height: "16", rx: "1.5", fill: "#4d5a6e", stroke: "#222" }), [10, 14, 18, 22].map((x) => /* @__PURE__ */ import_react15.default.createElement("rect", { key: x, x: x - 0.8, y: "4", width: "1.6", height: "4", fill: GREY })), [10, 14, 18, 22].map((x) => /* @__PURE__ */ import_react15.default.createElement("rect", { key: x + "b", x: x - 0.8, y: "24", width: "1.6", height: "4", fill: GREY })), /* @__PURE__ */ import_react15.default.createElement("rect", { x: "10", y: "12", width: "12", height: "8", fill: "#6f7d94" })),
|
|
4959
|
+
programs: /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement("rect", { x: "3", y: "9", width: "18", height: "18", fill: "#c99a4c", stroke: "#7a5520" }), /* @__PURE__ */ import_react15.default.createElement("circle", { cx: "21", cy: "12", r: "9", fill: "#e6ecf5", stroke: LINE }), /* @__PURE__ */ import_react15.default.createElement("circle", { cx: "21", cy: "12", r: "2.5", fill: PAPER, stroke: LINE })),
|
|
4960
|
+
tools: /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement("circle", { cx: "14", cy: "14", r: "9", fill: GREY, stroke: "#5d6a82", strokeWidth: "1.5" }), /* @__PURE__ */ import_react15.default.createElement("circle", { cx: "14", cy: "14", r: "3.5", fill: PAPER, stroke: "#5d6a82" }), [0, 45, 90, 135, 180, 225, 270, 315].map((a) => /* @__PURE__ */ import_react15.default.createElement("rect", { key: a, x: "12.5", y: "2.5", width: "3", height: "4", fill: GREY, stroke: "#5d6a82", strokeWidth: ".6", transform: `rotate(${a} 14 14)` })), /* @__PURE__ */ import_react15.default.createElement("path", { d: "M19 20l9 9", stroke: "#8a5a2b", strokeWidth: "3.5", strokeLinecap: "round" })),
|
|
4961
|
+
updates: globe(/* @__PURE__ */ import_react15.default.createElement("path", { d: "M22 18v10M18 24l4 4 4-4", fill: "none", stroke: "#e0441e", strokeWidth: "2.5", strokeLinecap: "round" })),
|
|
4962
|
+
clock: /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, clock()),
|
|
4963
|
+
display: monitor("#5d92f0"),
|
|
4964
|
+
folder: folder(),
|
|
4965
|
+
fonts: folder(/* @__PURE__ */ import_react15.default.createElement("text", { x: "16", y: "25", fontSize: "11", fontWeight: "700", fontFamily: "serif", textAnchor: "middle", fill: DARK }, "A")),
|
|
4966
|
+
gamepad: /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement("path", { d: "M6 12h20c3 0 4 3 4 7 0 5-3 7-5 5l-3-3H10l-3 3c-2 2-5 0-5-5 0-4 1-7 4-7z", fill: GREY, stroke: "#5d6a82" }), /* @__PURE__ */ import_react15.default.createElement("path", { d: "M9 15v6M6 18h6", stroke: DARK, strokeWidth: "2" }), /* @__PURE__ */ import_react15.default.createElement("circle", { cx: "22", cy: "16", r: "1.6", fill: "#e0441e" }), /* @__PURE__ */ import_react15.default.createElement("circle", { cx: "25", cy: "19", r: "1.6", fill: GREEN })),
|
|
4967
|
+
internet: globe(),
|
|
4968
|
+
keyboard: /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement("rect", { x: "2", y: "9", width: "28", height: "14", rx: "2", fill: "#e6ecf5", stroke: LINE }), [0, 1, 2].map((r2) => [0, 1, 2, 3, 4, 5].map((c) => /* @__PURE__ */ import_react15.default.createElement("rect", { key: `${r2}-${c}`, x: 4.5 + c * 4, y: 11.5 + r2 * 3.4, width: "3", height: "2.4", fill: PAPER, stroke: "#8a96ab", strokeWidth: ".5" })))),
|
|
4969
|
+
mouse: /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement("rect", { x: "9", y: "5", width: "14", height: "22", rx: "7", fill: PAPER, stroke: LINE, strokeWidth: "1.4" }), /* @__PURE__ */ import_react15.default.createElement("path", { d: "M16 5v8M9 13h14", stroke: LINE }), /* @__PURE__ */ import_react15.default.createElement("path", { d: "M16 5c0-3 4-3 4-5", fill: "none", stroke: "#5d6a82" })),
|
|
4970
|
+
network: /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement("g", { transform: "translate(-2 -2) scale(.6)" }, monitor()), /* @__PURE__ */ import_react15.default.createElement("g", { transform: "translate(14 12) scale(.6)" }, monitor()), /* @__PURE__ */ import_react15.default.createElement("path", { d: "M9 15v9h12", fill: "none", stroke: GREEN, strokeWidth: "2" })),
|
|
4971
|
+
phone: /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement("rect", { x: "9", y: "3", width: "14", height: "26", rx: "2.5", fill: "#5d6a82", stroke: "#222" }), /* @__PURE__ */ import_react15.default.createElement("rect", { x: "11.5", y: "6", width: "9", height: "8", fill: "#c8e6b8" }), [0, 1, 2].map((r2) => [0, 1, 2].map((c) => /* @__PURE__ */ import_react15.default.createElement("rect", { key: `${r2}-${c}`, x: 11.5 + c * 3.3, y: 17 + r2 * 3.4, width: "2.4", height: "2.2", fill: PAPER })))),
|
|
4972
|
+
power: /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement("rect", { x: "8", y: "6", width: "16", height: "22", rx: "2", fill: "#e8c33a", stroke: "#8a6b00" }), /* @__PURE__ */ import_react15.default.createElement("rect", { x: "12", y: "3", width: "8", height: "3", fill: "#8a6b00" }), /* @__PURE__ */ import_react15.default.createElement("path", { d: "M17 10l-5 8h4l-2 7 6-9h-4z", fill: "#fff", stroke: "#8a6b00", strokeWidth: ".6" })),
|
|
4973
|
+
printer: /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement("rect", { x: "8", y: "3", width: "16", height: "10", fill: PAPER, stroke: "#5d6a82" }), /* @__PURE__ */ import_react15.default.createElement("rect", { x: "3", y: "12", width: "26", height: "11", rx: "2", fill: GREY, stroke: "#5d6a82" }), /* @__PURE__ */ import_react15.default.createElement("rect", { x: "8", y: "20", width: "16", height: "9", fill: PAPER, stroke: "#5d6a82" }), /* @__PURE__ */ import_react15.default.createElement("circle", { cx: "25", cy: "16", r: "1.2", fill: GREEN })),
|
|
4974
|
+
regional: globe(/* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement("circle", { cx: "24", cy: "24", r: "6", fill: PAPER, stroke: LINE }), /* @__PURE__ */ import_react15.default.createElement("path", { d: "M21 24h6M24 21c-2 2-2 4 0 6M24 21c2 2 2 4 0 6", fill: "none", stroke: LINE }))),
|
|
4975
|
+
camera: /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement("rect", { x: "3", y: "10", width: "26", height: "17", rx: "2.5", fill: "#5d6a82", stroke: "#222" }), /* @__PURE__ */ import_react15.default.createElement("rect", { x: "10", y: "6", width: "9", height: "5", fill: "#5d6a82", stroke: "#222" }), /* @__PURE__ */ import_react15.default.createElement("circle", { cx: "16", cy: "18.5", r: "6", fill: "#8fb4e8", stroke: "#222" }), /* @__PURE__ */ import_react15.default.createElement("circle", { cx: "16", cy: "18.5", r: "2.5", fill: DARK })),
|
|
4976
|
+
tasks: folder(/* @__PURE__ */ import_react15.default.createElement("g", null, clock(22, 21, 7))),
|
|
4977
|
+
security: /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement("path", { d: "M16 2l12 4v8c0 8-6 13-12 16C10 27 4 22 4 14V6z", fill: "#e0441e", stroke: "#7a1a07" }), /* @__PURE__ */ import_react15.default.createElement("path", { d: "M16 2v28C10 27 4 22 4 14V6z", fill: BLUE }), /* @__PURE__ */ import_react15.default.createElement("path", { d: "M4 14h24", stroke: PAPER, strokeWidth: "1.5" })),
|
|
4978
|
+
sound: /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement("path", { d: "M4 12h6l8-6v20l-8-6H4z", fill: GREY, stroke: "#5d6a82" }), /* @__PURE__ */ import_react15.default.createElement("path", { d: "M22 11c2 3 2 7 0 10M25 8c4 5 4 11 0 16", fill: "none", stroke: BLUE, strokeWidth: "2", strokeLinecap: "round" })),
|
|
4979
|
+
speech: /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement("path", { d: "M4 5h24v15H14l-6 6v-6H4z", fill: PAPER, stroke: LINE, strokeWidth: "1.4" }), /* @__PURE__ */ import_react15.default.createElement("path", { d: "M9 10h14M9 14h10", stroke: BLUE, strokeWidth: "2", strokeLinecap: "round" })),
|
|
4980
|
+
system: monitor("#3c9a3c"),
|
|
4981
|
+
taskbar: /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement("rect", { x: "3", y: "5", width: "26", height: "22", fill: "#4aa3e8", stroke: LINE }), /* @__PURE__ */ import_react15.default.createElement("rect", { x: "3", y: "22", width: "26", height: "5", fill: BLUE }), /* @__PURE__ */ import_react15.default.createElement("rect", { x: "3", y: "22", width: "8", height: "5", rx: "2", fill: GREEN }), /* @__PURE__ */ import_react15.default.createElement("rect", { x: "6", y: "9", width: "10", height: "11", fill: PAPER, stroke: LINE, strokeWidth: ".7" })),
|
|
4982
|
+
users: /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement("circle", { cx: "20", cy: "10", r: "5", fill: "#f2c79a", stroke: "#8a5a2b", strokeWidth: ".8" }), /* @__PURE__ */ import_react15.default.createElement("path", { d: "M12 28c0-6 3.5-9 8-9s8 3 8 9z", fill: GREEN, stroke: "#1f5a1f", strokeWidth: ".8" }), /* @__PURE__ */ import_react15.default.createElement("circle", { cx: "11", cy: "12", r: "5", fill: "#f7d4ad", stroke: "#8a5a2b", strokeWidth: ".8" }), /* @__PURE__ */ import_react15.default.createElement("path", { d: "M3 30c0-6 3.5-9 8-9s8 3 8 9z", fill: BLUE, stroke: DARK, strokeWidth: ".8" })),
|
|
4983
|
+
firewall: /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement("rect", { x: "3", y: "8", width: "26", height: "20", fill: "#c0503a", stroke: "#6e2414" }), [12, 17, 22].map((y) => /* @__PURE__ */ import_react15.default.createElement("path", { key: y, d: `M3 ${y}h26`, stroke: "#e8d3c8" })), [0, 1, 2, 3].map((r2) => /* @__PURE__ */ import_react15.default.createElement("path", { key: r2, d: `M${r2 % 2 ? 9 : 15} ${8 + r2 * 5}v5M${r2 % 2 ? 21 : 27} ${8 + r2 * 5}v5`, stroke: "#e8d3c8" })), /* @__PURE__ */ import_react15.default.createElement("path", { d: "M20 2c4 4-1 6 3 9 2-3 4-1 4 2", fill: "#f0a030", stroke: "#b85a00" })),
|
|
4984
|
+
wireless: /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement("rect", { x: "6", y: "18", width: "20", height: "9", rx: "2", fill: GREY, stroke: "#5d6a82" }), /* @__PURE__ */ import_react15.default.createElement("path", { d: "M16 18V8", stroke: "#5d6a82", strokeWidth: "2" }), /* @__PURE__ */ import_react15.default.createElement("path", { d: "M11 8a7 7 0 0 1 10 0M8 5a11 11 0 0 1 16 0", fill: "none", stroke: GREEN, strokeWidth: "2", strokeLinecap: "round" }), /* @__PURE__ */ import_react15.default.createElement("circle", { cx: "22", cy: "22.5", r: "1.2", fill: GREEN }))
|
|
4985
|
+
};
|
|
4986
|
+
var AppletIcon = ({ glyph }) => /* @__PURE__ */ import_react15.default.createElement("svg", { viewBox: "0 0 32 32", className: "tl-cp-icon" }, APPLET_GLYPHS[glyph]);
|
|
4987
|
+
|
|
4988
|
+
// src/front/window/ControlPanelWindow.tsx
|
|
4989
|
+
var CONTROL_PANEL_WIDTH = 560;
|
|
4990
|
+
var CONTROL_PANEL_HEIGHT = 440;
|
|
4991
|
+
var CONTROL_PANEL_APPLETS = [
|
|
4992
|
+
{ name: "Accessibility Options", glyph: "accessibility" },
|
|
4993
|
+
{ name: "Add Hardware", glyph: "hardware" },
|
|
4994
|
+
{ name: "Add or Remove Programs", glyph: "programs" },
|
|
4995
|
+
{ name: "Administrative Tools", glyph: "tools" },
|
|
4996
|
+
{ name: "Automatic Updates", glyph: "updates" },
|
|
4997
|
+
{ name: "Date and Time", glyph: "clock" },
|
|
4998
|
+
{ name: "Display", glyph: "display" },
|
|
4999
|
+
{ name: "Folder Options", glyph: "folder" },
|
|
5000
|
+
{ name: "Fonts", glyph: "fonts" },
|
|
5001
|
+
{ name: "Game Controllers", glyph: "gamepad" },
|
|
5002
|
+
{ name: "Internet Options", glyph: "internet" },
|
|
5003
|
+
{ name: "Keyboard", glyph: "keyboard" },
|
|
5004
|
+
{ name: "Mouse", glyph: "mouse" },
|
|
5005
|
+
{ name: "Network Connections", glyph: "network" },
|
|
5006
|
+
{ name: "Phone and Modem Options", glyph: "phone" },
|
|
5007
|
+
{ name: "Power Options", glyph: "power" },
|
|
5008
|
+
{ name: "Printers and Faxes", glyph: "printer" },
|
|
5009
|
+
{ name: "Regional and Language Options", glyph: "regional" },
|
|
5010
|
+
{ name: "Scanners and Cameras", glyph: "camera" },
|
|
5011
|
+
{ name: "Scheduled Tasks", glyph: "tasks" },
|
|
5012
|
+
{ name: "Security Center", glyph: "security" },
|
|
5013
|
+
{ name: "Sounds and Audio Devices", glyph: "sound" },
|
|
5014
|
+
{ name: "Speech", glyph: "speech" },
|
|
5015
|
+
{ name: "System", glyph: "system" },
|
|
5016
|
+
{ name: "Taskbar and Start Menu", glyph: "taskbar" },
|
|
5017
|
+
{ name: "User Accounts", glyph: "users" },
|
|
5018
|
+
{ name: "Firewall", glyph: "firewall" },
|
|
5019
|
+
{ name: "Wireless Network Setup Wizard", glyph: "wireless" }
|
|
5020
|
+
];
|
|
5021
|
+
var disabledMenu = (label, items) => ({ label, items: items.map((i) => i ? { label: i, disabled: true } : {}) });
|
|
5022
|
+
var ControlPanelWindow = ({ session, desktop, desktopWidth, desktopHeight, zIndex }) => {
|
|
5023
|
+
const menus = [
|
|
5024
|
+
disabledMenu("File", ["Open", "Create Shortcut", "", "Properties"]),
|
|
5025
|
+
disabledMenu("Edit", ["Undo", "", "Select All", "Invert Selection"]),
|
|
5026
|
+
disabledMenu("View", ["Toolbars", "Status Bar", "", "Thumbnails", "Tiles", "Icons", "List", "Details", "", "Refresh"]),
|
|
5027
|
+
disabledMenu("Favorites", ["Add to Favorites...", "Organize Favorites..."]),
|
|
5028
|
+
disabledMenu("Tools", ["Map Network Drive...", "Folder Options..."]),
|
|
5029
|
+
disabledMenu("Help", ["Help and Support Center"])
|
|
5030
|
+
];
|
|
5031
|
+
return /* @__PURE__ */ import_react16.default.createElement(
|
|
5032
|
+
LunaWindow,
|
|
5033
|
+
{
|
|
5034
|
+
title: "Control Panel",
|
|
5035
|
+
icon: /* @__PURE__ */ import_react16.default.createElement(ControlPanelIcon, { title: true }),
|
|
5036
|
+
frame: session.controlPanel,
|
|
5037
|
+
firstWidth: CONTROL_PANEL_WIDTH,
|
|
5038
|
+
firstHeight: CONTROL_PANEL_HEIGHT,
|
|
5039
|
+
desktop,
|
|
5040
|
+
desktopWidth,
|
|
5041
|
+
desktopHeight,
|
|
5042
|
+
active: session.activeWindow() === CONTROL_PANEL_WINDOW,
|
|
5043
|
+
zIndex,
|
|
5044
|
+
onFrame: (patch) => session.setFrame(CONTROL_PANEL_WINDOW, patch),
|
|
5045
|
+
onActivate: () => session.activate(CONTROL_PANEL_WINDOW),
|
|
5046
|
+
onClose: session.closeControlPanel,
|
|
5047
|
+
testId: "tl-control-panel"
|
|
5048
|
+
},
|
|
5049
|
+
/* @__PURE__ */ import_react16.default.createElement("div", { className: "tl-frame tl-cp" }, /* @__PURE__ */ import_react16.default.createElement("div", { className: "tl-cp-menurow" }, /* @__PURE__ */ import_react16.default.createElement(MenuBar, { entries: menus }), /* @__PURE__ */ import_react16.default.createElement("span", { className: "tl-cp-throbber" }, /* @__PURE__ */ import_react16.default.createElement(KubernetesLogo, null))), /* @__PURE__ */ import_react16.default.createElement("div", { className: "tl-cp-toolbar" }, ["Back", "Forward", "Up", "Search", "Folders", "Views"].map((b) => /* @__PURE__ */ import_react16.default.createElement("span", { key: b, className: "tl-cp-tool tl-disabled", role: "button", "aria-label": b, "aria-disabled": "true" }, b))), /* @__PURE__ */ import_react16.default.createElement("div", { className: "tl-cp-address" }, /* @__PURE__ */ import_react16.default.createElement("span", { className: "tl-cp-address-label" }, "Address"), /* @__PURE__ */ import_react16.default.createElement("span", { className: "tl-input tl-cp-address-box" }, /* @__PURE__ */ import_react16.default.createElement(ControlPanelIcon, { title: true }), "Control Panel"), /* @__PURE__ */ import_react16.default.createElement("span", { className: "tl-cp-go tl-disabled", role: "button", "aria-label": "Go", "aria-disabled": "true" }, "Go")), /* @__PURE__ */ import_react16.default.createElement("div", { className: "tl-cp-grid", "data-testid": "tl-cp-applets" }, CONTROL_PANEL_APPLETS.map((a) => /* @__PURE__ */ import_react16.default.createElement("div", { key: a.name, className: "tl-cp-applet tl-disabled", role: "button", "aria-label": a.name, "aria-disabled": "true", title: `${a.name} (not available yet)` }, /* @__PURE__ */ import_react16.default.createElement(AppletIcon, { glyph: a.glyph }), /* @__PURE__ */ import_react16.default.createElement("span", null, a.name)))))
|
|
5050
|
+
);
|
|
5051
|
+
};
|
|
5052
|
+
|
|
4830
5053
|
// src/front/window/TaskManagerWindow.tsx
|
|
4831
5054
|
var TABS = [
|
|
4832
5055
|
{ id: "applications" /* APPLICATIONS */, label: "Applications" },
|
|
@@ -4835,22 +5058,22 @@
|
|
|
4835
5058
|
{ id: "networking" /* NETWORKING */, label: "Networking" },
|
|
4836
5059
|
{ id: "users" /* USERS */, label: "Users" }
|
|
4837
5060
|
];
|
|
4838
|
-
var TaskManagerWindow = ({ session, width, height }) => {
|
|
4839
|
-
const [dialog, setDialog] = (0,
|
|
4840
|
-
const [contextMenu, setContextMenu] = (0,
|
|
4841
|
-
const rootRef = (0,
|
|
4842
|
-
const [desktop, setDesktop] = (0,
|
|
4843
|
-
const close = (0,
|
|
4844
|
-
const closeMenu = (0,
|
|
5061
|
+
var TaskManagerWindow = ({ session, width, height, userName, onTurnOff }) => {
|
|
5062
|
+
const [dialog, setDialog] = (0, import_react17.useState)();
|
|
5063
|
+
const [contextMenu, setContextMenu] = (0, import_react17.useState)();
|
|
5064
|
+
const rootRef = (0, import_react17.useRef)(null);
|
|
5065
|
+
const [desktop, setDesktop] = (0, import_react17.useState)(null);
|
|
5066
|
+
const close = (0, import_react17.useCallback)(() => setDialog(void 0), []);
|
|
5067
|
+
const closeMenu = (0, import_react17.useCallback)(() => setContextMenu(void 0), []);
|
|
4845
5068
|
const snapshot = session.snapshot;
|
|
4846
5069
|
const tab = session.state.tab;
|
|
4847
|
-
const errorBox = (title, lines) => setDialog(/* @__PURE__ */
|
|
4848
|
-
const infoBox = (title, lines) => setDialog(/* @__PURE__ */
|
|
4849
|
-
const confirm = (title, lines, onYes) => setDialog(/* @__PURE__ */
|
|
5070
|
+
const errorBox = (title, lines) => setDialog(/* @__PURE__ */ import_react17.default.createElement(MessageBox, { title, icon: /* @__PURE__ */ import_react17.default.createElement(ErrorIcon, null), lines, onClose: close, buttons: [{ label: "OK", onClick: close }], testId: "tl-error" }));
|
|
5071
|
+
const infoBox = (title, lines) => setDialog(/* @__PURE__ */ import_react17.default.createElement(MessageBox, { title, icon: /* @__PURE__ */ import_react17.default.createElement(InfoIcon, null), lines, onClose: close, buttons: [{ label: "OK", onClick: close }], testId: "tl-info" }));
|
|
5072
|
+
const confirm = (title, lines, onYes) => setDialog(/* @__PURE__ */ import_react17.default.createElement(
|
|
4850
5073
|
MessageBox,
|
|
4851
5074
|
{
|
|
4852
5075
|
title,
|
|
4853
|
-
icon: /* @__PURE__ */
|
|
5076
|
+
icon: /* @__PURE__ */ import_react17.default.createElement(WarningIcon, null),
|
|
4854
5077
|
lines,
|
|
4855
5078
|
onClose: close,
|
|
4856
5079
|
testId: "tl-warning",
|
|
@@ -4918,7 +5141,7 @@
|
|
|
4918
5141
|
list?.querySelector(".tl-list-row.tl-selected")?.scrollIntoView({ block: "nearest" });
|
|
4919
5142
|
}, 0);
|
|
4920
5143
|
};
|
|
4921
|
-
const newTask = () => setDialog(/* @__PURE__ */
|
|
5144
|
+
const newTask = () => setDialog(/* @__PURE__ */ import_react17.default.createElement(
|
|
4922
5145
|
CreateNewTaskDialog,
|
|
4923
5146
|
{
|
|
4924
5147
|
users: snapshot?.users ?? [],
|
|
@@ -4935,7 +5158,7 @@
|
|
|
4935
5158
|
session.select("users" /* USERS */, []);
|
|
4936
5159
|
});
|
|
4937
5160
|
};
|
|
4938
|
-
const shutDown = (action) => setDialog(/* @__PURE__ */
|
|
5161
|
+
const shutDown = (action) => setDialog(/* @__PURE__ */ import_react17.default.createElement(
|
|
4939
5162
|
ShutDownDialog,
|
|
4940
5163
|
{
|
|
4941
5164
|
action,
|
|
@@ -4948,7 +5171,7 @@
|
|
|
4948
5171
|
)
|
|
4949
5172
|
}
|
|
4950
5173
|
));
|
|
4951
|
-
const properties = (p) => setDialog(/* @__PURE__ */
|
|
5174
|
+
const properties = (p) => setDialog(/* @__PURE__ */ import_react17.default.createElement(PropertiesDialog, { process: p, onClose: close }));
|
|
4952
5175
|
const viewLog = async (p, container) => {
|
|
4953
5176
|
try {
|
|
4954
5177
|
const response = await session.request({ command: "log" /* LOG */, targetNamespace: p.namespace, targetName: p.name, containerName: container });
|
|
@@ -5019,7 +5242,7 @@
|
|
|
5019
5242
|
{},
|
|
5020
5243
|
...tab === "processes" /* PROCESSES */ ? [{
|
|
5021
5244
|
label: "Select Columns...",
|
|
5022
|
-
onClick: () => setDialog(/* @__PURE__ */
|
|
5245
|
+
onClick: () => setDialog(/* @__PURE__ */ import_react17.default.createElement(SelectColumnsDialog, { columns: session.state.columns, onClose: close, onOk: (columns) => session.setState({ columns }) }))
|
|
5023
5246
|
}] : [],
|
|
5024
5247
|
...tab === "performance" /* PERFORMANCE */ ? [
|
|
5025
5248
|
{
|
|
@@ -5063,11 +5286,11 @@
|
|
|
5063
5286
|
items: [
|
|
5064
5287
|
{ label: "Task Manager Help Topics", disabled: true },
|
|
5065
5288
|
{},
|
|
5066
|
-
{ label: "About Task Manager", onClick: () => setDialog(/* @__PURE__ */
|
|
5289
|
+
{ label: "About Task Manager", onClick: () => setDialog(/* @__PURE__ */ import_react17.default.createElement(AboutDialog, { cluster: session.cluster, onClose: close })) }
|
|
5067
5290
|
]
|
|
5068
5291
|
}
|
|
5069
5292
|
];
|
|
5070
|
-
(0,
|
|
5293
|
+
(0, import_react17.useEffect)(() => {
|
|
5071
5294
|
const root = rootRef.current;
|
|
5072
5295
|
if (!root) return;
|
|
5073
5296
|
const key = (e) => {
|
|
@@ -5086,11 +5309,11 @@
|
|
|
5086
5309
|
const metrics = snapshot?.metrics;
|
|
5087
5310
|
const limit = (snapshot?.nodes ?? []).reduce((n, x) => n + x.memoryAllocatable, 0);
|
|
5088
5311
|
const openMenu = (items, x, y) => setContextMenu({ items, x, y });
|
|
5089
|
-
return /* @__PURE__ */
|
|
5312
|
+
return /* @__PURE__ */ import_react17.default.createElement("div", { className: "tl-root", ref: rootRef, tabIndex: -1, "data-testid": "tasklist-window-root", style: { width, height } }, /* @__PURE__ */ import_react17.default.createElement("div", { className: "tl-desktop", ref: setDesktop, style: { height: deskHeight }, "data-testid": "tl-desktop" }, session.taskManagerOpen && /* @__PURE__ */ import_react17.default.createElement(
|
|
5090
5313
|
LunaWindow,
|
|
5091
5314
|
{
|
|
5092
5315
|
title: "Task Manager",
|
|
5093
|
-
icon: /* @__PURE__ */
|
|
5316
|
+
icon: /* @__PURE__ */ import_react17.default.createElement(WindowIcon, null),
|
|
5094
5317
|
frame: session.taskManager,
|
|
5095
5318
|
firstWidth: NORMAL_WIDTH,
|
|
5096
5319
|
firstHeight: NORMAL_HEIGHT,
|
|
@@ -5105,10 +5328,10 @@
|
|
|
5105
5328
|
onActivate: () => session.activate(TASK_MANAGER_WINDOW),
|
|
5106
5329
|
onClose: session.closeTaskManager
|
|
5107
5330
|
},
|
|
5108
|
-
/* @__PURE__ */
|
|
5331
|
+
/* @__PURE__ */ import_react17.default.createElement("div", { className: "tl-frame" }, /* @__PURE__ */ import_react17.default.createElement(MenuBar, { entries: menus }), /* @__PURE__ */ import_react17.default.createElement("div", { className: "tl-body" }, /* @__PURE__ */ import_react17.default.createElement(TabStrip, { tabs: TABS, selected: tab, onSelect: (t) => session.setState({ tab: t }) }), /* @__PURE__ */ import_react17.default.createElement("div", { className: "tl-tabpanel", "data-testid": `tl-panel-${tab}`, onDoubleClick: (e) => {
|
|
5109
5332
|
const target = e.target;
|
|
5110
5333
|
if (target === e.currentTarget || target.closest(".tl-screen, .tl-net-graphs, .tl-perf")) session.setCompact(!session.compact);
|
|
5111
|
-
} }, tab === "applications" /* APPLICATIONS */ && /* @__PURE__ */
|
|
5334
|
+
} }, tab === "applications" /* APPLICATIONS */ && /* @__PURE__ */ import_react17.default.createElement(
|
|
5112
5335
|
ApplicationsTab,
|
|
5113
5336
|
{
|
|
5114
5337
|
session,
|
|
@@ -5118,7 +5341,7 @@
|
|
|
5118
5341
|
onEdit: (a) => void edit(a.kind, a.namespace, a.name),
|
|
5119
5342
|
onContextMenu: openMenu
|
|
5120
5343
|
}
|
|
5121
|
-
), tab === "processes" /* PROCESSES */ && /* @__PURE__ */
|
|
5344
|
+
), tab === "processes" /* PROCESSES */ && /* @__PURE__ */ import_react17.default.createElement(
|
|
5122
5345
|
ProcessesTab,
|
|
5123
5346
|
{
|
|
5124
5347
|
session,
|
|
@@ -5130,8 +5353,39 @@
|
|
|
5130
5353
|
onEdit: (p) => void edit("Pod", p.namespace, p.name),
|
|
5131
5354
|
onContextMenu: openMenu
|
|
5132
5355
|
}
|
|
5133
|
-
), tab === "performance" /* PERFORMANCE */ && /* @__PURE__ */
|
|
5134
|
-
), session.
|
|
5356
|
+
), tab === "performance" /* PERFORMANCE */ && /* @__PURE__ */ import_react17.default.createElement(PerformanceTab, { session }), tab === "networking" /* NETWORKING */ && /* @__PURE__ */ import_react17.default.createElement(NetworkingTab, { session }), tab === "users" /* USERS */ && /* @__PURE__ */ import_react17.default.createElement(UsersTab, { session, onLogOff: logOff, onContextMenu: openMenu }))), /* @__PURE__ */ import_react17.default.createElement("div", { className: "tl-status", "data-testid": "tl-status" }, /* @__PURE__ */ import_react17.default.createElement("div", { className: "tl-status-panel", style: { width: 110 } }, session.error ? "Not responding" : `Processes: ${snapshot?.processes.length ?? 0}`), /* @__PURE__ */ import_react17.default.createElement("div", { className: "tl-status-panel", style: { width: 110 } }, "CPU Usage: ", percent(metrics?.cpu)), /* @__PURE__ */ import_react17.default.createElement("div", { className: "tl-status-panel", style: { flex: 1 }, title: session.error }, session.error ?? `Commit Charge: ${megabytes(snapshot?.requests.memory ?? 0)} / ${limit > 0 ? megabytes(limit) : "--"}`), !maximized && /* @__PURE__ */ import_react17.default.createElement("span", { className: "tl-grip", "data-testid": "tl-grip" })))
|
|
5357
|
+
), session.controlPanelOpen && /* @__PURE__ */ import_react17.default.createElement(
|
|
5358
|
+
ControlPanelWindow,
|
|
5359
|
+
{
|
|
5360
|
+
session,
|
|
5361
|
+
desktop,
|
|
5362
|
+
desktopWidth: deskWidth,
|
|
5363
|
+
desktopHeight: deskHeight,
|
|
5364
|
+
zIndex: zIndexOf(CONTROL_PANEL_WINDOW)
|
|
5365
|
+
}
|
|
5366
|
+
), session.notepads.map((n) => /* @__PURE__ */ import_react17.default.createElement(NotepadWindow, { key: n.id, session, notepad: n, desktop, desktopWidth: deskWidth, desktopHeight: deskHeight, zIndex: zIndexOf(n.id) })), dialog), /* @__PURE__ */ import_react17.default.createElement(
|
|
5367
|
+
Taskbar,
|
|
5368
|
+
{
|
|
5369
|
+
session,
|
|
5370
|
+
userName,
|
|
5371
|
+
onRun: newTask,
|
|
5372
|
+
onAbout: () => setDialog(/* @__PURE__ */ import_react17.default.createElement(AboutKubernetesXPDialog, { cluster: session.cluster, onClose: close })),
|
|
5373
|
+
onTurnOff: onTurnOff && (() => setDialog(/* @__PURE__ */ import_react17.default.createElement(
|
|
5374
|
+
MessageBox,
|
|
5375
|
+
{
|
|
5376
|
+
title: "Turn Off Computer",
|
|
5377
|
+
icon: /* @__PURE__ */ import_react17.default.createElement(WarningIcon, null),
|
|
5378
|
+
testId: "tl-turn-off",
|
|
5379
|
+
lines: ["KubernetesXP will be turned off: the channel stops, and its windows close.", "Start the channel again to turn it back on."],
|
|
5380
|
+
onClose: close,
|
|
5381
|
+
buttons: [{ label: "Turn Off", onClick: () => {
|
|
5382
|
+
close();
|
|
5383
|
+
onTurnOff();
|
|
5384
|
+
} }, { label: "Cancel", onClick: close }]
|
|
5385
|
+
}
|
|
5386
|
+
)))
|
|
5387
|
+
}
|
|
5388
|
+
), contextMenu && /* @__PURE__ */ import_react17.default.createElement(ContextMenu, { items: contextMenu.items, x: contextMenu.x, y: contextMenu.y, onClose: closeMenu }));
|
|
5135
5389
|
};
|
|
5136
5390
|
|
|
5137
5391
|
// src/front/fonts/tahoma.ttf
|
|
@@ -5237,6 +5491,68 @@
|
|
|
5237
5491
|
.tl-tray-icon { width: 16px; height: 16px; display: block; }
|
|
5238
5492
|
.tl-clock { white-space: nowrap; }
|
|
5239
5493
|
|
|
5494
|
+
/* the Start menu: the user on blue, programs on white, places on pale blue, Log Off and Turn Off at the foot */
|
|
5495
|
+
.tl-sm { position: absolute; left: 0; bottom: 30px; width: 390px; z-index: 60; display: flex; flex-direction: column; border: 1px solid #0d3ea6;
|
|
5496
|
+
border-radius: 7px 7px 0 0; background: #1c58d6; box-shadow: 2px 2px 8px rgba(0,0,0,.5); }
|
|
5497
|
+
.tl-sm-head { height: 58px; display: flex; align-items: center; gap: 9px; padding: 0 10px; border-radius: 6px 6px 0 0; position: relative;
|
|
5498
|
+
background: linear-gradient(to bottom, #1868ce 0%, #0e60cb 15%, #1667cf 33%, #1e70d9 54%, #297ae0 65%, #3786e5 79%, #4791eb 100%); }
|
|
5499
|
+
.tl-sm-head::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
|
|
5500
|
+
background: linear-gradient(to right, #2f6be0 0%, #f0a030 50%, #2f6be0 100%); }
|
|
5501
|
+
.tl-sm-picture { width: 44px; height: 44px; border: 2px solid #fff; border-radius: 4px; background: #dfe8f6; display: flex; align-items: center; justify-content: center;
|
|
5502
|
+
box-shadow: 1px 1px 3px rgba(0,0,0,.4); }
|
|
5503
|
+
.tl-sm-picture .tl-start-logo { width: 36px; height: 36px; filter: none; }
|
|
5504
|
+
.tl-sm-user { color: #fff; font-size: 14px; font-weight: 700; text-shadow: 1px 1px 2px #0f2d6e; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
|
|
5505
|
+
.tl-sm-body { display: flex; height: 340px; margin-top: 2px; }
|
|
5506
|
+
.tl-sm-left { width: 190px; background: #fff; display: flex; flex-direction: column; padding: 6px 0; }
|
|
5507
|
+
.tl-sm-right { flex: 1; background: #d3e5fa; border-left: 1px solid #95bdee; padding: 6px 0; display: flex; flex-direction: column; }
|
|
5508
|
+
.tl-sm-item { position: relative; display: flex; align-items: center; gap: 7px; padding: 4px 8px; color: #000; cursor: default; line-height: 13px; }
|
|
5509
|
+
.tl-sm-item:hover:not(.tl-disabled), .tl-sm-item.tl-open { background: #316ac5; color: #fff; }
|
|
5510
|
+
.tl-sm-item:hover:not(.tl-disabled) .tl-sm-line { color: #dfe8f6; }
|
|
5511
|
+
.tl-sm-item.tl-disabled { color: #8a94a6; }
|
|
5512
|
+
.tl-sm-item.tl-disabled svg { opacity: .55; filter: grayscale(.5); }
|
|
5513
|
+
.tl-sm-program { padding: 5px 8px; }
|
|
5514
|
+
.tl-sm-big { width: 32px; height: 32px; flex: 0 0 auto; }
|
|
5515
|
+
.tl-sm-big .tl-title-icon { width: 32px; height: 32px; margin: 0; }
|
|
5516
|
+
.tl-sm-line { color: #716f64; }
|
|
5517
|
+
.tl-sm-fill { flex: 1; }
|
|
5518
|
+
.tl-sm-sep { height: 1px; margin: 4px 8px; flex: 0 0 auto; background: linear-gradient(to right, transparent, #a8b5cf, transparent); }
|
|
5519
|
+
.tl-sm-right .tl-sm-sep { background: linear-gradient(to right, transparent, #7ea3dd, transparent); }
|
|
5520
|
+
.tl-sm-all { justify-content: center; gap: 10px; padding: 6px 8px; }
|
|
5521
|
+
.tl-sm-arrow { width: 16px; height: 16px; }
|
|
5522
|
+
.tl-sm-icon { width: 24px; height: 24px; flex: 0 0 auto; display: inline-flex; }
|
|
5523
|
+
/* a place's icon, whatever its drawing: always the same 24px */
|
|
5524
|
+
.tl-sm-slot { width: 24px; height: 24px; flex: 0 0 auto; display: inline-flex; }
|
|
5525
|
+
.tl-sm-slot svg { width: 24px; height: 24px; }
|
|
5526
|
+
.tl-sm-place { color: #00136b; }
|
|
5527
|
+
.tl-sm-logo .tl-start-logo { width: 24px; height: 24px; filter: none; }
|
|
5528
|
+
.tl-sm-foot { height: 40px; display: flex; justify-content: flex-end; align-items: center; gap: 14px; padding: 0 12px;
|
|
5529
|
+
background: linear-gradient(to bottom, #4282d6 0%, #418ae3 5%, #3786e4 26%, #2e7ee1 39%, #2374df 49%, #196edb 62%, #1468d5 75%, #0f61cb 100%); }
|
|
5530
|
+
.tl-sm-button { display: flex; align-items: center; gap: 5px; color: #fff; padding: 2px 5px; border-radius: 3px; cursor: default; }
|
|
5531
|
+
.tl-sm-button:hover:not(.tl-disabled) { background: rgba(255,255,255,.18); }
|
|
5532
|
+
.tl-sm-button.tl-disabled { opacity: .55; }
|
|
5533
|
+
.tl-sm-foot-icon { width: 22px; height: 22px; }
|
|
5534
|
+
|
|
5535
|
+
/* the Control Panel: an Explorer window */
|
|
5536
|
+
.tl-frame.tl-cp { background: #fff; }
|
|
5537
|
+
.tl-cp-menurow { display: flex; align-items: stretch; background: #ece9d8; }
|
|
5538
|
+
.tl-cp-menurow .tl-menubar { flex: 1; }
|
|
5539
|
+
.tl-cp-throbber { width: 38px; background: #fff; border-left: 1px solid #aca899; display: flex; align-items: center; justify-content: center; }
|
|
5540
|
+
.tl-cp-throbber .tl-start-logo { width: 16px; height: 16px; filter: none; }
|
|
5541
|
+
.tl-cp-toolbar { display: flex; gap: 2px; padding: 3px 4px; background: #ece9d8; border-top: 1px solid #fff; border-bottom: 1px solid #aca899; }
|
|
5542
|
+
.tl-cp-tool { padding: 4px 9px; border-radius: 3px; }
|
|
5543
|
+
.tl-cp-tool.tl-disabled { color: #aca899; }
|
|
5544
|
+
.tl-cp-address { display: flex; align-items: center; gap: 4px; padding: 2px 4px; background: #ece9d8; border-bottom: 1px solid #aca899; }
|
|
5545
|
+
.tl-cp-address-label { color: #716f64; padding: 0 2px; }
|
|
5546
|
+
.tl-cp-address-box { flex: 1; display: flex; align-items: center; gap: 4px; }
|
|
5547
|
+
.tl-cp-address-box .tl-title-icon { margin: 0; }
|
|
5548
|
+
.tl-cp-go { padding: 0 8px; }
|
|
5549
|
+
.tl-cp-go.tl-disabled { color: #aca899; }
|
|
5550
|
+
.tl-cp-grid { flex: 1; min-height: 0; overflow: auto; background: #fff; display: grid; grid-template-columns: repeat(auto-fill, 80px); gap: 12px 6px; padding: 10px; align-content: start; }
|
|
5551
|
+
.tl-cp-applet { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; line-height: 13px; cursor: default; }
|
|
5552
|
+
.tl-cp-applet.tl-disabled { color: #8a8a80; }
|
|
5553
|
+
.tl-cp-applet.tl-disabled .tl-cp-icon { filter: grayscale(.55) opacity(.6); }
|
|
5554
|
+
.tl-cp-icon { width: 32px; height: 32px; }
|
|
5555
|
+
|
|
5240
5556
|
/* the window is resized by its edges and corners, which only change the pointer, as XP's */
|
|
5241
5557
|
.tl-resize { position: absolute; z-index: 5; }
|
|
5242
5558
|
.tl-resize-n { top: -3px; left: 8px; right: 8px; height: 6px; cursor: ns-resize; }
|
|
@@ -5406,15 +5722,15 @@
|
|
|
5406
5722
|
};
|
|
5407
5723
|
var TasklistTabContent = ({ channelObject }) => {
|
|
5408
5724
|
const session = currentSession(channelObject);
|
|
5409
|
-
const [, setRevision] = (0,
|
|
5410
|
-
(0,
|
|
5411
|
-
(0,
|
|
5725
|
+
const [, setRevision] = (0, import_react18.useState)(0);
|
|
5726
|
+
(0, import_react18.useEffect)(() => session?.subscribe(() => setRevision((r2) => r2 + 1)), [session]);
|
|
5727
|
+
(0, import_react18.useEffect)(() => {
|
|
5412
5728
|
injectLunaStyle();
|
|
5413
5729
|
void loadLunaFont().then(() => setRevision((r2) => r2 + 1));
|
|
5414
5730
|
}, []);
|
|
5415
|
-
const containerRef = (0,
|
|
5416
|
-
const [size, setSize] = (0,
|
|
5417
|
-
(0,
|
|
5731
|
+
const containerRef = (0, import_react18.useRef)(null);
|
|
5732
|
+
const [size, setSize] = (0, import_react18.useState)({ width: 0, height: 0 });
|
|
5733
|
+
(0, import_react18.useEffect)(() => {
|
|
5418
5734
|
const measure = () => {
|
|
5419
5735
|
const box = containerRef.current?.getBoundingClientRect();
|
|
5420
5736
|
if (!box) return;
|
|
@@ -5432,17 +5748,26 @@
|
|
|
5432
5748
|
};
|
|
5433
5749
|
}, [session, channelObject.isFullscreen]);
|
|
5434
5750
|
if (!session) {
|
|
5435
|
-
return /* @__PURE__ */
|
|
5751
|
+
return /* @__PURE__ */ import_react18.default.createElement(import_material2.Stack, { sx: { height: "60vh", alignItems: "center", justifyContent: "center", px: 4 } }, /* @__PURE__ */ import_react18.default.createElement(
|
|
5436
5752
|
import_kwirth_common_front.ChannelNotStarted,
|
|
5437
5753
|
{
|
|
5438
|
-
icon: /* @__PURE__ */
|
|
5754
|
+
icon: /* @__PURE__ */ import_react18.default.createElement(import_material2.Box, { sx: { display: "flex", color: "primary.main" } }, TasklistIcon),
|
|
5439
5755
|
name: "KubernetesXP",
|
|
5440
5756
|
hint: "KubernetesXP not started. Start the channel to open the desktop of this cluster: its Task Manager, its logs and its YAML.",
|
|
5441
5757
|
channelObject
|
|
5442
5758
|
}
|
|
5443
5759
|
));
|
|
5444
5760
|
}
|
|
5445
|
-
return /* @__PURE__ */
|
|
5761
|
+
return /* @__PURE__ */ import_react18.default.createElement("div", { ref: containerRef, style: { width: "100%", height: size.height }, "data-testid": "tasklist-window-host" }, size.width > 0 && /* @__PURE__ */ import_react18.default.createElement(
|
|
5762
|
+
TaskManagerWindow,
|
|
5763
|
+
{
|
|
5764
|
+
session,
|
|
5765
|
+
width: size.width,
|
|
5766
|
+
height: size.height,
|
|
5767
|
+
userName: channelObject.userName || "User",
|
|
5768
|
+
onTurnOff: channelObject.stopChannel
|
|
5769
|
+
}
|
|
5770
|
+
));
|
|
5446
5771
|
};
|
|
5447
5772
|
|
|
5448
5773
|
// src/front/TasklistData.ts
|