]> source.dussan.org Git - gitea.git/commitdiff
Export LFS & TimeTracking function status (#14753)
author6543 <6543@obermui.de>
Sat, 20 Feb 2021 10:17:51 +0000 (11:17 +0100)
committerGitHub <noreply@github.com>
Sat, 20 Feb 2021 10:17:51 +0000 (11:17 +0100)
integrations/api_settings_test.go
modules/structs/settings.go
routers/api/v1/settings/settings.go
templates/swagger/v1_json.tmpl

index 19a005387696bd7dfcf20bb0bc4b464f599e0de0..fdd8b02d625d1de497fea8d03a9c35ccd0523c1a 100644 (file)
@@ -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)
index 5fd916affe91f01d7c536e58760c5421e819d2e7..e15c750356f68615be53c049b6d4d47d4c3a95eb 100644 (file)
@@ -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
index 6095988404b011846cc9e73b6782b8954e074a3f..cfb059a3acce852d3a242dd8da9e4133f0c6a4ce 100644 (file)
@@ -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,
        })
 }
 
index 71caee9c75e1801e5199b040ee394ccb99358144..4a97650e56a73e38f8502ed4312228e716df907d 100644 (file)
           "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"