Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdafbba1

Browse files
committed
move interval loop
1 parent5588e39 commitdafbba1

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

‎coderd/insights.go

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -254,17 +254,6 @@ func (api *API) insightsTemplates(rw http.ResponseWriter, r *http.Request) {
254254
return
255255
}
256256

257-
intervalReports:= []codersdk.TemplateInsightsIntervalReport{}
258-
for_,row:=rangedailyUsage {
259-
intervalReports=append(intervalReports, codersdk.TemplateInsightsIntervalReport{
260-
StartTime:row.StartTime,
261-
EndTime:row.EndTime,
262-
Interval:interval,
263-
TemplateIDs:row.TemplateIDs,
264-
ActiveUsers:row.ActiveUsers,
265-
})
266-
}
267-
268257
resp:= codersdk.TemplateInsightsResponse{
269258
Report: codersdk.TemplateInsightsReport{
270259
StartTime:startTime,
@@ -273,7 +262,16 @@ func (api *API) insightsTemplates(rw http.ResponseWriter, r *http.Request) {
273262
ActiveUsers:usage.ActiveUsers,
274263
AppsUsage:convertTemplateInsightsBuiltinApps(usage),
275264
},
276-
IntervalReports:intervalReports,
265+
IntervalReports: []codersdk.TemplateInsightsIntervalReport{},
266+
}
267+
for_,row:=rangedailyUsage {
268+
resp.IntervalReports=append(resp.IntervalReports, codersdk.TemplateInsightsIntervalReport{
269+
StartTime:row.StartTime,
270+
EndTime:row.EndTime,
271+
Interval:interval,
272+
TemplateIDs:row.TemplateIDs,
273+
ActiveUsers:row.ActiveUsers,
274+
})
277275
}
278276
httpapi.Write(ctx,rw,http.StatusOK,resp)
279277
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp