diff --git a/html/dsslist.html b/html/dsslist.html new file mode 100644 index 0000000000000000000000000000000000000000..5fab85eb07862f90f140c47029eec29873fa5974 --- /dev/null +++ b/html/dsslist.html @@ -0,0 +1,35 @@ +<html> + <head> + <title>DSS list - MaDIPHS Integration platform</title> + </head> + <body> + <a href="/"><img src="css/images/MaDiPHS_logo.png" style="width: 300px;" alt="MaDiPHS logo"/></a> + <h1>DSS list</h1> + <p>A human-friendly view of the data returned from <a href="/dss/rest/dss">this endpoint</a></p> + <div id="dsslist"> + + </div> + </body> + <script type="text/javascript"> + fetch("https://test.madiphs.org/dss/rest/dss/") + .then(x => x.json()) + .then(dsss => + { + var html = ""; + for(var i in dsss) + { + dss = dsss[i]; + html += "<h2>" + dss.name + "</h2>\n"; + html += "<ul>"; + for(var j in dss.models) + { + model = dss.models[j]; + console.info(model.name); + html += "<li><b>" + model.name + "</b>: " + model.purpose + "</li>"; + } + html += "</ul>"; + } + document.getElementById("dsslist").innerHTML = html; + }); + </script> +</html> \ No newline at end of file diff --git a/html/index.html b/html/index.html index 7e36dff71a174be2d13dedbc1fcc42401212dbfb..b0412b1b72b13423966a2f91078078b1e7535204 100644 --- a/html/index.html +++ b/html/index.html @@ -1,3 +1,4 @@ +<!DOCTYPE html> <html> <head> <title>MaDIPHS Integration platform</title> @@ -15,13 +16,13 @@ </p> <ul> <li><a href="/dss/apidocs/">API documentation</a></li> - <li><a href="/dss/rest/dss">List all DSSs available</a></p></li> + <li><a href="/dsslist.html">List all DSSs available</a></p></li> </ul> <h3>Weather API</h3> <p>This is the web service API for discovery of and usage of weather datasources, providing input data to DSS, both measured/calculated data from the current growing season and weather forecasts.</p> <ul> <li><a href="/weather/apidocs/">API documentation</a></li> - <li><a href="/weather/rest/dss">List all DSSs available</a></p></li> + <li><a href="/weatherdatasourcelist">List all weather datasources available</a></p></li> </ul> <p style="font-size: small;"> The DSS API and the Weather API are based on software developed for a similar purpose in Europe in the <a href="https://platform.ipmdecisions.net/" target="new">IPM Decisions project</a> diff --git a/html/weatherdatasourcelist.html b/html/weatherdatasourcelist.html new file mode 100644 index 0000000000000000000000000000000000000000..3cc97955d65075b8456233b1c6c63b6f5fe33995 --- /dev/null +++ b/html/weatherdatasourcelist.html @@ -0,0 +1,28 @@ +<html> + <head> + <title>Weather datasource list - MaDIPHS Integration platform</title> + </head> + <body> + <a href="/"><img src="css/images/MaDiPHS_logo.png" style="width: 300px;" alt="MaDiPHS logo"/></a> + <h1>DSS list</h1> + <p>A human-friendly view of the data returned from <a href="/weather/rest/weatherdatasource">this endpoint</a></p> + <div id="weatherdatasourcelist"> + + </div> + </body> + <script type="text/javascript"> + fetch("https://test.madiphs.org/weather/rest/weatherdatasource") + .then(x => x.json()) + .then(wdss => + { + var html = ""; + for(var i in wdss) + { + wds = wdss[i]; + html += "<h2>" + wds.name + "</h2>\n"; + html += "<p>" + wds.description + "</p>\n"; + } + document.getElementById("weatherdatasourcelist").innerHTML = html; + }); + </script> +</html> \ No newline at end of file