2020-06-04 05:16:53 -04:00
|
|
|
// 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.
|
|
|
|
|
|
|
|
package misc
|
|
|
|
|
|
|
|
import (
|
2020-06-04 14:06:24 -04:00
|
|
|
"net/http"
|
|
|
|
|
2020-06-04 05:16:53 -04:00
|
|
|
"code.gitea.io/gitea/modules/context"
|
|
|
|
"code.gitea.io/gitea/modules/setting"
|
2020-06-10 08:05:46 -04:00
|
|
|
api "code.gitea.io/gitea/modules/structs"
|
2020-06-04 05:16:53 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
// SettingGetsAllowedReactions return allowed reactions
|
|
|
|
func SettingGetsAllowedReactions(ctx *context.APIContext) {
|
|
|
|
// swagger:operation GET /settings/allowed_reactions miscellaneous getAllowedReactions
|
|
|
|
// ---
|
|
|
|
// summary: Returns string array of allowed reactions
|
|
|
|
// produces:
|
|
|
|
// - application/json
|
|
|
|
// responses:
|
|
|
|
// "200":
|
|
|
|
// "$ref": "#/responses/StringSlice"
|
2020-06-04 14:06:24 -04:00
|
|
|
ctx.JSON(http.StatusOK, setting.UI.Reactions)
|
2020-06-04 05:16:53 -04:00
|
|
|
}
|
2020-06-10 08:05:46 -04:00
|
|
|
|
|
|
|
// GetGeneralRepoSettings returns instance's global settings for repositories
|
|
|
|
func GetGeneralRepoSettings(ctx *context.APIContext) {
|
|
|
|
// swagger:operation GET /settings/repository miscellaneous getGeneralRepositorySettings
|
|
|
|
// ---
|
|
|
|
// 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,
|
|
|
|
})
|
|
|
|
}
|