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
5 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.
|
||
|
|
||
5 years ago
|
package settings
|
||
5 years ago
|
|
||
|
import (
|
||
5 years ago
|
"net/http"
|
||
|
|
||
5 years ago
|
"code.gitea.io/gitea/modules/context"
|
||
|
"code.gitea.io/gitea/modules/setting"
|
||
5 years ago
|
api "code.gitea.io/gitea/modules/structs"
|
||
5 years ago
|
)
|
||
|
|
||
5 years ago
|
// GetGeneralUISettings returns instance's global settings for ui
|
||
|
func GetGeneralUISettings(ctx *context.APIContext) {
|
||
|
// swagger:operation GET /settings/ui settings getGeneralUISettings
|
||
5 years ago
|
// ---
|
||
5 years ago
|
// summary: Get instance's global settings for ui
|
||
5 years ago
|
// produces:
|
||
|
// - application/json
|
||
|
// responses:
|
||
|
// "200":
|
||
5 years ago
|
// "$ref": "#/responses/GeneralUISettings"
|
||
|
ctx.JSON(http.StatusOK, api.GeneralUISettings{
|
||
|
AllowedReactions: setting.UI.Reactions,
|
||
|
})
|
||
5 years ago
|
}
|
||
5 years ago
|
|
||
|
// GetGeneralRepoSettings returns instance's global settings for repositories
|
||
|
func GetGeneralRepoSettings(ctx *context.APIContext) {
|
||
5 years ago
|
// swagger:operation GET /settings/repository settings getGeneralRepositorySettings
|
||
5 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,
|
||
|
})
|
||
|
}
|