You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.3 KiB
45 lines
1.3 KiB
4 years ago
|
// 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.
|
||
|
|
||
4 years ago
|
package settings
|
||
4 years ago
|
|
||
|
import (
|
||
4 years ago
|
"net/http"
|
||
|
|
||
4 years ago
|
"code.gitea.io/gitea/modules/context"
|
||
|
"code.gitea.io/gitea/modules/setting"
|
||
4 years ago
|
api "code.gitea.io/gitea/modules/structs"
|
||
4 years ago
|
)
|
||
|
|
||
4 years ago
|
// GetGeneralUISettings returns instance's global settings for ui
|
||
|
func GetGeneralUISettings(ctx *context.APIContext) {
|
||
|
// swagger:operation GET /settings/ui settings getGeneralUISettings
|
||
4 years ago
|
// ---
|
||
4 years ago
|
// summary: Get instance's global settings for ui
|
||
4 years ago
|
// produces:
|
||
|
// - application/json
|
||
|
// responses:
|
||
|
// "200":
|
||
4 years ago
|
// "$ref": "#/responses/GeneralUISettings"
|
||
|
ctx.JSON(http.StatusOK, api.GeneralUISettings{
|
||
|
AllowedReactions: setting.UI.Reactions,
|
||
|
})
|
||
4 years ago
|
}
|
||
4 years ago
|
|
||
|
// GetGeneralRepoSettings returns instance's global settings for repositories
|
||
|
func GetGeneralRepoSettings(ctx *context.APIContext) {
|
||
4 years ago
|
// swagger:operation GET /settings/repository settings getGeneralRepositorySettings
|
||
4 years ago
|
// ---
|
||
|
// 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,
|
||
|
})
|
||
|
}
|