goosebit 0.1.2__py3-none-any.whl → 0.2.1__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.
- goosebit/__init__.py +50 -19
- goosebit/__main__.py +7 -0
- goosebit/api/responses.py +5 -0
- goosebit/api/routes.py +5 -15
- goosebit/api/telemetry/__init__.py +1 -0
- goosebit/{telemetry/__init__.py → api/telemetry/metrics.py} +9 -3
- goosebit/api/telemetry/prometheus/__init__.py +2 -0
- goosebit/api/telemetry/prometheus/readers.py +3 -0
- goosebit/api/telemetry/prometheus/routes.py +18 -0
- goosebit/api/telemetry/routes.py +9 -0
- goosebit/api/v1/__init__.py +1 -0
- goosebit/api/v1/devices/__init__.py +1 -0
- goosebit/api/v1/devices/device/__init__.py +1 -0
- goosebit/api/v1/devices/device/responses.py +13 -0
- goosebit/api/v1/devices/device/routes.py +27 -0
- goosebit/api/v1/devices/requests.py +7 -0
- goosebit/api/v1/devices/responses.py +16 -0
- goosebit/api/v1/devices/routes.py +35 -0
- goosebit/api/v1/download/__init__.py +1 -0
- goosebit/api/v1/download/routes.py +22 -0
- goosebit/api/v1/rollouts/__init__.py +1 -0
- goosebit/api/v1/rollouts/requests.py +16 -0
- goosebit/api/v1/rollouts/responses.py +19 -0
- goosebit/api/v1/rollouts/routes.py +50 -0
- goosebit/api/v1/routes.py +9 -0
- goosebit/api/v1/software/__init__.py +1 -0
- goosebit/api/v1/software/requests.py +5 -0
- goosebit/api/v1/software/responses.py +16 -0
- goosebit/api/v1/software/routes.py +77 -0
- goosebit/auth/__init__.py +101 -101
- goosebit/db/__init__.py +11 -0
- goosebit/db/config.py +10 -0
- goosebit/db/migrations/models/0_20240830054046_init.py +136 -0
- goosebit/{models.py → db/models.py} +17 -10
- goosebit/realtime/logs.py +4 -3
- goosebit/realtime/routes.py +2 -2
- goosebit/schema/__init__.py +0 -0
- goosebit/schema/devices.py +73 -0
- goosebit/schema/rollouts.py +31 -0
- goosebit/schema/software.py +37 -0
- goosebit/settings/__init__.py +17 -0
- goosebit/settings/const.py +21 -0
- goosebit/settings/schema.py +86 -0
- goosebit/ui/bff/__init__.py +1 -0
- goosebit/ui/bff/devices/__init__.py +1 -0
- goosebit/ui/bff/devices/requests.py +12 -0
- goosebit/ui/bff/devices/responses.py +39 -0
- goosebit/ui/bff/devices/routes.py +72 -0
- goosebit/ui/bff/download/__init__.py +1 -0
- goosebit/ui/bff/download/routes.py +22 -0
- goosebit/ui/bff/rollouts/__init__.py +1 -0
- goosebit/ui/bff/rollouts/responses.py +37 -0
- goosebit/ui/bff/rollouts/routes.py +52 -0
- goosebit/ui/bff/routes.py +11 -0
- goosebit/ui/bff/software/__init__.py +1 -0
- goosebit/ui/bff/software/responses.py +37 -0
- goosebit/ui/bff/software/routes.py +83 -0
- goosebit/ui/nav.py +16 -0
- goosebit/ui/routes.py +29 -66
- goosebit/ui/static/favicon.ico +0 -0
- goosebit/ui/static/favicon.svg +1 -1
- goosebit/ui/static/js/devices.js +47 -71
- goosebit/ui/static/js/index.js +4 -9
- goosebit/ui/static/js/login.js +23 -0
- goosebit/ui/static/js/logs.js +1 -1
- goosebit/ui/static/js/rollouts.js +33 -19
- goosebit/ui/static/js/{firmware.js → software.js} +87 -86
- goosebit/ui/static/js/util.js +60 -6
- goosebit/ui/static/svg/goosebit-logo.svg +1 -1
- goosebit/ui/templates/__init__.py +9 -1
- goosebit/ui/templates/devices.html.jinja +75 -0
- goosebit/ui/templates/index.html.jinja +25 -0
- goosebit/ui/templates/login.html.jinja +57 -0
- goosebit/ui/templates/logs.html.jinja +31 -0
- goosebit/ui/templates/nav.html.jinja +84 -0
- goosebit/ui/templates/rollouts.html.jinja +93 -0
- goosebit/ui/templates/software.html.jinja +139 -0
- goosebit/updater/controller/v1/routes.py +101 -96
- goosebit/updater/controller/v1/schema.py +56 -0
- goosebit/updater/manager.py +65 -65
- goosebit/updater/routes.py +3 -11
- goosebit/updates/__init__.py +91 -32
- goosebit/updates/swdesc.py +2 -7
- goosebit-0.2.1.dist-info/METADATA +173 -0
- goosebit-0.2.1.dist-info/RECORD +95 -0
- goosebit/api/devices.py +0 -136
- goosebit/api/download.py +0 -34
- goosebit/api/firmware.py +0 -57
- goosebit/api/helper.py +0 -30
- goosebit/api/rollouts.py +0 -87
- goosebit/db.py +0 -37
- goosebit/permissions.py +0 -75
- goosebit/settings.py +0 -64
- goosebit/telemetry/prometheus.py +0 -10
- goosebit/ui/templates/devices.html +0 -115
- goosebit/ui/templates/firmware.html +0 -163
- goosebit/ui/templates/index.html +0 -23
- goosebit/ui/templates/login.html +0 -65
- goosebit/ui/templates/logs.html +0 -36
- goosebit/ui/templates/nav.html +0 -117
- goosebit/ui/templates/rollouts.html +0 -76
- goosebit-0.1.2.dist-info/METADATA +0 -123
- goosebit-0.1.2.dist-info/RECORD +0 -51
- {goosebit-0.1.2.dist-info → goosebit-0.2.1.dist-info}/LICENSE +0 -0
- {goosebit-0.1.2.dist-info → goosebit-0.2.1.dist-info}/WHEEL +0 -0
goosebit/ui/static/favicon.svg
CHANGED
@@ -1 +1 @@
|
|
1
|
-
<svg width="160mm" height="160mm" version="1.1" viewBox="0 0 160 160" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><g
|
1
|
+
<svg width="160mm" height="160mm" version="1.1" viewBox="0 0 160 160" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><g stroke="#000"><path d="m71.456 6.9438c-1.6968-1.1e-4 -3.0723 1.3754-3.0722 3.0722 5e-5 0.81363 0.32287 1.594 0.89762 2.1699v13.554l-31.794-0.00155c-0.053963 0-0.10636 0.006217-0.1602 0.006718v-13.557c0.57209-0.57322 0.89469-1.3492 0.89762-2.159 1.1e-4 -1.6968-1.3759-3.0723-3.0727-3.0722-1.6968-1.11e-4 -3.0728 1.3754-3.0727 3.0722 5e-5 0.81363 0.32287 1.594 0.89762 2.1699v14.156c-5.6155 1.5454-10.042 5.898-11.682 11.475h-12.416c-0.57321-0.57209-1.3492-0.89469-2.159-0.89762-1.6968-1.1e-4 -3.0723 1.3754-3.0722 3.0722-1.105e-4 1.6968 1.3754 3.0723 3.0722 3.0722 0.81363-4.8e-5 1.594-0.32287 2.1699-0.89762h11.731c-0.0039 0.15084-0.022737 0.29776-0.022737 0.44958v7.3003h-11.719c-0.57321-0.57209-1.3492-0.89469-2.159-0.89762-1.6968-1.1e-4 -3.0723 1.3754-3.0722 3.0722-1.105e-4 1.6968 1.3754 3.0728 3.0722 3.0727 0.81363-4.8e-5 1.594-0.32287 2.1699-0.89762h11.708v7.7499h-11.719c-0.57321-0.57209-1.3487-0.89469-2.1585-0.89762-1.6968-1.1e-4 -3.0728 1.3754-3.0727 3.0722-1.105e-4 1.6968 1.3759 3.0723 3.0727 3.0722 0.81363-4.8e-5 1.594-0.32287 2.1699-0.89762h11.708v7.7499h-11.719c-0.57321-0.57209-1.3492-0.89469-2.159-0.89762-1.6968-1.1e-4 -3.0723 1.3754-3.0722 3.0722-1.105e-4 1.6968 1.3754 3.0723 3.0722 3.0722 0.81363-4.8e-5 1.594-0.32287 2.1699-0.89762h11.708v7.7499h-11.719c-0.57321-0.57209-1.3487-0.89469-2.1585-0.89762-1.6968-1.1e-4 -3.0728 1.3754-3.0727 3.0722-1.105e-4 1.6968 1.3759 3.0723 3.0727 3.0722 0.81363-4.8e-5 1.594-0.32287 2.1699-0.89762h11.708v7.7499h-11.719c-0.57321-0.57209-1.3492-0.89469-2.159-0.89762-1.6968-1.1e-4 -3.0723 1.3754-3.0722 3.0722-1.105e-4 1.6968 1.3754 3.0723 3.0722 3.0722 0.81363-5e-5 1.594-0.32287 2.1699-0.89762h11.708v7.7494h-11.719c-0.57321-0.57209-1.3492-0.89469-2.159-0.89762-1.6968-1.1e-4 -3.0723 1.3754-3.0722 3.0722-1.105e-4 1.6968 1.3754 3.0728 3.0722 3.0727 0.81363-5e-5 1.594-0.32287 2.1699-0.89762h11.708v7.3003c0 0.1517 0.018798 0.29835 0.022738 0.44907h-11.742c-0.57322-0.57209-1.3492-0.89469-2.159-0.89762-1.6968-1.1e-4 -3.0723 1.3759-3.0722 3.0727-1.105e-4 1.6968 1.3754 3.0723 3.0722 3.0722 0.81363-5e-5 1.594-0.32287 2.1699-0.89762h12.405c1.6399 5.5765 6.0655 9.9236 11.683 11.468v15.152c-0.57209 0.57322-0.89469 1.3492-0.89762 2.159-1.1e-4 1.6968 1.3754 3.0723 3.0722 3.0722 1.6968 1.1e-4 3.0723-1.3754 3.0722-3.0722-4.8e-5 -0.81362-0.32287-1.594-0.89762-2.1699v-14.527c0.05398 5e-4 0.10609 0.00827 0.1602 0.00827h7.5897v14.529c-0.57209 0.57322-0.89469 1.3492-0.89762 2.159-1.1e-4 1.6968 1.3754 3.0723 3.0722 3.0722 1.6968 1.1e-4 3.0723-1.3754 3.0722-3.0722-4.8e-5 -0.81363-0.32287-1.594-0.89762-2.1699v-14.518h7.7494v14.529c-0.57209 0.57322-0.89469 1.3492-0.89762 2.159-1.1e-4 1.6968 1.3759 3.0723 3.0727 3.0722 1.6968 1.1e-4 3.0723-1.3754 3.0722-3.0722-4.8e-5 -0.81363-0.32287-1.594-0.89762-2.1699v-14.518h7.7499v14.529c-0.57209 0.57322-0.89469 1.3492-0.89762 2.159-1.1e-4 1.6968 1.3754 3.0723 3.0722 3.0722 1.6968 1.1e-4 3.0723-1.3754 3.0722-3.0722-4.8e-5 -0.81363-0.32287-1.594-0.89762-2.1699v-14.518h7.7499v14.529c-0.57209 0.57322-0.89469 1.3492-0.89762 2.159-1.1e-4 1.6968 1.3754 3.0723 3.0722 3.0722 1.6968 1.1e-4 3.0723-1.3754 3.0722-3.0722-4.8e-5 -0.81363-0.32287-1.594-0.89762-2.1699v-14.518h7.7499v14.529c-0.57209 0.57322-0.89469 1.3492-0.89762 2.159-1.1e-4 1.6968 1.3754 3.0723 3.0722 3.0722 1.6968 1.1e-4 3.0723-1.3754 3.0722-3.0722-4.8e-5 -0.81363-0.32287-1.594-0.89762-2.1699v-14.518h7.7499v14.529c-0.57209 0.57322-0.89469 1.3492-0.89762 2.159-1.1e-4 1.6968 1.3754 3.0723 3.0722 3.0722 1.6968 1.1e-4 3.0723-1.3754 3.0722-3.0722-5e-5 -0.81363-0.32287-1.594-0.89762-2.1699v-14.518h7.5892c0.0543 0 0.10656-0.00775 0.16071-0.00775v14.538c-0.57209 0.57322-0.89469 1.3492-0.89762 2.159-1.1e-4 1.6968 1.3754 3.0723 3.0722 3.0722 1.6968 1.1e-4 3.0723-1.3754 3.0722-3.0722-5e-5 -0.81362-0.32287-1.594-0.89762-2.1699v-15.141c5.6174-1.5445 10.043-5.8916 11.682-11.468h12.992c0.57322 0.57209 1.3492 0.89469 2.159 0.89762 1.6968 1.1e-4 3.0723-1.3754 3.0722-3.0722 1.1e-4 -1.6968-1.3754-3.0723-3.0722-3.0722-0.81363 5e-5 -1.5945 0.32287-2.1704 0.89762h-12.307c4e-3 -0.15072 0.02274-0.29737 0.02274-0.44907v-7.3008h12.295c0.57321 0.57209 1.3492 0.89469 2.159 0.89762 1.6968 1.1e-4 3.0723-1.3754 3.0722-3.0722 1.1e-4 -1.6968-1.3754-3.0723-3.0722-3.0722-0.81363 5e-5 -1.594 0.32287-2.1699 0.89762h-12.284v-7.7494h12.295c0.57321 0.57209 1.3492 0.8947 2.159 0.89762 1.6968 1.1e-4 3.0723-1.3759 3.0722-3.0727 1.1e-4 -1.6968-1.3754-3.0723-3.0722-3.0722-0.81363 4.8e-5 -1.594 0.32287-2.1699 0.89762h-12.284v-7.7499h12.295c0.57322 0.57209 1.3492 0.89469 2.159 0.89762 1.6968 1.1e-4 3.0723-1.3754 3.0722-3.0722 1.1e-4 -1.6968-1.3754-3.0723-3.0722-3.0722-0.81363 4.8e-5 -1.5945 0.32287-2.1704 0.89762h-12.283v-7.753h12.295c0.57321 0.5721 1.3492 0.8947 2.159 0.89762 1.6968 1.1e-4 3.0723-1.3759 3.0722-3.0727 1.1e-4 -1.6968-1.3754-3.0723-3.0722-3.0722-0.81363 5e-5 -1.594 0.32287-2.1699 0.89762h-12.284v-7.7499h12.295c0.57321 0.5721 1.3492 0.8947 2.159 0.89762 1.6968 1.1e-4 3.0723-1.3754 3.0722-3.0722 1.1e-4 -1.6968-1.3754-3.0723-3.0722-3.0722-0.81363 5e-5 -1.594 0.32287-2.1699 0.89762h-12.284v-19.396c0-0.15199-0.01517-0.30015-0.01913-0.45114h12.303c0.5759 0.57475 1.3563 0.89757 2.1699 0.89762 1.6968 1e-4 3.0723-1.3759 3.0722-3.0727 1e-4 -1.6968-1.3754-3.0723-3.0722-3.0722-0.8098 0.00293-1.5858 0.32553-2.159 0.89762h-12.997c-1.6432-5.5691-6.0616-9.9213-11.677-11.465v-14.176c0.57208-0.57321 0.89469-1.3487 0.89762-2.1585 1.1e-4 -1.6968-1.3754-3.0728-3.0722-3.0727-1.6968-1.105e-4 -3.0723 1.3759-3.0722 3.0727 5e-5 0.81363 0.32287 1.594 0.89762 2.1699v13.551c-0.0542-5.05e-4 -0.10644-0.008785-0.16071-0.008785h-7.5892v-13.553c0.57209-0.57322 0.89469-1.3492 0.89762-2.159 1.1e-4 -1.6968-1.3754-3.0723-3.0722-3.0722-1.6968-1.105e-4 -3.0723 1.3754-3.0722 3.0722 5e-5 0.81363 0.32287 1.594 0.89762 2.1699v13.542h-7.7499v-13.553c0.57209-0.57322 0.89469-1.3487 0.89762-2.1585 1.1e-4 -1.6968-1.3754-3.0728-3.0722-3.0727-1.6968-1.105e-4 -3.0723 1.3759-3.0722 3.0727 4.8e-5 0.81363 0.32287 1.594 0.89762 2.1699v13.542l-7.7411-5.17e-4v-13.565c0.5721-0.57321 0.8947-1.3492 0.89762-2.159 1.1e-4 -1.6968-1.3759-3.0723-3.0727-3.0722-1.6968-1.1e-4 -3.0723 1.3754-3.0722 3.0722 5e-5 0.81363 0.32287 1.594 0.89762 2.1699v13.554l-7.7499-5.16e-4v-13.565c0.5721-0.57321 0.8947-1.3492 0.89762-2.159 1.1e-4 -1.6968-1.3754-3.0723-3.0722-3.0722l-0.00155-5.168e-4z" fill="#fff"/><path d="m54.142 1.28c-7.7785-0.10611-12.693 4.0778-12.693 4.0778s-4.8045 3.244-6.8197 5.6885c-2.0152 2.4446-3.9998 3.3161-3.9998 3.3161l-10.92 4.4292s-4.3039 2.004-4.6829 6.8874c-0.37903 4.8834 8.6052 6.8151 8.6052 6.8151l10.779 1.2867c-3.797 2.1848-6.349 6.2714-6.349 10.984v74.649c0 7.0224 5.6533 12.676 12.676 12.676h74.649c7.0224 0 12.676-5.6533 12.676-12.676v-28.141c19.08-22.042 22.782-33.839 22.782-33.839s2.3205-7.1538 4.8922-15.174c2.5717-8.0199-3.6974-6.8585-3.6974-6.8585l-24.252 6.7293c-1.207-5.7485-6.2825-10.041-12.4-10.041h-33.177c-1.9266-19.83-13.78-25.894-13.78-25.894-5.3521-3.6273-10.213-4.8599-14.287-4.9155z" fill="#121e2c"/><path d="m40.27 37.282c-3.9647 0-7.1567 3.1915-7.1567 7.1562v40.219c0.96019-8.4807 4.4328-18.052 9.6733-24.824 9.8714-12.755 9.3931-19.262 5.7521-22.552zm42.644 0c0.24496 10.488-4.3418 20.083-4.3418 20.083l44.46-13.835c-0.44487-3.5314-3.4372-6.2477-7.0931-6.2477zm-49.801 61.069v21.844c0 3.9647 3.192 7.1562 7.1567 7.1562h18.112c-8.3075-3.693-21.415-12.054-25.268-29z" fill="#29befe"/><path d="m149.79 41.432-69.703 20.837s-18.894 12.226-6.2239 35.914c0.31428-4e-3 39.979 0.0384 39.979 0.0384s5.3864-3.9688 9.3648-9.8406l-40.695-0.25269s-2.0754 0.0793-2.0075-2.3201c0.068-2.3994 1.2177-2.4825 1.2177-2.4825l44.832 0.25605s3.3352-2.6554 8.4851-11.307l-46.34-0.0399s-1.8324-0.34051-1.7768-2.6268c0.0556-2.2863 2.6305-2.585 2.6305-2.585l45.957-0.17048s2.2148 0.37311 4.94-2.6224c2.7252-2.9954 9.801-21.321 9.801-21.321s0.63122-1.6448-0.46214-1.4781zm-72.26 60.929 33.354-0.22045s-4.43 6.7245-14.346 7.0264c-14.503 0.44144-19.008-6.8059-19.008-6.8059zm-39.296-87.393 7.3033 15.24s22.892 2.1374 4.4586 29.071c-18.433 26.934-7.9015 44.329-7.9015 44.329s10.309 21.075 36.028 23.294l35.722 0.45927s7.6669 5e-3 8.9801-7.2795l-0.0255-22.663s-10.703 16.455-23.723 17.408c-9.6849 0.70923-14.934-1.1038-17.672-2.5611-2.2513-1.1981-30.046-14.686-11.338-50.201 16.735-31.77-0.73572-47.166-0.73572-47.166l-13.986 3.0599s0.67535 2.9676-1.8951 4.436c-1.9916 1.1377-5.4854 0.11131-6.6183-1.8831-1.1522-2.0285-0.22903-5.5118 1.8024-6.7625 2.7445-1.6898 5.1812-0.15486 5.1812-0.15486l12.185-2.4294s-15.541-10.99-27.765 3.8033zm2.126 14.889s-16.877-2.0953-19.634-2.9542c-2.7568-0.85892-0.37994-2.5393-0.37994-2.5393s10.175-2.8442 14.302-6.5923z" fill="#fff"/></g></svg>
|
goosebit/ui/static/js/devices.js
CHANGED
@@ -23,18 +23,13 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
23
23
|
select: true,
|
24
24
|
rowId: "uuid",
|
25
25
|
ajax: {
|
26
|
-
url: "/
|
26
|
+
url: "/ui/bff/devices/",
|
27
27
|
contentType: "application/json",
|
28
28
|
},
|
29
29
|
initComplete: () => {
|
30
30
|
updateBtnState();
|
31
31
|
},
|
32
32
|
columnDefs: [
|
33
|
-
{
|
34
|
-
targets: [1, 2, 3, 4, 5, 6, 9, 10],
|
35
|
-
searchable: true,
|
36
|
-
orderable: true,
|
37
|
-
},
|
38
33
|
{
|
39
34
|
targets: "_all",
|
40
35
|
searchable: false,
|
@@ -57,16 +52,15 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
57
52
|
return data;
|
58
53
|
},
|
59
54
|
},
|
60
|
-
{ data: "uuid" },
|
61
|
-
{ data: "name" },
|
55
|
+
{ data: "uuid", searchable: true, orderable: true },
|
56
|
+
{ data: "name", searchable: true, orderable: true },
|
62
57
|
{ data: "hw_model" },
|
63
58
|
{ data: "hw_revision" },
|
64
|
-
{ data: "feed" },
|
65
|
-
{ data: "
|
66
|
-
{ data: "
|
67
|
-
{ data: "
|
68
|
-
{ data: "
|
69
|
-
{ data: "state" },
|
59
|
+
{ data: "feed", searchable: true, orderable: true },
|
60
|
+
{ data: "sw_version", searchable: true, orderable: true },
|
61
|
+
{ data: "sw_target_version" },
|
62
|
+
{ data: "update_mode", searchable: true, orderable: true },
|
63
|
+
{ data: "last_state", searchable: true, orderable: true },
|
70
64
|
{
|
71
65
|
data: "force_update",
|
72
66
|
render: (data, type) => {
|
@@ -129,25 +123,10 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
129
123
|
buttons: [
|
130
124
|
{
|
131
125
|
text: '<i class="bi bi-pen" ></i>',
|
132
|
-
action: (e, dt) => {
|
133
|
-
const input = document.getElementById("device-selected-name");
|
134
|
-
input.value = dt
|
135
|
-
.rows({ selected: true })
|
136
|
-
.data()
|
137
|
-
.toArray()
|
138
|
-
.map((d) => d.name)[0];
|
139
|
-
|
140
|
-
new bootstrap.Modal("#device-rename-modal").show();
|
141
|
-
},
|
142
|
-
className: "buttons-rename",
|
143
|
-
titleAttr: "Rename Devices",
|
144
|
-
},
|
145
|
-
{
|
146
|
-
text: '<i class="bi bi-gear" ></i>',
|
147
126
|
action: () => {
|
148
127
|
const selectedDevice = dataTable.rows({ selected: true }).data().toArray()[0];
|
149
|
-
$("#
|
150
|
-
$("#
|
128
|
+
$("#device-selected-name").val(selectedDevice.name);
|
129
|
+
$("#device-selected-feed").val(selectedDevice.feed);
|
151
130
|
|
152
131
|
let selectedValue;
|
153
132
|
if (selectedDevice.update_mode === "Rollout") {
|
@@ -155,9 +134,9 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
155
134
|
} else if (selectedDevice.update_mode === "Latest") {
|
156
135
|
selectedValue = "latest";
|
157
136
|
} else {
|
158
|
-
selectedValue = selectedDevice.
|
137
|
+
selectedValue = selectedDevice.sw_assigned;
|
159
138
|
}
|
160
|
-
$("#selected-
|
139
|
+
$("#selected-sw").val(selectedValue);
|
161
140
|
|
162
141
|
new bootstrap.Modal("#device-config-modal").show();
|
163
142
|
},
|
@@ -166,39 +145,39 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
166
145
|
},
|
167
146
|
{
|
168
147
|
text: '<i class="bi bi-trash" ></i>',
|
169
|
-
action: (e, dt) => {
|
148
|
+
action: async (e, dt) => {
|
170
149
|
const selectedDevices = dt
|
171
150
|
.rows({ selected: true })
|
172
151
|
.data()
|
173
152
|
.toArray()
|
174
153
|
.map((d) => d.uuid);
|
175
|
-
deleteDevices(selectedDevices);
|
154
|
+
await deleteDevices(selectedDevices);
|
176
155
|
},
|
177
156
|
className: "buttons-delete",
|
178
157
|
titleAttr: "Delete Devices",
|
179
158
|
},
|
180
159
|
{
|
181
160
|
text: '<i class="bi bi-box-arrow-in-up-right"></i>',
|
182
|
-
action: () => {
|
161
|
+
action: async () => {
|
183
162
|
const selectedDevices = dataTable
|
184
163
|
.rows({ selected: true })
|
185
164
|
.data()
|
186
165
|
.toArray()
|
187
166
|
.map((d) => d.uuid);
|
188
|
-
forceUpdateDevices(selectedDevices);
|
167
|
+
await forceUpdateDevices(selectedDevices);
|
189
168
|
},
|
190
169
|
className: "buttons-force-update",
|
191
170
|
titleAttr: "Force Update",
|
192
171
|
},
|
193
172
|
{
|
194
173
|
text: '<i class="bi bi-pin-angle"></i>',
|
195
|
-
action: () => {
|
174
|
+
action: async () => {
|
196
175
|
const selectedDevices = dataTable
|
197
176
|
.rows({ selected: true })
|
198
177
|
.data()
|
199
178
|
.toArray()
|
200
179
|
.map((d) => d.uuid);
|
201
|
-
pinDevices(selectedDevices);
|
180
|
+
await pinDevices(selectedDevices);
|
202
181
|
},
|
203
182
|
className: "buttons-pin",
|
204
183
|
titleAttr: "Pin Version",
|
@@ -208,11 +187,6 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
208
187
|
},
|
209
188
|
});
|
210
189
|
|
211
|
-
dataTable.on("click", "button.edit-name", (e) => {
|
212
|
-
const data = dataTable.row(e.target.closest("tr")).data();
|
213
|
-
updateDeviceName(data.uuid);
|
214
|
-
});
|
215
|
-
|
216
190
|
dataTable
|
217
191
|
.on("select", () => {
|
218
192
|
updateBtnState();
|
@@ -225,7 +199,28 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
225
199
|
dataTable.ajax.reload(null, false);
|
226
200
|
}, TABLE_UPDATE_TIME);
|
227
201
|
|
228
|
-
await
|
202
|
+
await updateSoftwareSelection(true);
|
203
|
+
|
204
|
+
// Config form submit
|
205
|
+
const configForm = document.getElementById("device-config-form");
|
206
|
+
configForm.addEventListener(
|
207
|
+
"submit",
|
208
|
+
async (event) => {
|
209
|
+
if (configForm.checkValidity() === false) {
|
210
|
+
event.preventDefault();
|
211
|
+
event.stopPropagation();
|
212
|
+
configForm.classList.add("was-validated");
|
213
|
+
} else {
|
214
|
+
event.preventDefault();
|
215
|
+
await updateDeviceConfig();
|
216
|
+
configForm.classList.remove("was-validated");
|
217
|
+
configForm.reset();
|
218
|
+
const modal = bootstrap.Modal.getInstance(document.getElementById("device-config-modal"));
|
219
|
+
modal.hide();
|
220
|
+
}
|
221
|
+
},
|
222
|
+
false,
|
223
|
+
);
|
229
224
|
});
|
230
225
|
|
231
226
|
function updateBtnState() {
|
@@ -244,44 +239,25 @@ function updateBtnState() {
|
|
244
239
|
}
|
245
240
|
if (dataTable.rows({ selected: true }).count() === 1) {
|
246
241
|
document.querySelector("button.buttons-logs").classList.remove("disabled");
|
247
|
-
document.querySelector("button.buttons-rename").classList.remove("disabled");
|
248
242
|
} else {
|
249
243
|
document.querySelector("button.buttons-logs").classList.add("disabled");
|
250
|
-
document.querySelector("button.buttons-rename").classList.add("disabled");
|
251
244
|
}
|
252
245
|
}
|
253
246
|
|
254
247
|
async function updateDeviceConfig() {
|
255
|
-
const devices = dataTable
|
256
|
-
.rows({ selected: true })
|
257
|
-
.data()
|
258
|
-
.toArray()
|
259
|
-
.map((d) => d.uuid);
|
260
|
-
const firmware = document.getElementById("selected-fw").value;
|
261
|
-
const feed = document.getElementById("rollout-selected-feed").value;
|
262
|
-
const flavor = document.getElementById("rollout-selected-flavor").value;
|
263
|
-
|
264
|
-
try {
|
265
|
-
await post("/api/devices/update", { devices, firmware, feed, flavor });
|
266
|
-
} catch (error) {
|
267
|
-
console.error("Update device config failed:", error);
|
268
|
-
}
|
269
|
-
|
270
|
-
setTimeout(updateDeviceList, 50);
|
271
|
-
}
|
272
|
-
|
273
|
-
async function updateDeviceName() {
|
274
248
|
const devices = dataTable
|
275
249
|
.rows({ selected: true })
|
276
250
|
.data()
|
277
251
|
.toArray()
|
278
252
|
.map((d) => d.uuid);
|
279
253
|
const name = document.getElementById("device-selected-name").value;
|
254
|
+
const feed = document.getElementById("device-selected-feed").value;
|
255
|
+
const software = document.getElementById("selected-sw").value;
|
280
256
|
|
281
257
|
try {
|
282
|
-
await
|
258
|
+
await patch_request("/ui/bff/devices", { devices, name, feed, software });
|
283
259
|
} catch (error) {
|
284
|
-
console.error("Update device
|
260
|
+
console.error("Update device config failed:", error);
|
285
261
|
}
|
286
262
|
|
287
263
|
setTimeout(updateDeviceList, 50);
|
@@ -289,7 +265,7 @@ async function updateDeviceName() {
|
|
289
265
|
|
290
266
|
async function forceUpdateDevices(devices) {
|
291
267
|
try {
|
292
|
-
await
|
268
|
+
await patch_request("/ui/bff/devices", { devices, force_update: true });
|
293
269
|
} catch (error) {
|
294
270
|
console.error("Update force update state failed:", error);
|
295
271
|
}
|
@@ -299,7 +275,7 @@ async function forceUpdateDevices(devices) {
|
|
299
275
|
|
300
276
|
async function deleteDevices(devices) {
|
301
277
|
try {
|
302
|
-
await
|
278
|
+
await delete_request("/ui/bff/devices", { devices });
|
303
279
|
} catch (error) {
|
304
280
|
console.error("Delete device failed:", error);
|
305
281
|
}
|
@@ -309,7 +285,7 @@ async function deleteDevices(devices) {
|
|
309
285
|
|
310
286
|
async function pinDevices(devices) {
|
311
287
|
try {
|
312
|
-
await
|
288
|
+
await patch_request("/ui/bff/devices", { devices, pinned: true });
|
313
289
|
} catch (error) {
|
314
290
|
console.error("Error:", error);
|
315
291
|
}
|
goosebit/ui/static/js/index.js
CHANGED
@@ -20,18 +20,13 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
20
20
|
}
|
21
21
|
},
|
22
22
|
ajax: {
|
23
|
-
url: "/
|
23
|
+
url: "/ui/bff/devices",
|
24
24
|
contentType: "application/json",
|
25
25
|
},
|
26
26
|
initComplete: () => {
|
27
27
|
updateBtnState();
|
28
28
|
},
|
29
29
|
columnDefs: [
|
30
|
-
{
|
31
|
-
targets: [0, 2],
|
32
|
-
searchable: true,
|
33
|
-
orderable: true,
|
34
|
-
},
|
35
30
|
{
|
36
31
|
targets: "_all",
|
37
32
|
searchable: false,
|
@@ -40,7 +35,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
40
35
|
},
|
41
36
|
],
|
42
37
|
columns: [
|
43
|
-
{ data: "name" },
|
38
|
+
{ data: "name", searchable: true, orderable: true },
|
44
39
|
{
|
45
40
|
data: "online",
|
46
41
|
render: (data, type) => {
|
@@ -55,8 +50,8 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
55
50
|
return data;
|
56
51
|
},
|
57
52
|
},
|
58
|
-
{ data: "uuid" },
|
59
|
-
{ data: "
|
53
|
+
{ data: "uuid", searchable: true, orderable: true },
|
54
|
+
{ data: "sw_version", searchable: true, orderable: true },
|
60
55
|
{
|
61
56
|
data: "progress",
|
62
57
|
render: (data, type) => {
|
@@ -0,0 +1,23 @@
|
|
1
|
+
loginForm = document.getElementById("login_form");
|
2
|
+
|
3
|
+
async function login() {
|
4
|
+
const formData = new FormData(loginForm);
|
5
|
+
|
6
|
+
try {
|
7
|
+
const response = await fetch("/login", {
|
8
|
+
method: "POST",
|
9
|
+
body: formData,
|
10
|
+
});
|
11
|
+
tokenData = await response.json();
|
12
|
+
document.cookie = `session_id=${tokenData.access_token}; path=/`;
|
13
|
+
location.reload();
|
14
|
+
} catch (e) {
|
15
|
+
// handle form errors later
|
16
|
+
console.error(e);
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
loginForm.addEventListener("submit", (event) => {
|
21
|
+
event.preventDefault();
|
22
|
+
login();
|
23
|
+
});
|
goosebit/ui/static/js/logs.js
CHANGED
@@ -20,6 +20,6 @@ function create_ws(s) {
|
|
20
20
|
const l = window.location;
|
21
21
|
const protocol = l.protocol === "https:" ? "wss://" : "ws://";
|
22
22
|
const port = l.port !== "80" || l.port !== "443" ? l.port : "";
|
23
|
-
const url = `${protocol}${l.hostname}
|
23
|
+
const url = `${protocol}${l.hostname}:${port}${s}`;
|
24
24
|
return new WebSocket(url);
|
25
25
|
}
|
@@ -23,18 +23,13 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
23
23
|
select: true,
|
24
24
|
rowId: "id",
|
25
25
|
ajax: {
|
26
|
-
url: "/
|
26
|
+
url: "/ui/bff/rollouts",
|
27
27
|
contentType: "application/json",
|
28
28
|
},
|
29
29
|
initComplete: () => {
|
30
30
|
updateBtnState();
|
31
31
|
},
|
32
32
|
columnDefs: [
|
33
|
-
{
|
34
|
-
targets: [1, 2, 3, 4],
|
35
|
-
searchable: true,
|
36
|
-
orderable: true,
|
37
|
-
},
|
38
33
|
{
|
39
34
|
targets: "_all",
|
40
35
|
searchable: false,
|
@@ -43,12 +38,11 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
43
38
|
],
|
44
39
|
columns: [
|
45
40
|
{ data: "id", visible: false },
|
46
|
-
{ data: "created_at", render: (data) => new Date(data).toLocaleString() },
|
47
|
-
{ data: "name" },
|
48
|
-
{ data: "feed" },
|
49
|
-
{ data: "
|
50
|
-
{ data: "
|
51
|
-
{ data: "fw_version" },
|
41
|
+
{ data: "created_at", orderable: true, render: (data) => new Date(data).toLocaleString() },
|
42
|
+
{ data: "name", searchable: true, orderable: true },
|
43
|
+
{ data: "feed", searchable: true, orderable: true },
|
44
|
+
{ data: "sw_file" },
|
45
|
+
{ data: "sw_version" },
|
52
46
|
{
|
53
47
|
data: "paused",
|
54
48
|
render: (data, type) => {
|
@@ -78,7 +72,7 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
78
72
|
new bootstrap.Modal("#rollout-create-modal").show();
|
79
73
|
},
|
80
74
|
className: "buttons-create",
|
81
|
-
titleAttr: "
|
75
|
+
titleAttr: "Add Rollout",
|
82
76
|
},
|
83
77
|
{
|
84
78
|
text: '<i class="bi bi-play-fill" ></i>',
|
@@ -134,7 +128,28 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
134
128
|
|
135
129
|
updateRolloutList();
|
136
130
|
|
137
|
-
await
|
131
|
+
await updateSoftwareSelection();
|
132
|
+
|
133
|
+
// Creation form submit
|
134
|
+
const form = document.getElementById("rollout-form");
|
135
|
+
form.addEventListener(
|
136
|
+
"submit",
|
137
|
+
(event) => {
|
138
|
+
if (form.checkValidity() === false) {
|
139
|
+
event.preventDefault();
|
140
|
+
event.stopPropagation();
|
141
|
+
form.classList.add("was-validated");
|
142
|
+
} else {
|
143
|
+
event.preventDefault();
|
144
|
+
createRollout();
|
145
|
+
form.classList.remove("was-validated");
|
146
|
+
form.reset();
|
147
|
+
const modal = bootstrap.Modal.getInstance(document.getElementById("rollout-create-modal"));
|
148
|
+
modal.hide();
|
149
|
+
}
|
150
|
+
},
|
151
|
+
false,
|
152
|
+
);
|
138
153
|
});
|
139
154
|
|
140
155
|
function updateBtnState() {
|
@@ -160,11 +175,10 @@ function updateBtnState() {
|
|
160
175
|
async function createRollout() {
|
161
176
|
const name = document.getElementById("rollout-selected-name").value;
|
162
177
|
const feed = document.getElementById("rollout-selected-feed").value;
|
163
|
-
const
|
164
|
-
const firmware_id = document.getElementById("selected-fw").value;
|
178
|
+
const software_id = document.getElementById("selected-sw").value;
|
165
179
|
|
166
180
|
try {
|
167
|
-
await
|
181
|
+
await post_request("/ui/bff/rollouts", { name, feed, software_id });
|
168
182
|
} catch (error) {
|
169
183
|
console.error("Rollout creation failed:", error);
|
170
184
|
}
|
@@ -178,7 +192,7 @@ function updateRolloutList() {
|
|
178
192
|
|
179
193
|
async function deleteRollouts(ids) {
|
180
194
|
try {
|
181
|
-
await
|
195
|
+
await delete_request("/ui/bff/rollouts", { ids });
|
182
196
|
} catch (error) {
|
183
197
|
console.error("Rollouts deletion failed:", error);
|
184
198
|
}
|
@@ -189,7 +203,7 @@ async function deleteRollouts(ids) {
|
|
189
203
|
|
190
204
|
async function pauseRollouts(ids, paused) {
|
191
205
|
try {
|
192
|
-
await
|
206
|
+
await patch_request("/ui/bff/rollouts", { ids, paused });
|
193
207
|
} catch (error) {
|
194
208
|
console.error(`Rollouts ${paused ? "pausing" : "unpausing"} failed:`, error);
|
195
209
|
}
|