Appearance API

原文:https://docs.gitlab.com/ee/api/appearance.html

Appearance API

在 GitLab 12.7 中引入 .

Appearance API 使您可以像在/admin/appearance使用 GitLab UI 一样维护 GitLab 的/admin/appearance . 该 API 需要管理员权限.

Get current appearance configuration

列出 GitLab 实例的当前外观配置.

GET /application/appearance 
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/application/appearance" 

响应示例:

{  "title":  "GitLab Test Instance",  "description":  "gitlab-test.example.com",  "logo":  "/uploads/-/system/appearance/logo/1/logo.png",  "header_logo":  "/uploads/-/system/appearance/header_logo/1/header.png",  "favicon":  "/uploads/-/system/appearance/favicon/1/favicon.png",  "new_project_guidelines":  "Please read the FAQs for help.",  "profile_image_guidelines":  "Custom profile image guidelines",  "header_message":  "",  "footer_message":  "",  "message_background_color":  "#e75e40",  "message_font_color":  "#ffffff",  "email_header_and_footer_enabled":  false  } 

Change appearance configuration

使用 API​​调用来修改 GitLab 实例外观配置.

PUT /application/appearance 
Attribute Type Required Description
title string no 登录/注册页面上的实例标题
description string no 降价文字显示在登录/注册页面上
logo mixed no 登录/注册页面上使用的实例图像
header_logo mixed no 用于主导航栏的实例图像
favicon mixed no .ico.png格式的实例图标
new_project_guidelines string no 新项目页面上显示的降价文字
profile_image_guidelines string no 降价文字显示在个人头像下方的个人资料页面上
header_message string no 系统标题栏中的消息
footer_message string no 系统页脚栏中的消息
message_background_color string no 系统页眉/页脚栏的背景颜色
message_font_color string no 系统页眉/页脚栏的字体颜色
email_header_and_footer_enabled boolean no 如果启用,则在所有外发电子邮件中添加页眉和页脚
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/application/appearance?email_header_and_footer_enabled=true&header_message=test" 

响应示例:

{  "title":  "GitLab Test Instance",  "description":  "gitlab-test.example.com",  "logo":  "/uploads/-/system/appearance/logo/1/logo.png",  "header_logo":  "/uploads/-/system/appearance/header_logo/1/header.png",  "favicon":  "/uploads/-/system/appearance/favicon/1/favicon.png",  "new_project_guidelines":  "Please read the FAQs for help.",  "profile_image_guidelines":  "Custom profile image guidelines",  "header_message":  "test",  "footer_message":  "",  "message_background_color":  "#e75e40",  "message_font_color":  "#ffffff",  "email_header_and_footer_enabled":  true  } 
Copyright © 温玉 2021 | 浙ICP备2020032454号 all right reserved,powered by Gitbook该文件修订时间: 2021-03-27 13:48:25

results matching ""

    No results matching ""