@plutonhq/core-frontend 0.1.31 → 0.1.32

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.
@@ -161,6 +161,10 @@ button {
161
161
  border-right: 1px solid var(--line-color);
162
162
  }
163
163
 
164
+ .linebreak-tooltip-content {
165
+ line-break: anywhere;
166
+ }
167
+
164
168
  .loadingScreen {
165
169
  width: 100%;
166
170
  height: 100vh;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@plutonhq/core-frontend",
3
3
  "description": "Pluton Core Frontend Library",
4
- "version": "0.1.31",
4
+ "version": "0.1.32",
5
5
  "author": "Plutonhq",
6
6
  "license": "Apache-2.0",
7
7
  "publishConfig": {
@@ -259,4 +259,6 @@
259
259
  padding: 10px;
260
260
  word-break: break-word;
261
261
  color: var(--error-button-color);
262
+ max-height: 400px;
263
+ overflow: auto;
262
264
  }
@@ -154,8 +154,8 @@ const BackupEvents = ({ id, type = 'backup', sourceId, sourceType, planId, inPro
154
154
  )}
155
155
  </div>
156
156
  {showError && (
157
- <Modal title="Error Details" closeModal={() => setShowError(false)} width="400px">
158
- <div className={classes.errorDetails}>
157
+ <Modal title="Error Details" closeModal={() => setShowError(false)} width={'400px'}>
158
+ <div className={classes.errorDetails} data-length={showError.length}>
159
159
  {(() => {
160
160
  if (typeof showError === 'string') {
161
161
  if (showError.startsWith('main-')) {
@@ -40,6 +40,7 @@
40
40
  color: var(--error-button-color);
41
41
  margin-left: 0.5rem;
42
42
  font-size: 0.9em;
43
+ cursor: pointer;
43
44
  i {
44
45
  font-style: normal;
45
46
  }
@@ -148,7 +148,12 @@ const BackupProgress = ({ item, sourceId, sourceType, planId, type = 'backup' }:
148
148
  {item.errorMsg && (
149
149
  <span className={classes.backupError}>
150
150
  <Icon type="error-circle-filled" size={13} />{' '}
151
- <i data-tooltip-id="htmlToolTip" data-tooltip-place="top" data-tooltip-html={item.errorMsg}>
151
+ <i
152
+ data-tooltip-id="htmlToolTip"
153
+ data-tooltip-place="top"
154
+ data-tooltip-html={`<div class="linebreak-tooltip-content">${item.errorMsg.slice(0, 120) + (item.errorMsg.length > 120 ? '...' : '')}</div>`}
155
+ onClick={() => setShowProgressDetails(true)}
156
+ >
152
157
  <u>Error</u> Occurred.
153
158
  </i>{' '}
154
159
  Retrying...
@@ -233,6 +233,22 @@
233
233
  }
234
234
  }
235
235
 
236
+ .errorDetailsModal {
237
+ width: 100%;
238
+ max-height: 500px;
239
+ overflow: auto;
240
+ font-family: monospace;
241
+ box-sizing: border-box;
242
+ border-radius: 6px;
243
+ background-color: var(--primary-color-lighter);
244
+ p {
245
+ border-bottom: 1px solid;
246
+ padding: 12px;
247
+ margin: 0;
248
+ border-color: var(--line-color);
249
+ }
250
+ }
251
+
236
252
  @media only screen and (max-width: 768px) {
237
253
  .backupsTable {
238
254
  overflow: auto;
@@ -21,7 +21,7 @@ import BackupEvents from '../BackupEvents/BackupEvents';
21
21
  import Input from '../../common/form/Input/Input';
22
22
  import MirrorStatusBadge from '../Mirrors/MirrorStatusBadge';
23
23
  import MirrorStorageSelectorModal from '../Mirrors/MirrorStorageSelectorModal';
24
- import { SidePanel, SnapshotViewer } from '../..';
24
+ import { Modal, SidePanel, SnapshotViewer } from '../..';
25
25
 
26
26
  const DownloadLabel = ({ download, downloadBackup }: { download: Backup['download']; downloadBackup: () => void }) => {
27
27
  if (download?.status === 'started') {
@@ -101,6 +101,7 @@ const Backups = ({
101
101
  const [showRestoreModal, setShowRestoreModal] = useState<Backup | false>(false);
102
102
  const [showBackupEvents, setShowBackupEvents] = useState<false | string>(false);
103
103
  const [showSnapshotViewer, setShowSnapshotViewer] = useState<Backup | false>(false);
104
+ const [showBackupError, setShowBackupError] = useState<string | false>(false);
104
105
  const [showEditModal, setShowEditModal] = useState<Backup | false>(false);
105
106
  const [showStorageSelector, setShowStorageSelector] = useState<Backup | false>(false);
106
107
  const queryClient = useQueryClient();
@@ -240,8 +241,9 @@ const Backups = ({
240
241
  <div
241
242
  className={`${classes.status} ${errorMsg ? classes.statusHasError : ''}`}
242
243
  data-tooltip-id="htmlToolTip"
243
- data-tooltip-html={`<div><string>Error</string>: ${errorMsg}</div>`}
244
+ data-tooltip-html={`<div class="linebreak-tooltip-content"><string>Error</string>: ${errorMsg?.slice(0, 120) + (errorMsg && errorMsg.length > 120 ? '...' : '')}</div>`}
244
245
  data-tooltip-hidden={!errorMsg}
246
+ onClick={() => errorMsg && errorMsg.length > 120 && setShowBackupError(errorMsg)}
245
247
  >
246
248
  <StatusLabel status={status} hasError={!!errorMsg} />
247
249
  </div>
@@ -453,6 +455,15 @@ const Backups = ({
453
455
  />
454
456
  </SidePanel>
455
457
  )}
458
+ {showBackupError && (
459
+ <Modal title="Error Details" closeModal={() => setShowBackupError(false)} width={'600px'}>
460
+ <div className={`${classes.errorDetailsModal} styled__scrollbar`}>
461
+ {showBackupError.split('\n').map((line, index) => (
462
+ <p key={index}>{line}</p>
463
+ ))}
464
+ </div>
465
+ </Modal>
466
+ )}
456
467
  </div>
457
468
  );
458
469
  };
@@ -161,6 +161,10 @@ button {
161
161
  border-right: 1px solid var(--line-color);
162
162
  }
163
163
 
164
+ .linebreak-tooltip-content {
165
+ line-break: anywhere;
166
+ }
167
+
164
168
  .loadingScreen {
165
169
  width: 100%;
166
170
  height: 100vh;