TheThingsNetwork / lorawan-stack

The Things Stack, an Open Source LoRaWAN Network Server
https://www.thethingsindustries.com/stack/
Apache License 2.0
973 stars 304 forks source link

Pass configuration options to frontend #2913

Closed htdvisser closed 3 years ago

htdvisser commented 4 years ago

Summary

We need to find a way to pass backend configuration to the frontend.

Why do we need this?

What is already there? What do you see now?

What is missing? What do you want to see?

How do you propose to implement this?

Option A: Pass such configuration in the HTML template. This works for the Account frontend (because it runs on the Identity Server, but not for the Console, because the Identity Server runs on a different server.

Option B: Add a method to the ttn.lorawan.v3.Configuration service to get config options (this has my preference).

How do you propose to test this?

Can be unit-tested

Can you do this yourself and submit a Pull Request?

Yes, if I have time, but if anyone is interested in working on this, please comment!

KrishnaIyer commented 4 years ago

+1 for Option B.

bafonins commented 4 years ago

Are we talking about these https://github.com/TheThingsNetwork/lorawan-stack/blob/develop/pkg/webui/template.go#L93-L101 ?

I guess option A is the easiest. However, option B seems to be more appropriate and reliable. It is also quite helpful for mocking stack configuration for e2e tests.

kschiffer commented 4 years ago

Agreed. Option B.

htdvisser commented 4 years ago

With the API done, I'm handing this over to @kschiffer and/or @bafonins.