[Task] add traffic light to monolith
This commit is contained in:
parent
2374f9331b
commit
d73c5d0cd9
|
@ -27,7 +27,7 @@ public class HomepageController {
|
||||||
* @param model Template model
|
* @param model Template model
|
||||||
* @return The constant template name fpr the stock admin frontend.
|
* @return The constant template name fpr the stock admin frontend.
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/admin", method = RequestMethod.GET)
|
@RequestMapping(value = "/stockadmin", method = RequestMethod.GET)
|
||||||
public String redirect(Model model) {
|
public String redirect(Model model) {
|
||||||
return this.STOCKADMINFRONTENDTEMPLATE;
|
return this.STOCKADMINFRONTENDTEMPLATE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<h2 th:text="${product.name}">Product Name</h2>
|
<h2 th:text="${product.name}">Product Name</h2>
|
||||||
|
<img class="icon" ng-src="{'localhost:65000/api/good/availablity/'+products.id| reloadSrc}}"/>
|
||||||
<p class="text-info text-uppercase" th:text="${product.price}">0,00 Euro</p>
|
<p class="text-info text-uppercase" th:text="${product.price}">0,00 Euro</p>
|
||||||
<p class="lead" th:text="${product.description}">Description.</p>
|
<p class="lead" th:text="${product.description}">Description.</p>
|
||||||
<div th:replace="fragments/reviews :: reviews"></div>
|
<div th:replace="fragments/reviews :: reviews"></div>
|
||||||
|
|
|
@ -11,7 +11,7 @@ import (
|
||||||
|
|
||||||
// Path to the svg image template, that shows the availablity or freshness of a given good
|
// Path to the svg image template, that shows the availablity or freshness of a given good
|
||||||
// with a traffic light food labeling system
|
// with a traffic light food labeling system
|
||||||
var GoodAvailabilityTemplate string
|
var GoodAvailablityTemplate string
|
||||||
var GoodFreshnessTemplate string
|
var GoodFreshnessTemplate string
|
||||||
|
|
||||||
// Function to calculate a percent value from a given value and an maximum value
|
// Function to calculate a percent value from a given value and an maximum value
|
||||||
|
@ -32,7 +32,7 @@ func getGoodAvailablitySVG(w http.ResponseWriter, count int) {
|
||||||
"process_radius": tempProcessRadius,
|
"process_radius": tempProcessRadius,
|
||||||
})
|
})
|
||||||
buf := bytes.NewBuffer(nil)
|
buf := bytes.NewBuffer(nil)
|
||||||
f, _ := os.Open(GoodAvailabilityTemplate) // Error handling elided for brevity.
|
f, _ := os.Open(GoodAvailablityTemplate) // Error handling elided for brevity.
|
||||||
io.Copy(buf, f) // Error handling elided for brevity.
|
io.Copy(buf, f) // Error handling elided for brevity.
|
||||||
f.Close()
|
f.Close()
|
||||||
|
|
||||||
|
|
Reference in New Issue