@plutonhq/core-frontend 0.1.33 → 0.1.34

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/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.33",
4
+ "version": "0.1.34",
5
5
  "author": "Plutonhq",
6
6
  "license": "Apache-2.0",
7
7
  "publishConfig": {
@@ -44,8 +44,8 @@ const DeviceResticSettings = ({ settings = {}, onUpdate }: DeviceResticSettingsP
44
44
  <div className={classes.field}>
45
45
  <NumberInput
46
46
  label="Packet Size (MB)"
47
- fieldValue={settings?.packSize ? parseInt(settings.packSize.replace('MiB', ''), 10) : ''}
48
- onUpdate={(val) => onUpdate({ ...settings, packSize: val ? val + 'MiB' : '' })}
47
+ fieldValue={settings?.packSize ? parseInt(settings.packSize, 10) : ''}
48
+ onUpdate={(val) => onUpdate({ ...settings, packSize: val ? val.toString() : '' })}
49
49
  min={0}
50
50
  max={4000}
51
51
  hint="Packs are blobs of data, which are encrypted and stored in the repository. Increasing the pack size requires more disk space for temporary pack files to be created before uploading."
@@ -34,8 +34,8 @@ const PlanPerformanceSettings = ({ plan, onUpdate }: PlanPerformanceSettingsProp
34
34
  <div className={classes.field}>
35
35
  <NumberInput
36
36
  label="Packet Size (MB)"
37
- fieldValue={perfSettings?.packSize ? parseInt(perfSettings.packSize.replace('MiB', ''), 10) : ''}
38
- onUpdate={(val) => onUpdate({ ...perfSettings, packSize: val + 'MiB' })}
37
+ fieldValue={perfSettings?.packSize ? parseInt(perfSettings.packSize, 10) : ''}
38
+ onUpdate={(val) => onUpdate({ ...perfSettings, packSize: val ? val.toString() : '' })}
39
39
  min={0}
40
40
  max={4000}
41
41
  />
@@ -44,7 +44,7 @@
44
44
  border: 1px solid var(--line-color);
45
45
  border-radius: 4px;
46
46
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
47
- min-width: 70px;
47
+ min-width: 80px;
48
48
 
49
49
  li {
50
50
  padding: 4px 10px;
@@ -10,12 +10,12 @@ ChartJS.register(CategoryScale, LinearScale, PointElement, LineElement, Filler,
10
10
 
11
11
  type RangeKey = '7d' | '14d' | '1m' | '3m' | '6m';
12
12
 
13
- const RANGE_OPTIONS: { key: RangeKey; label: string; days: number }[] = [
14
- { key: '7d', label: '7d', days: 7 },
15
- { key: '14d', label: '14d', days: 14 },
16
- { key: '1m', label: '1m', days: 30 },
17
- { key: '3m', label: '3m', days: 90 },
18
- { key: '6m', label: '6m', days: 180 },
13
+ const RANGE_OPTIONS: { key: RangeKey; label: string; labelFull: string; days: number }[] = [
14
+ { key: '7d', label: '7d', labelFull: '7 days', days: 7 },
15
+ { key: '14d', label: '14d', labelFull: '14 days', days: 14 },
16
+ { key: '1m', label: '1m', labelFull: '1 month', days: 30 },
17
+ { key: '3m', label: '3m', labelFull: '3 months', days: 90 },
18
+ { key: '6m', label: '6m', labelFull: '6 months', days: 180 },
19
19
  ];
20
20
 
21
21
  interface PlanSizeChartProps {
@@ -42,7 +42,10 @@ const PlanSizeChart = ({ backups }: PlanSizeChartProps) => {
42
42
 
43
43
  const filtered = useMemo(() => {
44
44
  const cutoff = Date.now() - activeRange.days * 24 * 60 * 60 * 1000;
45
- return [...(backups || [])]
45
+ // if there is only one backup duplicate the first backup to make 2 items
46
+ // so that the graph is never empty and shows the size even if there is only one backup in the selected range
47
+ const theBackups = backups && backups.length === 1 ? [backups[0], backups[0]] : backups || [];
48
+ return [...theBackups]
46
49
  .filter((b) => {
47
50
  const t = new Date(b.started).getTime();
48
51
  return !isNaN(t) && t >= cutoff;
@@ -141,7 +144,7 @@ const PlanSizeChart = ({ backups }: PlanSizeChartProps) => {
141
144
  setOpen(false);
142
145
  }}
143
146
  >
144
- {opt.label}
147
+ {opt.labelFull}
145
148
  </li>
146
149
  ))}
147
150
  </ul>
@@ -163,6 +163,13 @@
163
163
  max-width: 70px;
164
164
  }
165
165
 
166
+ .fileDate {
167
+ max-width: 150px;
168
+ white-space: nowrap;
169
+ overflow: hidden;
170
+ text-overflow: ellipsis;
171
+ }
172
+
166
173
  .selected {
167
174
  background: #e6f7ff;
168
175
  }