selfstore 1.0.0 → 1.1.0
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/README.md +4 -0
- package/dist/advanced.d.ts +5 -5
- package/dist/advanced.js +7 -7
- package/dist/backups.d.ts +1 -1
- package/dist/backups.js +1 -1
- package/dist/backups.js.map +1 -1
- package/dist/{cache-lock-LZILZNLP.js → cache-lock-NXIR6JRB.js} +3 -3
- package/dist/{cache-lock-LZILZNLP.js.map → cache-lock-NXIR6JRB.js.map} +1 -1
- package/dist/{chunk-SGISYMT5.js → chunk-43BJDRPT.js} +2 -2
- package/dist/{chunk-SGISYMT5.js.map → chunk-43BJDRPT.js.map} +1 -1
- package/dist/{chunk-FDPAKHQS.js → chunk-6746AL4I.js} +9 -4
- package/dist/chunk-6746AL4I.js.map +1 -0
- package/dist/{chunk-ATUPHVLG.js → chunk-CUFKME4S.js} +5 -5
- package/dist/chunk-CUFKME4S.js.map +1 -0
- package/dist/{chunk-OWLX6PNT.js → chunk-KHER6MWR.js} +26 -8
- package/dist/chunk-KHER6MWR.js.map +1 -0
- package/dist/{chunk-IBIEKK36.js → chunk-SKWHKM25.js} +24 -5
- package/dist/chunk-SKWHKM25.js.map +1 -0
- package/dist/{chunk-JB4JHM7V.js → chunk-SRKUHFRG.js} +17 -8
- package/dist/chunk-SRKUHFRG.js.map +1 -0
- package/dist/{chunk-CUWB5EWF.js → chunk-TEIAFKFS.js} +63 -22
- package/dist/chunk-TEIAFKFS.js.map +1 -0
- package/dist/{chunk-BJ3RUMGI.js → chunk-UWVAKBU4.js} +3 -3
- package/dist/{chunk-BJ3RUMGI.js.map → chunk-UWVAKBU4.js.map} +1 -1
- package/dist/{chunk-N4RPMX3Y.js → chunk-XI3MGK4M.js} +120 -30
- package/dist/chunk-XI3MGK4M.js.map +1 -0
- package/dist/{drive-Bv94UM8b.d.ts → drive-DNiDXBDe.d.ts} +7 -2
- package/dist/flows.d.ts +2 -2
- package/dist/flows.js +7 -7
- package/dist/flows.js.map +1 -1
- package/dist/groups.js +3 -3
- package/dist/groups.js.map +1 -1
- package/dist/households.d.ts +1 -1
- package/dist/households.js +10 -4
- package/dist/households.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +14 -11
- package/dist/index.js.map +1 -1
- package/dist/{local-2py_vGGy.d.ts → local-DsXG7QW7.d.ts} +2 -2
- package/dist/local-KIP25T7I.js +7 -0
- package/dist/{local-AM22RWRR.js.map → local-KIP25T7I.js.map} +1 -1
- package/dist/{store-ChIGEOph.d.ts → store-2RnED1Vq.d.ts} +5 -0
- package/dist/sync.js +1 -1
- package/dist/widgets.d.ts +2 -2
- package/dist/widgets.js +445 -86
- package/dist/widgets.js.map +1 -1
- package/package.json +129 -97
- package/dist/chunk-ATUPHVLG.js.map +0 -1
- package/dist/chunk-CUWB5EWF.js.map +0 -1
- package/dist/chunk-FDPAKHQS.js.map +0 -1
- package/dist/chunk-IBIEKK36.js.map +0 -1
- package/dist/chunk-JB4JHM7V.js.map +0 -1
- package/dist/chunk-N4RPMX3Y.js.map +0 -1
- package/dist/chunk-OWLX6PNT.js.map +0 -1
- package/dist/local-AM22RWRR.js +0 -7
package/dist/widgets.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { connectFlow, shareFlow, joinFlow } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
1
|
+
import { connectFlow, shareFlow, joinFlow } from './chunk-CUFKME4S.js';
|
|
2
|
+
import './chunk-TEIAFKFS.js';
|
|
3
|
+
import './chunk-SRKUHFRG.js';
|
|
4
|
+
import './chunk-43BJDRPT.js';
|
|
5
|
+
import './chunk-KHER6MWR.js';
|
|
6
6
|
import './chunk-QBCU7OOP.js';
|
|
7
|
-
import './chunk-
|
|
7
|
+
import './chunk-6746AL4I.js';
|
|
8
8
|
import './chunk-VBFMMR7Q.js';
|
|
9
9
|
|
|
10
10
|
// src/widgets/base.ts
|
|
@@ -377,7 +377,7 @@ var FlowWidget = class extends HTMLElement {
|
|
|
377
377
|
/** Rebuild the body, keeping the focused input's value and focus across the
|
|
378
378
|
* rebuild (inputs carry data-keep so typing survives a snapshot change). */
|
|
379
379
|
rerender() {
|
|
380
|
-
let active
|
|
380
|
+
let active;
|
|
381
381
|
try {
|
|
382
382
|
active = this.root.activeElement;
|
|
383
383
|
} catch {
|
|
@@ -629,7 +629,11 @@ var SelfstoreConnectElement = class extends FlowWidget {
|
|
|
629
629
|
into.append(
|
|
630
630
|
h(
|
|
631
631
|
"button",
|
|
632
|
-
{
|
|
632
|
+
{
|
|
633
|
+
part: "link advanced-link",
|
|
634
|
+
"data-kind": kind,
|
|
635
|
+
onclick: () => this.#flow?.choose(kind)
|
|
636
|
+
},
|
|
633
637
|
this.t(`connect.${kind}`)
|
|
634
638
|
)
|
|
635
639
|
);
|
|
@@ -644,9 +648,7 @@ var SelfstoreConnectElement = class extends FlowWidget {
|
|
|
644
648
|
h("div", { part: "title" }, this.t(tabbed ? "connect.server" : `connect.${kind}`))
|
|
645
649
|
];
|
|
646
650
|
if (tabbed) children.push(this.serverTabs(kind));
|
|
647
|
-
children.push(
|
|
648
|
-
...kind === "s3" ? this.s3FormChildren(flow) : this.webdavFormChildren(flow)
|
|
649
|
-
);
|
|
651
|
+
children.push(...kind === "s3" ? this.s3FormChildren(flow) : this.webdavFormChildren(flow));
|
|
650
652
|
into.append(...children);
|
|
651
653
|
return;
|
|
652
654
|
}
|
|
@@ -705,7 +707,9 @@ var SelfstoreConnectElement = class extends FlowWidget {
|
|
|
705
707
|
{
|
|
706
708
|
part: "eye",
|
|
707
709
|
type: "button",
|
|
708
|
-
"aria-label": this.t(
|
|
710
|
+
"aria-label": this.t(
|
|
711
|
+
this.#pwVisible ? "connect.password.hide" : "connect.password.show"
|
|
712
|
+
),
|
|
709
713
|
"aria-pressed": this.#pwVisible ? "true" : "false",
|
|
710
714
|
onclick: () => this.togglePassword()
|
|
711
715
|
},
|
|
@@ -723,7 +727,11 @@ var SelfstoreConnectElement = class extends FlowWidget {
|
|
|
723
727
|
{ part: "row" },
|
|
724
728
|
h(
|
|
725
729
|
"button",
|
|
726
|
-
{
|
|
730
|
+
{
|
|
731
|
+
part: "button button-primary",
|
|
732
|
+
disabled: s.busy,
|
|
733
|
+
onclick: () => this.submitPassword()
|
|
734
|
+
},
|
|
727
735
|
this.t("connect.password.submit")
|
|
728
736
|
),
|
|
729
737
|
// Cancel is never disabled, even mid-trial-read: a hung leg must
|
|
@@ -757,7 +765,9 @@ var SelfstoreConnectElement = class extends FlowWidget {
|
|
|
757
765
|
)
|
|
758
766
|
);
|
|
759
767
|
}
|
|
760
|
-
into.append(
|
|
768
|
+
into.append(
|
|
769
|
+
h("button", { part: "link", onclick: () => this.cancel() }, this.t("connect.cancel"))
|
|
770
|
+
);
|
|
761
771
|
return;
|
|
762
772
|
}
|
|
763
773
|
if (s.step === "connected") {
|
|
@@ -765,17 +775,29 @@ var SelfstoreConnectElement = class extends FlowWidget {
|
|
|
765
775
|
h(
|
|
766
776
|
"div",
|
|
767
777
|
{ part: "status status-ok" },
|
|
768
|
-
h(
|
|
778
|
+
h(
|
|
779
|
+
"div",
|
|
780
|
+
{ part: "title" },
|
|
781
|
+
this.t(s.outcome === "manual" ? "connect.done.manual" : "connect.done")
|
|
782
|
+
)
|
|
769
783
|
)
|
|
770
784
|
);
|
|
771
785
|
return;
|
|
772
786
|
}
|
|
773
787
|
into.append(
|
|
774
|
-
h(
|
|
788
|
+
h(
|
|
789
|
+
"div",
|
|
790
|
+
{ part: "status status-error" },
|
|
791
|
+
h("div", { part: "title" }, this.errorText(s.error?.labelKey))
|
|
792
|
+
),
|
|
775
793
|
h(
|
|
776
794
|
"div",
|
|
777
795
|
{ part: "row" },
|
|
778
|
-
h(
|
|
796
|
+
h(
|
|
797
|
+
"button",
|
|
798
|
+
{ part: "button button-primary", onclick: () => flow.retry() },
|
|
799
|
+
this.t("connect.retry")
|
|
800
|
+
),
|
|
779
801
|
h("button", { part: "button", onclick: () => this.cancel() }, this.t("connect.cancel"))
|
|
780
802
|
)
|
|
781
803
|
);
|
|
@@ -798,7 +820,11 @@ var SelfstoreConnectElement = class extends FlowWidget {
|
|
|
798
820
|
actions.append(
|
|
799
821
|
h(
|
|
800
822
|
"button",
|
|
801
|
-
{
|
|
823
|
+
{
|
|
824
|
+
part: "button button-primary",
|
|
825
|
+
"data-action": "create",
|
|
826
|
+
onclick: () => this.#flow?.choose("file", "create")
|
|
827
|
+
},
|
|
802
828
|
this.t("connect.file.new")
|
|
803
829
|
)
|
|
804
830
|
);
|
|
@@ -807,7 +833,11 @@ var SelfstoreConnectElement = class extends FlowWidget {
|
|
|
807
833
|
actions.append(
|
|
808
834
|
h(
|
|
809
835
|
"button",
|
|
810
|
-
{
|
|
836
|
+
{
|
|
837
|
+
part: "button",
|
|
838
|
+
"data-action": "open",
|
|
839
|
+
onclick: () => this.#flow?.choose("file", "open")
|
|
840
|
+
},
|
|
811
841
|
this.t("connect.file.open")
|
|
812
842
|
)
|
|
813
843
|
);
|
|
@@ -923,7 +953,12 @@ var SelfstoreConnectElement = class extends FlowWidget {
|
|
|
923
953
|
picked.help,
|
|
924
954
|
picked.helpUrl ? h(
|
|
925
955
|
"a",
|
|
926
|
-
{
|
|
956
|
+
{
|
|
957
|
+
part: "link webdav-help",
|
|
958
|
+
href: picked.helpUrl,
|
|
959
|
+
target: "_blank",
|
|
960
|
+
rel: "noopener noreferrer"
|
|
961
|
+
},
|
|
927
962
|
` ${this.t("connect.webdav.help.more")}`
|
|
928
963
|
) : null
|
|
929
964
|
)
|
|
@@ -933,7 +968,11 @@ var SelfstoreConnectElement = class extends FlowWidget {
|
|
|
933
968
|
h(
|
|
934
969
|
"div",
|
|
935
970
|
{ part: "row" },
|
|
936
|
-
h(
|
|
971
|
+
h(
|
|
972
|
+
"button",
|
|
973
|
+
{ part: "button button-primary", onclick: () => this.submitWebdav() },
|
|
974
|
+
this.t("connect.webdav.submit")
|
|
975
|
+
),
|
|
937
976
|
h("button", { part: "button", onclick: () => flow.cancel() }, this.t("connect.cancel"))
|
|
938
977
|
)
|
|
939
978
|
);
|
|
@@ -941,7 +980,12 @@ var SelfstoreConnectElement = class extends FlowWidget {
|
|
|
941
980
|
out.push(
|
|
942
981
|
h(
|
|
943
982
|
"a",
|
|
944
|
-
{
|
|
983
|
+
{
|
|
984
|
+
part: "link webdav-signup",
|
|
985
|
+
href: picked.signupUrl,
|
|
986
|
+
target: "_blank",
|
|
987
|
+
rel: "noopener noreferrer"
|
|
988
|
+
},
|
|
945
989
|
this.t("connect.webdav.signup")
|
|
946
990
|
)
|
|
947
991
|
);
|
|
@@ -958,16 +1002,56 @@ var SelfstoreConnectElement = class extends FlowWidget {
|
|
|
958
1002
|
oninput: (e) => set(e.target.value)
|
|
959
1003
|
});
|
|
960
1004
|
return [
|
|
961
|
-
field(
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
1005
|
+
field(
|
|
1006
|
+
"url",
|
|
1007
|
+
"connect.s3.endpoint",
|
|
1008
|
+
"s3-endpoint",
|
|
1009
|
+
() => this.#s3Endpoint,
|
|
1010
|
+
(v) => this.#s3Endpoint = v
|
|
1011
|
+
),
|
|
1012
|
+
field(
|
|
1013
|
+
"text",
|
|
1014
|
+
"connect.s3.region",
|
|
1015
|
+
"s3-region",
|
|
1016
|
+
() => this.#s3Region,
|
|
1017
|
+
(v) => this.#s3Region = v
|
|
1018
|
+
),
|
|
1019
|
+
field(
|
|
1020
|
+
"text",
|
|
1021
|
+
"connect.s3.bucket",
|
|
1022
|
+
"s3-bucket",
|
|
1023
|
+
() => this.#s3Bucket,
|
|
1024
|
+
(v) => this.#s3Bucket = v
|
|
1025
|
+
),
|
|
1026
|
+
field(
|
|
1027
|
+
"text",
|
|
1028
|
+
"connect.s3.key",
|
|
1029
|
+
"s3-key",
|
|
1030
|
+
() => this.#s3Key,
|
|
1031
|
+
(v) => this.#s3Key = v
|
|
1032
|
+
),
|
|
1033
|
+
field(
|
|
1034
|
+
"text",
|
|
1035
|
+
"connect.s3.accessKeyId",
|
|
1036
|
+
"s3-akid",
|
|
1037
|
+
() => this.#s3AccessKeyId,
|
|
1038
|
+
(v) => this.#s3AccessKeyId = v
|
|
1039
|
+
),
|
|
1040
|
+
field(
|
|
1041
|
+
"password",
|
|
1042
|
+
"connect.s3.secret",
|
|
1043
|
+
"s3-secret",
|
|
1044
|
+
() => this.#s3Secret,
|
|
1045
|
+
(v) => this.#s3Secret = v
|
|
1046
|
+
),
|
|
967
1047
|
h(
|
|
968
1048
|
"div",
|
|
969
1049
|
{ part: "row" },
|
|
970
|
-
h(
|
|
1050
|
+
h(
|
|
1051
|
+
"button",
|
|
1052
|
+
{ part: "button button-primary", onclick: () => this.submitS3() },
|
|
1053
|
+
this.t("connect.s3.submit")
|
|
1054
|
+
),
|
|
971
1055
|
h("button", { part: "button", onclick: () => flow.cancel() }, this.t("connect.cancel"))
|
|
972
1056
|
)
|
|
973
1057
|
];
|
|
@@ -1227,12 +1311,21 @@ var SelfstoreShareElement = class extends FlowWidget {
|
|
|
1227
1311
|
),
|
|
1228
1312
|
h(
|
|
1229
1313
|
"button",
|
|
1230
|
-
{
|
|
1314
|
+
{
|
|
1315
|
+
part: "button",
|
|
1316
|
+
"data-action": "copy",
|
|
1317
|
+
onclick: () => this.copy(link.id, link.url)
|
|
1318
|
+
},
|
|
1231
1319
|
this.t(this.#copiedId === link.id ? "share.copied" : "share.copy")
|
|
1232
1320
|
),
|
|
1233
1321
|
h(
|
|
1234
1322
|
"button",
|
|
1235
|
-
{
|
|
1323
|
+
{
|
|
1324
|
+
part: "button button-danger",
|
|
1325
|
+
"data-action": "revoke",
|
|
1326
|
+
disabled: s.busy !== null,
|
|
1327
|
+
onclick: () => this.revoke(link.id)
|
|
1328
|
+
},
|
|
1236
1329
|
this.t("share.revoke")
|
|
1237
1330
|
)
|
|
1238
1331
|
)
|
|
@@ -1262,7 +1355,12 @@ var SelfstoreShareElement = class extends FlowWidget {
|
|
|
1262
1355
|
),
|
|
1263
1356
|
s.canRemoveMembers && !m.self ? h(
|
|
1264
1357
|
"button",
|
|
1265
|
-
{
|
|
1358
|
+
{
|
|
1359
|
+
part: "button button-danger",
|
|
1360
|
+
"data-action": "remove",
|
|
1361
|
+
disabled: s.busy !== null,
|
|
1362
|
+
onclick: () => this.removeRow(m.id)
|
|
1363
|
+
},
|
|
1266
1364
|
this.t("share.remove")
|
|
1267
1365
|
) : null
|
|
1268
1366
|
)
|
|
@@ -1278,7 +1376,12 @@ var SelfstoreShareElement = class extends FlowWidget {
|
|
|
1278
1376
|
{ part: "footer", style: "text-align:right" },
|
|
1279
1377
|
h(
|
|
1280
1378
|
"button",
|
|
1281
|
-
{
|
|
1379
|
+
{
|
|
1380
|
+
part: "link link-danger",
|
|
1381
|
+
"data-action": "stop",
|
|
1382
|
+
disabled: s.busy !== null,
|
|
1383
|
+
onclick: () => this.stop()
|
|
1384
|
+
},
|
|
1282
1385
|
this.t("share.stop")
|
|
1283
1386
|
)
|
|
1284
1387
|
)
|
|
@@ -1453,7 +1556,11 @@ var SelfstoreJoinElement = class extends FlowWidget {
|
|
|
1453
1556
|
"div",
|
|
1454
1557
|
{ part: "status" },
|
|
1455
1558
|
h("span", { part: "spinner", "aria-hidden": "true" }),
|
|
1456
|
-
h(
|
|
1559
|
+
h(
|
|
1560
|
+
"div",
|
|
1561
|
+
{ part: "title" },
|
|
1562
|
+
this.t(s.step === "joining" ? "join.joining" : "join.previewing")
|
|
1563
|
+
)
|
|
1457
1564
|
)
|
|
1458
1565
|
);
|
|
1459
1566
|
return;
|
|
@@ -1466,9 +1573,25 @@ var SelfstoreJoinElement = class extends FlowWidget {
|
|
|
1466
1573
|
h(
|
|
1467
1574
|
"div",
|
|
1468
1575
|
{ part: "row banner" },
|
|
1469
|
-
h(
|
|
1470
|
-
|
|
1471
|
-
|
|
1576
|
+
h(
|
|
1577
|
+
"div",
|
|
1578
|
+
{ part: "title", style: "flex:1;min-width:0" },
|
|
1579
|
+
p?.label || this.t("join.title")
|
|
1580
|
+
),
|
|
1581
|
+
h(
|
|
1582
|
+
"button",
|
|
1583
|
+
{
|
|
1584
|
+
part: "button button-primary",
|
|
1585
|
+
"data-action": "accept",
|
|
1586
|
+
onclick: () => flow.accept()
|
|
1587
|
+
},
|
|
1588
|
+
this.t("join.accept")
|
|
1589
|
+
),
|
|
1590
|
+
s.canSwitchAccount ? h(
|
|
1591
|
+
"button",
|
|
1592
|
+
{ part: "link", "data-action": "switch", onclick: () => flow.switchAccount() },
|
|
1593
|
+
this.t("join.switchAccount")
|
|
1594
|
+
) : null
|
|
1472
1595
|
)
|
|
1473
1596
|
);
|
|
1474
1597
|
return;
|
|
@@ -1481,34 +1604,72 @@ var SelfstoreJoinElement = class extends FlowWidget {
|
|
|
1481
1604
|
h(
|
|
1482
1605
|
"div",
|
|
1483
1606
|
{ part: "row" },
|
|
1484
|
-
h(
|
|
1485
|
-
|
|
1607
|
+
h(
|
|
1608
|
+
"button",
|
|
1609
|
+
{
|
|
1610
|
+
part: "button button-primary",
|
|
1611
|
+
"data-action": "accept",
|
|
1612
|
+
onclick: () => flow.accept()
|
|
1613
|
+
},
|
|
1614
|
+
this.t("join.accept")
|
|
1615
|
+
),
|
|
1616
|
+
s.canSwitchAccount ? h(
|
|
1617
|
+
"button",
|
|
1618
|
+
{ part: "link", "data-action": "switch", onclick: () => flow.switchAccount() },
|
|
1619
|
+
this.t("join.switchAccount")
|
|
1620
|
+
) : null
|
|
1486
1621
|
)
|
|
1487
1622
|
);
|
|
1488
1623
|
return;
|
|
1489
1624
|
}
|
|
1490
1625
|
if (s.step === "joined") {
|
|
1491
|
-
into.append(
|
|
1626
|
+
into.append(
|
|
1627
|
+
h("div", { part: "status status-ok" }, h("div", { part: "title" }, this.t("join.joined")))
|
|
1628
|
+
);
|
|
1492
1629
|
return;
|
|
1493
1630
|
}
|
|
1494
1631
|
if (s.step === "mismatch" || s.step === "no-invite") {
|
|
1495
1632
|
into.append(
|
|
1496
|
-
h(
|
|
1633
|
+
h(
|
|
1634
|
+
"div",
|
|
1635
|
+
{ part: "status" },
|
|
1636
|
+
h(
|
|
1637
|
+
"div",
|
|
1638
|
+
{ part: "title" },
|
|
1639
|
+
this.t(s.step === "mismatch" ? "join.mismatch" : "join.noInvite")
|
|
1640
|
+
)
|
|
1641
|
+
)
|
|
1497
1642
|
);
|
|
1498
1643
|
if (s.step === "no-invite" && s.canSwitchAccount) {
|
|
1499
1644
|
into.append(
|
|
1500
|
-
h(
|
|
1645
|
+
h(
|
|
1646
|
+
"div",
|
|
1647
|
+
{ part: "row" },
|
|
1648
|
+
h(
|
|
1649
|
+
"button",
|
|
1650
|
+
{ part: "button", "data-action": "switch", onclick: () => flow.switchAccount() },
|
|
1651
|
+
this.t("join.switchAccount")
|
|
1652
|
+
)
|
|
1653
|
+
)
|
|
1501
1654
|
);
|
|
1502
1655
|
}
|
|
1503
1656
|
return;
|
|
1504
1657
|
}
|
|
1505
1658
|
into.append(
|
|
1506
|
-
h(
|
|
1659
|
+
h(
|
|
1660
|
+
"div",
|
|
1661
|
+
{ part: "status status-error" },
|
|
1662
|
+
h("div", { part: "title" }, this.errorText(s.error?.labelKey))
|
|
1663
|
+
),
|
|
1507
1664
|
h(
|
|
1508
1665
|
"div",
|
|
1509
1666
|
{ part: "row" },
|
|
1510
1667
|
h("button", { part: "button", onclick: () => flow.retry() }, this.t("join.retry")),
|
|
1511
|
-
s.canSwitchAccount ? h(
|
|
1668
|
+
s.canSwitchAccount ? h(
|
|
1669
|
+
"button",
|
|
1670
|
+
{ part: "link", "data-action": "switch", onclick: () => flow.switchAccount() },
|
|
1671
|
+
this.t("join.switchAccount")
|
|
1672
|
+
) : null
|
|
1512
1673
|
)
|
|
1513
1674
|
);
|
|
1514
1675
|
}
|
|
@@ -1700,7 +1861,15 @@ var EYE_OPEN = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strok
|
|
|
1700
1861
|
var EYE_SHUT = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m3 3 18 18"/><path d="M10.6 5.1A10.9 10.9 0 0 1 12 5c6.5 0 10 7 10 7a17.4 17.4 0 0 1-3.4 4.4M6.6 6.6A17 17 0 0 0 2 12s3.5 7 10 7a10.7 10.7 0 0 0 5.4-1.4"/></svg>';
|
|
1701
1862
|
var SelfstoreBackupsElement = class extends FlowWidget {
|
|
1702
1863
|
static get observedAttributes() {
|
|
1703
|
-
return [
|
|
1864
|
+
return [
|
|
1865
|
+
"with-create",
|
|
1866
|
+
"with-rename",
|
|
1867
|
+
"with-delete",
|
|
1868
|
+
"with-open",
|
|
1869
|
+
"with-encrypt",
|
|
1870
|
+
"with-share",
|
|
1871
|
+
"with-shared"
|
|
1872
|
+
];
|
|
1704
1873
|
}
|
|
1705
1874
|
#manager = null;
|
|
1706
1875
|
#rows = null;
|
|
@@ -1720,7 +1889,14 @@ var SelfstoreBackupsElement = class extends FlowWidget {
|
|
|
1720
1889
|
#replicaFlow = null;
|
|
1721
1890
|
#replicaSnap = null;
|
|
1722
1891
|
#repWebdav = { url: "", username: "", password: "" };
|
|
1723
|
-
#repS3 = {
|
|
1892
|
+
#repS3 = {
|
|
1893
|
+
endpoint: "",
|
|
1894
|
+
region: "",
|
|
1895
|
+
bucket: "",
|
|
1896
|
+
key: "",
|
|
1897
|
+
accessKeyId: "",
|
|
1898
|
+
secretAccessKey: ""
|
|
1899
|
+
};
|
|
1724
1900
|
#activeEncrypted = null;
|
|
1725
1901
|
#activeShared = null;
|
|
1726
1902
|
#confirmAction = null;
|
|
@@ -1971,11 +2147,19 @@ var SelfstoreBackupsElement = class extends FlowWidget {
|
|
|
1971
2147
|
const shared = h("ul", { part: "list" });
|
|
1972
2148
|
if (badge) {
|
|
1973
2149
|
const activeRow = rows.find((r) => r.fileId === active) ?? null;
|
|
1974
|
-
const leaveAction = {
|
|
2150
|
+
const leaveAction = {
|
|
2151
|
+
type: "leave",
|
|
2152
|
+
fileId: badge.fileId ?? null,
|
|
2153
|
+
who: badge.by
|
|
2154
|
+
};
|
|
1975
2155
|
shared.append(
|
|
1976
2156
|
h(
|
|
1977
2157
|
"li",
|
|
1978
|
-
{
|
|
2158
|
+
{
|
|
2159
|
+
part: "card card-active",
|
|
2160
|
+
style: "position:relative;border-color:var(--_ok)",
|
|
2161
|
+
"data-member": ""
|
|
2162
|
+
},
|
|
1979
2163
|
h(
|
|
1980
2164
|
"div",
|
|
1981
2165
|
{ style: "flex:1;min-width:0" },
|
|
@@ -2011,9 +2195,19 @@ var SelfstoreBackupsElement = class extends FlowWidget {
|
|
|
2011
2195
|
{ part: "card", style: "position:relative", "data-shared": s.fileId },
|
|
2012
2196
|
this.#withOpen ? h(
|
|
2013
2197
|
"button",
|
|
2014
|
-
{
|
|
2198
|
+
{
|
|
2199
|
+
part: "link open-shared",
|
|
2200
|
+
style: "flex:1;min-width:0;text-align:left;text-decoration:none",
|
|
2201
|
+
"data-action": "open-shared",
|
|
2202
|
+
disabled: this.#busy,
|
|
2203
|
+
onclick: () => this.open(s.fileId)
|
|
2204
|
+
},
|
|
2015
2205
|
h("div", { part: "title" }, this.ts("backups.shared.by", { who: s.who })),
|
|
2016
|
-
h(
|
|
2206
|
+
h(
|
|
2207
|
+
"div",
|
|
2208
|
+
{ part: "sub" },
|
|
2209
|
+
this.#openBusy === s.fileId ? this.t("backups.loading") : this.t("backups.replaceHint")
|
|
2210
|
+
)
|
|
2017
2211
|
) : h(
|
|
2018
2212
|
"div",
|
|
2019
2213
|
{ style: "flex:1;min-width:0" },
|
|
@@ -2034,7 +2228,10 @@ var SelfstoreBackupsElement = class extends FlowWidget {
|
|
|
2034
2228
|
"forget",
|
|
2035
2229
|
this.t("backups.delete"),
|
|
2036
2230
|
true,
|
|
2037
|
-
() => this.guarded(
|
|
2231
|
+
() => this.guarded(
|
|
2232
|
+
{ type: "forget", fileId: s.fileId, who: s.who },
|
|
2233
|
+
() => void this.forget(s.fileId)
|
|
2234
|
+
)
|
|
2038
2235
|
) : null
|
|
2039
2236
|
) : null
|
|
2040
2237
|
)
|
|
@@ -2049,16 +2246,30 @@ var SelfstoreBackupsElement = class extends FlowWidget {
|
|
|
2049
2246
|
const bits = [];
|
|
2050
2247
|
if (enc !== null) {
|
|
2051
2248
|
bits.push(
|
|
2052
|
-
h(
|
|
2249
|
+
h(
|
|
2250
|
+
"span",
|
|
2251
|
+
{ part: enc ? "pill pill-encrypted sev-ok" : "pill pill-plain", style: pillStyle },
|
|
2252
|
+
this.t(enc ? "backups.pill.encrypted" : "backups.pill.plain")
|
|
2253
|
+
)
|
|
2053
2254
|
);
|
|
2054
2255
|
}
|
|
2055
2256
|
if (shr !== null) {
|
|
2056
2257
|
bits.push(
|
|
2057
|
-
h(
|
|
2258
|
+
h(
|
|
2259
|
+
"span",
|
|
2260
|
+
{ part: shr ? "pill pill-shared sev-warn" : "pill pill-private", style: pillStyle },
|
|
2261
|
+
this.t(shr ? "backups.pill.shared" : "backups.pill.private")
|
|
2262
|
+
)
|
|
2058
2263
|
);
|
|
2059
2264
|
}
|
|
2060
2265
|
if (r.modifiedAt) {
|
|
2061
|
-
bits.push(
|
|
2266
|
+
bits.push(
|
|
2267
|
+
h(
|
|
2268
|
+
"span",
|
|
2269
|
+
{ part: "sub" },
|
|
2270
|
+
this.ts("backups.modified", { when: new Date(r.modifiedAt).toLocaleDateString() })
|
|
2271
|
+
)
|
|
2272
|
+
);
|
|
2062
2273
|
}
|
|
2063
2274
|
return bits;
|
|
2064
2275
|
}
|
|
@@ -2066,26 +2277,60 @@ var SelfstoreBackupsElement = class extends FlowWidget {
|
|
|
2066
2277
|
const body = h(
|
|
2067
2278
|
"div",
|
|
2068
2279
|
{ style: "flex:1;min-width:0" },
|
|
2069
|
-
h(
|
|
2280
|
+
h(
|
|
2281
|
+
"div",
|
|
2282
|
+
{ part: "title" },
|
|
2283
|
+
this.label(r),
|
|
2284
|
+
active ? h("span", { part: "tag" }, this.t("backups.active")) : null
|
|
2285
|
+
),
|
|
2070
2286
|
h("div", { part: "row", style: "margin-top:0.2rem" }, ...this.pills(r, active)),
|
|
2071
2287
|
footer
|
|
2072
2288
|
);
|
|
2073
2289
|
const opens = this.#withOpen && !active;
|
|
2074
2290
|
const face = opens ? h(
|
|
2075
2291
|
"button",
|
|
2076
|
-
{
|
|
2292
|
+
{
|
|
2293
|
+
part: "link open-row",
|
|
2294
|
+
style: "flex:1;min-width:0;text-align:left;text-decoration:none",
|
|
2295
|
+
"data-action": "open",
|
|
2296
|
+
disabled: this.#busy,
|
|
2297
|
+
onclick: () => this.open(r.fileId)
|
|
2298
|
+
},
|
|
2077
2299
|
this.#openBusy === r.fileId ? h("div", { part: "sub" }, this.t("backups.loading")) : body
|
|
2078
2300
|
) : body;
|
|
2079
2301
|
return h(
|
|
2080
2302
|
"li",
|
|
2081
|
-
{
|
|
2303
|
+
{
|
|
2304
|
+
part: active ? "card card-active" : "card",
|
|
2305
|
+
style: active ? "position:relative;border-color:var(--_ok)" : "position:relative",
|
|
2306
|
+
"data-row": r.fileId
|
|
2307
|
+
},
|
|
2082
2308
|
face,
|
|
2083
2309
|
this.menuButton(r.fileId),
|
|
2084
2310
|
this.#menuFor === r.fileId ? this.menu(
|
|
2085
2311
|
opens ? this.menuItem("open", this.t("backups.open"), false, () => this.open(r.fileId)) : null,
|
|
2086
|
-
this.#withEncrypt ? this.menuItem(
|
|
2087
|
-
|
|
2088
|
-
|
|
2312
|
+
this.#withEncrypt ? this.menuItem(
|
|
2313
|
+
"encrypt",
|
|
2314
|
+
this.t("backups.encrypt"),
|
|
2315
|
+
false,
|
|
2316
|
+
() => this.emit("selfstore-backups-encrypt", {
|
|
2317
|
+
fileId: r.fileId,
|
|
2318
|
+
label: r.label,
|
|
2319
|
+
active
|
|
2320
|
+
})
|
|
2321
|
+
) : null,
|
|
2322
|
+
this.#withShare ? this.menuItem(
|
|
2323
|
+
"share",
|
|
2324
|
+
this.t("backups.share"),
|
|
2325
|
+
false,
|
|
2326
|
+
() => this.emit("selfstore-backups-share", { fileId: r.fileId, label: r.label, active })
|
|
2327
|
+
) : null,
|
|
2328
|
+
active && this.#replicaFlow && this.#replicaSnap?.step === "idle" && !this.#replicaSnap.replica ? this.menuItem(
|
|
2329
|
+
"replica-add",
|
|
2330
|
+
this.t("backups.replica.add"),
|
|
2331
|
+
false,
|
|
2332
|
+
() => this.#replicaFlow?.open()
|
|
2333
|
+
) : null,
|
|
2089
2334
|
this.#withRename ? this.menuItem("rename", this.t("backups.rename"), false, () => {
|
|
2090
2335
|
this.#renameFor = r;
|
|
2091
2336
|
this.#renameLabel = r.label ?? "";
|
|
@@ -2095,7 +2340,10 @@ var SelfstoreBackupsElement = class extends FlowWidget {
|
|
|
2095
2340
|
"delete",
|
|
2096
2341
|
this.t("backups.delete"),
|
|
2097
2342
|
true,
|
|
2098
|
-
() => this.guarded(
|
|
2343
|
+
() => this.guarded(
|
|
2344
|
+
{ type: "delete", fileId: r.fileId, name: r.name, active },
|
|
2345
|
+
() => void this.deleteRow(r.fileId)
|
|
2346
|
+
)
|
|
2099
2347
|
) : null
|
|
2100
2348
|
) : null
|
|
2101
2349
|
);
|
|
@@ -2131,8 +2379,26 @@ var SelfstoreBackupsElement = class extends FlowWidget {
|
|
|
2131
2379
|
}),
|
|
2132
2380
|
this.eye()
|
|
2133
2381
|
),
|
|
2134
|
-
h(
|
|
2135
|
-
|
|
2382
|
+
h(
|
|
2383
|
+
"button",
|
|
2384
|
+
{
|
|
2385
|
+
part: "button button-primary",
|
|
2386
|
+
"data-action": "pw-open",
|
|
2387
|
+
disabled: this.#busy,
|
|
2388
|
+
onclick: submit
|
|
2389
|
+
},
|
|
2390
|
+
this.t("backups.open")
|
|
2391
|
+
),
|
|
2392
|
+
h(
|
|
2393
|
+
"button",
|
|
2394
|
+
{
|
|
2395
|
+
part: "button",
|
|
2396
|
+
"data-action": "pw-cancel",
|
|
2397
|
+
disabled: this.#busy,
|
|
2398
|
+
onclick: () => this.closePw()
|
|
2399
|
+
},
|
|
2400
|
+
this.t("backups.cancel")
|
|
2401
|
+
)
|
|
2136
2402
|
)
|
|
2137
2403
|
)
|
|
2138
2404
|
);
|
|
@@ -2159,17 +2425,35 @@ var SelfstoreBackupsElement = class extends FlowWidget {
|
|
|
2159
2425
|
this.rerender();
|
|
2160
2426
|
}
|
|
2161
2427
|
}),
|
|
2162
|
-
taken ? h("div", { part: "error-note" }, this.t("backups.taken")) : clean ? h(
|
|
2428
|
+
taken ? h("div", { part: "error-note" }, this.t("backups.taken")) : clean ? h(
|
|
2429
|
+
"div",
|
|
2430
|
+
{ part: "sub" },
|
|
2431
|
+
this.ts("backups.willBe", { file: this.#manager?.fileNameFor(clean) ?? "" })
|
|
2432
|
+
) : null,
|
|
2163
2433
|
h(
|
|
2164
2434
|
"div",
|
|
2165
2435
|
{ part: "row", style: "margin-top:0.45rem" },
|
|
2166
|
-
h("button", { part: "button button-primary", "data-action": "rename-save", disabled: this.#busy || !clean || taken, onclick: () => void this.rename(r) }, this.t("backups.rename")),
|
|
2167
2436
|
h(
|
|
2168
2437
|
"button",
|
|
2169
|
-
{
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2438
|
+
{
|
|
2439
|
+
part: "button button-primary",
|
|
2440
|
+
"data-action": "rename-save",
|
|
2441
|
+
disabled: this.#busy || !clean || taken,
|
|
2442
|
+
onclick: () => void this.rename(r)
|
|
2443
|
+
},
|
|
2444
|
+
this.t("backups.rename")
|
|
2445
|
+
),
|
|
2446
|
+
h(
|
|
2447
|
+
"button",
|
|
2448
|
+
{
|
|
2449
|
+
part: "button",
|
|
2450
|
+
"data-action": "rename-cancel",
|
|
2451
|
+
disabled: this.#busy,
|
|
2452
|
+
onclick: () => {
|
|
2453
|
+
this.#renameFor = null;
|
|
2454
|
+
this.rerender();
|
|
2455
|
+
}
|
|
2456
|
+
},
|
|
2173
2457
|
this.t("backups.cancel")
|
|
2174
2458
|
)
|
|
2175
2459
|
)
|
|
@@ -2199,17 +2483,35 @@ var SelfstoreBackupsElement = class extends FlowWidget {
|
|
|
2199
2483
|
this.rerender();
|
|
2200
2484
|
}
|
|
2201
2485
|
}),
|
|
2202
|
-
taken ? h("div", { part: "error-note" }, this.t("backups.taken")) : clean ? h(
|
|
2486
|
+
taken ? h("div", { part: "error-note" }, this.t("backups.taken")) : clean ? h(
|
|
2487
|
+
"div",
|
|
2488
|
+
{ part: "sub" },
|
|
2489
|
+
this.ts("backups.willBe", { file: this.#manager?.fileNameFor(clean) ?? "" })
|
|
2490
|
+
) : null,
|
|
2203
2491
|
h(
|
|
2204
2492
|
"div",
|
|
2205
2493
|
{ part: "row", style: "margin-top:0.45rem" },
|
|
2206
|
-
h("button", { part: "button button-primary", "data-action": "create", disabled: this.#busy || !clean || taken, onclick: () => void this.create() }, this.t("backups.create")),
|
|
2207
2494
|
h(
|
|
2208
2495
|
"button",
|
|
2209
|
-
{
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2496
|
+
{
|
|
2497
|
+
part: "button button-primary",
|
|
2498
|
+
"data-action": "create",
|
|
2499
|
+
disabled: this.#busy || !clean || taken,
|
|
2500
|
+
onclick: () => void this.create()
|
|
2501
|
+
},
|
|
2502
|
+
this.t("backups.create")
|
|
2503
|
+
),
|
|
2504
|
+
h(
|
|
2505
|
+
"button",
|
|
2506
|
+
{
|
|
2507
|
+
part: "button",
|
|
2508
|
+
"data-action": "create-cancel",
|
|
2509
|
+
disabled: this.#busy,
|
|
2510
|
+
onclick: () => {
|
|
2511
|
+
this.#createOpen = false;
|
|
2512
|
+
this.rerender();
|
|
2513
|
+
}
|
|
2514
|
+
},
|
|
2213
2515
|
this.t("backups.cancel")
|
|
2214
2516
|
)
|
|
2215
2517
|
)
|
|
@@ -2242,7 +2544,10 @@ var SelfstoreBackupsElement = class extends FlowWidget {
|
|
|
2242
2544
|
"span",
|
|
2243
2545
|
{ part: "sub replica-ok" },
|
|
2244
2546
|
this.ts("backups.replica.uptodate", {
|
|
2245
|
-
when: new Date(rep.lastPublishAt).toLocaleTimeString([], {
|
|
2547
|
+
when: new Date(rep.lastPublishAt).toLocaleTimeString([], {
|
|
2548
|
+
hour: "2-digit",
|
|
2549
|
+
minute: "2-digit"
|
|
2550
|
+
})
|
|
2246
2551
|
})
|
|
2247
2552
|
) : h("span", { part: "sub" }, this.t("backups.replica.pending"));
|
|
2248
2553
|
return h(
|
|
@@ -2288,7 +2593,12 @@ var SelfstoreBackupsElement = class extends FlowWidget {
|
|
|
2288
2593
|
snap.error ? h("div", { part: "error-note" }, this.t("error.generic")) : null,
|
|
2289
2594
|
h(
|
|
2290
2595
|
"button",
|
|
2291
|
-
{
|
|
2596
|
+
{
|
|
2597
|
+
part: "button",
|
|
2598
|
+
"data-action": "replica-cancel",
|
|
2599
|
+
disabled: snap.busy,
|
|
2600
|
+
onclick: () => this.#replicaFlow?.cancel()
|
|
2601
|
+
},
|
|
2292
2602
|
this.t("backups.cancel")
|
|
2293
2603
|
)
|
|
2294
2604
|
);
|
|
@@ -2309,22 +2619,48 @@ var SelfstoreBackupsElement = class extends FlowWidget {
|
|
|
2309
2619
|
const c = this.#repWebdav;
|
|
2310
2620
|
const submit = () => {
|
|
2311
2621
|
if (!c.url.trim()) return;
|
|
2312
|
-
this.#replicaFlow?.submitWebdav({
|
|
2622
|
+
this.#replicaFlow?.submitWebdav({
|
|
2623
|
+
url: c.url.trim(),
|
|
2624
|
+
username: c.username.trim(),
|
|
2625
|
+
password: c.password
|
|
2626
|
+
});
|
|
2313
2627
|
};
|
|
2314
2628
|
return h(
|
|
2315
2629
|
"li",
|
|
2316
2630
|
{ part: "card replica-form", style: "display:block" },
|
|
2317
2631
|
h("div", { part: "title", style: "margin-bottom:0.3rem" }, this.t("backups.replica.title")),
|
|
2318
|
-
h(
|
|
2632
|
+
h(
|
|
2633
|
+
"div",
|
|
2634
|
+
{ part: "sub", style: "margin-bottom:0.6rem" },
|
|
2635
|
+
this.t("backups.replica.webdav.help")
|
|
2636
|
+
),
|
|
2319
2637
|
this.replicaField("backups.replica.webdav.url", "url", c.url, (v) => c.url = v),
|
|
2320
2638
|
this.replicaField("backups.replica.webdav.user", "text", c.username, (v) => c.username = v),
|
|
2321
|
-
this.replicaField(
|
|
2639
|
+
this.replicaField(
|
|
2640
|
+
"backups.replica.webdav.password",
|
|
2641
|
+
"password",
|
|
2642
|
+
c.password,
|
|
2643
|
+
(v) => c.password = v
|
|
2644
|
+
),
|
|
2322
2645
|
snap.error ? h("div", { part: "error-note" }, this.t("error.generic")) : null,
|
|
2323
2646
|
h(
|
|
2324
2647
|
"div",
|
|
2325
2648
|
{ part: "row", style: "margin-top:0.45rem" },
|
|
2326
|
-
h(
|
|
2327
|
-
|
|
2649
|
+
h(
|
|
2650
|
+
"button",
|
|
2651
|
+
{
|
|
2652
|
+
part: "button button-primary",
|
|
2653
|
+
"data-action": "replica-webdav",
|
|
2654
|
+
disabled: snap.busy,
|
|
2655
|
+
onclick: submit
|
|
2656
|
+
},
|
|
2657
|
+
this.t("backups.replica.save")
|
|
2658
|
+
),
|
|
2659
|
+
h(
|
|
2660
|
+
"button",
|
|
2661
|
+
{ part: "button", disabled: snap.busy, onclick: () => this.#replicaFlow?.cancel() },
|
|
2662
|
+
this.t("backups.cancel")
|
|
2663
|
+
)
|
|
2328
2664
|
)
|
|
2329
2665
|
);
|
|
2330
2666
|
}
|
|
@@ -2351,14 +2687,37 @@ var SelfstoreBackupsElement = class extends FlowWidget {
|
|
|
2351
2687
|
this.replicaField("backups.replica.s3.region", "text", c.region, (v) => c.region = v),
|
|
2352
2688
|
this.replicaField("backups.replica.s3.bucket", "text", c.bucket, (v) => c.bucket = v),
|
|
2353
2689
|
this.replicaField("backups.replica.s3.key", "text", c.key, (v) => c.key = v),
|
|
2354
|
-
this.replicaField(
|
|
2355
|
-
|
|
2690
|
+
this.replicaField(
|
|
2691
|
+
"backups.replica.s3.accessKeyId",
|
|
2692
|
+
"text",
|
|
2693
|
+
c.accessKeyId,
|
|
2694
|
+
(v) => c.accessKeyId = v
|
|
2695
|
+
),
|
|
2696
|
+
this.replicaField(
|
|
2697
|
+
"backups.replica.s3.secret",
|
|
2698
|
+
"password",
|
|
2699
|
+
c.secretAccessKey,
|
|
2700
|
+
(v) => c.secretAccessKey = v
|
|
2701
|
+
),
|
|
2356
2702
|
snap.error ? h("div", { part: "error-note" }, this.t("error.generic")) : null,
|
|
2357
2703
|
h(
|
|
2358
2704
|
"div",
|
|
2359
2705
|
{ part: "row", style: "margin-top:0.45rem" },
|
|
2360
|
-
h(
|
|
2361
|
-
|
|
2706
|
+
h(
|
|
2707
|
+
"button",
|
|
2708
|
+
{
|
|
2709
|
+
part: "button button-primary",
|
|
2710
|
+
"data-action": "replica-s3",
|
|
2711
|
+
disabled: snap.busy,
|
|
2712
|
+
onclick: submit
|
|
2713
|
+
},
|
|
2714
|
+
this.t("backups.replica.save")
|
|
2715
|
+
),
|
|
2716
|
+
h(
|
|
2717
|
+
"button",
|
|
2718
|
+
{ part: "button", disabled: snap.busy, onclick: () => this.#replicaFlow?.cancel() },
|
|
2719
|
+
this.t("backups.cancel")
|
|
2720
|
+
)
|
|
2362
2721
|
)
|
|
2363
2722
|
);
|
|
2364
2723
|
}
|