Commit Graph

38 Commits

Author SHA1 Message Date
Björn Bohman ffeb822a21 Set name and label at creation of client. Fixes #48 (#49)
* Set name and label at creation of client. Fixes #48

Changes behaviour of the add button from directly creating an
configuration to directing the user to an "create configuration" view.

If no name is given the default name is used same way as before.
This means that the go backend works with the old frontend as well with the new.

* Follow best practice in writing json.

Also handle err.

* 2 Bug fixes.

1. Fix bug introduced in last commit.
Don't try to json encode data that is already encoded.

2. Honor --max-number-client-config
When the creation moved from Clients.svelte to NewClient.svelte the
check in returned json for errors got lost. Now it is back.
2020-04-14 15:26:34 +02:00
Björn Bohman fb5cf90751 Add limit in how many configurations each user may have. (#47)
* Add limit in how many configurations each user may have.

If the option max-number-client-config is more than 0 this number is the
maximum number of clients a user can create.

The setting only limits creation. If a user had created more
configurations before this setting is enforced or lowered the user may
user the service as before, just cant create any more configurations.

* Fix spelling and fmt as suggested by @luna-duclos

* Alert user when limit is reached.

When the user tries to create more configurations than are allow an
alert will pop up.

* Change http status as discussed with @freddd

http 400 seems a better fit than 429 as a more generic error.
2020-03-20 15:09:01 +01:00
dependabot[bot] 005b2413b7 Bump acorn from 5.7.3 to 5.7.4 in /ui (#45)
Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.3 to 5.7.4.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/5.7.3...5.7.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-03-16 09:25:05 +01:00
sclem e176ae04c2 ui: avoid "async race" with new client POST
The getClients() and POST request were being issued one after another
(not waiting for the POST to return). This can cause the GET /clients to
return the old list before the user config is updated. Waiting for the
POST to return before retrieving the new client list fixes the race.

This behavior can be reproduced by adding a time.Sleep(time.Second) to
the CreateClient server handler.
2020-01-17 11:22:26 -05:00
Fredrik Grönqvist b471f3dff5 Github actions & clean up to be able to do linting (#27)
* Github actions & clean up to be able to do linting

* renamed user

* pushing images to github packages

* Fixed tags
2019-12-19 13:03:03 +01:00
Fredrik Grönqvist c34711ebc0 Upgraded webpack 2019-12-10 14:46:17 +01:00
Daniel Lundin 8fae238166 Set content-type for config to avoid .txt suffixes on some devices 2019-10-09 13:17:22 +02:00
Daniel Lundin 2c046634ff Update screenshot 2019-10-09 13:12:09 +02:00
Daniel Lundin 21816558f3 Proper captilization of WireGuard 2019-10-09 13:02:48 +02:00
Daniel Lundin 0aeff20c97 Hide end nav section on small screens 2019-10-09 12:54:36 +02:00
Daniel Lundin c2acb485c7 Add footer with link + copyright notice 2019-10-09 12:45:43 +02:00
Daniel Lundin f5e41c937e Add some basic instructions 2019-10-09 12:31:38 +02:00
Daniel Lundin 4814533da6 Better copy 2019-10-03 19:54:24 +02:00
Daniel Lundin 4cc6bf6b70 Adjust layout to be more spacious 2019-10-03 19:51:44 +02:00
Daniel Lundin 4a072f69ac Move the back-button when editing client 2019-10-03 19:36:08 +02:00
Daniel Lundin 6636184c69 ui tweaks to make it purty 2019-10-03 19:21:31 +02:00
Daniel Lundin 8439119fc4 Change ui to use svelte material ui everywhere 2019-10-03 18:49:53 +02:00
Daniel Lundin e819b7b781 Style client card. Hide QR code on small screens 2019-10-03 17:34:04 +02:00
Daniel Lundin de8eec0e69 Use floating action button to add client 2019-10-03 16:51:52 +02:00
Daniel Lundin d6fe4d9817 Replace top bar 2019-10-03 15:51:36 +02:00
Daniel Lundin 0556dfef2a Rip out old frontend setup in favor of webpack 2019-10-03 15:15:37 +02:00
Daniel Lundin 23eae39199 Fix QR code to contain config, not link to it 2019-10-02 20:53:11 +02:00
Daniel Lundin 8682fe4f5b Generate QR code for loading config on mobile 2019-10-02 20:43:45 +02:00
Daniel Lundin a584e942eb Fix username when unauthenticated 2019-10-02 19:22:35 +02:00
Daniel Lundin adbda414a5 Remove logout button 2019-10-02 18:48:06 +02:00
Daniel Lundin 9b24d6355f Add logout button in nav 2019-07-27 18:41:03 +02:00
Daniel Lundin 353310f675 Implement auth using oauth2_proxy w/headers 2019-07-27 17:59:35 +02:00
Daniel Lundin 0e0e4e27fb Set background color of client cards based on key 2019-07-27 11:41:04 +02:00
Daniel Lundin 986bf8fb58 Add an icon to the clients list 2019-07-27 11:26:09 +02:00
Daniel Lundin 40430182f5 Add Notes field to client config 2019-07-27 11:01:07 +02:00
Daniel Lundin fc26305823 Implemented CRUD operations for clients 2019-07-20 20:48:08 +02:00
Daniel Lundin c82f5eccec Fix embedded assets, particularly when serving UI/App urls 2019-07-20 14:19:35 +02:00
Daniel Lundin 0762143528 Implemented downloading client config 2019-07-20 13:28:45 +02:00
Daniel Lundin 44c98b72b8 Begun styling the clients list 2019-07-20 12:57:11 +02:00
Daniel Lundin d1d69290fe Add some text to the about page 2019-07-20 12:34:14 +02:00
Daniel Lundin 49203fb2ea Rename term "device" => "client". Add some WIP ui components 2019-07-20 12:26:34 +02:00
Daniel Lundin a4f0e1f98e ui: update dependencies 2019-06-06 20:06:46 +02:00
Daniel Lundin e0e60f321f Add ui scaffolding 2019-06-06 19:48:24 +02:00