💄 Gitee 登录时展示使用 Gitee 登录

This commit is contained in:
naiba 2021-04-23 11:07:18 +08:00
parent b69b069f27
commit c955e21d5b
4 changed files with 13 additions and 5 deletions

View File

@ -1,7 +1,7 @@
<div align="center" style="background-color: white">
<img width="500" style="max-width:100%" src="https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.png" title="哪吒监控">
<br><br>
<img src="https://img.shields.io/github/workflow/status/naiba/nezha/Dashboard%20image?label=Dash%20v0.6.4&logo=github&style=for-the-badge">&nbsp;<img src="https://img.shields.io/github/v/release/naiba/nezha?color=brightgreen&label=Agent&style=for-the-badge&logo=github">&nbsp;<img src="https://img.shields.io/github/workflow/status/naiba/nezha/Agent%20release?label=Agent%20CI&logo=github&style=for-the-badge">&nbsp;<img src="https://img.shields.io/badge/Installer-v0.4.10-brightgreen?style=for-the-badge&logo=linux">
<img src="https://img.shields.io/github/workflow/status/naiba/nezha/Dashboard%20image?label=Dash%20v0.6.5&logo=github&style=for-the-badge">&nbsp;<img src="https://img.shields.io/github/v/release/naiba/nezha?color=brightgreen&label=Agent&style=for-the-badge&logo=github">&nbsp;<img src="https://img.shields.io/github/workflow/status/naiba/nezha/Agent%20release?label=Agent%20CI&logo=github&style=for-the-badge">&nbsp;<img src="https://img.shields.io/badge/Installer-v0.4.10-brightgreen?style=for-the-badge&logo=linux">
<br>
<p>:trollface: 哪吒监控 一站式轻监控轻运维系统。支持系统状态、HTTP(SSL 证书变更、即将到期、到期)、TCP、Ping 监控报警,命令批量执行和计划任务。</p>
</div>

View File

@ -51,7 +51,15 @@ func (gp *guestPage) serve() {
}
func (gp *guestPage) login(c *gin.Context) {
LoginType := "GitHub"
RegistrationLink := "https://github.com/join"
if dao.Conf.Oauth2.Type == model.ConfigTypeGitee {
LoginType = "Gitee"
RegistrationLink = "https://gitee.com/signup"
}
c.HTML(http.StatusOK, "dashboard/login", mygin.CommonEnvironment(c, gin.H{
"Title": "登录",
"Title": "登录",
"LoginType": LoginType,
"RegistrationLink": RegistrationLink,
}))
}

View File

@ -6,12 +6,12 @@
<h2 class="ui teal image header">
<img src="static/logo.png?v20210320" class="image">
<div class="content">
使用 GitHub 账号登录
使用 {{.LoginType}} 账号登录
</div>
</h2>
<a href="/oauth2/login" class="ui fluid large teal submit button">登录</a>
<div class="ui message">
没有账号? <a href="https://github.com/join" target="_blank">注册</a>
没有账号? <a href="{{.RegistrationLink}}" target="_blank">注册</a>
</div>
</div>
</div>

View File

@ -13,7 +13,7 @@ import (
pb "github.com/naiba/nezha/proto"
)
var Version = "v0.6.4" // !!记得修改 README 中的 badge 版本!!
var Version = "v0.6.5" // !!记得修改 README 中的 badge 版本!!
const (
SnapshotDelay = 3