MCPcopy Create free account
hub / github.com/devfeel/dottask / CounterOutputHttpHandler

Method CounterOutputHttpHandler

tasks_httphandler.go:10–27  ·  view source on GitHub ↗

CounterOutputHttpHandler Http Handler for output counter info

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

8
9// CounterOutputHttpHandler Http Handler for output counter info
10func (service *TaskService) CounterOutputHttpHandler(w http.ResponseWriter, r *http.Request) {
11 tableData := ""
12 for _, v := range service.GetAllTaskCountInfo() {
13 tableData += "<tr><td>" + v.TaskID + "</td><td>" + v.Lable + "</td><td>" + fmt.Sprint(v.Count) + "</td></tr>"
14 }
15 col := `<colgroup>
16 <col width="40%">
17 <col width="30%">
18 <col width="30%">
19 </colgroup>`
20 header := `<tr>
21 <th>TaskID</th>
22 <th>Lable</th>
23 <th>Value</th>
24 </tr>`
25 html := createOneTableHtml(col, "TaskCounterInfo", header, tableData)
26 w.Write([]byte(html))
27}
28
29// TaskOutputHttpHandler Http Handler for output task info
30func (service *TaskService) TaskOutputHttpHandler(w http.ResponseWriter, r *http.Request) {

Callers

nothing calls this directly

Calls 2

GetAllTaskCountInfoMethod · 0.95
createOneTableHtmlFunction · 0.85

Tested by

no test coverage detected