* 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.
* 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.
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.