Skip to content

Commit

Permalink
export LFS & TimeTracking function status
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 committed Feb 19, 2021
1 parent 91424ff commit 1aae913
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
8 changes: 5 additions & 3 deletions integrations/api_settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ func TestAPIExposedSettings(t *testing.T) {

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)
Expand Down
8 changes: 5 additions & 3 deletions modules/structs/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ package structs

// 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
Expand Down
8 changes: 5 additions & 3 deletions routers/api/v1/settings/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ func GetGeneralRepoSettings(ctx *context.APIContext) {
// "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,
})
}

Expand Down
8 changes: 8 additions & 0 deletions templates/swagger/v1_json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -14101,13 +14101,21 @@
"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"
Expand Down

0 comments on commit 1aae913

Please sign in to comment.