goosebit 0.2.4__py3-none-any.whl → 0.2.5__py3-none-any.whl

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.
Files changed (34) hide show
  1. goosebit/__init__.py +16 -0
  2. goosebit/api/v1/devices/device/routes.py +2 -2
  3. goosebit/api/v1/devices/routes.py +19 -4
  4. goosebit/auth/__init__.py +5 -1
  5. goosebit/db/migrations/models/1_20241109151811_update.py +11 -0
  6. goosebit/db/models.py +6 -2
  7. goosebit/realtime/logs.py +1 -1
  8. goosebit/schema/devices.py +1 -1
  9. goosebit/settings/schema.py +2 -0
  10. goosebit/ui/bff/common/requests.py +3 -15
  11. goosebit/ui/bff/common/responses.py +16 -0
  12. goosebit/ui/bff/devices/responses.py +6 -2
  13. goosebit/ui/bff/devices/routes.py +53 -2
  14. goosebit/ui/bff/rollouts/responses.py +6 -2
  15. goosebit/ui/bff/routes.py +4 -2
  16. goosebit/ui/bff/software/responses.py +19 -9
  17. goosebit/ui/routes.py +7 -16
  18. goosebit/ui/static/js/devices.js +53 -69
  19. goosebit/ui/static/js/rollouts.js +16 -13
  20. goosebit/ui/static/js/software.js +5 -11
  21. goosebit/ui/static/js/util.js +21 -1
  22. goosebit/ui/templates/devices.html.jinja +0 -20
  23. goosebit/ui/templates/nav.html.jinja +13 -2
  24. goosebit/updater/controller/v1/routes.py +26 -20
  25. goosebit/updater/manager.py +20 -52
  26. goosebit/updater/routes.py +6 -2
  27. goosebit/updates/swdesc.py +1 -1
  28. {goosebit-0.2.4.dist-info → goosebit-0.2.5.dist-info}/METADATA +14 -6
  29. {goosebit-0.2.4.dist-info → goosebit-0.2.5.dist-info}/RECORD +32 -31
  30. {goosebit-0.2.4.dist-info → goosebit-0.2.5.dist-info}/WHEEL +1 -1
  31. goosebit-0.2.5.dist-info/entry_points.txt +3 -0
  32. goosebit/ui/static/js/index.js +0 -155
  33. goosebit/ui/templates/index.html.jinja +0 -25
  34. {goosebit-0.2.4.dist-info → goosebit-0.2.5.dist-info}/LICENSE +0 -0
@@ -1,4 +1,4 @@
1
- goosebit/__init__.py,sha256=ty8VdDubrAwegJpU43SHo2wLeO2GrbkAdpaqu_iId_Q,3529
1
+ goosebit/__init__.py,sha256=qHY0WDT5n5PdX6D6tv2bAsBwBfMw-bcjEjKotIQDAzg,4158
2
2
  goosebit/__main__.py,sha256=ezSLOobcrbnBspFOSbyjuATEdk8B3aAj9cgEu647ujk,161
3
3
  goosebit/api/__init__.py,sha256=4RRIzqC6KbCESIC9Vc6G4iAa28IWQH4KROTGd2S4AoI,41
4
4
  goosebit/api/responses.py,sha256=HXLpFgL-iv5Ts6LKa3AMt1XGV1GbDE5GzjK66_3Gz5o,84
@@ -13,10 +13,10 @@ goosebit/api/v1/__init__.py,sha256=4RRIzqC6KbCESIC9Vc6G4iAa28IWQH4KROTGd2S4AoI,4
13
13
  goosebit/api/v1/devices/__init__.py,sha256=kzt5TBA-bJmDZFXYPohggbMOW7GhklyflaRKZNC0yDY,42
14
14
  goosebit/api/v1/devices/device/__init__.py,sha256=kzt5TBA-bJmDZFXYPohggbMOW7GhklyflaRKZNC0yDY,42
15
15
  goosebit/api/v1/devices/device/responses.py,sha256=THIPMzc6mwl7GmIXuqAeLLesFHfssvPrMJeHe8tV4mA,222
16
- goosebit/api/v1/devices/device/routes.py,sha256=SGw6qSBK0hJyjJAXHNgGa5PAy0z4JREQKslpRGN8IT0,1169
16
+ goosebit/api/v1/devices/device/routes.py,sha256=rxdu7A2_NRcPV1ofXntrqE1elH9H2GuKE5kO07xQtXM,1173
17
17
  goosebit/api/v1/devices/requests.py,sha256=zx9eWXQanqBnmy-XboA_lrzInfx9ozOB4vG2jRTwnJA,131
18
18
  goosebit/api/v1/devices/responses.py,sha256=NmaxpXKJ_YsQ92mvoTXG8HYB39_HLFmZaHo_uvXFmhg,185
19
- goosebit/api/v1/devices/routes.py,sha256=t9MbKyiT-CLhQWk1DSFcF_Pvuy9pJsBIsRob6yxqj0g,1067
19
+ goosebit/api/v1/devices/routes.py,sha256=pcQx5U-KJXnGjbwheINOtdWtdcJOz3mvnRVcefAph10,1683
20
20
  goosebit/api/v1/download/__init__.py,sha256=kzt5TBA-bJmDZFXYPohggbMOW7GhklyflaRKZNC0yDY,42
21
21
  goosebit/api/v1/download/routes.py,sha256=wdeXA-dGO4D9FxaUP6OnUSW4_2NZhi_VgIxMcSRL2x4,675
22
22
  goosebit/api/v1/rollouts/__init__.py,sha256=4RRIzqC6KbCESIC9Vc6G4iAa28IWQH4KROTGd2S4AoI,41
@@ -28,71 +28,72 @@ goosebit/api/v1/software/__init__.py,sha256=4RRIzqC6KbCESIC9Vc6G4iAa28IWQH4KROTG
28
28
  goosebit/api/v1/software/requests.py,sha256=visd81BMeWDKJADcC10NBJDs7Z3xQC-5nod9z_WHiPg,101
29
29
  goosebit/api/v1/software/responses.py,sha256=l41-JWqyJmmEslXkx4NEJsGOqMrAB__nBUZS3E_9le0,192
30
30
  goosebit/api/v1/software/routes.py,sha256=r8lSPg1eQajPF6990DwnbJpDsuzW53rC5ktLuG3zyjA,3209
31
- goosebit/auth/__init__.py,sha256=WqvVHPAlvH_Tf8G9STcD--eE_JDfIcPLbX9Q7mhPJhk,4605
31
+ goosebit/auth/__init__.py,sha256=VWrDFMfYfQpGV6Pc4xkb2zbUiQATpcsv5PbTiXQ9FoU,4703
32
32
  goosebit/db/__init__.py,sha256=ktnV4302iWzzTr-3oHXv3ud-23qTcAJ4tPLAXyTZZJw,462
33
33
  goosebit/db/config.py,sha256=YCtF52lQ5bEVtKsrqkSzQpbKmCbD79O8Tz0RE4thV3c,220
34
34
  goosebit/db/migrations/models/0_20240830054046_init.py,sha256=EBig7b0-AOWt_AE10rQf_0ZrserjKTm0r53wYInK5Co,5526
35
- goosebit/db/models.py,sha256=UGwcTScSxyBzu7d7YVlYkc1NKkTktOO9dMiYbxCw_BQ,5009
35
+ goosebit/db/migrations/models/1_20241109151811_update.py,sha256=cPbX-8Ga7HYKHQkESR5FXNlS-s-bsx4bsLrXvcfVIkQ,309
36
+ goosebit/db/models.py,sha256=4gi-FsNJFLiAVNxV61Eb4qU8_Qn3zDNQmc2ngqDt_uU,5150
36
37
  goosebit/realtime/__init__.py,sha256=4RRIzqC6KbCESIC9Vc6G4iAa28IWQH4KROTGd2S4AoI,41
37
- goosebit/realtime/logs.py,sha256=JJ6bfVKzux9n3mXaUFoQhH2krGCpW7U1VzaloNmiORY,1223
38
+ goosebit/realtime/logs.py,sha256=sjGg2n7H-4j4i02Kbq_YlECLFp33mmOmaoAZXeE8J9Y,1225
38
39
  goosebit/realtime/routes.py,sha256=yLHrA-BHHU5cpUNvxAPVxWC3KcB9aUrV31HT_th24Ls,265
39
40
  goosebit/schema/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
40
- goosebit/schema/devices.py,sha256=icHFjfVsqiYaWB8xheoBPXABK7hmmsq3jyAW3tzZ9nw,2652
41
+ goosebit/schema/devices.py,sha256=mUmPLLEF506eKAxVPuUv5echqeHrkLIEuhNCHxL5y0Y,2659
41
42
  goosebit/schema/rollouts.py,sha256=Kp--XRC39SDs1bKf59q8fBHzitoW88ZMN1GVlbCQotQ,882
42
43
  goosebit/schema/software.py,sha256=W02rA0guQ7zeeVMTdwxt6EjCnTdf-9JewVJRqdN_GK0,951
43
44
  goosebit/settings/__init__.py,sha256=UkJa_G_VJckNf16Em0zz8sXgEi5pzxHFvZ96oa9MC3k,360
44
45
  goosebit/settings/const.py,sha256=hOpeA9pGmbU4V4mqcfhpHV7cmEjf2GIenmzCSz2Jpj8,779
45
- goosebit/settings/schema.py,sha256=T6MntOkM6Pbf98dQHZoEVUADwKpeJqCrFDc40ufCiG4,2543
46
+ goosebit/settings/schema.py,sha256=ffDhMsyW6_TGIReJRiw3hisKUretdf1PnISTJ0yBe0o,2577
46
47
  goosebit/ui/__init__.py,sha256=4RRIzqC6KbCESIC9Vc6G4iAa28IWQH4KROTGd2S4AoI,41
47
48
  goosebit/ui/bff/__init__.py,sha256=4RRIzqC6KbCESIC9Vc6G4iAa28IWQH4KROTGd2S4AoI,41
48
49
  goosebit/ui/bff/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
49
- goosebit/ui/bff/common/requests.py,sha256=KoC2jRXcGdKAgDvsX-N2_tkXCYIw8YnaHHgVEO0nEs0,1499
50
+ goosebit/ui/bff/common/requests.py,sha256=Db8AohkRfsjUbx3pbdKVva7ZkLhAfBiDwAA221OXd5M,1183
51
+ goosebit/ui/bff/common/responses.py,sha256=3LLIrBhsjdELnZ4kFc5-QDDYwdn7OvcD_2CObiJ6NME,303
50
52
  goosebit/ui/bff/common/util.py,sha256=_hz89EFLAL1UvbIvJJJSF80PL4T1mz1Vk7354wHBzOE,1144
51
53
  goosebit/ui/bff/devices/__init__.py,sha256=4RRIzqC6KbCESIC9Vc6G4iAa28IWQH4KROTGd2S4AoI,41
52
54
  goosebit/ui/bff/devices/requests.py,sha256=YbTUsyVLQZaUnn3dJ6AQe0mZl_H5aQC6QKCRxhCjGJc,286
53
- goosebit/ui/bff/devices/responses.py,sha256=ERzXIEYCozUYE2Npp89rj7GlEXvzUHhLGt4ywRK91XI,1140
54
- goosebit/ui/bff/devices/routes.py,sha256=cX0eEZhjmlRZQmBtr9w75ssYhDGEr66nVf72nqwXOKA,2877
55
+ goosebit/ui/bff/devices/responses.py,sha256=4279xeu-soqgyOc4ncKZpai6juBQ3dl096p2LgtIu2s,1208
56
+ goosebit/ui/bff/devices/routes.py,sha256=9WoGBheOkOT5-UDlQ0rtK-MJF4MNPuHxz3mBxdVhbWU,5260
55
57
  goosebit/ui/bff/download/__init__.py,sha256=kzt5TBA-bJmDZFXYPohggbMOW7GhklyflaRKZNC0yDY,42
56
58
  goosebit/ui/bff/download/routes.py,sha256=wdeXA-dGO4D9FxaUP6OnUSW4_2NZhi_VgIxMcSRL2x4,675
57
59
  goosebit/ui/bff/rollouts/__init__.py,sha256=4RRIzqC6KbCESIC9Vc6G4iAa28IWQH4KROTGd2S4AoI,41
58
- goosebit/ui/bff/rollouts/responses.py,sha256=QnTtlPLqY6S9gs5-duw3rov5X1LAa5KuieniYzUf9zg,1112
60
+ goosebit/ui/bff/rollouts/responses.py,sha256=gFEzWkFUBIka98lrA0ivdXBiTqaU5AugfJm2F3p33uk,1180
59
61
  goosebit/ui/bff/rollouts/routes.py,sha256=ZO-mkDzTgzssBtIbhOqSxrPgZYMVPsMW4EXw3f8YA1o,1553
60
- goosebit/ui/bff/routes.py,sha256=dq0fHXBiJfERzvUhvR4KVYCK3Ogf0Gb9wMSpzQanDac,323
62
+ goosebit/ui/bff/routes.py,sha256=wx7so5Kfleop7ZdTEnMFSQ6P_Eck8iX6TnAqyetd3wM,428
61
63
  goosebit/ui/bff/software/__init__.py,sha256=4RRIzqC6KbCESIC9Vc6G4iAa28IWQH4KROTGd2S4AoI,41
62
- goosebit/ui/bff/software/responses.py,sha256=ynur0zdslI8s7rhsLHZJ63veDJc4MBDRQPH7YOqu3cs,1292
64
+ goosebit/ui/bff/software/responses.py,sha256=e7zMP8q2uWgKRy1q5Jp0HTNx-lggljOy2BFQRJglDSo,1920
63
65
  goosebit/ui/bff/software/routes.py,sha256=xwLsI6wTJzu_-eWAV1f8DlEWw67i22LK72D-uYLRMu0,3220
64
66
  goosebit/ui/nav.py,sha256=l-MCY2AN5v6jDCSDZoka3qjQ2_24SjLqUi1dYtxCjIM,378
65
- goosebit/ui/routes.py,sha256=6SizNvgDwuFIX7_ywwvOncNRQoslizVr2OoqFA37TPg,2143
67
+ goosebit/ui/routes.py,sha256=J6Nkh1yShO810IRU3vjFlZCwYOy_qgwPCiOhHP3szbw,2015
66
68
  goosebit/ui/static/__init__.py,sha256=AsZiM3h9chQ_YaBbAD6TVFf0244Q9DetkDMl70q8swQ,135
67
69
  goosebit/ui/static/favicon.ico,sha256=MKAqEjW7F1-j2dmW4s08y4U0dFteIlU7rpLKakU0Lxk,4286
68
70
  goosebit/ui/static/favicon.svg,sha256=8zvM7o2Ob3YmTEV6Rj7rCTgSajvY6wIaAQAAjWwlDsw,8733
69
- goosebit/ui/static/js/devices.js,sha256=ZKMw6gv5xhBbEGMd17r5gogEayR82cB7-9y7z7T-Czc,14611
70
- goosebit/ui/static/js/index.js,sha256=ldsPX0PpGB1vkYEfMY05tYEgG6iCif3tx60aaAc3URY,5515
71
+ goosebit/ui/static/js/devices.js,sha256=zseDgA1PnnreNajQRx7F38GuS_BjQugVtQLNPUhI3xg,13635
71
72
  goosebit/ui/static/js/login.js,sha256=9qlXki3udm5CmAO8UXUJe94Kc_-SJekdKjfH9TzJhgk,579
72
73
  goosebit/ui/static/js/logs.js,sha256=DgOWLKUvK-mM-oYRA0JJTIhtiCiegb5qCJ7pE9H2I3k,863
73
- goosebit/ui/static/js/rollouts.js,sha256=yQEiwWEy1ZuslTeE6P9YS8YY0YbGcKnIVYakm2M7wr8,7470
74
- goosebit/ui/static/js/software.js,sha256=H9P4RjizC2EhL6Otjv4-iLnESdi3IvQYhWFvM4ddjaQ,8907
75
- goosebit/ui/static/js/util.js,sha256=j-dsuiqG9FXhrIeYw4DLDeDURxsVEtu7aclMFQuWEA4,4042
74
+ goosebit/ui/static/js/rollouts.js,sha256=bswZSdPvDGSctpxyw2qhnuslTPugXDqkIMVBMYiY-Gc,7484
75
+ goosebit/ui/static/js/software.js,sha256=3B9F6mLkvKhl0K1YJn4qkw5Wj4u_V9gabbz3ix84tDI,8728
76
+ goosebit/ui/static/js/util.js,sha256=GlF2eVL6iGUWEbBgxzmLX4r3x5bLYh1YiBN7okX9dVE,4593
76
77
  goosebit/ui/static/svg/goosebit-logo.svg,sha256=8zvM7o2Ob3YmTEV6Rj7rCTgSajvY6wIaAQAAjWwlDsw,8733
77
78
  goosebit/ui/templates/__init__.py,sha256=xHCio6TnuNnYKLOZ3VhvbxyJPZ2ddzTSle_RmiuLrrA,378
78
- goosebit/ui/templates/devices.html.jinja,sha256=aA2H0rJS3fu6oEx5aPNYji_eeNMHGb9NlQ8ho67Tuno,6608
79
- goosebit/ui/templates/index.html.jinja,sha256=SDROkbhSRX6-pdET-yikfnrcfNKZR5zPhY2ByrSdAy4,907
79
+ goosebit/ui/templates/devices.html.jinja,sha256=G2t3pKIe0e7LDkm9H0YwDddSvyXY4PaSPM11Rl9d1BY,5773
80
80
  goosebit/ui/templates/login.html.jinja,sha256=eQX1ypZ5iJ2L4v4lw8VB7GKluUjUYmpoUyUy8jY98Og,3050
81
81
  goosebit/ui/templates/logs.html.jinja,sha256=JLHogVHWcP_Y321dd-gHexNqix-PFfGVpEKbNmzsMU8,1310
82
- goosebit/ui/templates/nav.html.jinja,sha256=s56I5-iGac3LaMXM836eLC6Z5LsoE9EC3RBvZZyOCME,5264
82
+ goosebit/ui/templates/nav.html.jinja,sha256=cdAM-9RZG_taugisf9Sh-UcRT3jLHAqNGbf9r7mk8ow,5725
83
83
  goosebit/ui/templates/rollouts.html.jinja,sha256=s9kIxRYO8OypqIQH8tQUwZJDDjsex89piuV4kh1eqwE,4728
84
84
  goosebit/ui/templates/software.html.jinja,sha256=CTIeNkPMJMvtDVWbcKl_BjvtAFV3bskpCcNg-lCJIZM,7551
85
85
  goosebit/updater/__init__.py,sha256=4RRIzqC6KbCESIC9Vc6G4iAa28IWQH4KROTGd2S4AoI,41
86
86
  goosebit/updater/controller/__init__.py,sha256=4RRIzqC6KbCESIC9Vc6G4iAa28IWQH4KROTGd2S4AoI,41
87
87
  goosebit/updater/controller/routes.py,sha256=8CnLb-kDuO-yFeWdu4apIyctCf9OzvJ011Az3QDGemU,123
88
88
  goosebit/updater/controller/v1/__init__.py,sha256=4RRIzqC6KbCESIC9Vc6G4iAa28IWQH4KROTGd2S4AoI,41
89
- goosebit/updater/controller/v1/routes.py,sha256=pR8c1xHjpYXQBdKb9r9J73muEeR1FeRJTWzo6asJWC4,7251
89
+ goosebit/updater/controller/v1/routes.py,sha256=lJFx3gi01iI7ep_omPg5pI4TSVRa13kqfFSeXKuGIpY,7273
90
90
  goosebit/updater/controller/v1/schema.py,sha256=NwSyPx3A38iFabfOfzaVtxPozJQNacikP5WOhxMHqdg,1228
91
- goosebit/updater/manager.py,sha256=1aEPqrQwUTkYsMERk5nJnkllMuijcqXcayQetmn6L6A,11755
92
- goosebit/updater/routes.py,sha256=GfjbSdFYaw28B8b7hByOPN8BMIbaGvbz4CbG1jQCmP8,515
91
+ goosebit/updater/manager.py,sha256=b_OqH5TBHicd1cZNzvkwlgpjXTa5N4BOe6oqiNXgYLI,10692
92
+ goosebit/updater/routes.py,sha256=BYH8qdSUO99MQo09IQOkPNnmNZS74O5IZqIKcuNkNkY,647
93
93
  goosebit/updates/__init__.py,sha256=RIq3m7x0-ByWjU21llKZSnj4a0Hg27iSNMfO1G4Kjwc,4284
94
- goosebit/updates/swdesc.py,sha256=gRbx2q9EJv-QpCGo2JmP1zLDM1GNp_vTULXbIJbexRM,3123
95
- goosebit-0.2.4.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
96
- goosebit-0.2.4.dist-info/METADATA,sha256=WvIHdnyr1D8S6FYnk17LYlmtwwwfosnKoWO37POH7vc,5504
97
- goosebit-0.2.4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
98
- goosebit-0.2.4.dist-info/RECORD,,
94
+ goosebit/updates/swdesc.py,sha256=f2GxYwDvxgNsCTV_3RBlQ5oOWfB9cpNZuQBMMuZyZn8,3154
95
+ goosebit-0.2.5.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
96
+ goosebit-0.2.5.dist-info/METADATA,sha256=nHUxHj5Qy3KK8K542dcMbzTxSZ3wtTErq-OCGejBqz8,5801
97
+ goosebit-0.2.5.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
98
+ goosebit-0.2.5.dist-info/entry_points.txt,sha256=5p3wNB9_WEljksEBgZmOxO0DrBVhRxP20JD9JJ_lpb4,57
99
+ goosebit-0.2.5.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.9.0
2
+ Generator: poetry-core 1.9.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ generate-sample-data=sample_data:main
3
+
@@ -1,155 +0,0 @@
1
- let dataTable;
2
-
3
- document.addEventListener("DOMContentLoaded", () => {
4
- dataTable = new DataTable("#device-table", {
5
- responsive: true,
6
- paging: true,
7
- processing: false,
8
- serverSide: true,
9
- scrollCollapse: true,
10
- scroller: true,
11
- scrollY: "65vh",
12
- stateSave: true,
13
- stateLoadParams: (settings, data) => {
14
- // if save state is older than last breaking code change...
15
- if (data.time <= 1722434386000) {
16
- // ... delete it
17
- for (const key of Object.keys(data)) {
18
- delete data[key];
19
- }
20
- }
21
- },
22
- ajax: {
23
- url: "/ui/bff/devices",
24
- contentType: "application/json",
25
- },
26
- initComplete: () => {
27
- updateBtnState();
28
- },
29
- columnDefs: [
30
- {
31
- targets: "_all",
32
- searchable: false,
33
- orderable: false,
34
- render: (data) => data || "-",
35
- },
36
- ],
37
- columns: [
38
- { data: "name", searchable: true, orderable: true },
39
- {
40
- data: "online",
41
- render: (data, type) => {
42
- if (type === "display" || type === "filter") {
43
- const color = data ? "success" : "danger";
44
- return `
45
- <div class="text-${color}">
46
-
47
- </div>
48
- `;
49
- }
50
- return data;
51
- },
52
- },
53
- { data: "uuid", searchable: true, orderable: true },
54
- { data: "sw_version", searchable: true, orderable: true },
55
- {
56
- data: "progress",
57
- render: (data, type) => {
58
- if (type === "display" || type === "filter") {
59
- return data ? `${data}%` : "-";
60
- }
61
- return data;
62
- },
63
- },
64
- { data: "last_ip" },
65
- {
66
- data: "last_seen",
67
- render: (data, type) => {
68
- if (type === "display" || type === "filter") {
69
- return secondsToRecentDate(data);
70
- }
71
- return data;
72
- },
73
- },
74
- ],
75
- select: true,
76
- rowId: "uuid",
77
- layout: {
78
- top1Start: {
79
- buttons: [
80
- {
81
- text: '<i class="bi bi-check-all"></i>',
82
- extend: "selectAll",
83
- titleAttr: "Select All",
84
- },
85
- {
86
- text: '<i class="bi bi-x"></i>',
87
- extend: "selectNone",
88
- titleAttr: "Clear Selection",
89
- },
90
- {
91
- text: '<i class="bi bi-file-earmark-arrow-down"></i>',
92
- action: (e, dt) => {
93
- const selectedDevices = dt.rows({ selected: true }).data().toArray();
94
- downloadLogins(selectedDevices);
95
- },
96
- className: "buttons-export-login",
97
- titleAttr: "Export Login",
98
- },
99
- {
100
- text: '<i class="bi bi-file-text"></i>',
101
- action: (e, dt) => {
102
- const selectedDevice = dt.rows({ selected: true }).data().toArray()[0];
103
- window.location.href = `/ui/logs/${selectedDevice.uuid}`;
104
- },
105
- className: "buttons-logs",
106
- titleAttr: "View Log",
107
- },
108
- ],
109
- },
110
- },
111
- });
112
-
113
- dataTable
114
- .on("select", () => {
115
- updateBtnState();
116
- })
117
- .on("deselect", () => {
118
- updateBtnState();
119
- });
120
-
121
- setInterval(() => {
122
- dataTable.ajax.reload(null, false);
123
- }, TABLE_UPDATE_TIME);
124
- });
125
-
126
- function updateBtnState() {
127
- if (dataTable.rows({ selected: true }).any()) {
128
- document.querySelector("button.buttons-select-none").classList.remove("disabled");
129
- document.querySelector("button.buttons-export-login").classList.remove("disabled");
130
- } else {
131
- document.querySelector("button.buttons-select-none").classList.add("disabled");
132
- document.querySelector("button.buttons-export-login").classList.add("disabled");
133
- }
134
- if (dataTable.rows({ selected: true }).count() === 1) {
135
- document.querySelector("button.buttons-logs").classList.remove("disabled");
136
- } else {
137
- document.querySelector("button.buttons-logs").classList.add("disabled");
138
- }
139
- }
140
-
141
- function downloadLogins(devices) {
142
- const deviceLogins = devices.map((dev) => {
143
- return [dev.name, `https://${dev.uuid}-access.loadsync.io`, dev.uuid];
144
- });
145
- deviceLogins.unshift(["Building", "Access Link", "Serial Number/Wifi SSID", "Login/Wifi Password"]);
146
-
147
- const csvContent = `data:text/csv;charset=utf-8,${deviceLogins.map((e) => e.join(",")).join("\n")}`;
148
- const encodedUri = encodeURI(csvContent);
149
- const link = document.createElement("a");
150
- link.setAttribute("href", encodedUri);
151
- link.setAttribute("download", "LoadsyncLogins-Export.csv");
152
- document.body.appendChild(link);
153
-
154
- link.click();
155
- }
@@ -1,25 +0,0 @@
1
- {% extends "nav.html.jinja" %}
2
- {% block content %}
3
- <div class="container-fluid">
4
- <div class="row p-2 d-flex justify-content-center">
5
- <div class="col">
6
- <table id="device-table" class="table table-hover">
7
- <thead>
8
- <tr>
9
- <th>Name</th>
10
- <th>Up</th>
11
- <th>UUID</th>
12
- <th>Software</th>
13
- <th>Progress</th>
14
- <th>Last IP</th>
15
- <th>Last Seen</th>
16
- </tr>
17
- </thead>
18
- <tbody id="devices-list">
19
- </tbody>
20
- </table>
21
- </div>
22
- </div>
23
- </div>
24
- <script src="{{ url_for('static', path='js/index.js') }}"></script>
25
- {% endblock content %}