@trops/dash-core 0.1.180 → 0.1.182
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/index.esm.js +173 -55
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +173 -55
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -33223,8 +33223,21 @@ var ThemeQuickCreate = function ThemeQuickCreate(_ref8) {
|
|
|
33223
33223
|
_ref8$onExtract = _ref8.onExtract,
|
|
33224
33224
|
onExtract = _ref8$onExtract === void 0 ? null : _ref8$onExtract,
|
|
33225
33225
|
_ref8$onMapToTheme = _ref8.onMapToTheme,
|
|
33226
|
-
onMapToTheme = _ref8$onMapToTheme === void 0 ? null : _ref8$onMapToTheme
|
|
33226
|
+
onMapToTheme = _ref8$onMapToTheme === void 0 ? null : _ref8$onMapToTheme,
|
|
33227
|
+
_ref8$initialMethod = _ref8.initialMethod,
|
|
33228
|
+
initialMethod = _ref8$initialMethod === void 0 ? null : _ref8$initialMethod;
|
|
33227
33229
|
var canCreate = wizardName.trim().length > 0 && wizardTheme !== null;
|
|
33230
|
+
var showMethodPicker = initialMethod === null;
|
|
33231
|
+
useEffect(function () {
|
|
33232
|
+
if (initialMethod && wizardMethod !== initialMethod) {
|
|
33233
|
+
setWizardMethod(initialMethod);
|
|
33234
|
+
setWizardTheme(null);
|
|
33235
|
+
if (initialMethod === "random") {
|
|
33236
|
+
setWizardTheme(generateRandomTheme());
|
|
33237
|
+
}
|
|
33238
|
+
}
|
|
33239
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
33240
|
+
}, [initialMethod]);
|
|
33228
33241
|
function handleMethodSelect(method) {
|
|
33229
33242
|
setWizardMethod(method);
|
|
33230
33243
|
setWizardTheme(null);
|
|
@@ -33246,7 +33259,7 @@ var ThemeQuickCreate = function ThemeQuickCreate(_ref8) {
|
|
|
33246
33259
|
},
|
|
33247
33260
|
placeholder: "Theme name..."
|
|
33248
33261
|
})]
|
|
33249
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
33262
|
+
}), showMethodPicker && /*#__PURE__*/jsxs("div", {
|
|
33250
33263
|
className: "flex flex-col gap-2",
|
|
33251
33264
|
children: [/*#__PURE__*/jsx("span", {
|
|
33252
33265
|
className: "text-sm font-semibold opacity-50",
|
|
@@ -33344,9 +33357,7 @@ var ChooserCard = function ChooserCard(_ref) {
|
|
|
33344
33357
|
};
|
|
33345
33358
|
var ThemeNewChooser = function ThemeNewChooser(_ref2) {
|
|
33346
33359
|
var onSearchThemes = _ref2.onSearchThemes,
|
|
33347
|
-
|
|
33348
|
-
_ref2$onCreateFromUrl = _ref2.onCreateFromUrl,
|
|
33349
|
-
onCreateFromUrl = _ref2$onCreateFromUrl === void 0 ? null : _ref2$onCreateFromUrl;
|
|
33360
|
+
onSelectMethod = _ref2.onSelectMethod;
|
|
33350
33361
|
return /*#__PURE__*/jsxs("div", {
|
|
33351
33362
|
className: "flex flex-col gap-6 p-6 overflow-y-auto flex-1 min-h-0",
|
|
33352
33363
|
children: [/*#__PURE__*/jsx("span", {
|
|
@@ -33356,19 +33367,37 @@ var ThemeNewChooser = function ThemeNewChooser(_ref2) {
|
|
|
33356
33367
|
className: "grid grid-cols-2 gap-3",
|
|
33357
33368
|
children: [/*#__PURE__*/jsx(ChooserCard, {
|
|
33358
33369
|
icon: "magnifying-glass",
|
|
33359
|
-
title: "Search
|
|
33360
|
-
subtitle: "Browse
|
|
33370
|
+
title: "Search Marketplace",
|
|
33371
|
+
subtitle: "Browse community themes",
|
|
33361
33372
|
onClick: onSearchThemes
|
|
33362
33373
|
}), /*#__PURE__*/jsx(ChooserCard, {
|
|
33363
|
-
icon: "
|
|
33364
|
-
title: "
|
|
33365
|
-
subtitle: "
|
|
33366
|
-
onClick:
|
|
33367
|
-
|
|
33374
|
+
icon: "swatchbook",
|
|
33375
|
+
title: "From Presets",
|
|
33376
|
+
subtitle: "Start from a curated preset",
|
|
33377
|
+
onClick: function onClick() {
|
|
33378
|
+
return onSelectMethod("presets");
|
|
33379
|
+
}
|
|
33380
|
+
}), /*#__PURE__*/jsx(ChooserCard, {
|
|
33381
|
+
icon: "droplet",
|
|
33382
|
+
title: "From Colors",
|
|
33383
|
+
subtitle: "Build from a color palette",
|
|
33384
|
+
onClick: function onClick() {
|
|
33385
|
+
return onSelectMethod("color");
|
|
33386
|
+
}
|
|
33387
|
+
}), /*#__PURE__*/jsx(ChooserCard, {
|
|
33388
|
+
icon: "shuffle",
|
|
33389
|
+
title: "From Random",
|
|
33390
|
+
subtitle: "Generate a random theme",
|
|
33391
|
+
onClick: function onClick() {
|
|
33392
|
+
return onSelectMethod("random");
|
|
33393
|
+
}
|
|
33394
|
+
}), /*#__PURE__*/jsx(ChooserCard, {
|
|
33368
33395
|
icon: "globe",
|
|
33369
33396
|
title: "From Website",
|
|
33370
|
-
subtitle: "Extract colors from any URL
|
|
33371
|
-
onClick:
|
|
33397
|
+
subtitle: "Extract colors from any URL",
|
|
33398
|
+
onClick: function onClick() {
|
|
33399
|
+
return onSelectMethod("from-url");
|
|
33400
|
+
}
|
|
33372
33401
|
})]
|
|
33373
33402
|
})]
|
|
33374
33403
|
});
|
|
@@ -34056,10 +34085,10 @@ var ThemeManagerModal = function ThemeManagerModal(_ref) {
|
|
|
34056
34085
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
34057
34086
|
isSearching = _useState12[0],
|
|
34058
34087
|
setIsSearching = _useState12[1];
|
|
34059
|
-
var _useState13 = useState(
|
|
34088
|
+
var _useState13 = useState(null),
|
|
34060
34089
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
34061
|
-
|
|
34062
|
-
|
|
34090
|
+
selectedMethod = _useState14[0],
|
|
34091
|
+
setSelectedMethod = _useState14[1];
|
|
34063
34092
|
var _useState15 = useState(""),
|
|
34064
34093
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
34065
34094
|
wizardName = _useState16[0],
|
|
@@ -34087,7 +34116,7 @@ var ThemeManagerModal = function ThemeManagerModal(_ref) {
|
|
|
34087
34116
|
setIsCreating(false);
|
|
34088
34117
|
setIsChoosingMode(false);
|
|
34089
34118
|
setIsSearching(false);
|
|
34090
|
-
|
|
34119
|
+
setSelectedMethod(null);
|
|
34091
34120
|
} else {
|
|
34092
34121
|
if (themeKeySelected === null && themes) {
|
|
34093
34122
|
var themeKeyTemp = settings && "theme" in settings ? settings["theme"] in themes ? settings["theme"] : Object.keys(themes)[0] : Object.keys(themes)[0];
|
|
@@ -34130,10 +34159,12 @@ var ThemeManagerModal = function ThemeManagerModal(_ref) {
|
|
|
34130
34159
|
setIsCreating(false);
|
|
34131
34160
|
setIsSearching(false);
|
|
34132
34161
|
setIsEditing(false);
|
|
34162
|
+
setSelectedMethod(null);
|
|
34133
34163
|
}
|
|
34134
|
-
function
|
|
34164
|
+
function handleSelectMethod(method) {
|
|
34135
34165
|
setIsChoosingMode(false);
|
|
34136
34166
|
setIsCreating(true);
|
|
34167
|
+
setSelectedMethod(method);
|
|
34137
34168
|
setWizardName("");
|
|
34138
34169
|
setWizardMethod(null);
|
|
34139
34170
|
setWizardTheme(null);
|
|
@@ -34142,10 +34173,6 @@ var ThemeManagerModal = function ThemeManagerModal(_ref) {
|
|
|
34142
34173
|
setIsChoosingMode(false);
|
|
34143
34174
|
setIsSearching(true);
|
|
34144
34175
|
}
|
|
34145
|
-
function handleChooseFromUrl() {
|
|
34146
|
-
setIsChoosingMode(false);
|
|
34147
|
-
setIsFromUrl(true);
|
|
34148
|
-
}
|
|
34149
34176
|
function handleBackFromSearch() {
|
|
34150
34177
|
setIsSearching(false);
|
|
34151
34178
|
setIsChoosingMode(true);
|
|
@@ -34204,24 +34231,6 @@ var ThemeManagerModal = function ThemeManagerModal(_ref) {
|
|
|
34204
34231
|
}));
|
|
34205
34232
|
return _handleUrlMapToTheme.apply(this, arguments);
|
|
34206
34233
|
}
|
|
34207
|
-
function handleUrlThemeGenerated(theme) {
|
|
34208
|
-
var key = theme.id || "theme-".concat(Date.now());
|
|
34209
|
-
var finalTheme = _objectSpread$c(_objectSpread$c({}, theme), {}, {
|
|
34210
|
-
id: key
|
|
34211
|
-
});
|
|
34212
|
-
if (dashApi) {
|
|
34213
|
-
dashApi.saveTheme(credentials.appId, key, finalTheme, function (e, message) {
|
|
34214
|
-
changeThemesForApplication(message["themes"]);
|
|
34215
|
-
setIsFromUrl(false);
|
|
34216
|
-
var newThemes = message["themes"];
|
|
34217
|
-
if (newThemes && newThemes[key]) {
|
|
34218
|
-
setThemeKeySelected(key);
|
|
34219
|
-
setThemeSelected(newThemes[key]);
|
|
34220
|
-
setRawThemeSelected(finalTheme);
|
|
34221
|
-
}
|
|
34222
|
-
}, handleSaveThemeError);
|
|
34223
|
-
}
|
|
34224
|
-
}
|
|
34225
34234
|
function handleWizardComplete() {
|
|
34226
34235
|
if (!wizardTheme || !wizardName.trim()) return;
|
|
34227
34236
|
var key = wizardTheme.id || "theme-".concat(Date.now());
|
|
@@ -34234,6 +34243,7 @@ var ThemeManagerModal = function ThemeManagerModal(_ref) {
|
|
|
34234
34243
|
changeThemesForApplication(message["themes"]);
|
|
34235
34244
|
setIsCreating(false);
|
|
34236
34245
|
setIsEditing(false);
|
|
34246
|
+
setSelectedMethod(null);
|
|
34237
34247
|
var newThemes = message["themes"];
|
|
34238
34248
|
if (newThemes && newThemes[key]) {
|
|
34239
34249
|
setThemeKeySelected(key);
|
|
@@ -34247,7 +34257,7 @@ var ThemeManagerModal = function ThemeManagerModal(_ref) {
|
|
|
34247
34257
|
setIsCreating(false);
|
|
34248
34258
|
setIsChoosingMode(false);
|
|
34249
34259
|
setIsSearching(false);
|
|
34250
|
-
|
|
34260
|
+
setSelectedMethod(null);
|
|
34251
34261
|
}
|
|
34252
34262
|
function handleSaveTheme() {
|
|
34253
34263
|
if (themeKeySelected !== null && rawThemeSelected !== null) {
|
|
@@ -34302,6 +34312,7 @@ var ThemeManagerModal = function ThemeManagerModal(_ref) {
|
|
|
34302
34312
|
setThemeSelected(null);
|
|
34303
34313
|
setIsEditing(false);
|
|
34304
34314
|
}
|
|
34315
|
+
var isInWizardFlow = isCreating || isChoosingMode || isSearching;
|
|
34305
34316
|
return /*#__PURE__*/jsx(Modal, {
|
|
34306
34317
|
isOpen: open,
|
|
34307
34318
|
setIsOpen: setIsOpen,
|
|
@@ -34326,8 +34337,7 @@ var ThemeManagerModal = function ThemeManagerModal(_ref) {
|
|
|
34326
34337
|
rawTheme: rawThemeSelected,
|
|
34327
34338
|
wizardContent: isChoosingMode ? /*#__PURE__*/jsx(ThemeNewChooser, {
|
|
34328
34339
|
onSearchThemes: handleChooseSearch,
|
|
34329
|
-
|
|
34330
|
-
onCreateFromUrl: handleChooseFromUrl
|
|
34340
|
+
onSelectMethod: handleSelectMethod
|
|
34331
34341
|
}) : isSearching ? /*#__PURE__*/jsx(DiscoverThemesDetail, {
|
|
34332
34342
|
onBack: handleBackFromSearch,
|
|
34333
34343
|
appId: credentials === null || credentials === void 0 ? void 0 : credentials.appId,
|
|
@@ -34348,12 +34358,9 @@ var ThemeManagerModal = function ThemeManagerModal(_ref) {
|
|
|
34348
34358
|
wizardTheme: wizardTheme,
|
|
34349
34359
|
setWizardTheme: setWizardTheme,
|
|
34350
34360
|
onComplete: handleWizardComplete,
|
|
34351
|
-
onExtract: handleUrlExtract,
|
|
34352
|
-
onMapToTheme: handleUrlMapToTheme
|
|
34353
|
-
}) : isFromUrl ? /*#__PURE__*/jsx(ThemeFromUrlPane, {
|
|
34354
34361
|
onExtract: handleUrlExtract,
|
|
34355
34362
|
onMapToTheme: handleUrlMapToTheme,
|
|
34356
|
-
|
|
34363
|
+
initialMethod: selectedMethod
|
|
34357
34364
|
}) : null
|
|
34358
34365
|
}), !isCreating && themeSelected && isEditing === true && /*#__PURE__*/jsx(PanelTheme, {
|
|
34359
34366
|
theme: themeSelected,
|
|
@@ -34374,13 +34381,13 @@ var ThemeManagerModal = function ThemeManagerModal(_ref) {
|
|
|
34374
34381
|
children: themeKeySelected
|
|
34375
34382
|
})]
|
|
34376
34383
|
})
|
|
34377
|
-
}),
|
|
34384
|
+
}), isInWizardFlow && /*#__PURE__*/jsx("div", {
|
|
34378
34385
|
className: "flex flex-row space-x-2",
|
|
34379
34386
|
children: /*#__PURE__*/jsx(Button, {
|
|
34380
34387
|
onClick: handleCancelCreate,
|
|
34381
34388
|
title: "Cancel"
|
|
34382
34389
|
})
|
|
34383
|
-
}), !
|
|
34390
|
+
}), !isInWizardFlow && isEditing === false && /*#__PURE__*/jsxs("div", {
|
|
34384
34391
|
className: "flex flex-row space-x-2",
|
|
34385
34392
|
children: [/*#__PURE__*/jsx(Button, {
|
|
34386
34393
|
onClick: function onClick() {
|
|
@@ -34399,7 +34406,7 @@ var ThemeManagerModal = function ThemeManagerModal(_ref) {
|
|
|
34399
34406
|
onClick: handleActivateTheme,
|
|
34400
34407
|
title: "Activate"
|
|
34401
34408
|
})]
|
|
34402
|
-
}), !
|
|
34409
|
+
}), !isInWizardFlow && isEditing === true && /*#__PURE__*/jsxs("div", {
|
|
34403
34410
|
className: "flex flex-row space-x-2",
|
|
34404
34411
|
children: [/*#__PURE__*/jsx(Button, {
|
|
34405
34412
|
onClick: function onClick() {
|
|
@@ -38587,6 +38594,16 @@ var WebSocketProviderForm = function WebSocketProviderForm(_ref) {
|
|
|
38587
38594
|
_useState10 = _slicedToArray(_useState1, 2),
|
|
38588
38595
|
errors = _useState10[0],
|
|
38589
38596
|
setErrors = _useState10[1];
|
|
38597
|
+
var _useState11 = useState(false),
|
|
38598
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
38599
|
+
isWsTesting = _useState12[0],
|
|
38600
|
+
setIsWsTesting = _useState12[1];
|
|
38601
|
+
var _useState13 = useState(null),
|
|
38602
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
38603
|
+
wsTestResult = _useState14[0],
|
|
38604
|
+
setWsTestResult = _useState14[1];
|
|
38605
|
+
var appContext = useContext(AppContext);
|
|
38606
|
+
var dashApi = appContext === null || appContext === void 0 ? void 0 : appContext.dashApi;
|
|
38590
38607
|
var nextRowIdRef = useRef(0);
|
|
38591
38608
|
var nextRowId = function nextRowId() {
|
|
38592
38609
|
return "ws_hdr_".concat(++nextRowIdRef.current);
|
|
@@ -38676,6 +38693,92 @@ var WebSocketProviderForm = function WebSocketProviderForm(_ref) {
|
|
|
38676
38693
|
});
|
|
38677
38694
|
});
|
|
38678
38695
|
}
|
|
38696
|
+
function handleTestConnection() {
|
|
38697
|
+
return _handleTestConnection.apply(this, arguments);
|
|
38698
|
+
}
|
|
38699
|
+
function _handleTestConnection() {
|
|
38700
|
+
_handleTestConnection = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
38701
|
+
var headers, _iterator4, _step4, row, subprotoArray, testName, startTime, result, latency, _t;
|
|
38702
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
38703
|
+
while (1) switch (_context.prev = _context.next) {
|
|
38704
|
+
case 0:
|
|
38705
|
+
if (!(!(dashApi !== null && dashApi !== void 0 && dashApi.webSocket) || !url.trim() || !isValidWsUrl(url))) {
|
|
38706
|
+
_context.next = 1;
|
|
38707
|
+
break;
|
|
38708
|
+
}
|
|
38709
|
+
return _context.abrupt("return");
|
|
38710
|
+
case 1:
|
|
38711
|
+
setIsWsTesting(true);
|
|
38712
|
+
setWsTestResult(null);
|
|
38713
|
+
|
|
38714
|
+
// Build config from current form state (same as handleSave)
|
|
38715
|
+
headers = {};
|
|
38716
|
+
_iterator4 = _createForOfIteratorHelper$4(headerRows);
|
|
38717
|
+
try {
|
|
38718
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
38719
|
+
row = _step4.value;
|
|
38720
|
+
if (row.key.trim()) {
|
|
38721
|
+
headers[row.key.trim()] = row.value;
|
|
38722
|
+
}
|
|
38723
|
+
}
|
|
38724
|
+
} catch (err) {
|
|
38725
|
+
_iterator4.e(err);
|
|
38726
|
+
} finally {
|
|
38727
|
+
_iterator4.f();
|
|
38728
|
+
}
|
|
38729
|
+
subprotoArray = subprotocols.split(",").map(function (s) {
|
|
38730
|
+
return s.trim();
|
|
38731
|
+
}).filter(Boolean);
|
|
38732
|
+
testName = name.trim() || "__ws_test__";
|
|
38733
|
+
startTime = Date.now();
|
|
38734
|
+
_context.prev = 2;
|
|
38735
|
+
_context.next = 3;
|
|
38736
|
+
return dashApi.webSocket.connect(testName, {
|
|
38737
|
+
url: url.trim(),
|
|
38738
|
+
headers: Object.keys(headers).length > 0 ? headers : null,
|
|
38739
|
+
subprotocols: subprotoArray.length > 0 ? subprotoArray : null,
|
|
38740
|
+
credentials: Object.keys(credentials).length > 0 ? credentials : null
|
|
38741
|
+
});
|
|
38742
|
+
case 3:
|
|
38743
|
+
result = _context.sent;
|
|
38744
|
+
latency = Date.now() - startTime;
|
|
38745
|
+
if (!result.error) {
|
|
38746
|
+
_context.next = 4;
|
|
38747
|
+
break;
|
|
38748
|
+
}
|
|
38749
|
+
setWsTestResult({
|
|
38750
|
+
success: false,
|
|
38751
|
+
message: result.message || "Connection failed"
|
|
38752
|
+
});
|
|
38753
|
+
_context.next = 5;
|
|
38754
|
+
break;
|
|
38755
|
+
case 4:
|
|
38756
|
+
setWsTestResult({
|
|
38757
|
+
success: true,
|
|
38758
|
+
message: "Connected in ".concat(latency, "ms")
|
|
38759
|
+
});
|
|
38760
|
+
_context.next = 5;
|
|
38761
|
+
return dashApi.webSocket.disconnect(testName)["catch"](function () {});
|
|
38762
|
+
case 5:
|
|
38763
|
+
_context.next = 7;
|
|
38764
|
+
break;
|
|
38765
|
+
case 6:
|
|
38766
|
+
_context.prev = 6;
|
|
38767
|
+
_t = _context["catch"](2);
|
|
38768
|
+
setWsTestResult({
|
|
38769
|
+
success: false,
|
|
38770
|
+
message: (_t === null || _t === void 0 ? void 0 : _t.message) || "Connection failed"
|
|
38771
|
+
});
|
|
38772
|
+
case 7:
|
|
38773
|
+
setIsWsTesting(false);
|
|
38774
|
+
case 8:
|
|
38775
|
+
case "end":
|
|
38776
|
+
return _context.stop();
|
|
38777
|
+
}
|
|
38778
|
+
}, _callee, null, [[2, 6]]);
|
|
38779
|
+
}));
|
|
38780
|
+
return _handleTestConnection.apply(this, arguments);
|
|
38781
|
+
}
|
|
38679
38782
|
return /*#__PURE__*/jsxs("div", {
|
|
38680
38783
|
className: "flex flex-col flex-1 min-h-0",
|
|
38681
38784
|
children: [/*#__PURE__*/jsxs("div", {
|
|
@@ -38694,7 +38797,7 @@ var WebSocketProviderForm = function WebSocketProviderForm(_ref) {
|
|
|
38694
38797
|
return setName(value);
|
|
38695
38798
|
},
|
|
38696
38799
|
placeholder: "e.g., crypto-ws, stock-feed",
|
|
38697
|
-
|
|
38800
|
+
inputClassName: errors.name ? "border-red-500" : ""
|
|
38698
38801
|
}), errors.name && /*#__PURE__*/jsx("span", {
|
|
38699
38802
|
className: "text-xs text-red-400",
|
|
38700
38803
|
children: errors.name
|
|
@@ -38710,7 +38813,7 @@ var WebSocketProviderForm = function WebSocketProviderForm(_ref) {
|
|
|
38710
38813
|
return setUrl(value);
|
|
38711
38814
|
},
|
|
38712
38815
|
placeholder: "wss://api.example.com/ws or ws://localhost:8080",
|
|
38713
|
-
|
|
38816
|
+
inputClassName: errors.url ? "border-red-500" : ""
|
|
38714
38817
|
}), errors.url && /*#__PURE__*/jsx("span", {
|
|
38715
38818
|
className: "text-xs text-red-400",
|
|
38716
38819
|
children: errors.url
|
|
@@ -38818,17 +38921,32 @@ var WebSocketProviderForm = function WebSocketProviderForm(_ref) {
|
|
|
38818
38921
|
});
|
|
38819
38922
|
},
|
|
38820
38923
|
placeholder: "Enter ".concat(field),
|
|
38821
|
-
|
|
38924
|
+
inputClassName: errors["cred_".concat(field)] ? "border-red-500" : ""
|
|
38822
38925
|
}), errors["cred_".concat(field)] && /*#__PURE__*/jsx("span", {
|
|
38823
38926
|
className: "text-xs text-red-400",
|
|
38824
38927
|
children: errors["cred_".concat(field)]
|
|
38825
38928
|
})]
|
|
38826
38929
|
}, field);
|
|
38827
38930
|
})]
|
|
38931
|
+
}), wsTestResult && /*#__PURE__*/jsx("div", {
|
|
38932
|
+
className: "p-3 rounded-lg text-sm ".concat(wsTestResult.success ? "bg-green-900/30 border border-green-700 text-green-300" : "bg-red-900/30 border border-red-700 text-red-300"),
|
|
38933
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
38934
|
+
className: "flex items-center gap-2",
|
|
38935
|
+
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
38936
|
+
icon: wsTestResult.success ? "circle-check" : "circle-exclamation"
|
|
38937
|
+
}), /*#__PURE__*/jsx("span", {
|
|
38938
|
+
children: wsTestResult.message
|
|
38939
|
+
})]
|
|
38940
|
+
})
|
|
38828
38941
|
})]
|
|
38829
38942
|
}), /*#__PURE__*/jsxs("div", {
|
|
38830
38943
|
className: "flex-shrink-0 flex flex-row justify-end gap-2 px-6 py-4 border-t border-white/10",
|
|
38831
|
-
children: [/*#__PURE__*/jsx(Button, {
|
|
38944
|
+
children: [(dashApi === null || dashApi === void 0 ? void 0 : dashApi.webSocket) && /*#__PURE__*/jsx(Button, {
|
|
38945
|
+
title: isWsTesting ? "Testing..." : "Test Connection",
|
|
38946
|
+
onClick: handleTestConnection,
|
|
38947
|
+
size: "sm",
|
|
38948
|
+
disabled: !url.trim() || !isValidWsUrl(url)
|
|
38949
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
38832
38950
|
title: "Cancel",
|
|
38833
38951
|
onClick: onCancel,
|
|
38834
38952
|
size: "sm"
|