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

Commit056918e

Browse files
committed
remove interval none
1 parentbffc673 commit056918e

File tree

6 files changed

+17
-34
lines changed

6 files changed

+17
-34
lines changed

‎coderd/apidoc/docs.go

Lines changed: 1 addition & 8 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/apidoc/swagger.json

Lines changed: 3 additions & 11 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/insights.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ func (api *API) insightsTemplates(rw http.ResponseWriter, r *http.Request) {
196196
// to parse the time ourselves.
197197
startTimeString=p.String(vals,"","start_time")
198198
endTimeString=p.String(vals,"","end_time")
199-
intervalString=p.String(vals,string(codersdk.InsightsReportIntervalNone),"interval")
199+
intervalString=p.String(vals,"","interval")
200200
templateIDs=p.UUIDs(vals, []uuid.UUID{},"template_ids")
201201
)
202202
p.ErrorExcessParams(vals)
@@ -224,7 +224,7 @@ func (api *API) insightsTemplates(rw http.ResponseWriter, r *http.Request) {
224224
err:=api.Database.InTx(func(db database.Store)error {
225225
varerrerror
226226

227-
ifinterval!=codersdk.InsightsReportIntervalNone {
227+
ifinterval!="" {
228228
dailyUsage,err=db.GetTemplateDailyInsights(ctx, database.GetTemplateDailyInsightsParams{
229229
StartTime:startTime,
230230
EndTime:endTime,
@@ -435,15 +435,15 @@ func parseInsightsStartAndEndTime(ctx context.Context, rw http.ResponseWriter, s
435435

436436
funcverifyInsightsInterval(ctx context.Context,rw http.ResponseWriter,intervalStringstring) (codersdk.InsightsReportInterval,bool) {
437437
switchv:=codersdk.InsightsReportInterval(intervalString);v {
438-
casecodersdk.InsightsReportIntervalDay,codersdk.InsightsReportIntervalNone:
438+
casecodersdk.InsightsReportIntervalDay,"":
439439
returnv,true
440440
default:
441441
httpapi.Write(ctx,rw,http.StatusBadRequest, codersdk.Response{
442442
Message:"Query parameter has invalid value.",
443443
Validations: []codersdk.ValidationError{
444444
{
445445
Field:"interval",
446-
Detail:fmt.Sprintf("must be one of %v", []codersdk.InsightsReportInterval{codersdk.InsightsReportIntervalNone,codersdk.InsightsReportIntervalDay}),
446+
Detail:fmt.Sprintf("must be one of %v", []codersdk.InsightsReportInterval{codersdk.InsightsReportIntervalDay}),
447447
},
448448
},
449449
})

‎codersdk/insights.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ type InsightsReportInterval string
2121

2222
// InsightsReportInterval enums.
2323
const (
24-
InsightsReportIntervalNoneInsightsReportInterval="none"
25-
InsightsReportIntervalDayInsightsReportInterval="day"
24+
InsightsReportIntervalDayInsightsReportInterval="day"
2625
)
2726

2827
// UserLatencyInsightsResponse is the response from the user latency insights
@@ -109,7 +108,7 @@ type TemplateInsightsIntervalReport struct {
109108
StartTime time.Time`json:"start_time" format:"date-time"`
110109
EndTime time.Time`json:"end_time" format:"date-time"`
111110
TemplateIDs []uuid.UUID`json:"template_ids" format:"uuid"`
112-
IntervalInsightsReportInterval`json:"interval" example:"day"`
111+
IntervalInsightsReportInterval`json:"interval"`
113112
ActiveUsersint64`json:"active_users" example:"14"`
114113
}
115114

@@ -157,7 +156,7 @@ type TemplateInsightsRequest struct {
157156
StartTime time.Time`json:"start_time" format:"date-time"`
158157
EndTime time.Time`json:"end_time" format:"date-time"`
159158
TemplateIDs []uuid.UUID`json:"template_ids" format:"uuid"`
160-
IntervalInsightsReportInterval`json:"interval" example:"day"`
159+
IntervalInsightsReportInterval`json:"interval"`
161160
}
162161

163162
func (c*Client)TemplateInsights(ctx context.Context,reqTemplateInsightsRequest) (TemplateInsightsResponse,error) {

‎docs/api/schemas.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2914,17 +2914,16 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
29142914
##codersdk.InsightsReportInterval
29152915

29162916
```json
2917-
"none"
2917+
"day"
29182918
```
29192919

29202920
###Properties
29212921

29222922
####Enumerated Values
29232923

2924-
| Value|
2925-
| ------|
2926-
|`none`|
2927-
|`day`|
2924+
| Value|
2925+
| -----|
2926+
|`day`|
29282927

29292928
##codersdk.IssueReconnectingPTYSignedTokenRequest
29302929

‎site/src/api/typesGenerated.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,8 +1590,8 @@ export const GitProviders: GitProvider[] = [
15901590
]
15911591

15921592
// From codersdk/insights.go
1593-
exporttypeInsightsReportInterval="day"|"none"
1594-
exportconstInsightsReportIntervals:InsightsReportInterval[]=["day","none"]
1593+
exporttypeInsightsReportInterval="day"
1594+
exportconstInsightsReportIntervals:InsightsReportInterval[]=["day"]
15951595

15961596
// From codersdk/provisionerdaemons.go
15971597
exporttypeJobErrorCode=

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp