@trops/dash-core 0.1.120 → 0.1.121
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/electron/index.js +143 -19
- package/dist/electron/index.js.map +1 -1
- package/dist/index.esm.js +732 -298
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +732 -298
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -49,8 +49,8 @@ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
|
49
49
|
var jsxRuntime__namespace = /*#__PURE__*/_interopNamespaceDefault(jsxRuntime);
|
|
50
50
|
var ReactDOM__namespace = /*#__PURE__*/_interopNamespaceDefault(ReactDOM);
|
|
51
51
|
|
|
52
|
-
function ownKeys$
|
|
53
|
-
function _objectSpread$
|
|
52
|
+
function ownKeys$C(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
53
|
+
function _objectSpread$C(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$C(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$C(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
54
54
|
var event = {
|
|
55
55
|
list: new Map(),
|
|
56
56
|
// Map(1) { '<widget-UUID>' => { 'CustomSearchbar[10].searchQueryChanged': [] } }
|
|
@@ -112,7 +112,7 @@ var event = {
|
|
|
112
112
|
uuid: subscriber["uuid"]
|
|
113
113
|
};
|
|
114
114
|
if ("action" in subscriber && subscriber.action !== undefined) {
|
|
115
|
-
subscriber["action"](_objectSpread$
|
|
115
|
+
subscriber["action"](_objectSpread$C({}, objectToSend));
|
|
116
116
|
}
|
|
117
117
|
});
|
|
118
118
|
}
|
|
@@ -2552,8 +2552,8 @@ var DashboardWrapper = function DashboardWrapper(_ref) {
|
|
|
2552
2552
|
});
|
|
2553
2553
|
};
|
|
2554
2554
|
|
|
2555
|
-
function ownKeys$
|
|
2556
|
-
function _objectSpread$
|
|
2555
|
+
function ownKeys$B(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2556
|
+
function _objectSpread$B(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$B(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$B(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2557
2557
|
var DashboardThemeProvider = function DashboardThemeProvider(_ref) {
|
|
2558
2558
|
var themeKey = _ref.themeKey,
|
|
2559
2559
|
children = _ref.children;
|
|
@@ -2565,7 +2565,7 @@ var DashboardThemeProvider = function DashboardThemeProvider(_ref) {
|
|
|
2565
2565
|
var dashboardTheme = themes[themeKey];
|
|
2566
2566
|
var themeValue = dashboardTheme ? dashboardTheme[themeVariant] || null : null;
|
|
2567
2567
|
if (!themeValue) return null;
|
|
2568
|
-
return _objectSpread$
|
|
2568
|
+
return _objectSpread$B(_objectSpread$B({}, parentContext), {}, {
|
|
2569
2569
|
currentTheme: themeValue,
|
|
2570
2570
|
currentThemeKey: themeKey,
|
|
2571
2571
|
theme: themeValue,
|
|
@@ -2583,8 +2583,8 @@ var DashboardThemeProvider = function DashboardThemeProvider(_ref) {
|
|
|
2583
2583
|
});
|
|
2584
2584
|
};
|
|
2585
2585
|
|
|
2586
|
-
function ownKeys$
|
|
2587
|
-
function _objectSpread$
|
|
2586
|
+
function ownKeys$A(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2587
|
+
function _objectSpread$A(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$A(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$A(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2588
2588
|
var AppThemeScope = function AppThemeScope(_ref) {
|
|
2589
2589
|
var children = _ref.children;
|
|
2590
2590
|
var ctx = React.useContext(DashReact.ThemeContext);
|
|
@@ -2592,7 +2592,7 @@ var AppThemeScope = function AppThemeScope(_ref) {
|
|
|
2592
2592
|
children: children
|
|
2593
2593
|
});
|
|
2594
2594
|
return /*#__PURE__*/jsxRuntime.jsx(DashReact.ThemeContext.Provider, {
|
|
2595
|
-
value: _objectSpread$
|
|
2595
|
+
value: _objectSpread$A(_objectSpread$A({}, ctx), {}, {
|
|
2596
2596
|
currentTheme: ctx.appTheme,
|
|
2597
2597
|
currentThemeKey: ctx.appThemeKey,
|
|
2598
2598
|
theme: ctx.appTheme,
|
|
@@ -2704,8 +2704,8 @@ var LayoutContainer = function LayoutContainer(_ref) {
|
|
|
2704
2704
|
});
|
|
2705
2705
|
};
|
|
2706
2706
|
|
|
2707
|
-
function ownKeys$
|
|
2708
|
-
function _objectSpread$
|
|
2707
|
+
function ownKeys$z(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2708
|
+
function _objectSpread$z(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$z(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$z(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2709
2709
|
function _createForOfIteratorHelper$a(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$a(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
2710
2710
|
function _unsupportedIterableToArray$a(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$a(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$a(r, a) : void 0; } }
|
|
2711
2711
|
function _arrayLikeToArray$a(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
@@ -2949,7 +2949,7 @@ function createLayoutFromTemplate(template) {
|
|
|
2949
2949
|
try {
|
|
2950
2950
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
2951
2951
|
var cell = _step.value;
|
|
2952
|
-
grid[cell.key] = _objectSpread$
|
|
2952
|
+
grid[cell.key] = _objectSpread$z({
|
|
2953
2953
|
component: null,
|
|
2954
2954
|
hide: cell.hide || false
|
|
2955
2955
|
}, cell.span ? {
|
|
@@ -3464,7 +3464,8 @@ var StarRating = function StarRating(_ref) {
|
|
|
3464
3464
|
|
|
3465
3465
|
var RegistryDashboardDetail = function RegistryDashboardDetail(_ref) {
|
|
3466
3466
|
var dashboardPackage = _ref.dashboardPackage,
|
|
3467
|
-
appId = _ref.appId
|
|
3467
|
+
appId = _ref.appId,
|
|
3468
|
+
onInstallComplete = _ref.onInstallComplete;
|
|
3468
3469
|
var _useContext = React.useContext(DashReact.ThemeContext),
|
|
3469
3470
|
currentTheme = _useContext.currentTheme;
|
|
3470
3471
|
var panelStyles = DashReact.getStylesForItem(DashReact.themeObjects.PANEL, currentTheme, {
|
|
@@ -3534,6 +3535,9 @@ var RegistryDashboardDetail = function RegistryDashboardDetail(_ref) {
|
|
|
3534
3535
|
status: result !== null && result !== void 0 && result.success ? "success" : "error",
|
|
3535
3536
|
message: result !== null && result !== void 0 && result.success ? "Dashboard \"".concat(((_result$workspace = result.workspace) === null || _result$workspace === void 0 ? void 0 : _result$workspace.name) || pkg.name, "\" installed successfully.") : (result === null || result === void 0 ? void 0 : result.error) || "Installation failed."
|
|
3536
3537
|
});
|
|
3538
|
+
if (result !== null && result !== void 0 && result.success && onInstallComplete) {
|
|
3539
|
+
onInstallComplete(result);
|
|
3540
|
+
}
|
|
3537
3541
|
_context.next = 5;
|
|
3538
3542
|
break;
|
|
3539
3543
|
case 4:
|
|
@@ -3724,7 +3728,8 @@ var RegistryDashboardDetail = function RegistryDashboardDetail(_ref) {
|
|
|
3724
3728
|
|
|
3725
3729
|
var DiscoverDashboardsDetail = function DiscoverDashboardsDetail(_ref) {
|
|
3726
3730
|
var onBack = _ref.onBack,
|
|
3727
|
-
appId = _ref.appId
|
|
3731
|
+
appId = _ref.appId,
|
|
3732
|
+
onInstallComplete = _ref.onInstallComplete;
|
|
3728
3733
|
var _useContext = React.useContext(DashReact.ThemeContext),
|
|
3729
3734
|
currentTheme = _useContext.currentTheme;
|
|
3730
3735
|
var panelStyles = DashReact.getStylesForItem(DashReact.themeObjects.PANEL, currentTheme, {
|
|
@@ -3832,7 +3837,8 @@ var DiscoverDashboardsDetail = function DiscoverDashboardsDetail(_ref) {
|
|
|
3832
3837
|
})
|
|
3833
3838
|
}), /*#__PURE__*/jsxRuntime.jsx(RegistryDashboardDetail, {
|
|
3834
3839
|
dashboardPackage: selectedPackage,
|
|
3835
|
-
appId: appId
|
|
3840
|
+
appId: appId,
|
|
3841
|
+
onInstallComplete: onInstallComplete
|
|
3836
3842
|
})]
|
|
3837
3843
|
});
|
|
3838
3844
|
}
|
|
@@ -3927,6 +3933,8 @@ var DiscoverDashboardsDetail = function DiscoverDashboardsDetail(_ref) {
|
|
|
3927
3933
|
});
|
|
3928
3934
|
};
|
|
3929
3935
|
|
|
3936
|
+
function ownKeys$y(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3937
|
+
function _objectSpread$y(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$y(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$y(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3930
3938
|
var LayoutManagerModal = function LayoutManagerModal(_ref) {
|
|
3931
3939
|
var open = _ref.open,
|
|
3932
3940
|
setIsOpen = _ref.setIsOpen,
|
|
@@ -3936,7 +3944,9 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
|
|
|
3936
3944
|
_ref$onSaveMenuItem = _ref.onSaveMenuItem,
|
|
3937
3945
|
onSaveMenuItem = _ref$onSaveMenuItem === void 0 ? null : _ref$onSaveMenuItem,
|
|
3938
3946
|
appId = _ref.appId,
|
|
3939
|
-
onReloadWorkspaces = _ref.onReloadWorkspaces
|
|
3947
|
+
onReloadWorkspaces = _ref.onReloadWorkspaces,
|
|
3948
|
+
_ref$onOpenWorkspace = _ref.onOpenWorkspace,
|
|
3949
|
+
onOpenWorkspace = _ref$onOpenWorkspace === void 0 ? null : _ref$onOpenWorkspace;
|
|
3940
3950
|
var _useContext = React.useContext(DashReact.ThemeContext),
|
|
3941
3951
|
themes = _useContext.themes,
|
|
3942
3952
|
appThemeKey = _useContext.themeKey;
|
|
@@ -3969,19 +3979,31 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
|
|
|
3969
3979
|
localMenuItems = _useState12[0],
|
|
3970
3980
|
setLocalMenuItems = _useState12[1];
|
|
3971
3981
|
|
|
3972
|
-
//
|
|
3973
|
-
var _useState13 = React.useState(
|
|
3982
|
+
// Post-install workspace for registry stepper customization
|
|
3983
|
+
var _useState13 = React.useState(null),
|
|
3974
3984
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3985
|
+
importedWorkspace = _useState14[0],
|
|
3986
|
+
setImportedWorkspace = _useState14[1];
|
|
3987
|
+
|
|
3988
|
+
// Pre-import file selection (file preview, not yet saved)
|
|
3989
|
+
var _useState15 = React.useState(null),
|
|
3978
3990
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3991
|
+
selectedFile = _useState16[0],
|
|
3992
|
+
setSelectedFile = _useState16[1];
|
|
3993
|
+
|
|
3994
|
+
// Inline new-folder form state
|
|
3995
|
+
var _useState17 = React.useState(false),
|
|
3982
3996
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
3983
|
-
|
|
3984
|
-
|
|
3997
|
+
isCreatingFolder = _useState18[0],
|
|
3998
|
+
setIsCreatingFolder = _useState18[1];
|
|
3999
|
+
var _useState19 = React.useState(""),
|
|
4000
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
4001
|
+
newFolderName = _useState20[0],
|
|
4002
|
+
setNewFolderName = _useState20[1];
|
|
4003
|
+
var _useState21 = React.useState(null),
|
|
4004
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
4005
|
+
newFolderIcon = _useState22[0],
|
|
4006
|
+
setNewFolderIcon = _useState22[1];
|
|
3985
4007
|
|
|
3986
4008
|
// Reset state when modal opens
|
|
3987
4009
|
React.useEffect(function () {
|
|
@@ -3993,6 +4015,8 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
|
|
|
3993
4015
|
setSelectedMenuId(menuItems && menuItems.length > 0 ? menuItems[0].id : 1);
|
|
3994
4016
|
setSelectedTemplate(layoutTemplates[0]);
|
|
3995
4017
|
setSelectedThemeKey(null);
|
|
4018
|
+
setImportedWorkspace(null);
|
|
4019
|
+
setSelectedFile(null);
|
|
3996
4020
|
setIsCreatingFolder(false);
|
|
3997
4021
|
setNewFolderName("");
|
|
3998
4022
|
setNewFolderIcon(null);
|
|
@@ -4035,29 +4059,29 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
|
|
|
4035
4059
|
setActiveStep(2);
|
|
4036
4060
|
}
|
|
4037
4061
|
function handleMethodSelect(method) {
|
|
4038
|
-
|
|
4039
|
-
handleImportFromFile();
|
|
4040
|
-
} else {
|
|
4041
|
-
setCreationMethod(method);
|
|
4042
|
-
}
|
|
4062
|
+
setCreationMethod(method);
|
|
4043
4063
|
}
|
|
4044
4064
|
function handleImportFromFile() {
|
|
4045
4065
|
return _handleImportFromFile.apply(this, arguments);
|
|
4046
4066
|
}
|
|
4047
4067
|
function _handleImportFromFile() {
|
|
4048
4068
|
_handleImportFromFile = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
4049
|
-
var result;
|
|
4069
|
+
var result, _result$dashboardConf, _result$dashboardConf2, _result$dashboardConf3, _result$dashboardConf4;
|
|
4050
4070
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
4051
4071
|
while (1) switch (_context.prev = _context.next) {
|
|
4052
4072
|
case 0:
|
|
4053
4073
|
_context.prev = 0;
|
|
4054
4074
|
_context.next = 1;
|
|
4055
|
-
return window.mainApi.dashboardConfig.
|
|
4075
|
+
return window.mainApi.dashboardConfig.selectDashboardFile();
|
|
4056
4076
|
case 1:
|
|
4057
4077
|
result = _context.sent;
|
|
4058
4078
|
if (result && !result.canceled && result.success) {
|
|
4059
|
-
|
|
4060
|
-
|
|
4079
|
+
setSelectedFile(result);
|
|
4080
|
+
setDashboardName(((_result$dashboardConf = result.dashboardConfig) === null || _result$dashboardConf === void 0 || (_result$dashboardConf = _result$dashboardConf.workspace) === null || _result$dashboardConf === void 0 ? void 0 : _result$dashboardConf.name) || ((_result$dashboardConf2 = result.dashboardConfig) === null || _result$dashboardConf2 === void 0 ? void 0 : _result$dashboardConf2.name) || "");
|
|
4081
|
+
setSelectedMenuId(((_result$dashboardConf3 = result.dashboardConfig) === null || _result$dashboardConf3 === void 0 || (_result$dashboardConf3 = _result$dashboardConf3.workspace) === null || _result$dashboardConf3 === void 0 ? void 0 : _result$dashboardConf3.menuId) || (menuItems.length > 0 ? menuItems[0].id : 1));
|
|
4082
|
+
setSelectedThemeKey(((_result$dashboardConf4 = result.dashboardConfig) === null || _result$dashboardConf4 === void 0 || (_result$dashboardConf4 = _result$dashboardConf4.workspace) === null || _result$dashboardConf4 === void 0 ? void 0 : _result$dashboardConf4.themeKey) || null);
|
|
4083
|
+
setActiveStep(0);
|
|
4084
|
+
setCreationMethod("import");
|
|
4061
4085
|
}
|
|
4062
4086
|
_context.next = 3;
|
|
4063
4087
|
break;
|
|
@@ -4072,10 +4096,392 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
|
|
|
4072
4096
|
}));
|
|
4073
4097
|
return _handleImportFromFile.apply(this, arguments);
|
|
4074
4098
|
}
|
|
4099
|
+
function handleRegistryInstallComplete(result) {
|
|
4100
|
+
var _result$workspace, _result$workspace2, _result$workspace3;
|
|
4101
|
+
setImportedWorkspace(result.workspace);
|
|
4102
|
+
setDashboardName(((_result$workspace = result.workspace) === null || _result$workspace === void 0 ? void 0 : _result$workspace.name) || "");
|
|
4103
|
+
setSelectedMenuId(((_result$workspace2 = result.workspace) === null || _result$workspace2 === void 0 ? void 0 : _result$workspace2.menuId) || (menuItems.length > 0 ? menuItems[0].id : 1));
|
|
4104
|
+
setSelectedThemeKey(((_result$workspace3 = result.workspace) === null || _result$workspace3 === void 0 ? void 0 : _result$workspace3.themeKey) || null);
|
|
4105
|
+
setActiveStep(0);
|
|
4106
|
+
}
|
|
4107
|
+
function handleImportRegistryConfirm() {
|
|
4108
|
+
return _handleImportRegistryConfirm.apply(this, arguments);
|
|
4109
|
+
}
|
|
4110
|
+
function _handleImportRegistryConfirm() {
|
|
4111
|
+
_handleImportRegistryConfirm = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
4112
|
+
var menuId, newItem, result, updatedWorkspace;
|
|
4113
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
4114
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
4115
|
+
case 0:
|
|
4116
|
+
menuId = selectedMenuId;
|
|
4117
|
+
if (isCreatingFolder && newFolderName.trim() && newFolderIcon) {
|
|
4118
|
+
newItem = {
|
|
4119
|
+
id: Date.now(),
|
|
4120
|
+
name: newFolderName.trim(),
|
|
4121
|
+
icon: newFolderIcon
|
|
4122
|
+
};
|
|
4123
|
+
menuId = newItem.id;
|
|
4124
|
+
if (onSaveMenuItem) {
|
|
4125
|
+
onSaveMenuItem(newItem);
|
|
4126
|
+
}
|
|
4127
|
+
}
|
|
4128
|
+
|
|
4129
|
+
// Import flow: file not yet saved, call importDashboardConfig with overrides
|
|
4130
|
+
if (!(creationMethod === "import" && selectedFile)) {
|
|
4131
|
+
_context2.next = 5;
|
|
4132
|
+
break;
|
|
4133
|
+
}
|
|
4134
|
+
_context2.prev = 1;
|
|
4135
|
+
_context2.next = 2;
|
|
4136
|
+
return window.mainApi.dashboardConfig.importDashboardConfig(appId, {
|
|
4137
|
+
filePath: selectedFile.filePath,
|
|
4138
|
+
name: dashboardName.trim(),
|
|
4139
|
+
menuId: menuId,
|
|
4140
|
+
themeKey: selectedThemeKey
|
|
4141
|
+
});
|
|
4142
|
+
case 2:
|
|
4143
|
+
result = _context2.sent;
|
|
4144
|
+
if (result && result.success) {
|
|
4145
|
+
onReloadWorkspaces && onReloadWorkspaces();
|
|
4146
|
+
if (onOpenWorkspace && result.workspace) {
|
|
4147
|
+
onOpenWorkspace(result.workspace);
|
|
4148
|
+
}
|
|
4149
|
+
handleClose();
|
|
4150
|
+
}
|
|
4151
|
+
_context2.next = 4;
|
|
4152
|
+
break;
|
|
4153
|
+
case 3:
|
|
4154
|
+
_context2.prev = 3;
|
|
4155
|
+
_context2["catch"](1);
|
|
4156
|
+
case 4:
|
|
4157
|
+
return _context2.abrupt("return");
|
|
4158
|
+
case 5:
|
|
4159
|
+
if (importedWorkspace) {
|
|
4160
|
+
_context2.next = 6;
|
|
4161
|
+
break;
|
|
4162
|
+
}
|
|
4163
|
+
return _context2.abrupt("return");
|
|
4164
|
+
case 6:
|
|
4165
|
+
updatedWorkspace = _objectSpread$y(_objectSpread$y({}, importedWorkspace), {}, {
|
|
4166
|
+
name: dashboardName.trim(),
|
|
4167
|
+
menuId: menuId,
|
|
4168
|
+
themeKey: selectedThemeKey
|
|
4169
|
+
});
|
|
4170
|
+
_context2.prev = 7;
|
|
4171
|
+
_context2.next = 8;
|
|
4172
|
+
return window.mainApi.workspace.saveWorkspaceForApplication(appId, updatedWorkspace);
|
|
4173
|
+
case 8:
|
|
4174
|
+
onReloadWorkspaces && onReloadWorkspaces();
|
|
4175
|
+
if (onOpenWorkspace) {
|
|
4176
|
+
onOpenWorkspace(updatedWorkspace);
|
|
4177
|
+
}
|
|
4178
|
+
handleClose();
|
|
4179
|
+
_context2.next = 10;
|
|
4180
|
+
break;
|
|
4181
|
+
case 9:
|
|
4182
|
+
_context2.prev = 9;
|
|
4183
|
+
_context2["catch"](7);
|
|
4184
|
+
case 10:
|
|
4185
|
+
case "end":
|
|
4186
|
+
return _context2.stop();
|
|
4187
|
+
}
|
|
4188
|
+
}, _callee2, null, [[1, 3], [7, 9]]);
|
|
4189
|
+
}));
|
|
4190
|
+
return _handleImportRegistryConfirm.apply(this, arguments);
|
|
4191
|
+
}
|
|
4075
4192
|
var selectedFolder = localMenuItems.find(function (item) {
|
|
4076
4193
|
return item.id === selectedMenuId;
|
|
4077
4194
|
});
|
|
4078
4195
|
|
|
4196
|
+
// ─── Shared step renderers ──────────────────────────────────────
|
|
4197
|
+
function renderNameStep() {
|
|
4198
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4199
|
+
className: "flex flex-row w-full h-full",
|
|
4200
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4201
|
+
className: "flex flex-col w-1/3 p-6 py-10 space-y-4 justify-start",
|
|
4202
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Heading, {
|
|
4203
|
+
title: "Name",
|
|
4204
|
+
padding: false,
|
|
4205
|
+
textColor: "text-gray-300"
|
|
4206
|
+
}), /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
4207
|
+
className: "text-base font-normal text-gray-400",
|
|
4208
|
+
children: "Give your new dashboard a name."
|
|
4209
|
+
}), dashboardName.trim() && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4210
|
+
className: "flex flex-row items-center space-x-2 mt-4 pt-4 border-t border-gray-700",
|
|
4211
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
4212
|
+
icon: "clone",
|
|
4213
|
+
className: "text-blue-400"
|
|
4214
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4215
|
+
className: "text-sm font-medium text-gray-300",
|
|
4216
|
+
children: dashboardName.trim()
|
|
4217
|
+
})]
|
|
4218
|
+
})]
|
|
4219
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4220
|
+
className: "flex flex-col w-2/3 p-6 justify-start pt-10",
|
|
4221
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.InputText, {
|
|
4222
|
+
value: dashboardName,
|
|
4223
|
+
onChange: function onChange(val) {
|
|
4224
|
+
return setDashboardName(val);
|
|
4225
|
+
},
|
|
4226
|
+
placeholder: "Dashboard name",
|
|
4227
|
+
autoFocus: true
|
|
4228
|
+
})
|
|
4229
|
+
})]
|
|
4230
|
+
});
|
|
4231
|
+
}
|
|
4232
|
+
function renderFolderStep() {
|
|
4233
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4234
|
+
className: "flex flex-row w-full h-full",
|
|
4235
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4236
|
+
className: "flex flex-col w-1/3 p-6 py-10 space-y-4 justify-start",
|
|
4237
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Heading, {
|
|
4238
|
+
title: "Organize",
|
|
4239
|
+
padding: false,
|
|
4240
|
+
textColor: "text-gray-300"
|
|
4241
|
+
}), /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
4242
|
+
className: "text-base font-normal text-gray-400",
|
|
4243
|
+
children: "Assign this dashboard to a folder for easy organization in the sidebar."
|
|
4244
|
+
}), selectedFolder && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4245
|
+
className: "flex flex-row items-center space-x-2 mt-4 pt-4 border-t border-gray-700",
|
|
4246
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
4247
|
+
icon: selectedFolder.icon || selectedFolder.folder || "folder",
|
|
4248
|
+
className: "text-blue-400"
|
|
4249
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4250
|
+
className: "text-sm font-medium text-gray-300",
|
|
4251
|
+
children: selectedFolder.name
|
|
4252
|
+
})]
|
|
4253
|
+
})]
|
|
4254
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4255
|
+
className: "flex flex-col w-2/3 p-6 overflow-y-auto space-y-2",
|
|
4256
|
+
children: [!isCreatingFolder ? /*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
4257
|
+
type: "button",
|
|
4258
|
+
className: "flex flex-row items-center space-x-3 px-4 py-3 rounded-lg cursor-pointer transition-all text-gray-400 hover:text-gray-200 hover:bg-gray-700",
|
|
4259
|
+
onClick: function onClick() {
|
|
4260
|
+
return setIsCreatingFolder(true);
|
|
4261
|
+
},
|
|
4262
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
4263
|
+
icon: "plus",
|
|
4264
|
+
className: "w-5 h-5"
|
|
4265
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4266
|
+
className: "text-sm font-medium",
|
|
4267
|
+
children: "Create New Folder"
|
|
4268
|
+
})]
|
|
4269
|
+
}) : /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4270
|
+
className: "flex flex-col space-y-3 p-4 rounded-lg bg-gray-800 border border-gray-700",
|
|
4271
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4272
|
+
className: "flex flex-row items-center justify-between",
|
|
4273
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4274
|
+
className: "text-sm font-medium text-gray-300",
|
|
4275
|
+
children: "New Folder"
|
|
4276
|
+
}), /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
4277
|
+
type: "button",
|
|
4278
|
+
className: "text-gray-500 hover:text-gray-300 transition-colors",
|
|
4279
|
+
onClick: handleCancelNewFolder,
|
|
4280
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
4281
|
+
icon: "xmark"
|
|
4282
|
+
})
|
|
4283
|
+
})]
|
|
4284
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.InputText, {
|
|
4285
|
+
value: newFolderName,
|
|
4286
|
+
onChange: function onChange(val) {
|
|
4287
|
+
return setNewFolderName(val);
|
|
4288
|
+
},
|
|
4289
|
+
placeholder: "Folder name"
|
|
4290
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4291
|
+
className: "grid grid-cols-10 gap-2",
|
|
4292
|
+
children: FOLDER_ICONS.map(function (icon) {
|
|
4293
|
+
var isIconSelected = icon === newFolderIcon;
|
|
4294
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4295
|
+
className: "flex items-center justify-center p-2 rounded cursor-pointer transition-all ".concat(isIconSelected ? "bg-blue-600 ring-2 ring-blue-400 text-white" : "bg-gray-700 text-gray-400 hover:bg-gray-600 hover:text-gray-200"),
|
|
4296
|
+
onClick: function onClick() {
|
|
4297
|
+
return setNewFolderIcon(icon);
|
|
4298
|
+
},
|
|
4299
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
4300
|
+
icon: icon
|
|
4301
|
+
})
|
|
4302
|
+
}, icon);
|
|
4303
|
+
})
|
|
4304
|
+
})]
|
|
4305
|
+
}), localMenuItems.length > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4306
|
+
className: "border-t border-gray-700 my-2"
|
|
4307
|
+
}), localMenuItems.map(function (item) {
|
|
4308
|
+
var isSelected = !isCreatingFolder && item.id === selectedMenuId;
|
|
4309
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4310
|
+
className: "flex flex-row items-center space-x-3 px-4 py-3 rounded-lg cursor-pointer transition-all ".concat(isSelected ? "ring-2 ring-blue-500 bg-gray-700" : "hover:bg-gray-750 hover:ring-1 hover:ring-gray-600 bg-gray-800/50"),
|
|
4311
|
+
onClick: function onClick() {
|
|
4312
|
+
setSelectedMenuId(item.id);
|
|
4313
|
+
setIsCreatingFolder(false);
|
|
4314
|
+
setNewFolderName("");
|
|
4315
|
+
setNewFolderIcon(null);
|
|
4316
|
+
},
|
|
4317
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
4318
|
+
icon: item.icon || item.folder || "folder",
|
|
4319
|
+
className: "w-5 h-5 ".concat(isSelected ? "text-blue-400" : "text-gray-400")
|
|
4320
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4321
|
+
className: "text-sm font-medium ".concat(isSelected ? "text-blue-300" : "text-gray-300"),
|
|
4322
|
+
children: item.name
|
|
4323
|
+
}), isSelected && /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
4324
|
+
icon: "check",
|
|
4325
|
+
className: "ml-auto text-blue-400 text-sm"
|
|
4326
|
+
})]
|
|
4327
|
+
}, item.id);
|
|
4328
|
+
})]
|
|
4329
|
+
})]
|
|
4330
|
+
});
|
|
4331
|
+
}
|
|
4332
|
+
function renderThemeStep() {
|
|
4333
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4334
|
+
className: "flex flex-row w-full h-full",
|
|
4335
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4336
|
+
className: "flex flex-col w-1/3 p-6 py-10 space-y-4 justify-start",
|
|
4337
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Heading, {
|
|
4338
|
+
title: "Theme",
|
|
4339
|
+
padding: false,
|
|
4340
|
+
textColor: "text-gray-300"
|
|
4341
|
+
}), /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
4342
|
+
className: "text-base font-normal text-gray-400",
|
|
4343
|
+
children: "Choose a theme for this dashboard, or use the application default."
|
|
4344
|
+
}), selectedThemeKey !== null && themes && themes[selectedThemeKey] && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
4345
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4346
|
+
className: "flex flex-row items-center space-x-2 mt-4 pt-4 border-t border-gray-700",
|
|
4347
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
4348
|
+
icon: "palette",
|
|
4349
|
+
className: "text-blue-400"
|
|
4350
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4351
|
+
className: "text-sm font-medium text-gray-300",
|
|
4352
|
+
children: themes[selectedThemeKey].name || selectedThemeKey
|
|
4353
|
+
})]
|
|
4354
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4355
|
+
className: "flex flex-row space-x-2 mt-3",
|
|
4356
|
+
children: [themes[selectedThemeKey].primary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4357
|
+
className: "w-8 h-8 rounded bg-".concat(themes[selectedThemeKey].primary, "-500")
|
|
4358
|
+
}), themes[selectedThemeKey].secondary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4359
|
+
className: "w-8 h-8 rounded bg-".concat(themes[selectedThemeKey].secondary, "-500")
|
|
4360
|
+
}), themes[selectedThemeKey].tertiary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4361
|
+
className: "w-8 h-8 rounded bg-".concat(themes[selectedThemeKey].tertiary, "-500")
|
|
4362
|
+
})]
|
|
4363
|
+
})]
|
|
4364
|
+
}), selectedThemeKey === null && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4365
|
+
className: "flex flex-row items-center space-x-2 mt-4 pt-4 border-t border-gray-700",
|
|
4366
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
4367
|
+
icon: "palette",
|
|
4368
|
+
className: "text-blue-400"
|
|
4369
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4370
|
+
className: "text-sm font-medium text-gray-300",
|
|
4371
|
+
children: "App Default"
|
|
4372
|
+
})]
|
|
4373
|
+
})]
|
|
4374
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4375
|
+
className: "flex flex-col w-2/3 p-6 overflow-y-auto space-y-2",
|
|
4376
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4377
|
+
className: "flex flex-row items-center px-4 py-3 rounded-lg cursor-pointer transition-all ".concat(selectedThemeKey === null ? "ring-2 ring-blue-500 bg-gray-700" : "hover:bg-gray-750 hover:ring-1 hover:ring-gray-600 bg-gray-800/50"),
|
|
4378
|
+
onClick: function onClick() {
|
|
4379
|
+
return setSelectedThemeKey(null);
|
|
4380
|
+
},
|
|
4381
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
4382
|
+
icon: "palette",
|
|
4383
|
+
className: "w-5 h-5 mr-3 ".concat(selectedThemeKey === null ? "text-blue-400" : "text-gray-400")
|
|
4384
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4385
|
+
className: "text-sm font-medium ".concat(selectedThemeKey === null ? "text-blue-300" : "text-gray-300"),
|
|
4386
|
+
children: "App Default"
|
|
4387
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4388
|
+
className: "flex flex-row space-x-1 ml-auto",
|
|
4389
|
+
children: themes && appThemeKey && themes[appThemeKey] && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
4390
|
+
children: [themes[appThemeKey].primary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4391
|
+
className: "w-4 h-4 rounded bg-".concat(themes[appThemeKey].primary, "-500")
|
|
4392
|
+
}), themes[appThemeKey].secondary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4393
|
+
className: "w-4 h-4 rounded bg-".concat(themes[appThemeKey].secondary, "-500")
|
|
4394
|
+
}), themes[appThemeKey].tertiary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4395
|
+
className: "w-4 h-4 rounded bg-".concat(themes[appThemeKey].tertiary, "-500")
|
|
4396
|
+
})]
|
|
4397
|
+
})
|
|
4398
|
+
})]
|
|
4399
|
+
}), themes && Object.entries(themes).map(function (_ref2) {
|
|
4400
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
4401
|
+
key = _ref3[0],
|
|
4402
|
+
t = _ref3[1];
|
|
4403
|
+
var isThemeSelected = selectedThemeKey === key;
|
|
4404
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4405
|
+
className: "flex flex-row items-center px-4 py-3 rounded-lg cursor-pointer transition-all ".concat(isThemeSelected ? "ring-2 ring-blue-500 bg-gray-700" : "hover:bg-gray-750 hover:ring-1 hover:ring-gray-600 bg-gray-800/50"),
|
|
4406
|
+
onClick: function onClick() {
|
|
4407
|
+
return setSelectedThemeKey(key);
|
|
4408
|
+
},
|
|
4409
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
4410
|
+
icon: "palette",
|
|
4411
|
+
className: "w-5 h-5 mr-3 ".concat(isThemeSelected ? "text-blue-400" : "text-gray-400")
|
|
4412
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4413
|
+
className: "text-sm font-medium ".concat(isThemeSelected ? "text-blue-300" : "text-gray-300"),
|
|
4414
|
+
children: t.name || key
|
|
4415
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4416
|
+
className: "flex flex-row space-x-1 ml-auto",
|
|
4417
|
+
children: [t.primary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4418
|
+
className: "w-4 h-4 rounded bg-".concat(t.primary, "-500")
|
|
4419
|
+
}), t.secondary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4420
|
+
className: "w-4 h-4 rounded bg-".concat(t.secondary, "-500")
|
|
4421
|
+
}), t.tertiary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4422
|
+
className: "w-4 h-4 rounded bg-".concat(t.tertiary, "-500")
|
|
4423
|
+
})]
|
|
4424
|
+
})]
|
|
4425
|
+
}, key);
|
|
4426
|
+
})]
|
|
4427
|
+
})]
|
|
4428
|
+
});
|
|
4429
|
+
}
|
|
4430
|
+
function renderFileStep() {
|
|
4431
|
+
var fileName = selectedFile !== null && selectedFile !== void 0 && selectedFile.filePath ? selectedFile.filePath.split("/").pop() : null;
|
|
4432
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4433
|
+
className: "flex flex-row w-full h-full",
|
|
4434
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4435
|
+
className: "flex flex-col w-1/3 p-6 py-10 space-y-4 justify-start",
|
|
4436
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Heading, {
|
|
4437
|
+
title: "File",
|
|
4438
|
+
padding: false,
|
|
4439
|
+
textColor: "text-gray-300"
|
|
4440
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("p", {
|
|
4441
|
+
className: "text-base font-normal text-gray-400",
|
|
4442
|
+
children: ["Select a dashboard ZIP file downloaded from the registry or shared by a developer you trust. The filename should begin with", " ", /*#__PURE__*/jsxRuntime.jsx("code", {
|
|
4443
|
+
className: "text-gray-300",
|
|
4444
|
+
children: "dashboard"
|
|
4445
|
+
}), " and end with", " ", /*#__PURE__*/jsxRuntime.jsx("code", {
|
|
4446
|
+
className: "text-gray-300",
|
|
4447
|
+
children: ".zip"
|
|
4448
|
+
}), "."]
|
|
4449
|
+
}), fileName && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4450
|
+
className: "flex flex-row items-center space-x-2 mt-4 pt-4 border-t border-gray-700",
|
|
4451
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
4452
|
+
icon: "file-zipper",
|
|
4453
|
+
className: "text-blue-400"
|
|
4454
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4455
|
+
className: "text-sm font-medium text-gray-300",
|
|
4456
|
+
children: fileName
|
|
4457
|
+
})]
|
|
4458
|
+
})]
|
|
4459
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4460
|
+
className: "flex flex-col w-2/3 p-6 justify-start pt-10 space-y-4",
|
|
4461
|
+
children: [fileName && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4462
|
+
className: "flex flex-row items-center space-x-3 p-4 rounded-lg bg-gray-800 border border-gray-700",
|
|
4463
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
4464
|
+
icon: "file-zipper",
|
|
4465
|
+
className: "text-blue-400 text-lg"
|
|
4466
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4467
|
+
className: "text-sm font-medium text-gray-300 truncate",
|
|
4468
|
+
children: fileName
|
|
4469
|
+
})]
|
|
4470
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
4471
|
+
onClick: handleImportFromFile,
|
|
4472
|
+
title: "Choose File",
|
|
4473
|
+
textSize: "text-base",
|
|
4474
|
+
padding: "py-2 px-4",
|
|
4475
|
+
backgroundColor: "bg-blue-600",
|
|
4476
|
+
textColor: "text-white",
|
|
4477
|
+
hoverTextColor: "hover:text-white",
|
|
4478
|
+
hoverBackgroundColor: "hover:bg-blue-500",
|
|
4479
|
+
icon: "folder-open"
|
|
4480
|
+
})]
|
|
4481
|
+
})]
|
|
4482
|
+
});
|
|
4483
|
+
}
|
|
4484
|
+
|
|
4079
4485
|
// ─── Render body based on creationMethod ─────────────────────────
|
|
4080
4486
|
function renderBody() {
|
|
4081
4487
|
if (creationMethod === null) {
|
|
@@ -4094,7 +4500,9 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
|
|
|
4094
4500
|
})
|
|
4095
4501
|
});
|
|
4096
4502
|
}
|
|
4097
|
-
|
|
4503
|
+
|
|
4504
|
+
// Registry browser: show until install completes
|
|
4505
|
+
if (creationMethod === "registry" && !importedWorkspace) {
|
|
4098
4506
|
return /*#__PURE__*/jsxRuntime.jsx(DashReact.Panel, {
|
|
4099
4507
|
backgroundColor: "bg-slate-800",
|
|
4100
4508
|
padding: false,
|
|
@@ -4105,7 +4513,74 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
|
|
|
4105
4513
|
onBack: function onBack() {
|
|
4106
4514
|
return setCreationMethod(null);
|
|
4107
4515
|
},
|
|
4108
|
-
appId: appId
|
|
4516
|
+
appId: appId,
|
|
4517
|
+
onInstallComplete: handleRegistryInstallComplete
|
|
4518
|
+
})
|
|
4519
|
+
})
|
|
4520
|
+
});
|
|
4521
|
+
}
|
|
4522
|
+
|
|
4523
|
+
// Import stepper: 4 steps (File, Name, Folder, Theme)
|
|
4524
|
+
if (creationMethod === "import") {
|
|
4525
|
+
return /*#__PURE__*/jsxRuntime.jsx(DashReact.Panel, {
|
|
4526
|
+
backgroundColor: "bg-slate-800",
|
|
4527
|
+
padding: false,
|
|
4528
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.Panel.Body, {
|
|
4529
|
+
scrollable: false,
|
|
4530
|
+
className: "h-full",
|
|
4531
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(DashReact.Stepper, {
|
|
4532
|
+
activeStep: activeStep,
|
|
4533
|
+
onStepChange: setActiveStep,
|
|
4534
|
+
showNavigation: false,
|
|
4535
|
+
className: "h-full p-6 pb-0",
|
|
4536
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
|
|
4537
|
+
label: "File",
|
|
4538
|
+
description: "Select a file",
|
|
4539
|
+
children: renderFileStep()
|
|
4540
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
|
|
4541
|
+
label: "Name",
|
|
4542
|
+
description: "Name your dashboard",
|
|
4543
|
+
children: renderNameStep()
|
|
4544
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
|
|
4545
|
+
label: "Organize",
|
|
4546
|
+
description: "Choose a folder",
|
|
4547
|
+
children: renderFolderStep()
|
|
4548
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
|
|
4549
|
+
label: "Choose Theme",
|
|
4550
|
+
description: "Dashboard theme",
|
|
4551
|
+
children: renderThemeStep()
|
|
4552
|
+
})]
|
|
4553
|
+
})
|
|
4554
|
+
})
|
|
4555
|
+
});
|
|
4556
|
+
}
|
|
4557
|
+
|
|
4558
|
+
// Registry stepper: 3 steps (Name, Folder, Theme)
|
|
4559
|
+
if (creationMethod === "registry" && importedWorkspace) {
|
|
4560
|
+
return /*#__PURE__*/jsxRuntime.jsx(DashReact.Panel, {
|
|
4561
|
+
backgroundColor: "bg-slate-800",
|
|
4562
|
+
padding: false,
|
|
4563
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.Panel.Body, {
|
|
4564
|
+
scrollable: false,
|
|
4565
|
+
className: "h-full",
|
|
4566
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(DashReact.Stepper, {
|
|
4567
|
+
activeStep: activeStep,
|
|
4568
|
+
onStepChange: setActiveStep,
|
|
4569
|
+
showNavigation: false,
|
|
4570
|
+
className: "h-full p-6 pb-0",
|
|
4571
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
|
|
4572
|
+
label: "Name",
|
|
4573
|
+
description: "Name your dashboard",
|
|
4574
|
+
children: renderNameStep()
|
|
4575
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
|
|
4576
|
+
label: "Organize",
|
|
4577
|
+
description: "Choose a folder",
|
|
4578
|
+
children: renderFolderStep()
|
|
4579
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
|
|
4580
|
+
label: "Choose Theme",
|
|
4581
|
+
description: "Dashboard theme",
|
|
4582
|
+
children: renderThemeStep()
|
|
4583
|
+
})]
|
|
4109
4584
|
})
|
|
4110
4585
|
})
|
|
4111
4586
|
});
|
|
@@ -4126,39 +4601,7 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
|
|
|
4126
4601
|
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
|
|
4127
4602
|
label: "Name",
|
|
4128
4603
|
description: "Name your dashboard",
|
|
4129
|
-
children:
|
|
4130
|
-
className: "flex flex-row w-full h-full",
|
|
4131
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4132
|
-
className: "flex flex-col w-1/3 p-6 py-10 space-y-4 justify-start",
|
|
4133
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Heading, {
|
|
4134
|
-
title: "Name",
|
|
4135
|
-
padding: false,
|
|
4136
|
-
textColor: "text-gray-300"
|
|
4137
|
-
}), /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
4138
|
-
className: "text-base font-normal text-gray-400",
|
|
4139
|
-
children: "Give your new dashboard a name."
|
|
4140
|
-
}), dashboardName.trim() && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4141
|
-
className: "flex flex-row items-center space-x-2 mt-4 pt-4 border-t border-gray-700",
|
|
4142
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
4143
|
-
icon: "clone",
|
|
4144
|
-
className: "text-blue-400"
|
|
4145
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4146
|
-
className: "text-sm font-medium text-gray-300",
|
|
4147
|
-
children: dashboardName.trim()
|
|
4148
|
-
})]
|
|
4149
|
-
})]
|
|
4150
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4151
|
-
className: "flex flex-col w-2/3 p-6 justify-start pt-10",
|
|
4152
|
-
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.InputText, {
|
|
4153
|
-
value: dashboardName,
|
|
4154
|
-
onChange: function onChange(val) {
|
|
4155
|
-
return setDashboardName(val);
|
|
4156
|
-
},
|
|
4157
|
-
placeholder: "Dashboard name",
|
|
4158
|
-
autoFocus: true
|
|
4159
|
-
})
|
|
4160
|
-
})]
|
|
4161
|
-
})
|
|
4604
|
+
children: renderNameStep()
|
|
4162
4605
|
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
|
|
4163
4606
|
label: "Choose Layout",
|
|
4164
4607
|
description: "Pick a template",
|
|
@@ -4170,203 +4613,11 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
|
|
|
4170
4613
|
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
|
|
4171
4614
|
label: "Organize",
|
|
4172
4615
|
description: "Choose a folder",
|
|
4173
|
-
children:
|
|
4174
|
-
className: "flex flex-row w-full h-full",
|
|
4175
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4176
|
-
className: "flex flex-col w-1/3 p-6 py-10 space-y-4 justify-start",
|
|
4177
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Heading, {
|
|
4178
|
-
title: "Organize",
|
|
4179
|
-
padding: false,
|
|
4180
|
-
textColor: "text-gray-300"
|
|
4181
|
-
}), /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
4182
|
-
className: "text-base font-normal text-gray-400",
|
|
4183
|
-
children: "Assign this dashboard to a folder for easy organization in the sidebar."
|
|
4184
|
-
}), selectedFolder && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4185
|
-
className: "flex flex-row items-center space-x-2 mt-4 pt-4 border-t border-gray-700",
|
|
4186
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
4187
|
-
icon: selectedFolder.icon || selectedFolder.folder || "folder",
|
|
4188
|
-
className: "text-blue-400"
|
|
4189
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4190
|
-
className: "text-sm font-medium text-gray-300",
|
|
4191
|
-
children: selectedFolder.name
|
|
4192
|
-
})]
|
|
4193
|
-
})]
|
|
4194
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4195
|
-
className: "flex flex-col w-2/3 p-6 overflow-y-auto space-y-2",
|
|
4196
|
-
children: [!isCreatingFolder ? /*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
4197
|
-
type: "button",
|
|
4198
|
-
className: "flex flex-row items-center space-x-3 px-4 py-3 rounded-lg cursor-pointer transition-all text-gray-400 hover:text-gray-200 hover:bg-gray-700",
|
|
4199
|
-
onClick: function onClick() {
|
|
4200
|
-
return setIsCreatingFolder(true);
|
|
4201
|
-
},
|
|
4202
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
4203
|
-
icon: "plus",
|
|
4204
|
-
className: "w-5 h-5"
|
|
4205
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4206
|
-
className: "text-sm font-medium",
|
|
4207
|
-
children: "Create New Folder"
|
|
4208
|
-
})]
|
|
4209
|
-
}) : /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4210
|
-
className: "flex flex-col space-y-3 p-4 rounded-lg bg-gray-800 border border-gray-700",
|
|
4211
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4212
|
-
className: "flex flex-row items-center justify-between",
|
|
4213
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4214
|
-
className: "text-sm font-medium text-gray-300",
|
|
4215
|
-
children: "New Folder"
|
|
4216
|
-
}), /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
4217
|
-
type: "button",
|
|
4218
|
-
className: "text-gray-500 hover:text-gray-300 transition-colors",
|
|
4219
|
-
onClick: handleCancelNewFolder,
|
|
4220
|
-
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
4221
|
-
icon: "xmark"
|
|
4222
|
-
})
|
|
4223
|
-
})]
|
|
4224
|
-
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.InputText, {
|
|
4225
|
-
value: newFolderName,
|
|
4226
|
-
onChange: function onChange(val) {
|
|
4227
|
-
return setNewFolderName(val);
|
|
4228
|
-
},
|
|
4229
|
-
placeholder: "Folder name"
|
|
4230
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4231
|
-
className: "grid grid-cols-10 gap-2",
|
|
4232
|
-
children: FOLDER_ICONS.map(function (icon) {
|
|
4233
|
-
var isIconSelected = icon === newFolderIcon;
|
|
4234
|
-
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4235
|
-
className: "flex items-center justify-center p-2 rounded cursor-pointer transition-all ".concat(isIconSelected ? "bg-blue-600 ring-2 ring-blue-400 text-white" : "bg-gray-700 text-gray-400 hover:bg-gray-600 hover:text-gray-200"),
|
|
4236
|
-
onClick: function onClick() {
|
|
4237
|
-
return setNewFolderIcon(icon);
|
|
4238
|
-
},
|
|
4239
|
-
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
4240
|
-
icon: icon
|
|
4241
|
-
})
|
|
4242
|
-
}, icon);
|
|
4243
|
-
})
|
|
4244
|
-
})]
|
|
4245
|
-
}), localMenuItems.length > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4246
|
-
className: "border-t border-gray-700 my-2"
|
|
4247
|
-
}), localMenuItems.map(function (item) {
|
|
4248
|
-
var isSelected = !isCreatingFolder && item.id === selectedMenuId;
|
|
4249
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4250
|
-
className: "flex flex-row items-center space-x-3 px-4 py-3 rounded-lg cursor-pointer transition-all ".concat(isSelected ? "ring-2 ring-blue-500 bg-gray-700" : "hover:bg-gray-750 hover:ring-1 hover:ring-gray-600 bg-gray-800/50"),
|
|
4251
|
-
onClick: function onClick() {
|
|
4252
|
-
setSelectedMenuId(item.id);
|
|
4253
|
-
setIsCreatingFolder(false);
|
|
4254
|
-
setNewFolderName("");
|
|
4255
|
-
setNewFolderIcon(null);
|
|
4256
|
-
},
|
|
4257
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
4258
|
-
icon: item.icon || item.folder || "folder",
|
|
4259
|
-
className: "w-5 h-5 ".concat(isSelected ? "text-blue-400" : "text-gray-400")
|
|
4260
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4261
|
-
className: "text-sm font-medium ".concat(isSelected ? "text-blue-300" : "text-gray-300"),
|
|
4262
|
-
children: item.name
|
|
4263
|
-
}), isSelected && /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
4264
|
-
icon: "check",
|
|
4265
|
-
className: "ml-auto text-blue-400 text-sm"
|
|
4266
|
-
})]
|
|
4267
|
-
}, item.id);
|
|
4268
|
-
})]
|
|
4269
|
-
})]
|
|
4270
|
-
})
|
|
4616
|
+
children: renderFolderStep()
|
|
4271
4617
|
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
|
|
4272
4618
|
label: "Choose Theme",
|
|
4273
4619
|
description: "Dashboard theme",
|
|
4274
|
-
children:
|
|
4275
|
-
className: "flex flex-row w-full h-full",
|
|
4276
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4277
|
-
className: "flex flex-col w-1/3 p-6 py-10 space-y-4 justify-start",
|
|
4278
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Heading, {
|
|
4279
|
-
title: "Theme",
|
|
4280
|
-
padding: false,
|
|
4281
|
-
textColor: "text-gray-300"
|
|
4282
|
-
}), /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
4283
|
-
className: "text-base font-normal text-gray-400",
|
|
4284
|
-
children: "Choose a theme for this dashboard, or use the application default."
|
|
4285
|
-
}), selectedThemeKey !== null && themes && themes[selectedThemeKey] && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
4286
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4287
|
-
className: "flex flex-row items-center space-x-2 mt-4 pt-4 border-t border-gray-700",
|
|
4288
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
4289
|
-
icon: "palette",
|
|
4290
|
-
className: "text-blue-400"
|
|
4291
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4292
|
-
className: "text-sm font-medium text-gray-300",
|
|
4293
|
-
children: themes[selectedThemeKey].name || selectedThemeKey
|
|
4294
|
-
})]
|
|
4295
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4296
|
-
className: "flex flex-row space-x-2 mt-3",
|
|
4297
|
-
children: [themes[selectedThemeKey].primary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4298
|
-
className: "w-8 h-8 rounded bg-".concat(themes[selectedThemeKey].primary, "-500")
|
|
4299
|
-
}), themes[selectedThemeKey].secondary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4300
|
-
className: "w-8 h-8 rounded bg-".concat(themes[selectedThemeKey].secondary, "-500")
|
|
4301
|
-
}), themes[selectedThemeKey].tertiary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4302
|
-
className: "w-8 h-8 rounded bg-".concat(themes[selectedThemeKey].tertiary, "-500")
|
|
4303
|
-
})]
|
|
4304
|
-
})]
|
|
4305
|
-
}), selectedThemeKey === null && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4306
|
-
className: "flex flex-row items-center space-x-2 mt-4 pt-4 border-t border-gray-700",
|
|
4307
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
4308
|
-
icon: "palette",
|
|
4309
|
-
className: "text-blue-400"
|
|
4310
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4311
|
-
className: "text-sm font-medium text-gray-300",
|
|
4312
|
-
children: "App Default"
|
|
4313
|
-
})]
|
|
4314
|
-
})]
|
|
4315
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4316
|
-
className: "flex flex-col w-2/3 p-6 overflow-y-auto space-y-2",
|
|
4317
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4318
|
-
className: "flex flex-row items-center px-4 py-3 rounded-lg cursor-pointer transition-all ".concat(selectedThemeKey === null ? "ring-2 ring-blue-500 bg-gray-700" : "hover:bg-gray-750 hover:ring-1 hover:ring-gray-600 bg-gray-800/50"),
|
|
4319
|
-
onClick: function onClick() {
|
|
4320
|
-
return setSelectedThemeKey(null);
|
|
4321
|
-
},
|
|
4322
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
4323
|
-
icon: "palette",
|
|
4324
|
-
className: "w-5 h-5 mr-3 ".concat(selectedThemeKey === null ? "text-blue-400" : "text-gray-400")
|
|
4325
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4326
|
-
className: "text-sm font-medium ".concat(selectedThemeKey === null ? "text-blue-300" : "text-gray-300"),
|
|
4327
|
-
children: "App Default"
|
|
4328
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4329
|
-
className: "flex flex-row space-x-1 ml-auto",
|
|
4330
|
-
children: themes && appThemeKey && themes[appThemeKey] && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
4331
|
-
children: [themes[appThemeKey].primary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4332
|
-
className: "w-4 h-4 rounded bg-".concat(themes[appThemeKey].primary, "-500")
|
|
4333
|
-
}), themes[appThemeKey].secondary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4334
|
-
className: "w-4 h-4 rounded bg-".concat(themes[appThemeKey].secondary, "-500")
|
|
4335
|
-
}), themes[appThemeKey].tertiary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4336
|
-
className: "w-4 h-4 rounded bg-".concat(themes[appThemeKey].tertiary, "-500")
|
|
4337
|
-
})]
|
|
4338
|
-
})
|
|
4339
|
-
})]
|
|
4340
|
-
}), themes && Object.entries(themes).map(function (_ref2) {
|
|
4341
|
-
var _ref3 = _slicedToArray(_ref2, 2),
|
|
4342
|
-
key = _ref3[0],
|
|
4343
|
-
t = _ref3[1];
|
|
4344
|
-
var isThemeSelected = selectedThemeKey === key;
|
|
4345
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4346
|
-
className: "flex flex-row items-center px-4 py-3 rounded-lg cursor-pointer transition-all ".concat(isThemeSelected ? "ring-2 ring-blue-500 bg-gray-700" : "hover:bg-gray-750 hover:ring-1 hover:ring-gray-600 bg-gray-800/50"),
|
|
4347
|
-
onClick: function onClick() {
|
|
4348
|
-
return setSelectedThemeKey(key);
|
|
4349
|
-
},
|
|
4350
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
4351
|
-
icon: "palette",
|
|
4352
|
-
className: "w-5 h-5 mr-3 ".concat(isThemeSelected ? "text-blue-400" : "text-gray-400")
|
|
4353
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4354
|
-
className: "text-sm font-medium ".concat(isThemeSelected ? "text-blue-300" : "text-gray-300"),
|
|
4355
|
-
children: t.name || key
|
|
4356
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4357
|
-
className: "flex flex-row space-x-1 ml-auto",
|
|
4358
|
-
children: [t.primary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4359
|
-
className: "w-4 h-4 rounded bg-".concat(t.primary, "-500")
|
|
4360
|
-
}), t.secondary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4361
|
-
className: "w-4 h-4 rounded bg-".concat(t.secondary, "-500")
|
|
4362
|
-
}), t.tertiary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4363
|
-
className: "w-4 h-4 rounded bg-".concat(t.tertiary, "-500")
|
|
4364
|
-
})]
|
|
4365
|
-
})]
|
|
4366
|
-
}, key);
|
|
4367
|
-
})]
|
|
4368
|
-
})]
|
|
4369
|
-
})
|
|
4620
|
+
children: renderThemeStep()
|
|
4370
4621
|
})]
|
|
4371
4622
|
})
|
|
4372
4623
|
})
|
|
@@ -4394,8 +4645,8 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
|
|
|
4394
4645
|
});
|
|
4395
4646
|
}
|
|
4396
4647
|
|
|
4397
|
-
// Registry
|
|
4398
|
-
if (creationMethod === "registry") {
|
|
4648
|
+
// Registry browser: Cancel only (DiscoverDashboardsDetail has its own inline back button)
|
|
4649
|
+
if (creationMethod === "registry" && !importedWorkspace) {
|
|
4399
4650
|
return /*#__PURE__*/jsxRuntime.jsx(DashReact.Modal.Footer, {
|
|
4400
4651
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4401
4652
|
className: "flex flex-row space-x-2",
|
|
@@ -4413,6 +4664,189 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
|
|
|
4413
4664
|
});
|
|
4414
4665
|
}
|
|
4415
4666
|
|
|
4667
|
+
// Import stepper footer: 4 steps (File, Name, Organize, Theme)
|
|
4668
|
+
if (creationMethod === "import") {
|
|
4669
|
+
return /*#__PURE__*/jsxRuntime.jsx(DashReact.Modal.Footer, {
|
|
4670
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4671
|
+
className: "flex flex-row space-x-2",
|
|
4672
|
+
children: [activeStep === 0 && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
4673
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
4674
|
+
onClick: handleClose,
|
|
4675
|
+
title: "Cancel",
|
|
4676
|
+
textSize: "text-base xl:text-lg",
|
|
4677
|
+
padding: "py-2 px-4",
|
|
4678
|
+
backgroundColor: "bg-gray-700",
|
|
4679
|
+
textColor: "text-gray-300",
|
|
4680
|
+
hoverTextColor: "hover:text-gray-100",
|
|
4681
|
+
hoverBackgroundColor: "hover:bg-gray-600"
|
|
4682
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
4683
|
+
onClick: function onClick() {
|
|
4684
|
+
return setActiveStep(1);
|
|
4685
|
+
},
|
|
4686
|
+
title: "Next",
|
|
4687
|
+
textSize: "text-base xl:text-lg",
|
|
4688
|
+
padding: "py-2 px-4",
|
|
4689
|
+
backgroundColor: "bg-blue-600",
|
|
4690
|
+
textColor: "text-white",
|
|
4691
|
+
hoverTextColor: "hover:text-white",
|
|
4692
|
+
hoverBackgroundColor: "hover:bg-blue-500",
|
|
4693
|
+
disabled: !selectedFile
|
|
4694
|
+
})]
|
|
4695
|
+
}), activeStep === 1 && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
4696
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
4697
|
+
onClick: function onClick() {
|
|
4698
|
+
return setActiveStep(0);
|
|
4699
|
+
},
|
|
4700
|
+
title: "Back",
|
|
4701
|
+
textSize: "text-base xl:text-lg",
|
|
4702
|
+
padding: "py-2 px-4",
|
|
4703
|
+
backgroundColor: "bg-gray-700",
|
|
4704
|
+
textColor: "text-gray-300",
|
|
4705
|
+
hoverTextColor: "hover:text-gray-100",
|
|
4706
|
+
hoverBackgroundColor: "hover:bg-gray-600"
|
|
4707
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
4708
|
+
onClick: function onClick() {
|
|
4709
|
+
return setActiveStep(2);
|
|
4710
|
+
},
|
|
4711
|
+
title: "Next",
|
|
4712
|
+
textSize: "text-base xl:text-lg",
|
|
4713
|
+
padding: "py-2 px-4",
|
|
4714
|
+
backgroundColor: "bg-blue-600",
|
|
4715
|
+
textColor: "text-white",
|
|
4716
|
+
hoverTextColor: "hover:text-white",
|
|
4717
|
+
hoverBackgroundColor: "hover:bg-blue-500",
|
|
4718
|
+
disabled: !dashboardName.trim()
|
|
4719
|
+
})]
|
|
4720
|
+
}), activeStep === 2 && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
4721
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
4722
|
+
onClick: function onClick() {
|
|
4723
|
+
return setActiveStep(1);
|
|
4724
|
+
},
|
|
4725
|
+
title: "Back",
|
|
4726
|
+
textSize: "text-base xl:text-lg",
|
|
4727
|
+
padding: "py-2 px-4",
|
|
4728
|
+
backgroundColor: "bg-gray-700",
|
|
4729
|
+
textColor: "text-gray-300",
|
|
4730
|
+
hoverTextColor: "hover:text-gray-100",
|
|
4731
|
+
hoverBackgroundColor: "hover:bg-gray-600"
|
|
4732
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
4733
|
+
onClick: function onClick() {
|
|
4734
|
+
return setActiveStep(3);
|
|
4735
|
+
},
|
|
4736
|
+
title: "Next",
|
|
4737
|
+
textSize: "text-base xl:text-lg",
|
|
4738
|
+
padding: "py-2 px-4",
|
|
4739
|
+
backgroundColor: "bg-blue-600",
|
|
4740
|
+
textColor: "text-white",
|
|
4741
|
+
hoverTextColor: "hover:text-white",
|
|
4742
|
+
hoverBackgroundColor: "hover:bg-blue-500"
|
|
4743
|
+
})]
|
|
4744
|
+
}), activeStep === 3 && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
4745
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
4746
|
+
onClick: function onClick() {
|
|
4747
|
+
return setActiveStep(2);
|
|
4748
|
+
},
|
|
4749
|
+
title: "Back",
|
|
4750
|
+
textSize: "text-base xl:text-lg",
|
|
4751
|
+
padding: "py-2 px-4",
|
|
4752
|
+
backgroundColor: "bg-gray-700",
|
|
4753
|
+
textColor: "text-gray-300",
|
|
4754
|
+
hoverTextColor: "hover:text-gray-100",
|
|
4755
|
+
hoverBackgroundColor: "hover:bg-gray-600"
|
|
4756
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
4757
|
+
onClick: handleImportRegistryConfirm,
|
|
4758
|
+
title: "Save",
|
|
4759
|
+
textSize: "text-base xl:text-lg",
|
|
4760
|
+
padding: "py-2 px-4",
|
|
4761
|
+
backgroundColor: "bg-blue-600",
|
|
4762
|
+
textColor: "text-white",
|
|
4763
|
+
hoverTextColor: "hover:text-white",
|
|
4764
|
+
hoverBackgroundColor: "hover:bg-blue-500"
|
|
4765
|
+
})]
|
|
4766
|
+
})]
|
|
4767
|
+
})
|
|
4768
|
+
});
|
|
4769
|
+
}
|
|
4770
|
+
|
|
4771
|
+
// Registry stepper footer: 3 steps (Name, Organize, Theme)
|
|
4772
|
+
if (creationMethod === "registry" && importedWorkspace) {
|
|
4773
|
+
return /*#__PURE__*/jsxRuntime.jsx(DashReact.Modal.Footer, {
|
|
4774
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4775
|
+
className: "flex flex-row space-x-2",
|
|
4776
|
+
children: [activeStep === 0 && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
4777
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
4778
|
+
onClick: handleClose,
|
|
4779
|
+
title: "Cancel",
|
|
4780
|
+
textSize: "text-base xl:text-lg",
|
|
4781
|
+
padding: "py-2 px-4",
|
|
4782
|
+
backgroundColor: "bg-gray-700",
|
|
4783
|
+
textColor: "text-gray-300",
|
|
4784
|
+
hoverTextColor: "hover:text-gray-100",
|
|
4785
|
+
hoverBackgroundColor: "hover:bg-gray-600"
|
|
4786
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
4787
|
+
onClick: function onClick() {
|
|
4788
|
+
return setActiveStep(1);
|
|
4789
|
+
},
|
|
4790
|
+
title: "Next",
|
|
4791
|
+
textSize: "text-base xl:text-lg",
|
|
4792
|
+
padding: "py-2 px-4",
|
|
4793
|
+
backgroundColor: "bg-blue-600",
|
|
4794
|
+
textColor: "text-white",
|
|
4795
|
+
hoverTextColor: "hover:text-white",
|
|
4796
|
+
hoverBackgroundColor: "hover:bg-blue-500",
|
|
4797
|
+
disabled: !dashboardName.trim()
|
|
4798
|
+
})]
|
|
4799
|
+
}), activeStep === 1 && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
4800
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
4801
|
+
onClick: function onClick() {
|
|
4802
|
+
return setActiveStep(0);
|
|
4803
|
+
},
|
|
4804
|
+
title: "Back",
|
|
4805
|
+
textSize: "text-base xl:text-lg",
|
|
4806
|
+
padding: "py-2 px-4",
|
|
4807
|
+
backgroundColor: "bg-gray-700",
|
|
4808
|
+
textColor: "text-gray-300",
|
|
4809
|
+
hoverTextColor: "hover:text-gray-100",
|
|
4810
|
+
hoverBackgroundColor: "hover:bg-gray-600"
|
|
4811
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
4812
|
+
onClick: function onClick() {
|
|
4813
|
+
return setActiveStep(2);
|
|
4814
|
+
},
|
|
4815
|
+
title: "Next",
|
|
4816
|
+
textSize: "text-base xl:text-lg",
|
|
4817
|
+
padding: "py-2 px-4",
|
|
4818
|
+
backgroundColor: "bg-blue-600",
|
|
4819
|
+
textColor: "text-white",
|
|
4820
|
+
hoverTextColor: "hover:text-white",
|
|
4821
|
+
hoverBackgroundColor: "hover:bg-blue-500"
|
|
4822
|
+
})]
|
|
4823
|
+
}), activeStep === 2 && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
4824
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
4825
|
+
onClick: function onClick() {
|
|
4826
|
+
return setActiveStep(1);
|
|
4827
|
+
},
|
|
4828
|
+
title: "Back",
|
|
4829
|
+
textSize: "text-base xl:text-lg",
|
|
4830
|
+
padding: "py-2 px-4",
|
|
4831
|
+
backgroundColor: "bg-gray-700",
|
|
4832
|
+
textColor: "text-gray-300",
|
|
4833
|
+
hoverTextColor: "hover:text-gray-100",
|
|
4834
|
+
hoverBackgroundColor: "hover:bg-gray-600"
|
|
4835
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
4836
|
+
onClick: handleImportRegistryConfirm,
|
|
4837
|
+
title: "Save",
|
|
4838
|
+
textSize: "text-base xl:text-lg",
|
|
4839
|
+
padding: "py-2 px-4",
|
|
4840
|
+
backgroundColor: "bg-blue-600",
|
|
4841
|
+
textColor: "text-white",
|
|
4842
|
+
hoverTextColor: "hover:text-white",
|
|
4843
|
+
hoverBackgroundColor: "hover:bg-blue-500"
|
|
4844
|
+
})]
|
|
4845
|
+
})]
|
|
4846
|
+
})
|
|
4847
|
+
});
|
|
4848
|
+
}
|
|
4849
|
+
|
|
4416
4850
|
// Template wizard footer
|
|
4417
4851
|
return /*#__PURE__*/jsxRuntime.jsx(DashReact.Modal.Footer, {
|
|
4418
4852
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -32782,7 +33216,8 @@ var DashboardsSection = function DashboardsSection(_ref) {
|
|
|
32782
33216
|
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.SearchInput, {
|
|
32783
33217
|
value: searchQuery,
|
|
32784
33218
|
onChange: setSearchQuery,
|
|
32785
|
-
placeholder: "Search dashboards..."
|
|
33219
|
+
placeholder: "Search dashboards...",
|
|
33220
|
+
inputClassName: "py-1.5 text-xs"
|
|
32786
33221
|
})
|
|
32787
33222
|
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.ButtonIcon, {
|
|
32788
33223
|
icon: "file-import",
|
|
@@ -32790,36 +33225,34 @@ var DashboardsSection = function DashboardsSection(_ref) {
|
|
|
32790
33225
|
size: "sm",
|
|
32791
33226
|
title: "Import dashboard"
|
|
32792
33227
|
})]
|
|
32793
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
32794
|
-
|
|
32795
|
-
|
|
32796
|
-
|
|
32797
|
-
|
|
32798
|
-
|
|
32799
|
-
|
|
32800
|
-
|
|
32801
|
-
|
|
32802
|
-
|
|
32803
|
-
|
|
32804
|
-
}
|
|
32805
|
-
|
|
32806
|
-
|
|
32807
|
-
|
|
32808
|
-
|
|
32809
|
-
|
|
32810
|
-
|
|
32811
|
-
|
|
32812
|
-
|
|
32813
|
-
|
|
32814
|
-
|
|
32815
|
-
|
|
32816
|
-
|
|
32817
|
-
|
|
32818
|
-
|
|
32819
|
-
|
|
32820
|
-
|
|
32821
|
-
children: "Marketplace"
|
|
32822
|
-
})]
|
|
33228
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
33229
|
+
className: "flex bg-white/5 rounded-md p-0.5",
|
|
33230
|
+
children: [{
|
|
33231
|
+
key: "grouped",
|
|
33232
|
+
label: "Grouped"
|
|
33233
|
+
}, {
|
|
33234
|
+
key: "alphabetical",
|
|
33235
|
+
label: "A-Z"
|
|
33236
|
+
}, {
|
|
33237
|
+
key: "marketplace",
|
|
33238
|
+
label: "Marketplace"
|
|
33239
|
+
}].map(function (tab) {
|
|
33240
|
+
var currentTab = installMode === "marketplace" ? "marketplace" : viewMode;
|
|
33241
|
+
return /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
33242
|
+
type: "button",
|
|
33243
|
+
onClick: function onClick() {
|
|
33244
|
+
if (tab.key === "marketplace") {
|
|
33245
|
+
setInstallMode("marketplace");
|
|
33246
|
+
setSelectedId(null);
|
|
33247
|
+
} else {
|
|
33248
|
+
setInstallMode(null);
|
|
33249
|
+
setImportResult(null);
|
|
33250
|
+
setViewMode(tab.key);
|
|
33251
|
+
}
|
|
33252
|
+
},
|
|
33253
|
+
className: "flex-1 px-2 py-0.5 rounded text-[11px] transition-colors ".concat(currentTab === tab.key ? "bg-white/10 font-medium opacity-90" : "opacity-50 hover:opacity-70"),
|
|
33254
|
+
children: tab.label
|
|
33255
|
+
}, tab.key);
|
|
32823
33256
|
})
|
|
32824
33257
|
})]
|
|
32825
33258
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -41633,7 +42066,8 @@ var DashboardStageInner = function DashboardStageInner(_ref2) {
|
|
|
41633
42066
|
menuItems: menuItems,
|
|
41634
42067
|
onSaveMenuItem: handleSaveNewMenuItem,
|
|
41635
42068
|
appId: credentials === null || credentials === void 0 ? void 0 : credentials.appId,
|
|
41636
|
-
onReloadWorkspaces: loadWorkspaces
|
|
42069
|
+
onReloadWorkspaces: loadWorkspaces,
|
|
42070
|
+
onOpenWorkspace: handleOpenTab
|
|
41637
42071
|
})]
|
|
41638
42072
|
})]
|
|
41639
42073
|
}), !popout && /*#__PURE__*/jsxRuntime.jsx(DashCommandPalette, {
|