DecodeJSON(t, resp, &repo)
assert.EqualValues(t, &api.GeneralRepoSettings{
- MirrorsDisabled: setting.Repository.DisableMirrors,
- HTTPGitDisabled: setting.Repository.DisableHTTPGit,
- MigrationsDisabled: setting.Repository.DisableMigrations,
+ MirrorsDisabled: setting.Repository.DisableMirrors,
+ HTTPGitDisabled: setting.Repository.DisableHTTPGit,
+ MigrationsDisabled: setting.Repository.DisableMigrations,
+ TimeTrackingDisabled: false,
+ LFSDisabled: !setting.LFS.StartServer,
}, repo)
attachment := new(api.GeneralAttachmentSettings)
// GeneralRepoSettings contains global repository settings exposed by API
type GeneralRepoSettings struct {
- MirrorsDisabled bool `json:"mirrors_disabled"`
- HTTPGitDisabled bool `json:"http_git_disabled"`
- MigrationsDisabled bool `json:"migrations_disabled"`
+ MirrorsDisabled bool `json:"mirrors_disabled"`
+ HTTPGitDisabled bool `json:"http_git_disabled"`
+ MigrationsDisabled bool `json:"migrations_disabled"`
+ TimeTrackingDisabled bool `json:"time_tracking_disabled"`
+ LFSDisabled bool `json:"lfs_disabled"`
}
// GeneralUISettings contains global ui settings exposed by API
// "200":
// "$ref": "#/responses/GeneralRepoSettings"
ctx.JSON(http.StatusOK, api.GeneralRepoSettings{
- MirrorsDisabled: setting.Repository.DisableMirrors,
- HTTPGitDisabled: setting.Repository.DisableHTTPGit,
- MigrationsDisabled: setting.Repository.DisableMigrations,
+ MirrorsDisabled: setting.Repository.DisableMirrors,
+ HTTPGitDisabled: setting.Repository.DisableHTTPGit,
+ MigrationsDisabled: setting.Repository.DisableMigrations,
+ TimeTrackingDisabled: !setting.Service.EnableTimetracking,
+ LFSDisabled: !setting.LFS.StartServer,
})
}
"type": "boolean",
"x-go-name": "HTTPGitDisabled"
},
+ "lfs_disabled": {
+ "type": "boolean",
+ "x-go-name": "LFSDisabled"
+ },
"migrations_disabled": {
"type": "boolean",
"x-go-name": "MigrationsDisabled"
"mirrors_disabled": {
"type": "boolean",
"x-go-name": "MirrorsDisabled"
+ },
+ "time_tracking_disabled": {
+ "type": "boolean",
+ "x-go-name": "TimeTrackingDisabled"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"