@plutonhq/core-frontend 0.1.21 → 0.1.23
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-lib/@types/plans.d.ts +11 -20
- package/dist-lib/@types/plans.d.ts.map +1 -1
- package/dist-lib/components/Plan/PlanSettings/PlanAdvancedSettings.js +49 -47
- package/dist-lib/components/Plan/PlanSettings/PlanAdvancedSettings.js.map +1 -1
- package/dist-lib/components/Plan/PlanSettings/PlanNotificationSettings.d.ts +7 -4
- package/dist-lib/components/Plan/PlanSettings/PlanNotificationSettings.d.ts.map +1 -1
- package/dist-lib/components/Plan/PlanSettings/PlanNotificationSettings.js +177 -52
- package/dist-lib/components/Plan/PlanSettings/PlanNotificationSettings.js.map +1 -1
- package/dist-lib/components/Plan/PlanSettings/PlanNotificationSettingsTester.d.ts +9 -0
- package/dist-lib/components/Plan/PlanSettings/PlanNotificationSettingsTester.d.ts.map +1 -0
- package/dist-lib/components/Plan/PlanSettings/PlanNotificationSettingsTester.js +62 -0
- package/dist-lib/components/Plan/PlanSettings/PlanNotificationSettingsTester.js.map +1 -0
- package/dist-lib/components/Plan/PlanSettings/PlanPruneSettings.js +2 -2
- package/dist-lib/components/Plan/PlanSettings/PlanPruneSettings.js.map +1 -1
- package/dist-lib/components/Plan/PlanSettings/PlanSettings.module.scss.js +56 -40
- package/dist-lib/components/Plan/PlanSettings/PlanSettings.module.scss.js.map +1 -1
- package/dist-lib/components/Settings/GeneralSettings/GeneralSettings.d.ts.map +1 -1
- package/dist-lib/components/Settings/GeneralSettings/GeneralSettings.js +16 -8
- package/dist-lib/components/Settings/GeneralSettings/GeneralSettings.js.map +1 -1
- package/dist-lib/components/Storage/AddStorage/AddStorage.module.scss.js +42 -26
- package/dist-lib/components/Storage/AddStorage/AddStorage.module.scss.js.map +1 -1
- package/dist-lib/components/Storage/StorageAuthSettings/StorageAuthSettings.d.ts.map +1 -1
- package/dist-lib/components/Storage/StorageAuthSettings/StorageAuthSettings.js +119 -53
- package/dist-lib/components/Storage/StorageAuthSettings/StorageAuthSettings.js.map +1 -1
- package/dist-lib/components/common/Icon/Icon.d.ts.map +1 -1
- package/dist-lib/components/common/Icon/Icon.js +15 -1
- package/dist-lib/components/common/Icon/Icon.js.map +1 -1
- package/dist-lib/components/index.d.ts +1 -0
- package/dist-lib/components/index.d.ts.map +1 -1
- package/dist-lib/components.js +86 -84
- package/dist-lib/components.js.map +1 -1
- package/dist-lib/providers/s3compatible.png +0 -0
- package/dist-lib/services/plans.d.ts +13 -1
- package/dist-lib/services/plans.d.ts.map +1 -1
- package/dist-lib/services/plans.js +88 -61
- package/dist-lib/services/plans.js.map +1 -1
- package/dist-lib/services/settings.d.ts.map +1 -1
- package/dist-lib/services/settings.js +25 -24
- package/dist-lib/services/settings.js.map +1 -1
- package/dist-lib/services/storage.d.ts +10 -0
- package/dist-lib/services/storage.d.ts.map +1 -1
- package/dist-lib/services/storage.js +55 -20
- package/dist-lib/services/storage.js.map +1 -1
- package/dist-lib/services.js +106 -101
- package/dist-lib/styles/core-frontend.css +1 -1
- package/dist-lib/utils/constants.d.ts.map +1 -1
- package/dist-lib/utils/constants.js +28 -5
- package/dist-lib/utils/constants.js.map +1 -1
- package/dist-lib/utils/helpers.d.ts +1 -0
- package/dist-lib/utils/helpers.d.ts.map +1 -1
- package/dist-lib/utils/helpers.js +17 -10
- package/dist-lib/utils/helpers.js.map +1 -1
- package/dist-lib/utils.js +28 -27
- package/package.json +1 -1
- package/src/@types/plans.ts +11 -20
- package/src/components/Plan/PlanSettings/PlanAdvancedSettings.tsx +4 -4
- package/src/components/Plan/PlanSettings/PlanNotificationSettings.tsx +179 -47
- package/src/components/Plan/PlanSettings/PlanNotificationSettingsTester.tsx +85 -0
- package/src/components/Plan/PlanSettings/PlanPruneSettings.tsx +2 -2
- package/src/components/Plan/PlanSettings/PlanSettings.module.scss +71 -0
- package/src/components/Settings/GeneralSettings/GeneralSettings.tsx +6 -1
- package/src/components/Storage/AddStorage/AddStorage.module.scss +74 -0
- package/src/components/Storage/StorageAuthSettings/StorageAuthSettings.tsx +136 -3
- package/src/components/common/Icon/Icon.tsx +16 -0
- package/src/components/index.ts +1 -0
- package/src/services/plans.ts +38 -1
- package/src/services/settings.ts +2 -2
- package/src/services/storage.ts +49 -0
- package/src/utils/constants.ts +23 -0
- package/src/utils/helpers.ts +9 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { toast as n } from "react-toastify";
|
|
3
|
+
import { useState as T } from "react";
|
|
4
|
+
import { useTestNotification as k } from "../../../services/plans.js";
|
|
5
|
+
import b from "../../common/Icon/Icon.js";
|
|
6
|
+
import r from "./PlanSettings.module.scss.js";
|
|
7
|
+
import { isValidURL as y } from "../../../utils/helpers.js";
|
|
8
|
+
const w = ({
|
|
9
|
+
planId: s,
|
|
10
|
+
notificationChannel: i,
|
|
11
|
+
notificationSettings: f,
|
|
12
|
+
notificationType: d = "backup"
|
|
13
|
+
}) => {
|
|
14
|
+
const [a, l] = T(!1), m = k(), t = f[i], u = d === "integrity", o = (N) => {
|
|
15
|
+
if (l(!1), !s)
|
|
16
|
+
return n.error("Test notification can be sent after creating the Plan");
|
|
17
|
+
if (!(t != null && t.url) || !y(t.url))
|
|
18
|
+
return n.error("Please enter a valid URL to send test notifications");
|
|
19
|
+
n.promise(
|
|
20
|
+
m.mutateAsync({
|
|
21
|
+
planId: s,
|
|
22
|
+
notificationCase: N,
|
|
23
|
+
notificationChannel: i,
|
|
24
|
+
channelSettings: t
|
|
25
|
+
}),
|
|
26
|
+
{
|
|
27
|
+
pending: `Sending Test Request to your ${i}...`,
|
|
28
|
+
success: "Test Request Sent Successfully!",
|
|
29
|
+
error: {
|
|
30
|
+
render({ data: p }) {
|
|
31
|
+
return p.message || "Failed to send test request";
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
return /* @__PURE__ */ c("div", { className: r.testNotificationContainer, children: [
|
|
38
|
+
/* @__PURE__ */ c(
|
|
39
|
+
"button",
|
|
40
|
+
{
|
|
41
|
+
onClick: () => u ? o("integrity_failure") : l(!a),
|
|
42
|
+
className: `${r.testNotificationButton} ${t != null && t.url ? "" : r.disabled}`,
|
|
43
|
+
disabled: !(t != null && t.url) || !s,
|
|
44
|
+
title: s ? t != null && t.url ? void 0 : `Enter ${i === "webhook" ? "the" : i.charAt(0).toUpperCase() + i.slice(1)} Webhook URL to send test notifications` : "Create the Plan first to send test notifications",
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ e(b, { type: "send", size: 12 }),
|
|
47
|
+
" Send Test Request"
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
!u && a && /* @__PURE__ */ e("div", { className: r.testNotificationOptions, children: /* @__PURE__ */ c("ul", { children: [
|
|
52
|
+
/* @__PURE__ */ e("li", { onClick: () => o("start"), children: "Start Notification" }),
|
|
53
|
+
/* @__PURE__ */ e("li", { onClick: () => o("end"), children: "End Notification" }),
|
|
54
|
+
/* @__PURE__ */ e("li", { onClick: () => o("success"), children: "Success Notification" }),
|
|
55
|
+
/* @__PURE__ */ e("li", { onClick: () => o("failure"), children: "Failure Notification" })
|
|
56
|
+
] }) })
|
|
57
|
+
] });
|
|
58
|
+
};
|
|
59
|
+
export {
|
|
60
|
+
w as default
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=PlanNotificationSettingsTester.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlanNotificationSettingsTester.js","sources":["../../../../src/components/Plan/PlanSettings/PlanNotificationSettingsTester.tsx"],"sourcesContent":["import { toast } from 'react-toastify';\r\nimport { useState } from 'react';\r\nimport { useTestNotification } from '../../../services';\r\nimport { Icon } from '../..';\r\nimport { NewPlanSettings, PlanNotificationCase } from '../../..';\r\nimport classes from './PlanSettings.module.scss';\r\nimport { isValidURL } from '../../../utils';\r\n\r\nconst PlanNotificationSettingsTester = ({\r\n planId,\r\n notificationChannel,\r\n notificationSettings,\r\n notificationType = 'backup',\r\n}: {\r\n planId: string;\r\n notificationType?: 'backup' | 'integrity';\r\n notificationChannel: 'webhook' | 'slack' | 'discord';\r\n notificationSettings: NewPlanSettings['settings']['notification'];\r\n}) => {\r\n const [showTestNotificationOptions, setShowTestNotificationOptions] = useState(false);\r\n const testNotificationMutation = useTestNotification();\r\n const channelSettings = notificationSettings[notificationChannel as 'webhook' | 'slack' | 'discord'];\r\n const integrityNotification = notificationType === 'integrity';\r\n\r\n const sendTestNotification = (notificationCase: PlanNotificationCase | 'integrity_failure') => {\r\n setShowTestNotificationOptions(false);\r\n if (!planId) {\r\n return toast.error('Test notification can be sent after creating the Plan');\r\n }\r\n if (!channelSettings?.url || !isValidURL(channelSettings.url)) {\r\n return toast.error(`Please enter a valid URL to send test notifications`);\r\n }\r\n\r\n toast.promise(\r\n testNotificationMutation.mutateAsync({\r\n planId,\r\n notificationCase: notificationCase,\r\n notificationChannel,\r\n channelSettings: channelSettings,\r\n }),\r\n {\r\n pending: `Sending Test Request to your ${notificationChannel}...`,\r\n success: 'Test Request Sent Successfully!',\r\n error: {\r\n render({ data }: any) {\r\n return data.message || 'Failed to send test request';\r\n },\r\n },\r\n },\r\n );\r\n };\r\n\r\n return (\r\n <div className={classes.testNotificationContainer}>\r\n <button\r\n onClick={() =>\r\n integrityNotification ? sendTestNotification('integrity_failure') : setShowTestNotificationOptions(!showTestNotificationOptions)\r\n }\r\n className={`${classes.testNotificationButton} ${!channelSettings?.url ? classes.disabled : ''}`}\r\n disabled={!channelSettings?.url || !planId}\r\n title={\r\n !planId\r\n ? 'Create the Plan first to send test notifications'\r\n : !channelSettings?.url\r\n ? `Enter ${notificationChannel === 'webhook' ? 'the' : notificationChannel.charAt(0).toUpperCase() + notificationChannel.slice(1)} Webhook URL to send test notifications`\r\n : undefined\r\n }\r\n >\r\n <Icon type=\"send\" size={12} /> Send Test Request\r\n </button>\r\n {!integrityNotification && showTestNotificationOptions && (\r\n <div className={classes.testNotificationOptions}>\r\n <ul>\r\n <li onClick={() => sendTestNotification('start')}>Start Notification</li>\r\n <li onClick={() => sendTestNotification('end')}>End Notification</li>\r\n <li onClick={() => sendTestNotification('success')}>Success Notification</li>\r\n <li onClick={() => sendTestNotification('failure')}>Failure Notification</li>\r\n </ul>\r\n </div>\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nexport default PlanNotificationSettingsTester;\r\n"],"names":["PlanNotificationSettingsTester","planId","notificationChannel","notificationSettings","notificationType","showTestNotificationOptions","setShowTestNotificationOptions","useState","testNotificationMutation","useTestNotification","channelSettings","integrityNotification","sendTestNotification","notificationCase","toast","isValidURL","data","jsxs","classes","jsx","Icon"],"mappings":";;;;;;;AAQA,MAAMA,IAAiC,CAAC;AAAA,EACrC,QAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,kBAAAC,IAAmB;AACtB,MAKM;AACH,QAAM,CAACC,GAA6BC,CAA8B,IAAIC,EAAS,EAAK,GAC9EC,IAA2BC,EAAA,GAC3BC,IAAkBP,EAAqBD,CAAsD,GAC7FS,IAAwBP,MAAqB,aAE7CQ,IAAuB,CAACC,MAAiE;AAE5F,QADAP,EAA+B,EAAK,GAChC,CAACL;AACF,aAAOa,EAAM,MAAM,uDAAuD;AAE7E,QAAI,EAACJ,KAAA,QAAAA,EAAiB,QAAO,CAACK,EAAWL,EAAgB,GAAG;AACzD,aAAOI,EAAM,MAAM,qDAAqD;AAG3E,IAAAA,EAAM;AAAA,MACHN,EAAyB,YAAY;AAAA,QAClC,QAAAP;AAAA,QACA,kBAAAY;AAAA,QACA,qBAAAX;AAAA,QACA,iBAAAQ;AAAA,MAAA,CACF;AAAA,MACD;AAAA,QACG,SAAS,gCAAgCR,CAAmB;AAAA,QAC5D,SAAS;AAAA,QACT,OAAO;AAAA,UACJ,OAAO,EAAE,MAAAc,KAAa;AACnB,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t }) => {
|
|
|
82
82
|
onUpdate: (a) => t({ ...e, keepWeeklySnaps: a })
|
|
83
83
|
}
|
|
84
84
|
),
|
|
85
|
-
/* @__PURE__ */ l("span", { children: "
|
|
85
|
+
/* @__PURE__ */ l("span", { children: "Weeks" })
|
|
86
86
|
] }),
|
|
87
87
|
/* @__PURE__ */ s("div", { className: i.customPolicyOption, children: [
|
|
88
88
|
/* @__PURE__ */ l("span", { children: "Keep Monthly Backups for " }),
|
|
@@ -93,7 +93,7 @@ const b = ({ plan: c, onUpdate: t }) => {
|
|
|
93
93
|
onUpdate: (a) => t({ ...e, keepMonthlySnaps: a })
|
|
94
94
|
}
|
|
95
95
|
),
|
|
96
|
-
/* @__PURE__ */ l("span", { children: "
|
|
96
|
+
/* @__PURE__ */ l("span", { children: "Months" })
|
|
97
97
|
] })
|
|
98
98
|
] }) })
|
|
99
99
|
] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlanPruneSettings.js","sources":["../../../../src/components/Plan/PlanSettings/PlanPruneSettings.tsx"],"sourcesContent":["import classes from './PlanSettings.module.scss';\r\nimport Select from '../../common/form/Select/Select';\r\nimport Input from '../../common/form/Input/Input';\r\nimport Tristate from '../../common/form/Tristate/Tristate';\r\nimport { NewPlanSettings } from '../../../@types/plans';\r\nimport NumberInput from '../../common/form/NumberInput/NumberInput';\r\n\r\ninterface PlanPruneSettingsProps {\r\n plan: NewPlanSettings;\r\n onUpdate: (pruneSettings: NewPlanSettings['settings']['prune']) => void;\r\n}\r\n\r\nconst PlanPruneSettings = ({ plan, onUpdate }: PlanPruneSettingsProps) => {\r\n const pruneSettings = plan.settings?.prune;\r\n\r\n return (\r\n <>\r\n <div className={classes.field}>\r\n <label className={classes.label}>Backup Retention Policy</label>\r\n <Select\r\n options={[\r\n { label: 'Remove by Age', value: 'forgetByAge' },\r\n { label: 'Remove by Date', value: 'forgetByDate' },\r\n { label: 'Custom Prune Policy', value: 'custom' },\r\n ]}\r\n fieldValue={pruneSettings.policy}\r\n onUpdate={(val: string) => onUpdate({ ...pruneSettings, policy: val })}\r\n />\r\n </div>\r\n {pruneSettings.policy === 'forgetByAge' && (\r\n <div className={classes.field}>\r\n <label className={classes.label}>Remove Backups Older Than</label>\r\n <div className={classes.forgetByAgeField}>\r\n <NumberInput\r\n fieldValue={pruneSettings.forgetAge ? parseInt(pruneSettings.forgetAge.replace(/\\D/g, ''), 10) : 3}\r\n onUpdate={(val) =>\r\n onUpdate({\r\n ...pruneSettings,\r\n forgetAge: (pruneSettings.forgetAge || '3m').replace(/\\d+/g, val.toString()),\r\n })\r\n }\r\n placeholder=\"5\"\r\n min={1}\r\n full={true}\r\n />\r\n <Tristate\r\n fieldValue={(pruneSettings.forgetAge || '3m').replace(/\\d/g, '')}\r\n options={[\r\n { label: 'Days', value: 'd' },\r\n { label: 'Weeks', value: 'w' },\r\n { label: 'Months', value: 'm' },\r\n ]}\r\n onUpdate={(val: string) =>\r\n onUpdate({\r\n ...pruneSettings,\r\n forgetAge: (pruneSettings.forgetAge || '3m').replace(/\\D/g, val),\r\n })\r\n }\r\n />\r\n </div>\r\n </div>\r\n )}\r\n {pruneSettings.policy === 'forgetByDate' && (\r\n <div className={classes.field} style={{ width: '200px' }}>\r\n <label className={classes.label}>Remove Backups Older Than</label>\r\n <Input type=\"date\" fieldValue={pruneSettings.forgetDate || ''} onUpdate={(val) => onUpdate({ ...pruneSettings, forgetDate: val })} />\r\n </div>\r\n )}\r\n {pruneSettings.policy === 'custom' && (\r\n <>\r\n <div className={classes.field}>\r\n <label className={classes.label}>Custom Policy Settings</label>\r\n <div className={classes.customPolicyOption}>\r\n <span>Keep Daily Backups for </span>\r\n <NumberInput\r\n fieldValue={pruneSettings.keepDailySnaps || ''}\r\n onUpdate={(val) => onUpdate({ ...pruneSettings, keepDailySnaps: val })}\r\n />\r\n <span>Days</span>\r\n </div>\r\n <div className={classes.customPolicyOption}>\r\n <span>Keep Weekly Backups for </span>\r\n <NumberInput\r\n fieldValue={pruneSettings.keepWeeklySnaps || ''}\r\n onUpdate={(val) => onUpdate({ ...pruneSettings, keepWeeklySnaps: val })}\r\n />\r\n <span>
|
|
1
|
+
{"version":3,"file":"PlanPruneSettings.js","sources":["../../../../src/components/Plan/PlanSettings/PlanPruneSettings.tsx"],"sourcesContent":["import classes from './PlanSettings.module.scss';\r\nimport Select from '../../common/form/Select/Select';\r\nimport Input from '../../common/form/Input/Input';\r\nimport Tristate from '../../common/form/Tristate/Tristate';\r\nimport { NewPlanSettings } from '../../../@types/plans';\r\nimport NumberInput from '../../common/form/NumberInput/NumberInput';\r\n\r\ninterface PlanPruneSettingsProps {\r\n plan: NewPlanSettings;\r\n onUpdate: (pruneSettings: NewPlanSettings['settings']['prune']) => void;\r\n}\r\n\r\nconst PlanPruneSettings = ({ plan, onUpdate }: PlanPruneSettingsProps) => {\r\n const pruneSettings = plan.settings?.prune;\r\n\r\n return (\r\n <>\r\n <div className={classes.field}>\r\n <label className={classes.label}>Backup Retention Policy</label>\r\n <Select\r\n options={[\r\n { label: 'Remove by Age', value: 'forgetByAge' },\r\n { label: 'Remove by Date', value: 'forgetByDate' },\r\n { label: 'Custom Prune Policy', value: 'custom' },\r\n ]}\r\n fieldValue={pruneSettings.policy}\r\n onUpdate={(val: string) => onUpdate({ ...pruneSettings, policy: val })}\r\n />\r\n </div>\r\n {pruneSettings.policy === 'forgetByAge' && (\r\n <div className={classes.field}>\r\n <label className={classes.label}>Remove Backups Older Than</label>\r\n <div className={classes.forgetByAgeField}>\r\n <NumberInput\r\n fieldValue={pruneSettings.forgetAge ? parseInt(pruneSettings.forgetAge.replace(/\\D/g, ''), 10) : 3}\r\n onUpdate={(val) =>\r\n onUpdate({\r\n ...pruneSettings,\r\n forgetAge: (pruneSettings.forgetAge || '3m').replace(/\\d+/g, val.toString()),\r\n })\r\n }\r\n placeholder=\"5\"\r\n min={1}\r\n full={true}\r\n />\r\n <Tristate\r\n fieldValue={(pruneSettings.forgetAge || '3m').replace(/\\d/g, '')}\r\n options={[\r\n { label: 'Days', value: 'd' },\r\n { label: 'Weeks', value: 'w' },\r\n { label: 'Months', value: 'm' },\r\n ]}\r\n onUpdate={(val: string) =>\r\n onUpdate({\r\n ...pruneSettings,\r\n forgetAge: (pruneSettings.forgetAge || '3m').replace(/\\D/g, val),\r\n })\r\n }\r\n />\r\n </div>\r\n </div>\r\n )}\r\n {pruneSettings.policy === 'forgetByDate' && (\r\n <div className={classes.field} style={{ width: '200px' }}>\r\n <label className={classes.label}>Remove Backups Older Than</label>\r\n <Input type=\"date\" fieldValue={pruneSettings.forgetDate || ''} onUpdate={(val) => onUpdate({ ...pruneSettings, forgetDate: val })} />\r\n </div>\r\n )}\r\n {pruneSettings.policy === 'custom' && (\r\n <>\r\n <div className={classes.field}>\r\n <label className={classes.label}>Custom Policy Settings</label>\r\n <div className={classes.customPolicyOption}>\r\n <span>Keep Daily Backups for </span>\r\n <NumberInput\r\n fieldValue={pruneSettings.keepDailySnaps || ''}\r\n onUpdate={(val) => onUpdate({ ...pruneSettings, keepDailySnaps: val })}\r\n />\r\n <span>Days</span>\r\n </div>\r\n <div className={classes.customPolicyOption}>\r\n <span>Keep Weekly Backups for </span>\r\n <NumberInput\r\n fieldValue={pruneSettings.keepWeeklySnaps || ''}\r\n onUpdate={(val) => onUpdate({ ...pruneSettings, keepWeeklySnaps: val })}\r\n />\r\n <span>Weeks</span>\r\n </div>\r\n <div className={classes.customPolicyOption}>\r\n <span>Keep Monthly Backups for </span>\r\n <NumberInput\r\n fieldValue={pruneSettings.keepMonthlySnaps || ''}\r\n onUpdate={(val) => onUpdate({ ...pruneSettings, keepMonthlySnaps: val })}\r\n />\r\n <span>Months</span>\r\n </div>\r\n </div>\r\n </>\r\n )}\r\n </>\r\n );\r\n};\r\n\r\nexport default PlanPruneSettings;\r\n"],"names":["PlanPruneSettings","plan","onUpdate","pruneSettings","_a","jsxs","Fragment","classes","jsx","Select","val","NumberInput","Tristate","Input"],"mappings":";;;;;;AAYA,MAAMA,IAAoB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A,QAExE,gBAAAF,EAAC,UAAK,UAAA,OAAA,CAAI;AAAA,MAAA,GACb;AAAA,MACA,gBAAAH,EAAC,OAAA,EAAI,WAAWE,EAAQ,oBACrB,UAAA;AAAA,QAAA,gBAAAC,EAAC,UAAK,UAAA,2BAAA,CAAwB;AAAA,QAC9B,gBAAAA;AAAA,UAACG;AAAA,UAAA;AAAA,YACE,YAAYR,EAAc,mBAAmB;AAAA,YAC7C,UAAU,CAACO,MAAQR,EAAS,EAAE,GAAGC,GAAe,iBAAiBO,EAAA,CAAK;AAAA,UAAA;AAAA,QAAA;AAAA,QAEzE,gBAAAF,EAAC,UAAK,UAAA,QAAA,CAAK;AAAA,MAAA,GACd;AAAA,MACA,gBAAAH,EAAC,OAAA,EAAI,WAAWE,EAAQ,oBACrB,UAAA;AAAA,QAAA,gBAAAC,EAAC,UAAK,UAAA,4BAAA,CAAyB;AAAA,QAC/B,gBAAAA;AAAA,UAACG;AAAA,UAAA;AAAA,YACE,YAAYR,EAAc,oBAAoB;AAAA,YAC9C,UAAU,CAACO,MAAQR,EAAS,EAAE,GAAGC,GAAe,kBAAkBO,EAAA,CAAK;AAAA,UAAA;AAAA,QAAA;AAAA,QAE1E,gBAAAF,EAAC,UAAK,UAAA,SAAA,CAAM;AAAA,MAAA,EAAA,CACf;AAAA,IAAA,EAAA,CACH,EAAA,CACH;AAAA,EAAA,GAEN;AAEN;"}
|
|
@@ -1,62 +1,78 @@
|
|
|
1
|
-
const t = "
|
|
1
|
+
const t = "_field_mtlh9", i = "_fieldErrorLabel_Ydo80", e = "_fieldNotice_Gi8t0", n = "_label_ZF458", o = "_forgetByAgeField_FPhtE", c = "_customPolicyOption_XnYTh", s = "_advancedTabContent_lZsCo", a = "_advancedTabs_64uJh", _ = "_advancedTabActive_7Gdt2", d = "_advancedSettingsSelect_iG976", r = "_eventTabs_jx9ex", p = "_eventTab_pqCBd", l = "_eventTabHead_WfRJc", T = "_eventTabHeadTitle_Pxkrl", b = "_eventTabContent_5EcLX", f = "_addScriptButton_sngQZ", v = "_scriptItem_uike9", u = "_scriptHeader_Zr6xK", S = "_scriptTitle_je8nA", g = "_scriptPositionControls_wx8qF", O = "_scriptPathInput_FRbYR", m = "_scriptFooter_t9nVP", C = "_scriptOptions_yahN5", h = "_scriptOptionCheckbox_Xqn00", F = "_removeScriptButton_iTup8", B = "_scriptOptionTimeout_jRU1W", N = "_hasTimeOutSettings_7Vr2y", x = "_timeoutSettings_xbX9o", P = "_notificationTestField_7IXSB", H = "_notificationSettingsSection_Hf62u", y = "_notificationToggle_4xt2e", A = "_notificationSettings_X8F8e", I = "_testNotificationContainer_hS6w0", X = "_testNotificationButton_9tOKN", k = "_disabled_k7FZh", Z = "_testNotificationOptions_OX0Zx", E = {
|
|
2
2
|
field: t,
|
|
3
|
-
fieldErrorLabel:
|
|
4
|
-
fieldNotice:
|
|
5
|
-
label:
|
|
6
|
-
forgetByAgeField:
|
|
3
|
+
fieldErrorLabel: i,
|
|
4
|
+
fieldNotice: e,
|
|
5
|
+
label: n,
|
|
6
|
+
forgetByAgeField: o,
|
|
7
7
|
customPolicyOption: c,
|
|
8
8
|
advancedTabContent: s,
|
|
9
9
|
advancedTabs: a,
|
|
10
|
-
advancedTabActive:
|
|
11
|
-
advancedSettingsSelect:
|
|
12
|
-
eventTabs:
|
|
10
|
+
advancedTabActive: _,
|
|
11
|
+
advancedSettingsSelect: d,
|
|
12
|
+
eventTabs: r,
|
|
13
13
|
eventTab: p,
|
|
14
|
-
eventTabHead:
|
|
15
|
-
eventTabHeadTitle:
|
|
14
|
+
eventTabHead: l,
|
|
15
|
+
eventTabHeadTitle: T,
|
|
16
16
|
eventTabContent: b,
|
|
17
|
-
addScriptButton:
|
|
18
|
-
scriptItem:
|
|
19
|
-
scriptHeader:
|
|
20
|
-
scriptTitle:
|
|
17
|
+
addScriptButton: f,
|
|
18
|
+
scriptItem: v,
|
|
19
|
+
scriptHeader: u,
|
|
20
|
+
scriptTitle: S,
|
|
21
21
|
scriptPositionControls: g,
|
|
22
|
-
scriptPathInput:
|
|
23
|
-
scriptFooter:
|
|
22
|
+
scriptPathInput: O,
|
|
23
|
+
scriptFooter: m,
|
|
24
24
|
scriptOptions: C,
|
|
25
25
|
scriptOptionCheckbox: h,
|
|
26
|
-
removeScriptButton:
|
|
27
|
-
scriptOptionTimeout:
|
|
28
|
-
hasTimeOutSettings:
|
|
29
|
-
timeoutSettings:
|
|
26
|
+
removeScriptButton: F,
|
|
27
|
+
scriptOptionTimeout: B,
|
|
28
|
+
hasTimeOutSettings: N,
|
|
29
|
+
timeoutSettings: x,
|
|
30
|
+
notificationTestField: P,
|
|
31
|
+
notificationSettingsSection: H,
|
|
32
|
+
notificationToggle: y,
|
|
33
|
+
notificationSettings: A,
|
|
34
|
+
testNotificationContainer: I,
|
|
35
|
+
testNotificationButton: X,
|
|
36
|
+
disabled: k,
|
|
37
|
+
testNotificationOptions: Z
|
|
30
38
|
};
|
|
31
39
|
export {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
40
|
+
f as addScriptButton,
|
|
41
|
+
d as advancedSettingsSelect,
|
|
42
|
+
_ as advancedTabActive,
|
|
35
43
|
s as advancedTabContent,
|
|
36
44
|
a as advancedTabs,
|
|
37
45
|
c as customPolicyOption,
|
|
38
|
-
|
|
46
|
+
E as default,
|
|
47
|
+
k as disabled,
|
|
39
48
|
p as eventTab,
|
|
40
49
|
b as eventTabContent,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
50
|
+
l as eventTabHead,
|
|
51
|
+
T as eventTabHeadTitle,
|
|
52
|
+
r as eventTabs,
|
|
44
53
|
t as field,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
i as fieldErrorLabel,
|
|
55
|
+
e as fieldNotice,
|
|
56
|
+
o as forgetByAgeField,
|
|
57
|
+
N as hasTimeOutSettings,
|
|
58
|
+
n as label,
|
|
59
|
+
A as notificationSettings,
|
|
60
|
+
H as notificationSettingsSection,
|
|
61
|
+
P as notificationTestField,
|
|
62
|
+
y as notificationToggle,
|
|
63
|
+
F as removeScriptButton,
|
|
64
|
+
m as scriptFooter,
|
|
65
|
+
u as scriptHeader,
|
|
66
|
+
v as scriptItem,
|
|
54
67
|
h as scriptOptionCheckbox,
|
|
55
|
-
|
|
68
|
+
B as scriptOptionTimeout,
|
|
56
69
|
C as scriptOptions,
|
|
57
|
-
|
|
70
|
+
O as scriptPathInput,
|
|
58
71
|
g as scriptPositionControls,
|
|
59
|
-
|
|
60
|
-
|
|
72
|
+
S as scriptTitle,
|
|
73
|
+
X as testNotificationButton,
|
|
74
|
+
I as testNotificationContainer,
|
|
75
|
+
Z as testNotificationOptions,
|
|
76
|
+
x as timeoutSettings
|
|
61
77
|
};
|
|
62
78
|
//# sourceMappingURL=PlanSettings.module.scss.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlanSettings.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlanSettings.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeneralSettings.d.ts","sourceRoot":"","sources":["../../../../src/components/Settings/GeneralSettings/GeneralSettings.tsx"],"names":[],"mappings":"AASA,UAAU,oBAAoB;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;CACpD;AAED,QAAA,MAAM,eAAe,GAAI,oCAAoC,oBAAoB,
|
|
1
|
+
{"version":3,"file":"GeneralSettings.d.ts","sourceRoot":"","sources":["../../../../src/components/Settings/GeneralSettings/GeneralSettings.tsx"],"names":[],"mappings":"AASA,UAAU,oBAAoB;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;CACpD;AAED,QAAA,MAAM,eAAe,GAAI,oCAAoC,oBAAoB,4CAwFhF,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -2,14 +2,14 @@ import { jsxs as F, jsx as a } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as d } from "react";
|
|
3
3
|
import S from "../../common/ActionModal/ActionModal.js";
|
|
4
4
|
import t from "../../common/form/Input/Input.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import w from "../../common/form/Toggle/Toggle.js";
|
|
6
|
+
import v from "../../common/form/Tristate/Tristate.js";
|
|
7
7
|
import T from "../TwoFactorSetup/TwoFactorSetup.js";
|
|
8
8
|
import { useTheme as y } from "../../../context/ThemeContext.js";
|
|
9
9
|
import i from "./GeneralSettings.module.scss.js";
|
|
10
10
|
const L = ({ settings: e, settingsID: u, onUpdate: o }) => {
|
|
11
|
-
var
|
|
12
|
-
const { setTheme: f } = y(), [p, n] = d(!1), [h,
|
|
11
|
+
var m;
|
|
12
|
+
const { setTheme: f } = y(), [p, n] = d(!1), [h, c] = d(!1), { totp: r } = e || {}, s = r == null ? void 0 : r.secret, A = (l) => {
|
|
13
13
|
if (l === !0 && !s) {
|
|
14
14
|
n(!0);
|
|
15
15
|
return;
|
|
@@ -49,7 +49,7 @@ const L = ({ settings: e, settingsID: u, onUpdate: o }) => {
|
|
|
49
49
|
}
|
|
50
50
|
) }),
|
|
51
51
|
/* @__PURE__ */ a("div", { className: i.field, children: /* @__PURE__ */ a(
|
|
52
|
-
|
|
52
|
+
v,
|
|
53
53
|
{
|
|
54
54
|
label: "Color Scheme",
|
|
55
55
|
fieldValue: e.theme,
|
|
@@ -62,7 +62,15 @@ const L = ({ settings: e, settingsID: u, onUpdate: o }) => {
|
|
|
62
62
|
inline: !1
|
|
63
63
|
}
|
|
64
64
|
) }),
|
|
65
|
-
/* @__PURE__ */ a("div", { className: i.field, children: /* @__PURE__ */ a(
|
|
65
|
+
/* @__PURE__ */ a("div", { className: i.field, children: /* @__PURE__ */ a(
|
|
66
|
+
w,
|
|
67
|
+
{
|
|
68
|
+
label: "Enable Two-Factor Authentication (2FA)",
|
|
69
|
+
fieldValue: ((m = e == null ? void 0 : e.totp) == null ? void 0 : m.enabled) || !1,
|
|
70
|
+
onUpdate: (l) => A(l),
|
|
71
|
+
inline: !1
|
|
72
|
+
}
|
|
73
|
+
) }),
|
|
66
74
|
p && /* @__PURE__ */ a(
|
|
67
75
|
S,
|
|
68
76
|
{
|
|
@@ -74,11 +82,11 @@ const L = ({ settings: e, settingsID: u, onUpdate: o }) => {
|
|
|
74
82
|
title: "Yes, Enable 2FA",
|
|
75
83
|
type: "default",
|
|
76
84
|
isPending: !1,
|
|
77
|
-
action: () =>
|
|
85
|
+
action: () => c(!0)
|
|
78
86
|
}
|
|
79
87
|
}
|
|
80
88
|
),
|
|
81
|
-
h && /* @__PURE__ */ a(T, { id: u, close: () =>
|
|
89
|
+
h && /* @__PURE__ */ a(T, { id: u, close: () => c(!1) })
|
|
82
90
|
] });
|
|
83
91
|
};
|
|
84
92
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeneralSettings.js","sources":["../../../../src/components/Settings/GeneralSettings/GeneralSettings.tsx"],"sourcesContent":["import { useState } from 'react';\r\nimport { ActionModal } from '../..';\r\nimport { useTheme } from '../../../context/ThemeContext';\r\nimport Input from '../../common/form/Input/Input';\r\nimport Toggle from '../../common/form/Toggle/Toggle';\r\nimport Tristate from '../../common/form/Tristate/Tristate';\r\nimport TwoFactorSetup from '../TwoFactorSetup/TwoFactorSetup';\r\nimport classes from './GeneralSettings.module.scss';\r\n\r\ninterface GeneralSettingsProps {\r\n settingsID: number;\r\n settings: Record<string, any>;\r\n onUpdate: (settings: Record<string, any>) => void;\r\n}\r\n\r\nconst GeneralSettings = ({ settings, settingsID, onUpdate }: GeneralSettingsProps) => {\r\n const { setTheme } = useTheme();\r\n const [show2FASetupConfirm, setShow2FASetupConfirm] = useState(false);\r\n const [show2FASetup, setShow2FASetup] = useState(false);\r\n\r\n const { totp } = settings || {};\r\n const is2FASetupComplete = totp?.secret;\r\n\r\n const update2FASetting = (enabled: boolean) => {\r\n if (enabled === true && !is2FASetupComplete) {\r\n setShow2FASetupConfirm(true);\r\n return;\r\n } else {\r\n onUpdate({ ...settings, totp: { ...totp, enabled } });\r\n }\r\n };\r\n\r\n const handleThemeChange = (newThemeValue: 'auto' | 'light' | 'dark') => {\r\n setTheme(newThemeValue);\r\n onUpdate({ ...settings, theme: newThemeValue });\r\n };\r\n\r\n return (\r\n <div>\r\n <div className={classes.field}>\r\n <Input\r\n label=\"App Instance Title\"\r\n fieldValue={(settings?.title || '') as string}\r\n onUpdate={(val) => onUpdate({ ...settings, title: val })}\r\n inline={false}\r\n />\r\n </div>\r\n <div className={classes.field}>\r\n <Input\r\n label=\"App Instance Description\"\r\n fieldValue={(settings?.description || '') as string}\r\n onUpdate={(val) => onUpdate({ ...settings, description: val })}\r\n inline={false}\r\n />\r\n </div>\r\n <div className={classes.field}>\r\n <Input\r\n label=\"Admin Email\"\r\n fieldValue={settings.admin_email || ''}\r\n onUpdate={(val) => onUpdate({ ...settings, admin_email: val })}\r\n type=\"email\"\r\n placeholder=\"johndoe@mail.com\"\r\n inline={false}\r\n />\r\n </div>\r\n <div className={classes.field}>\r\n <Tristate\r\n label=\"Color Scheme\"\r\n fieldValue={settings.theme as string}\r\n options={[\r\n { label: 'Auto', value: 'auto' },\r\n { label: 'Dark', value: 'dark' },\r\n { label: 'Light', value: 'light' },\r\n ]}\r\n onUpdate={(val: string) => handleThemeChange(val as 'auto' | 'light' | 'dark')}\r\n inline={false}\r\n />\r\n </div>\r\n <div className={classes.field}>\r\n <Toggle
|
|
1
|
+
{"version":3,"file":"GeneralSettings.js","sources":["../../../../src/components/Settings/GeneralSettings/GeneralSettings.tsx"],"sourcesContent":["import { useState } from 'react';\r\nimport { ActionModal } from '../..';\r\nimport { useTheme } from '../../../context/ThemeContext';\r\nimport Input from '../../common/form/Input/Input';\r\nimport Toggle from '../../common/form/Toggle/Toggle';\r\nimport Tristate from '../../common/form/Tristate/Tristate';\r\nimport TwoFactorSetup from '../TwoFactorSetup/TwoFactorSetup';\r\nimport classes from './GeneralSettings.module.scss';\r\n\r\ninterface GeneralSettingsProps {\r\n settingsID: number;\r\n settings: Record<string, any>;\r\n onUpdate: (settings: Record<string, any>) => void;\r\n}\r\n\r\nconst GeneralSettings = ({ settings, settingsID, onUpdate }: GeneralSettingsProps) => {\r\n const { setTheme } = useTheme();\r\n const [show2FASetupConfirm, setShow2FASetupConfirm] = useState(false);\r\n const [show2FASetup, setShow2FASetup] = useState(false);\r\n\r\n const { totp } = settings || {};\r\n const is2FASetupComplete = totp?.secret;\r\n\r\n const update2FASetting = (enabled: boolean) => {\r\n if (enabled === true && !is2FASetupComplete) {\r\n setShow2FASetupConfirm(true);\r\n return;\r\n } else {\r\n onUpdate({ ...settings, totp: { ...totp, enabled } });\r\n }\r\n };\r\n\r\n const handleThemeChange = (newThemeValue: 'auto' | 'light' | 'dark') => {\r\n setTheme(newThemeValue);\r\n onUpdate({ ...settings, theme: newThemeValue });\r\n };\r\n\r\n return (\r\n <div>\r\n <div className={classes.field}>\r\n <Input\r\n label=\"App Instance Title\"\r\n fieldValue={(settings?.title || '') as string}\r\n onUpdate={(val) => onUpdate({ ...settings, title: val })}\r\n inline={false}\r\n />\r\n </div>\r\n <div className={classes.field}>\r\n <Input\r\n label=\"App Instance Description\"\r\n fieldValue={(settings?.description || '') as string}\r\n onUpdate={(val) => onUpdate({ ...settings, description: val })}\r\n inline={false}\r\n />\r\n </div>\r\n <div className={classes.field}>\r\n <Input\r\n label=\"Admin Email\"\r\n fieldValue={settings.admin_email || ''}\r\n onUpdate={(val) => onUpdate({ ...settings, admin_email: val })}\r\n type=\"email\"\r\n placeholder=\"johndoe@mail.com\"\r\n inline={false}\r\n />\r\n </div>\r\n <div className={classes.field}>\r\n <Tristate\r\n label=\"Color Scheme\"\r\n fieldValue={settings.theme as string}\r\n options={[\r\n { label: 'Auto', value: 'auto' },\r\n { label: 'Dark', value: 'dark' },\r\n { label: 'Light', value: 'light' },\r\n ]}\r\n onUpdate={(val: string) => handleThemeChange(val as 'auto' | 'light' | 'dark')}\r\n inline={false}\r\n />\r\n </div>\r\n <div className={classes.field}>\r\n <Toggle\r\n label=\"Enable Two-Factor Authentication (2FA)\"\r\n fieldValue={settings?.totp?.enabled || false}\r\n onUpdate={(val) => update2FASetting(val)}\r\n inline={false}\r\n />\r\n </div>\r\n {show2FASetupConfirm && (\r\n <ActionModal\r\n title={`Enable Two-Factor Authentication (2FA)`}\r\n message={`Are you sure you want to enable Two-Factor Authentication (2FA) to secure Pluton Login? You will be required to use an authenticator app to login if you enable this feature.`}\r\n closeModal={() => setShow2FASetupConfirm(false)}\r\n width=\"420px\"\r\n primaryAction={{\r\n title: `Yes, Enable 2FA`,\r\n type: 'default',\r\n isPending: false,\r\n action: () => setShow2FASetup(true),\r\n }}\r\n />\r\n )}\r\n {show2FASetup && <TwoFactorSetup id={settingsID} close={() => setShow2FASetup(false)} />}\r\n </div>\r\n );\r\n};\r\n\r\nexport default GeneralSettings;\r\n"],"names":["GeneralSettings","settings","settingsID","onUpdate","setTheme","useTheme","show2FASetupConfirm","setShow2FASetupConfirm","useState","show2FASetup","setShow2FASetup","totp","is2FASetupComplete","update2FASetting","enabled","handleThemeChange","newThemeValue","jsx","classes","Input","val","Tristate","Toggle","_a","ActionModal","TwoFactorSetup"],"mappings":";;;;;;;;;AAeA,MAAMA,IAAkB,CAAC,EAAE,UAAAC,GAAU,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vB,GAAY,OAAO,MAAMQ,EAAgB,EAAK,EAAA,CAAG;AAAA,EAAA,GACzF;AAEN;"}
|
|
@@ -1,34 +1,50 @@
|
|
|
1
|
-
const t = "
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const t = "_addStorage_OIwtX", o = "_loader_hFNvR", n = "_field_vxLnx", e = "_fieldErrorLabel_JQpkc", a = "_label_JAV7R", c = "_input_30oZl", r = "_inputHasError_mu8Ps", s = "_storageType_9j8NF", u = "_createButton_N2zgD", _ = "_advancedOptions_Vi5K5", d = "_advancedButton_O4koz", i = "_advancedButtonActive_cxq7u", h = "_authSettings_BE6ir", l = "_oauthDoc_8suty", B = "_codeBlock_tpOVA", p = "_oauthContainer_eLxGx", v = "_success_ZETFH", g = "_error_mS7QY", A = "_oauthButton_MhjWw", E = "_oauthAuthorizeBtn_mw4J6", f = "_oauthInnerBtn_5DQud", x = "_oauthProgress_9x8Q3", S = {
|
|
2
|
+
addStorage: t,
|
|
3
|
+
loader: o,
|
|
4
|
+
field: n,
|
|
4
5
|
fieldErrorLabel: e,
|
|
5
6
|
label: a,
|
|
6
|
-
input:
|
|
7
|
-
inputHasError:
|
|
8
|
-
storageType:
|
|
9
|
-
createButton:
|
|
10
|
-
advancedOptions:
|
|
11
|
-
advancedButton:
|
|
12
|
-
advancedButtonActive:
|
|
13
|
-
authSettings:
|
|
14
|
-
oauthDoc:
|
|
15
|
-
codeBlock:
|
|
7
|
+
input: c,
|
|
8
|
+
inputHasError: r,
|
|
9
|
+
storageType: s,
|
|
10
|
+
createButton: u,
|
|
11
|
+
advancedOptions: _,
|
|
12
|
+
advancedButton: d,
|
|
13
|
+
advancedButtonActive: i,
|
|
14
|
+
authSettings: h,
|
|
15
|
+
oauthDoc: l,
|
|
16
|
+
codeBlock: B,
|
|
17
|
+
oauthContainer: p,
|
|
18
|
+
success: v,
|
|
19
|
+
error: g,
|
|
20
|
+
oauthButton: A,
|
|
21
|
+
oauthAuthorizeBtn: E,
|
|
22
|
+
oauthInnerBtn: f,
|
|
23
|
+
oauthProgress: x
|
|
16
24
|
};
|
|
17
25
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
t as addStorage,
|
|
27
|
+
d as advancedButton,
|
|
28
|
+
i as advancedButtonActive,
|
|
29
|
+
_ as advancedOptions,
|
|
30
|
+
h as authSettings,
|
|
31
|
+
B as codeBlock,
|
|
32
|
+
u as createButton,
|
|
33
|
+
S as default,
|
|
34
|
+
g as error,
|
|
35
|
+
n as field,
|
|
26
36
|
e as fieldErrorLabel,
|
|
27
|
-
|
|
28
|
-
|
|
37
|
+
c as input,
|
|
38
|
+
r as inputHasError,
|
|
29
39
|
a as label,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
40
|
+
o as loader,
|
|
41
|
+
E as oauthAuthorizeBtn,
|
|
42
|
+
A as oauthButton,
|
|
43
|
+
p as oauthContainer,
|
|
44
|
+
l as oauthDoc,
|
|
45
|
+
f as oauthInnerBtn,
|
|
46
|
+
x as oauthProgress,
|
|
47
|
+
s as storageType,
|
|
48
|
+
v as success
|
|
33
49
|
};
|
|
34
50
|
//# sourceMappingURL=AddStorage.module.scss.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddStorage.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AddStorage.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageAuthSettings.d.ts","sourceRoot":"","sources":["../../../../src/components/Storage/StorageAuthSettings/StorageAuthSettings.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"StorageAuthSettings.d.ts","sourceRoot":"","sources":["../../../../src/components/Storage/StorageAuthSettings/StorageAuthSettings.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAO9D,UAAU,wBAAwB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;IACpD,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,CAAC,WAAW,EAAE,wBAAwB,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;IACtE,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/C;AAID,QAAA,MAAM,mBAAmB,GAAI,oGAS1B,wBAAwB,4CAgO1B,CAAC;AACF,eAAe,mBAAmB,CAAC"}
|