climsoft / climsoft-app

Web-based application that uses the API exposed by climsoft-api
MIT License
0 stars 2 forks source link

Build environment copy JSON config #21

Open isedwards opened 2 years ago

isedwards commented 2 years ago

Example JSON

{
    "dev.opencdms.org": {
        "domains": {
            "api-latest": "api-latest.opencdms.org",
            "api (stable)": "api.opencdms.org"
        },
        "defaultDomain": "api (stable)",
        "defaultLanguage": "en-EN",
        "defaultMode": "opencdms"
    },
    "kenya.openclimate.net": {
        "domains": {
            "KMD": "kmd_prod.openclimate.net"
        },
        "defaultDomain": "KMD",
        "defaultLanguage": "en-EN",
        "defaultMode": "climsoft"
    }
}

In the above example, only "domains" is mandatory. Other config values can assume defaults like "en-EN" language and "opencdms" mode. Defaults would also be used if the config values were invalid or not yet supported.

The image below shows the login screen with two additional dropdown boxes. The first allows the user to select the 'domain' being logged into (API being used). Once an API is selected, the front-end will query the API to ask what databases are available (e.g. {"production": "prod_db", "test_db": "test_db"}). image