2020-06-04 14:46:53 +05:30
|
|
|
// Copyright 2020 The Gitea Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a MIT-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
2020-06-22 23:51:31 +05:30
|
|
|
package settings
|
2020-06-04 14:46:53 +05:30
|
|
|
|
|
|
|
import (
|
2020-06-04 23:36:24 +05:30
|
|
|
"net/http"
|
|
|
|
|
2020-06-04 14:46:53 +05:30
|
|
|
"code.gitea.io/gitea/modules/context"
|
|
|
|
"code.gitea.io/gitea/modules/setting"
|
2020-06-10 17:35:46 +05:30
|
|
|
api "code.gitea.io/gitea/modules/structs"
|
2020-06-04 14:46:53 +05:30
|
|
|
)
|
|
|
|
|
2020-06-22 23:51:31 +05:30
|
|
|
// GetGeneralUISettings returns instance's global settings for ui
|
|
|
|
func GetGeneralUISettings(ctx *context.APIContext) {
|
|
|
|
// swagger:operation GET /settings/ui settings getGeneralUISettings
|
2020-06-04 14:46:53 +05:30
|
|
|
// ---
|
2020-06-22 23:51:31 +05:30
|
|
|
// summary: Get instance's global settings for ui
|
2020-06-04 14:46:53 +05:30
|
|
|
// produces:
|
|
|
|
// - application/json
|
|
|
|
// responses:
|
|
|
|
// "200":
|
2020-06-22 23:51:31 +05:30
|
|
|
// "$ref": "#/responses/GeneralUISettings"
|
|
|
|
ctx.JSON(http.StatusOK, api.GeneralUISettings{
|
|
|
|
AllowedReactions: setting.UI.Reactions,
|
|
|
|
})
|
2020-06-04 14:46:53 +05:30
|
|
|
}
|
2020-06-10 17:35:46 +05:30
|
|
|
|
|
|
|
// GetGeneralRepoSettings returns instance's global settings for repositories
|
|
|
|
func GetGeneralRepoSettings(ctx *context.APIContext) {
|
2020-06-22 23:51:31 +05:30
|
|
|
// swagger:operation GET /settings/repository settings getGeneralRepositorySettings
|
2020-06-10 17:35:46 +05:30
|
|
|
// ---
|
|
|
|
// summary: Get instance's global settings for repositories
|
|
|
|
// produces:
|
|
|
|
// - application/json
|
|
|
|
// responses:
|
|
|
|
// "200":
|
|
|
|
// "$ref": "#/responses/GeneralRepoSettings"
|
|
|
|
ctx.JSON(http.StatusOK, api.GeneralRepoSettings{
|
|
|
|
MirrorsDisabled: setting.Repository.DisableMirrors,
|
|
|
|
HTTPGitDisabled: setting.Repository.DisableHTTPGit,
|
|
|
|
})
|
|
|
|
}
|