@@ -180,14 +180,14 @@ type Cloudbrain struct { | |||||
AiCenter string //grampus ai center: center_id+center_name | AiCenter string //grampus ai center: center_id+center_name | ||||
TrainUrl string //输出模型的obs路径 | TrainUrl string //输出模型的obs路径 | ||||
BranchName string //分支名称 | |||||
BranchName string `xorm:"varchar(2550)"` //分支名称 | |||||
Parameters string //传给modelarts的param参数 | Parameters string //传给modelarts的param参数 | ||||
BootFile string //启动文件 | |||||
BootFile string `xorm:"varchar(2550)"` //启动文件 | |||||
DataUrl string `xorm:"varchar(3500)"` //数据集的obs路径 | DataUrl string `xorm:"varchar(3500)"` //数据集的obs路径 | ||||
LogUrl string //日志输出的obs路径 | LogUrl string //日志输出的obs路径 | ||||
PreVersionId int64 //父版本的版本id | PreVersionId int64 //父版本的版本id | ||||
FlavorCode string //modelarts上的规格id | FlavorCode string //modelarts上的规格id | ||||
Description string `xorm:"varchar(256)"` //描述 | |||||
Description string `xorm:"varchar(2550)"` //描述 | |||||
WorkServerNumber int //节点数 | WorkServerNumber int //节点数 | ||||
FlavorName string //规格名称 | FlavorName string //规格名称 | ||||
EngineName string //引擎名称 | EngineName string //引擎名称 | ||||
@@ -406,6 +406,8 @@ sspi_auth_failed = SSPI authentication failed | |||||
change_email = Change email | change_email = Change email | ||||
change_email_address = Change email address | change_email_address = Change email address | ||||
new_email_address = New email address | new_email_address = New email address | ||||
openi_community_really_awesome = OpenI, Really Awesome! | |||||
[phone] | [phone] | ||||
format_err=The format of phone number is wrong. | format_err=The format of phone number is wrong. | ||||
query_err=Fail to query phone number, please try again later. | query_err=Fail to query phone number, please try again later. | ||||
@@ -1061,6 +1063,8 @@ model_rename=Duplicate model name, please modify model name. | |||||
notebook_file_not_exist=Notebook file does not exist. | notebook_file_not_exist=Notebook file does not exist. | ||||
notebook_select_wrong=Please select a Notebook(.ipynb) file first. | notebook_select_wrong=Please select a Notebook(.ipynb) file first. | ||||
notebook_path_too_long=The total length of selected file or files path exceed 255 characters, please select a shorter path file or change the file path. | |||||
notebook_branch_name_too_long=The total length of branch or branches name exceed 255 characters, please select a file in other branch. | |||||
notebook_file_no_right=You have no right to access the Notebook(.ipynb) file. | notebook_file_no_right=You have no right to access the Notebook(.ipynb) file. | ||||
notebook_repo_conflict=The files in different branches of the same repository can not run together. | notebook_repo_conflict=The files in different branches of the same repository can not run together. | ||||
debug_again_fail=Fail to restart debug task, please try again later. | debug_again_fail=Fail to restart debug task, please try again later. | ||||
@@ -1481,7 +1485,7 @@ blame = Blame | |||||
normal_view = Normal View | normal_view = Normal View | ||||
line = line | line = line | ||||
lines = lines | lines = lines | ||||
notebook_open = Open in Notebook | |||||
notebook_open = Run Online | |||||
editor.new_file = New File | editor.new_file = New File | ||||
editor.upload_file = Upload File | editor.upload_file = Upload File | ||||
@@ -409,6 +409,8 @@ sspi_auth_failed=SSPI 认证失败 | |||||
change_email=修改邮箱 | change_email=修改邮箱 | ||||
change_email_address=修改邮箱地址 | change_email_address=修改邮箱地址 | ||||
new_email_address=新邮箱地址 | new_email_address=新邮箱地址 | ||||
openi_community_really_awesome=启智社区 确实给力 | |||||
[phone] | [phone] | ||||
format_err=手机号格式错误。 | format_err=手机号格式错误。 | ||||
query_err=查询手机号失败,请稍后再试。 | query_err=查询手机号失败,请稍后再试。 | ||||
@@ -1060,6 +1062,8 @@ model_rename=模型名称重复,请修改模型名称 | |||||
notebook_file_not_exist=Notebook文件不存在。 | notebook_file_not_exist=Notebook文件不存在。 | ||||
notebook_select_wrong=请先选择Notebook(.ipynb)文件。 | notebook_select_wrong=请先选择Notebook(.ipynb)文件。 | ||||
notebook_path_too_long=选择的一个或多个Notebook文件路径总长度超过255个字符,请选择路径较短的文件或调整文件路径。 | |||||
notebook_branch_name_too_long=选择的一个或多个Notebook文件分支名总长度超过255个字符,请选择其他分支的文件。 | |||||
notebook_file_no_right=您没有这个Notebook文件的读权限。 | notebook_file_no_right=您没有这个Notebook文件的读权限。 | ||||
notebook_repo_conflict=同一个仓库的不同分支文件不能同时运行。 | notebook_repo_conflict=同一个仓库的不同分支文件不能同时运行。 | ||||
debug_again_fail=再次调试失败,请稍后再试。 | debug_again_fail=再次调试失败,请稍后再试。 | ||||
@@ -1499,7 +1503,7 @@ normal_view=普通视图 | |||||
line=行 | line=行 | ||||
lines=行 | lines=行 | ||||
notebook_open = 在Notebook中打开 | |||||
notebook_open = 在线运行 | |||||
editor.new_file=新建文件 | editor.new_file=新建文件 | ||||
editor.upload_file=上传文件 | editor.upload_file=上传文件 | ||||
@@ -1,22 +1,67 @@ | |||||
package repo | package repo | ||||
import ( | import ( | ||||
"net/http" | |||||
"code.gitea.io/gitea/modules/log" | |||||
"code.gitea.io/gitea/models" | |||||
"code.gitea.io/gitea/modules/context" | "code.gitea.io/gitea/modules/context" | ||||
routeRepo "code.gitea.io/gitea/routers/repo" | routeRepo "code.gitea.io/gitea/routers/repo" | ||||
) | ) | ||||
func GetSuccessChunks(ctx *context.APIContext) { | func GetSuccessChunks(ctx *context.APIContext) { | ||||
if errStr := checkDatasetPermission(ctx); errStr != "" { | |||||
ctx.JSON(http.StatusForbidden, ctx.Tr(errStr)) | |||||
} | |||||
routeRepo.GetSuccessChunks(ctx.Context) | routeRepo.GetSuccessChunks(ctx.Context) | ||||
} | } | ||||
func checkDatasetPermission(ctx *context.APIContext) string { | |||||
datasetId := ctx.QueryInt64("dataset_id") | |||||
dataset, err := models.GetDatasetByID(datasetId) | |||||
if err != nil { | |||||
log.Warn("can not find dataset", err) | |||||
return "dataset.query_dataset_fail" | |||||
} | |||||
repo, err := models.GetRepositoryByID(dataset.RepoID) | |||||
if err != nil { | |||||
log.Warn("can not find repo", err) | |||||
return "dataset.query_dataset_fail" | |||||
} | |||||
permission, err := models.GetUserRepoPermission(repo, ctx.User) | |||||
if err != nil { | |||||
log.Warn("can not find repo permission for user", err) | |||||
return "dataset.query_dataset_fail" | |||||
} | |||||
if !permission.CanWrite(models.UnitTypeDatasets) { | |||||
return "error.no_right" | |||||
} | |||||
return "" | |||||
} | |||||
func NewMultipart(ctx *context.APIContext) { | func NewMultipart(ctx *context.APIContext) { | ||||
if errStr := checkDatasetPermission(ctx); errStr != "" { | |||||
ctx.JSON(http.StatusForbidden, ctx.Tr(errStr)) | |||||
} | |||||
routeRepo.NewMultipart(ctx.Context) | routeRepo.NewMultipart(ctx.Context) | ||||
} | } | ||||
func GetMultipartUploadUrl(ctx *context.APIContext) { | func GetMultipartUploadUrl(ctx *context.APIContext) { | ||||
if errStr := checkDatasetPermission(ctx); errStr != "" { | |||||
ctx.JSON(http.StatusForbidden, ctx.Tr(errStr)) | |||||
} | |||||
routeRepo.GetMultipartUploadUrl(ctx.Context) | routeRepo.GetMultipartUploadUrl(ctx.Context) | ||||
} | } | ||||
func CompleteMultipart(ctx *context.APIContext) { | func CompleteMultipart(ctx *context.APIContext) { | ||||
if errStr := checkDatasetPermission(ctx); errStr != "" { | |||||
ctx.JSON(http.StatusForbidden, ctx.Tr(errStr)) | |||||
} | |||||
routeRepo.CompleteMultipart(ctx.Context) | routeRepo.CompleteMultipart(ctx.Context) | ||||
} | } | ||||
@@ -483,7 +483,7 @@ func getFileUrl(url string, filename string) string { | |||||
} | } | ||||
} | } | ||||
return url + middle + filename | |||||
return url + middle + filename + "?reset" | |||||
} | } | ||||
func NotebookRestart(ctx *context.Context) { | func NotebookRestart(ctx *context.Context) { | ||||
@@ -36,6 +36,7 @@ import ( | |||||
"code.gitea.io/gitea/modules/util" | "code.gitea.io/gitea/modules/util" | ||||
"code.gitea.io/gitea/services/externalaccount" | "code.gitea.io/gitea/services/externalaccount" | ||||
"code.gitea.io/gitea/services/mailer" | "code.gitea.io/gitea/services/mailer" | ||||
"code.gitea.io/gitea/services/repository" | |||||
"gitea.com/macaron/captcha" | "gitea.com/macaron/captcha" | ||||
"github.com/markbates/goth" | "github.com/markbates/goth" | ||||
@@ -145,6 +146,11 @@ func checkAutoLogin(ctx *context.Context) bool { | |||||
return false | return false | ||||
} | } | ||||
func getActivityTpl() string { | |||||
result, _ := repository.RecommendContentFromPromote(setting.RecommentRepoAddr + "/signin/activity_tpl") | |||||
return result | |||||
} | |||||
// SignIn render sign in page | // SignIn render sign in page | ||||
func SignIn(ctx *context.Context) { | func SignIn(ctx *context.Context) { | ||||
ctx.Data["Title"] = ctx.Tr("sign_in") | ctx.Data["Title"] = ctx.Tr("sign_in") | ||||
@@ -168,6 +174,7 @@ func SignIn(ctx *context.Context) { | |||||
ctx.Data["PageIsLogin"] = true | ctx.Data["PageIsLogin"] = true | ||||
ctx.Data["EnableSSPI"] = models.IsSSPIEnabled() | ctx.Data["EnableSSPI"] = models.IsSSPIEnabled() | ||||
ctx.Data["EnableCloudBrain"] = true | ctx.Data["EnableCloudBrain"] = true | ||||
ctx.Data["ActivityTpl"] = getActivityTpl() | |||||
ctx.HTML(200, tplSignIn) | ctx.HTML(200, tplSignIn) | ||||
} | } | ||||
@@ -185,6 +192,7 @@ func SignInCloudBrain(ctx *context.Context) { | |||||
ctx.Data["PageIsSignIn"] = true | ctx.Data["PageIsSignIn"] = true | ||||
ctx.Data["PageIsCloudBrainLogin"] = true | ctx.Data["PageIsCloudBrainLogin"] = true | ||||
ctx.Data["EnableCloudBrain"] = true | ctx.Data["EnableCloudBrain"] = true | ||||
ctx.Data["ActivityTpl"] = getActivityTpl() | |||||
ctx.HTML(200, tplSignInCloudBrain) | ctx.HTML(200, tplSignInCloudBrain) | ||||
} | } | ||||
@@ -197,6 +205,7 @@ func SignInPhone(ctx *context.Context) { | |||||
} | } | ||||
ctx.Data["PageIsPhoneLogin"] = true | ctx.Data["PageIsPhoneLogin"] = true | ||||
ctx.Data["ActivityTpl"] = getActivityTpl() | |||||
ctx.HTML(200, tplSignInPhone) | ctx.HTML(200, tplSignInPhone) | ||||
} | } | ||||
@@ -206,6 +215,7 @@ func SignInPhonePost(ctx *context.Context, form auth.PhoneNumberCodeForm) { | |||||
ctx.Data["PageIsPhoneLogin"] = true | ctx.Data["PageIsPhoneLogin"] = true | ||||
ctx.Data["IsCourse"] = ctx.QueryBool("course") | ctx.Data["IsCourse"] = ctx.QueryBool("course") | ||||
ctx.Data["EnableCloudBrain"] = true | ctx.Data["EnableCloudBrain"] = true | ||||
ctx.Data["ActivityTpl"] = getActivityTpl() | |||||
if ctx.HasError() { | if ctx.HasError() { | ||||
ctx.HTML(200, tplSignInPhone) | ctx.HTML(200, tplSignInPhone) | ||||
@@ -356,6 +366,7 @@ func SignInPostCommon(ctx *context.Context, form auth.SignInForm) { | |||||
func SignInCloudBrainPost(ctx *context.Context, form auth.SignInForm) { | func SignInCloudBrainPost(ctx *context.Context, form auth.SignInForm) { | ||||
ctx.Data["PageIsCloudBrainLogin"] = true | ctx.Data["PageIsCloudBrainLogin"] = true | ||||
ctx.Data["SignInLink"] = setting.AppSubURL + "/user/login/cloud_brain" | ctx.Data["SignInLink"] = setting.AppSubURL + "/user/login/cloud_brain" | ||||
ctx.Data["ActivityTpl"] = getActivityTpl() | |||||
SignInPostCommon(ctx, form) | SignInPostCommon(ctx, form) | ||||
} | } | ||||
@@ -363,6 +374,7 @@ func SignInCloudBrainPost(ctx *context.Context, form auth.SignInForm) { | |||||
func SignInPost(ctx *context.Context, form auth.SignInForm) { | func SignInPost(ctx *context.Context, form auth.SignInForm) { | ||||
ctx.Data["PageIsLogin"] = true | ctx.Data["PageIsLogin"] = true | ||||
ctx.Data["SignInLink"] = setting.AppSubURL + "/user/login" | ctx.Data["SignInLink"] = setting.AppSubURL + "/user/login" | ||||
ctx.Data["ActivityTpl"] = getActivityTpl() | |||||
SignInPostCommon(ctx, form) | SignInPostCommon(ctx, form) | ||||
} | } | ||||
@@ -1257,6 +1269,7 @@ func SignUp(ctx *context.Context) { | |||||
//Show Disabled Registration message if DisableRegistration or AllowOnlyExternalRegistration options are true | //Show Disabled Registration message if DisableRegistration or AllowOnlyExternalRegistration options are true | ||||
ctx.Data["DisableRegistration"] = setting.Service.DisableRegistration || setting.Service.AllowOnlyExternalRegistration | ctx.Data["DisableRegistration"] = setting.Service.DisableRegistration || setting.Service.AllowOnlyExternalRegistration | ||||
ctx.Data["ActivityTpl"] = getActivityTpl() | |||||
ctx.HTML(200, tplSignUp) | ctx.HTML(200, tplSignUp) | ||||
} | } | ||||
@@ -1272,6 +1285,7 @@ func SignUpPost(ctx *context.Context, cpt *captcha.Captcha, form auth.RegisterFo | |||||
ctx.Data["CaptchaType"] = setting.Service.CaptchaType | ctx.Data["CaptchaType"] = setting.Service.CaptchaType | ||||
ctx.Data["RecaptchaSitekey"] = setting.Service.RecaptchaSitekey | ctx.Data["RecaptchaSitekey"] = setting.Service.RecaptchaSitekey | ||||
ctx.Data["PageIsSignUp"] = true | ctx.Data["PageIsSignUp"] = true | ||||
ctx.Data["ActivityTpl"] = getActivityTpl() | |||||
//Permission denied if DisableRegistration or AllowOnlyExternalRegistration options are true | //Permission denied if DisableRegistration or AllowOnlyExternalRegistration options are true | ||||
if setting.Service.DisableRegistration || setting.Service.AllowOnlyExternalRegistration { | if setting.Service.DisableRegistration || setting.Service.AllowOnlyExternalRegistration { | ||||
@@ -35,6 +35,7 @@ const NoteBookExtension = ".ipynb" | |||||
const CPUType = 0 | const CPUType = 0 | ||||
const GPUType = 1 | const GPUType = 1 | ||||
const NPUType = 2 | const NPUType = 2 | ||||
const CharacterLength = 2550 | |||||
func FileNotebookCreate(ctx *context.Context, option api.CreateFileNotebookJobOption) { | func FileNotebookCreate(ctx *context.Context, option api.CreateFileNotebookJobOption) { | ||||
@@ -46,6 +47,14 @@ func FileNotebookCreate(ctx *context.Context, option api.CreateFileNotebookJobOp | |||||
ctx.JSON(http.StatusOK, models.BaseErrorMessageApi(ctx.Tr("repo.notebook_select_wrong"))) | ctx.JSON(http.StatusOK, models.BaseErrorMessageApi(ctx.Tr("repo.notebook_select_wrong"))) | ||||
return | return | ||||
} | } | ||||
if len(getBootFile(option.File, option.OwnerName, option.ProjectName)) > CharacterLength { | |||||
ctx.JSON(http.StatusOK, models.BaseErrorMessageApi(ctx.Tr("repo.notebook_path_too_long"))) | |||||
return | |||||
} | |||||
if len(option.BranchName) > CharacterLength { | |||||
ctx.JSON(http.StatusOK, models.BaseErrorMessageApi(ctx.Tr("repo.notebook_branch_name_too_long"))) | |||||
return | |||||
} | |||||
isNotebookFileExist, _ := isNoteBookFileExist(ctx, option) | isNotebookFileExist, _ := isNoteBookFileExist(ctx, option) | ||||
if !isNotebookFileExist { | if !isNotebookFileExist { | ||||
@@ -105,14 +114,29 @@ func FileNotebookCreate(ctx *context.Context, option api.CreateFileNotebookJobOp | |||||
err = downloadCode(sourceRepo, getCodePath(noteBook.JobName, sourceRepo), option.BranchName) | err = downloadCode(sourceRepo, getCodePath(noteBook.JobName, sourceRepo), option.BranchName) | ||||
if err != nil { | if err != nil { | ||||
log.Error("download code failed", err) | log.Error("download code failed", err) | ||||
ctx.JSON(http.StatusOK, models.BaseErrorMessageApi(ctx.Tr("cloudbrain.load_code_failed"))) | |||||
return | |||||
if !strings.Contains(err.Error(), "already exists and is not an empty directory") { | |||||
ctx.JSON(http.StatusOK, models.BaseErrorMessageApi(ctx.Tr("cloudbrain.load_code_failed"))) | |||||
return | |||||
} | |||||
} | } | ||||
} | } | ||||
if !isRepoFileMatch(option, noteBook) { | if !isRepoFileMatch(option, noteBook) { | ||||
noteBook.BootFile += ";" + getBootFile(option.File, option.OwnerName, option.ProjectName) | |||||
noteBook.BranchName += ";" + option.BranchName | |||||
noteBook.Description += ";" + getDescription(option) | |||||
if len(noteBook.BootFile)+len(getBootFile(option.File, option.OwnerName, option.ProjectName))+1 <= CharacterLength { | |||||
noteBook.BootFile += ";" + getBootFile(option.File, option.OwnerName, option.ProjectName) | |||||
} else { | |||||
ctx.JSON(http.StatusOK, models.BaseErrorMessageApi(ctx.Tr("repo.notebook_path_too_long"))) | |||||
return | |||||
} | |||||
if len(noteBook.BranchName)+len(option.BranchName)+1 <= CharacterLength { | |||||
noteBook.BranchName += ";" + option.BranchName | |||||
} else { | |||||
ctx.JSON(http.StatusOK, models.BaseErrorMessageApi(ctx.Tr("repo.notebook_branch_name_too_long"))) | |||||
return | |||||
} | |||||
if len(noteBook.Description)+len(getDescription(option))+1 <= CharacterLength { | |||||
noteBook.Description += ";" + getDescription(option) | |||||
} | |||||
err := models.UpdateJob(noteBook) | err := models.UpdateJob(noteBook) | ||||
if err != nil { | if err != nil { | ||||
@@ -417,7 +441,7 @@ func cloudBrainFileNoteBookCreate(ctx *context.Context, option api.CreateFileNot | |||||
} | } | ||||
func getCloudbrainType(optionType int) int { | func getCloudbrainType(optionType int) int { | ||||
if optionType < 1 { | |||||
if optionType <= GPUType { | |||||
return models.TypeCloudBrainOne | return models.TypeCloudBrainOne | ||||
} | } | ||||
if setting.ModelartsCD.Enabled { | if setting.ModelartsCD.Enabled { | ||||
@@ -431,7 +455,11 @@ func getCodePath(jobName string, repo *models.Repository) string { | |||||
} | } | ||||
func getDescription(option api.CreateFileNotebookJobOption) string { | func getDescription(option api.CreateFileNotebookJobOption) string { | ||||
return option.OwnerName + "/" + option.ProjectName + "/" + option.File | |||||
des := option.OwnerName + "/" + option.ProjectName + "/" + option.File | |||||
if len(des) <= CharacterLength { | |||||
return des | |||||
} | |||||
return "" | |||||
} | } | ||||
func modelartsFileNoteBookCreate(ctx *context.Context, option api.CreateFileNotebookJobOption, repo *models.Repository, sourceRepo *models.Repository) { | func modelartsFileNoteBookCreate(ctx *context.Context, option api.CreateFileNotebookJobOption, repo *models.Repository, sourceRepo *models.Repository) { | ||||
@@ -1,3 +1,13 @@ | |||||
<style> | |||||
@media only screen and (max-width: 767px) { | |||||
.mobile-text-align-center { | |||||
text-align: center !important; | |||||
} | |||||
.mobile-justify-content-center { | |||||
justify-content: center !important; | |||||
} | |||||
} | |||||
</style> | |||||
<footer style="border-top:none;"> | <footer style="border-top:none;"> | ||||
<div class="ui container"> | <div class="ui container"> | ||||
<div class="ui grid"> | <div class="ui grid"> | ||||
@@ -111,7 +111,9 @@ | |||||
<td class="ti-text-form-content"> | <td class="ti-text-form-content"> | ||||
<div class="text-span text-span-w" id="{{.VersionName}}-code"> | <div class="text-span text-span-w" id="{{.VersionName}}-code"> | ||||
{{.BranchName}} | {{.BranchName}} | ||||
{{if not .BootFile}} | |||||
<span style="margin-left:1rem" class="ui label">{{SubStr .CommitID 0 10}}</span> | <span style="margin-left:1rem" class="ui label">{{SubStr .CommitID 0 10}}</span> | ||||
{{end}} | |||||
</div> | </div> | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||
@@ -376,6 +378,7 @@ | |||||
{{template "base/footer" .}} | {{template "base/footer" .}} | ||||
<script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script> | <script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script> | ||||
<script> | <script> | ||||
$('.menu .item').tab() | $('.menu .item').tab() | ||||
$(document).ready(function () { | $(document).ready(function () { | ||||
$('.ui.accordion').accordion({ selector: { trigger: '.icon' } }); | $('.ui.accordion').accordion({ selector: { trigger: '.icon' } }); | ||||
@@ -1,9 +1,51 @@ | |||||
{{template "base/head" .}} | {{template "base/head" .}} | ||||
<style> | |||||
@media only screen and (max-width: 1200px) { | |||||
._container { | |||||
display:block !important; | |||||
} | |||||
._left-img-area { | |||||
display: none; | |||||
} | |||||
._right_content_area { | |||||
} | |||||
._right_content_area .segment { | |||||
margin-left: auto !important; | |||||
border-top-left-radius: .28571429rem !important; | |||||
border-bottom-left-radius: .28571429rem !important; | |||||
border-left: border: 1px solid rgba(34,36,38,.15) !important; | |||||
} | |||||
} | |||||
</style> | |||||
<script> | |||||
var ActivityTpl = {{ .ActivityTpl }}; | |||||
</script> | |||||
<div class="user signin{{if .LinkAccountMode}} icon{{end}}"> | <div class="user signin{{if .LinkAccountMode}} icon{{end}}"> | ||||
{{template "user/auth/signin_navbar" .}} | |||||
<div class="ui container"> | |||||
<div class="ui raised very padded text container segment"> | |||||
{{template "user/auth/signin_inner" .}} | |||||
<div class="ui container" style="margin-top:60px;"> | |||||
<div class="_container" style="display:flex;justify-content:center;"> | |||||
<div class="_left-img-area" style="padding-right:0;flex:2"> | |||||
<div style="width:450px;height:100%;float:right;border-radius:0.28571429rem;border-top-right-radius: 0; | |||||
border-bottom-right-radius: 0;border-right:none !important;overflow: hidden; | |||||
-webkit-box-shadow: 0 2px 4px 0 rgba(34,36,38,.12),0 2px 10px 0 rgba(34,36,38,.15); | |||||
box-shadow: 0 2px 4px 0rgba(34,36,38,.12),0 2px 10px 0rgba(34,36,38,.15);"> | |||||
{{ if .ActivityTpl }} | |||||
{{ .ActivityTpl | Safe}} | |||||
{{ else }} | |||||
{{ template "user/auth/signin_up_img_default" .}} | |||||
{{ end }} | |||||
</div> | |||||
</div> | |||||
<div class="_right_content_area" style="padding-left:0;flex:3;"> | |||||
<div class="ui raised very padded text container segment" style="margin-left:0; | |||||
border-top-left-radius: 0; | |||||
border-bottom-left-radius: 0; | |||||
border-left: none !important; | |||||
"> | |||||
{{template "user/auth/signin_navbar" .}} | |||||
{{template "user/auth/signin_inner" .}} | |||||
</div> | |||||
</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -1,9 +1,48 @@ | |||||
{{template "base/head" .}} | {{template "base/head" .}} | ||||
<style> | |||||
@media only screen and (max-width: 1200px) { | |||||
._container { | |||||
display:block !important; | |||||
} | |||||
._left-img-area { | |||||
display: none; | |||||
} | |||||
._right_content_area { | |||||
} | |||||
._right_content_area .segment { | |||||
margin-left: auto !important; | |||||
border-top-left-radius: .28571429rem !important; | |||||
border-bottom-left-radius: .28571429rem !important; | |||||
border-left: border: 1px solid rgba(34,36,38,.15) !important; | |||||
} | |||||
} | |||||
</style> | |||||
<div class="user signin"> | <div class="user signin"> | ||||
{{template "user/auth/signin_navbar" .}} | |||||
<div class="ui container"> | |||||
<div class="ui raised very padded text container segment"> | |||||
{{template "user/auth/signin_cloudbrain" .}} | |||||
<div class="ui container" style="margin-top:60px;"> | |||||
<div class="_container" style="display:flex;justify-content:center;"> | |||||
<div class="_left-img-area" style="padding-right:0;flex:2"> | |||||
<div style="width:450px;height:100%;float:right;border-radius:0.28571429rem;border-top-right-radius: 0; | |||||
border-bottom-right-radius: 0;border-right:none !important;overflow: hidden; | |||||
-webkit-box-shadow: 0 2px 4px 0 rgba(34,36,38,.12),0 2px 10px 0 rgba(34,36,38,.15); | |||||
box-shadow: 0 2px 4px 0rgba(34,36,38,.12),0 2px 10px 0rgba(34,36,38,.15);"> | |||||
{{ if .ActivityTpl }} | |||||
{{ .ActivityTpl | Safe}} | |||||
{{ else }} | |||||
{{ template "user/auth/signin_up_img_default" .}} | |||||
{{ end }} | |||||
</div> | |||||
</div> | |||||
<div class="_right_content_area" style="padding-left:0;flex:3;"> | |||||
<div class="ui raised very padded text container segment" style="margin-left:0; | |||||
border-top-left-radius: 0; | |||||
border-bottom-left-radius: 0; | |||||
border-left: none !important; | |||||
"> | |||||
{{template "user/auth/signin_navbar" .}} | |||||
{{template "user/auth/signin_cloudbrain" .}} | |||||
</div> | |||||
</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -1,5 +1,5 @@ | |||||
{{if or .EnablePhone .EnableOpenIDSignIn .EnableSSPI .EnableCloudBrain}} | {{if or .EnablePhone .EnableOpenIDSignIn .EnableSSPI .EnableCloudBrain}} | ||||
<div class="ui secondary pointing tabular top attached borderless menu new-menu navbar"> | |||||
<div class="ui secondary pointing tabular top attached borderless menu new-menu navbar" style="margin-bottom:45px !important;background-color:transparent !important;"> | |||||
{{if .EnablePhone }} | {{if .EnablePhone }} | ||||
<a class="{{if .PageIsPhoneLogin}}active{{end}} item" rel="nofollow" href="{{AppSubUrl}}/user/login/phone"> | <a class="{{if .PageIsPhoneLogin}}active{{end}} item" rel="nofollow" href="{{AppSubUrl}}/user/login/phone"> | ||||
{{.i18n.Tr "phone.mobile_login"}} | {{.i18n.Tr "phone.mobile_login"}} | ||||
@@ -1,73 +1,111 @@ | |||||
{{template "base/head" .}} | {{template "base/head" .}} | ||||
<style> | |||||
@media only screen and (max-width: 1200px) { | |||||
._container { | |||||
display:block !important; | |||||
} | |||||
._left-img-area { | |||||
display: none; | |||||
} | |||||
._right_content_area { | |||||
} | |||||
._right_content_area .segment { | |||||
margin-left: auto !important; | |||||
border-top-left-radius: .28571429rem !important; | |||||
border-bottom-left-radius: .28571429rem !important; | |||||
border-left: border: 1px solid rgba(34,36,38,.15) !important; | |||||
} | |||||
} | |||||
</style> | |||||
<div class="user signin"> | <div class="user signin"> | ||||
{{template "user/auth/signin_navbar" .}} | |||||
<div class="ui container"> | |||||
<div class="ui raised very padded text container segment"> | |||||
<style> | |||||
.full.height{background-color: #F9F9F9;} | |||||
.ui.left:not(.action){ float:none;} | |||||
.ui.left{ float:none;} | |||||
.ui.secondary.pointing.menu{ border-bottom:none;} | |||||
</style> | |||||
{{template "base/alert" .}} | |||||
<div class="ui negative message" style="display:none;"> | |||||
<p></p> | |||||
</div> | |||||
<div class="ui centered grid"> | |||||
<div class="sixteen wide mobile ten wide tablet ten wide computer column"> | |||||
<div class="ui bottom aligned two column grid"> | |||||
<div class="column"> | |||||
<h2 class="ui header"> | |||||
{{if .LinkAccountMode}} | |||||
{{.i18n.Tr "auth.oauth_signin_title"}} | |||||
{{else}} | |||||
{{.i18n.Tr "auth.login_userpass"}} | |||||
{{end}} | |||||
</h2> | |||||
</div> | |||||
{{if .ShowRegistrationButton}} | |||||
<div class="ui right floated column"> | |||||
<a href="{{AppSubUrl}}/user/sign_up">{{.i18n.Tr "auth.sign_up_now" | Str2html}}</a> | |||||
</div> | |||||
{{end}} | |||||
<div class="ui container" style="margin-top:60px;"> | |||||
<div class="_container" style="display:flex;justify-content:center;"> | |||||
<div class="_left-img-area" style="padding-right:0;flex:2"> | |||||
<div style="width:450px;height:100%;float:right;border-radius:0.28571429rem;border-top-right-radius: 0; | |||||
border-bottom-right-radius: 0;border-right:none !important;overflow: hidden; | |||||
-webkit-box-shadow: 0 2px 4px 0 rgba(34,36,38,.12),0 2px 10px 0 rgba(34,36,38,.15); | |||||
box-shadow: 0 2px 4px 0rgba(34,36,38,.12),0 2px 10px 0rgba(34,36,38,.15);"> | |||||
{{ if .ActivityTpl }} | |||||
{{ .ActivityTpl | Safe}} | |||||
{{ else }} | |||||
{{ template "user/auth/signin_up_img_default" .}} | |||||
{{ end }} | |||||
</div> | </div> | ||||
<div class="ui grid"> | |||||
<div class="column"> | |||||
<form class="ui form" action="/user/login/phone" method="post"> | |||||
{{.CsrfTokenHtml}} | |||||
{{if .EnablePhone }} | |||||
<div class="use-type" usetype="1" autofocus="true"> | |||||
{{template "user/auth/phone_verify" .}} | |||||
</div> | |||||
{{end}} | |||||
<div class="two fields inline"> | |||||
<div class="field"> | |||||
<div class="ui checkbox"> | |||||
<label>{{.i18n.Tr "auth.remember_me"}}</label> | |||||
<input name="remember" type="checkbox"> | |||||
</div> | |||||
<div class="_right_content_area" style="padding-left:0;flex:3;"> | |||||
<div class="ui raised very padded text container segment" style="margin-left:0; | |||||
border-top-left-radius: 0; | |||||
border-bottom-left-radius: 0; | |||||
border-left: none !important; | |||||
"> | |||||
<style> | |||||
.full.height{background-color: #F9F9F9;} | |||||
.ui.left:not(.action){ float:none;} | |||||
.ui.left{ float:none;} | |||||
.ui.secondary.pointing.menu{ border-bottom:none;} | |||||
</style> | |||||
{{template "user/auth/signin_navbar" .}} | |||||
{{template "base/alert" .}} | |||||
<div class="ui negative message" style="display:none;"> | |||||
<p></p> | |||||
</div> | |||||
<div class="ui centered grid"> | |||||
<div class="sixteen wide mobile ten wide tablet ten wide computer column"> | |||||
<div class="ui bottom aligned two column grid"> | |||||
<div class="column"> | |||||
<h2 class="ui header"> | |||||
{{if .LinkAccountMode}} | |||||
{{.i18n.Tr "auth.oauth_signin_title"}} | |||||
{{else}} | |||||
{{.i18n.Tr "auth.login_userpass"}} | |||||
{{end}} | |||||
</h2> | |||||
</div> | </div> | ||||
{{if .ShowRegistrationButton}} | |||||
<div class="ui right floated column"> | |||||
<a href="{{AppSubUrl}}/user/sign_up">{{.i18n.Tr "auth.sign_up_now" | Str2html}}</a> | |||||
</div> | |||||
{{end}} | |||||
</div> | </div> | ||||
<div class="field" style="padding-right: 0; text-align: right;"> | |||||
<a href="{{AppSubUrl}}/user/forgot_password?type=phone">{{.i18n.Tr "auth.forgot_password"}}</a> | |||||
</div> | |||||
</div> | |||||
<div class="ui grid"> | |||||
<div class="column"> | |||||
<form class="ui form" action="/user/login/phone" method="post"> | |||||
{{.CsrfTokenHtml}} | |||||
{{if .EnablePhone }} | |||||
<div class="use-type" usetype="1" autofocus="true"> | |||||
{{template "user/auth/phone_verify" .}} | |||||
</div> | |||||
{{end}} | |||||
<div class="ui hidden divider"></div> | |||||
<div class="two fields inline"> | |||||
<div class="field"> | |||||
<div class="ui checkbox"> | |||||
<label>{{.i18n.Tr "auth.remember_me"}}</label> | |||||
<input name="remember" type="checkbox"> | |||||
</div> | |||||
</div> | |||||
<div class="field" style="padding-right: 0; text-align: right;"> | |||||
<a href="{{AppSubUrl}}/user/forgot_password?type=phone">{{.i18n.Tr "auth.forgot_password"}}</a> | |||||
</div> | |||||
</div> | |||||
<div class="center aligned field"> | |||||
<button class="fluid large ui blue button"> | |||||
{{.i18n.Tr "sign_in"}} | |||||
</button> | |||||
<div class="ui hidden divider"></div> | |||||
<div class="center aligned field"> | |||||
<button class="fluid large ui blue button"> | |||||
{{.i18n.Tr "sign_in"}} | |||||
</button> | |||||
</div> | |||||
</form> | |||||
</div> | |||||
</div> | |||||
</div> | </div> | ||||
</form> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | |||||
</div> | |||||
</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
{{template "base/footer" .}} | {{template "base/footer" .}} |
@@ -0,0 +1,45 @@ | |||||
<div style="width:100%;height:100%; | |||||
border-radius: 0.28571429rem; | |||||
border-top-right-radius: 0; | |||||
border-bottom-right-radius: 0; | |||||
-webkit-box-shadow: 0 2px 4px 0 rgba(34,36,38,.12),0 2px 10px 0 rgba(34,36,38,.15); | |||||
box-shadow: 0 2px 4px 0rgba(34,36,38,.12),0 2px 10px 0rgba(34,36,38,.15); | |||||
display: flex; | |||||
flex-direction: column; | |||||
justify-content: center; | |||||
padding: 0 40px; | |||||
background: url('/img/login_bg_default.png') center center no-repeat; | |||||
background-size: cover; | |||||
border-right:none !important; | |||||
"> | |||||
<div style="margin: 14px 0;"> | |||||
<span style="font-weight:500;font-size:28px;color:rgb(0, 122, 255);">{{.i18n.Tr "auth.openi_community_really_awesome"}}</span> | |||||
</div> | |||||
<div style="margin: 14px 0;"> | |||||
<span style="font-weight:300;font-size:14px;color:rgb(140, 162, 170);">{{.i18n.Tr "home.page_description"}}</span> | |||||
</div> | |||||
<div style="margin: 14px 0;"> | |||||
<div style="width:111px"> | |||||
<a href="https://openi.pcl.ac.cn/zeizei/OpenI_Learning"> | |||||
<div style=" | |||||
width: 111px; | |||||
height: 40px; | |||||
font-size: 14px; | |||||
border-color: rgb(0, 122, 255); | |||||
border-width: 1px; | |||||
border-style: solid; | |||||
color: rgb(0, 122, 255); | |||||
display:flex; | |||||
align-items: center; | |||||
justify-content: center; | |||||
"> | |||||
<svg xmlns="http://www.w3.org/2000/svg" style="margin-right:8px;margin-top:-2px;" class="styles__StyledSVGIconPathComponent-sc-16fsqc8-0 fPsHiw svg-icon-path-icon fill" viewBox="0 0 32 32" width="16" height="16"><defs data-reactroot=""></defs><g><path fill="rgb(0, 122, 255)" d="M2.667 5.324c0.005-0.729 0.594-1.318 1.322-1.324h24.022c0.731 0 1.323 0.593 1.323 1.324v21.352c-0.005 0.729-0.594 1.318-1.322 1.324h-24.022c-0.731-0.001-1.323-0.593-1.323-1.324v0-21.352zM14.667 6.667h-9.333v18.667h9.333v-18.667zM17.333 6.667v18.667h9.333v-18.667h-9.333zM18.667 9.333h6.667v2.667h-6.667v-2.667zM18.667 13.333h6.667v2.667h-6.667v-2.667z"></path></g></svg> | |||||
<span>{{.i18n.Tr "custom.Platform_Tutorial"}}</span> | |||||
</div> | |||||
</a> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
@@ -1,112 +1,151 @@ | |||||
<style> | <style> | ||||
.full.height{background-color: #F9F9F9;} | .full.height{background-color: #F9F9F9;} | ||||
</style> | </style> | ||||
<div class="ui container very padded {{if .LinkAccountMode}} icon{{end}}" style=" padding-top: 5.0rem; padding-bottom: 3.0rem;"> | |||||
<div class="ui raised very padded text container segment"> | |||||
<div class="ui centered grid"> | |||||
<div class="sixteen wide mobile ten wide tablet ten wide computer column"> | |||||
<div class="ui bottom aligned two column grid"> | |||||
<div class="column"> | |||||
<h2 class="ui header"> | |||||
{{if .LinkAccountMode}} | |||||
{{.i18n.Tr "auth.oauth_signup_title"}} | |||||
{{else}} | |||||
{{.i18n.Tr "sign_up"}} | |||||
{{end}} | |||||
</h2> | |||||
</div> | |||||
{{if not .LinkAccountMode}} | |||||
<div class="ui right floated column"> | |||||
<a href="{{AppSubUrl}}/user/login">{{.i18n.Tr "auth.register_helper_msg"}}</a> | |||||
</div> | |||||
{{end}} | |||||
</div> | |||||
<div class="ui grid"> | |||||
<div class="column"> | |||||
<form class="ui form" action="{{.SignUpLink}}" method="post"> | |||||
{{.CsrfTokenHtml}} | |||||
{{if or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister)}} | |||||
{{template "base/alert" .}} | |||||
{{end}} | |||||
<div class="ui negative message" style="display:none;"> | |||||
<p></p> | |||||
</div> | |||||
{{if .DisableRegistration}} | |||||
<p>{{.i18n.Tr "auth.disable_register_prompt"}}</p> | |||||
{{else}} | |||||
<div class="field invitation_tips" style="font-weight:400;font-size:14px;color:rgba(250,140,22,1);{{if not .invitationCode}}display:none;{{end}}"> | |||||
<span>{{.i18n.Tr "your_friend"}} <span class="__invitation_code__">{{.invitationCode}}</span> {{.i18n.Tr "invite_you_to_join_the_OpenI_AI_Collaboration_Platform_and_enjoy_abundant_free_computing_resources"}}</span> | |||||
</div> | |||||
<div class="field {{if and (.Err_UserName) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}"> | |||||
<input id="user_name" name="user_name" value="{{.user_name}}" placeholder="{{.i18n.Tr "username"}}" autofocus required> | |||||
</div> | |||||
<div class="field {{if .Err_Email}}error{{end}}"> | |||||
<input id="email" name="email" type="email" value="{{.email}}" placeholder="{{.i18n.Tr "email"}}" required> | |||||
</div> | |||||
{{if not .DisablePassword}} | |||||
<div class="field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}"> | |||||
<input id="password" name="password" type="password" value="{{.password}}" placeholder="{{.i18n.Tr "password"}}" autocomplete="off" required> | |||||
</div> | |||||
<div class="field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}"> | |||||
<input id="retype" name="retype" type="password" value="{{.retype}}" placeholder="{{.i18n.Tr "re_type"}}" autocomplete="off" required> | |||||
</div> | |||||
{{end}} | |||||
{{if and .EnableCaptcha (eq .CaptchaType "image")}} | |||||
<div class="field"> | |||||
{{.Captcha.CreateHtml}} | |||||
</div> | |||||
<div class="field {{if .Err_Captcha}}error{{end}}"> | |||||
<input id="captcha" name="captcha" value="{{.captcha}}" placeholder="{{.i18n.Tr "captcha"}}" autocomplete="off"> | |||||
</div> | |||||
{{end}} | |||||
{{if and .EnableCaptcha (eq .CaptchaType "recaptcha")}} | |||||
<div class="field required"> | |||||
<div class="g-recaptcha" data-sitekey="{{ .RecaptchaSitekey }}"></div> | |||||
</div> | |||||
<style> | |||||
@media only screen and (max-width: 1200px) { | |||||
._container { | |||||
display:block !important; | |||||
} | |||||
._left-img-area { | |||||
display: none; | |||||
} | |||||
._right_content_area { | |||||
} | |||||
._right_content_area .segment { | |||||
margin-left: auto !important; | |||||
border-top-left-radius: .28571429rem !important; | |||||
border-bottom-left-radius: .28571429rem !important; | |||||
border-left: border: 1px solid rgba(34,36,38,.15) !important; | |||||
} | |||||
} | |||||
</style> | |||||
<div class="ui container very padded {{if .LinkAccountMode}} icon{{end}}" style=" padding-top: 5.0rem; padding-bottom: 3.0rem;"> | |||||
<div class="_container" style="display:flex;justify-content:center;"> | |||||
<div class="_left-img-area" style="padding-right:0;flex:2"> | |||||
<div style="width:450px;height:100%;float:right;border-radius:0.28571429rem;border-top-right-radius: 0; | |||||
border-bottom-right-radius: 0;border-right:none !important;overflow: hidden; | |||||
-webkit-box-shadow: 0 2px 4px 0 rgba(34,36,38,.12),0 2px 10px 0 rgba(34,36,38,.15); | |||||
box-shadow: 0 2px 4px 0rgba(34,36,38,.12),0 2px 10px 0rgba(34,36,38,.15);"> | |||||
{{ if .ActivityTpl }} | |||||
{{ .ActivityTpl | Safe}} | |||||
{{ else }} | |||||
{{ template "user/auth/signin_up_img_default" .}} | |||||
{{ end }} | |||||
</div> | |||||
</div> | |||||
<div class="_right_content_area" style="padding-left:0;flex:3;"> | |||||
<div class="ui raised very padded text container segment" style="margin-left:0; | |||||
border-top-left-radius: 0; | |||||
border-bottom-left-radius: 0; | |||||
border-left: none !important; | |||||
"> | |||||
<div class="ui centered grid"> | |||||
<div class="sixteen wide mobile ten wide tablet ten wide computer column"> | |||||
<div class="ui bottom aligned two column grid"> | |||||
<div class="column"> | |||||
<h2 class="ui header"> | |||||
{{if .LinkAccountMode}} | |||||
{{.i18n.Tr "auth.oauth_signup_title"}} | |||||
{{else}} | |||||
{{.i18n.Tr "sign_up"}} | |||||
{{end}} | {{end}} | ||||
{{if .EnablePhone }} | |||||
<div class="use-type" usetype="0"> | |||||
{{template "user/auth/phone_verify" .}} | |||||
</h2> | |||||
</div> | |||||
{{if not .LinkAccountMode}} | |||||
<div class="ui right floated column"> | |||||
<a href="{{AppSubUrl}}/user/login">{{.i18n.Tr "auth.register_helper_msg"}}</a> | |||||
</div> | |||||
{{end}} | |||||
</div> | |||||
<div class="ui grid"> | |||||
<div class="column"> | |||||
<form class="ui form" action="{{.SignUpLink}}" method="post"> | |||||
{{.CsrfTokenHtml}} | |||||
{{if or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister)}} | |||||
{{template "base/alert" .}} | |||||
{{end}} | |||||
<div class="ui negative message" style="display:none;"> | |||||
<p></p> | |||||
</div> | </div> | ||||
{{end}} | |||||
<div class="field"> | |||||
<div style="display:flex;"> | |||||
<div style="display:flex;align-items:center;"> | |||||
<span>{{.i18n.Tr "recommender"}}</span> | |||||
{{if .DisableRegistration}} | |||||
<p>{{.i18n.Tr "auth.disable_register_prompt"}}</p> | |||||
{{else}} | |||||
<div class="field invitation_tips" style="font-weight:400;font-size:14px;color:rgba(250,140,22,1);{{if not .invitationCode}}display:none;{{end}}"> | |||||
<span>{{.i18n.Tr "your_friend"}} <span class="__invitation_code__">{{.invitationCode}}</span> {{.i18n.Tr "invite_you_to_join_the_OpenI_AI_Collaboration_Platform_and_enjoy_abundant_free_computing_resources"}}</span> | |||||
</div> | |||||
<div class="field {{if and (.Err_UserName) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}"> | |||||
<input id="user_name" name="user_name" value="{{.user_name}}" placeholder="{{.i18n.Tr "username"}}" autofocus required> | |||||
</div> | |||||
<div class="field {{if .Err_Email}}error{{end}}"> | |||||
<input id="email" name="email" type="email" value="{{.email}}" placeholder="{{.i18n.Tr "email"}}" required> | |||||
</div> | </div> | ||||
<input style="flex:1;margin-left:12px;" id="invitation_code" name="invitation_code" value="{{.invitationCode}}" {{if .invitationCode}}readonly="true"{{end}} autocomplete="off" /> | |||||
</div> | |||||
</div> | |||||
<div class="field"> | |||||
<div class="ui checkbox"> | |||||
<input name="agree" type="checkbox" tabindex="0" class="hidden" {{if .agree}}checked{{end}}><label>{{.i18n.Tr "use_and_privacy_agree" "/home/term" "/home/privacy" | Safe}}</label> | |||||
</div> | |||||
</div> | |||||
<div class="ui hidden divider"></div> | |||||
<div class="center aligned field"> | |||||
<button class="fluid large ui blue button"> | |||||
{{if .LinkAccountMode}} | |||||
{{.i18n.Tr "auth.oauth_signup_submit"}} | |||||
{{else}} | |||||
{{.i18n.Tr "auth.create_new_account"}} | |||||
{{if not .DisablePassword}} | |||||
<div class="field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}"> | |||||
<input id="password" name="password" type="password" value="{{.password}}" placeholder="{{.i18n.Tr "password"}}" autocomplete="off" required> | |||||
</div> | |||||
<div class="field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}"> | |||||
<input id="retype" name="retype" type="password" value="{{.retype}}" placeholder="{{.i18n.Tr "re_type"}}" autocomplete="off" required> | |||||
</div> | |||||
{{end}} | {{end}} | ||||
</button> | |||||
</div> | |||||
{{end}} | |||||
</form> | |||||
</div> | |||||
{{if and .EnableCaptcha (eq .CaptchaType "image")}} | |||||
<div class="field"> | |||||
{{.Captcha.CreateHtml}} | |||||
</div> | |||||
<div class="field {{if .Err_Captcha}}error{{end}}"> | |||||
<input id="captcha" name="captcha" value="{{.captcha}}" placeholder="{{.i18n.Tr "captcha"}}" autocomplete="off"> | |||||
</div> | |||||
{{end}} | |||||
{{if and .EnableCaptcha (eq .CaptchaType "recaptcha")}} | |||||
<div class="field required"> | |||||
<div class="g-recaptcha" data-sitekey="{{ .RecaptchaSitekey }}"></div> | |||||
</div> | |||||
{{end}} | |||||
{{if .EnablePhone }} | |||||
<div class="use-type" usetype="0"> | |||||
{{template "user/auth/phone_verify" .}} | |||||
</div> | |||||
{{end}} | |||||
<div class="field"> | |||||
<div style="display:flex;"> | |||||
<div style="display:flex;align-items:center;"> | |||||
<span>{{.i18n.Tr "recommender"}}</span> | |||||
</div> | |||||
<input style="flex:1;margin-left:12px;" id="invitation_code" name="invitation_code" value="{{.invitationCode}}" {{if .invitationCode}}readonly="true"{{end}} autocomplete="off" /> | |||||
</div> | |||||
</div> | |||||
<div class="field"> | |||||
<div class="ui checkbox"> | |||||
<input name="agree" type="checkbox" tabindex="0" class="hidden" {{if .agree}}checked{{end}}><label>{{.i18n.Tr "use_and_privacy_agree" "/home/term" "/home/privacy" | Safe}}</label> | |||||
</div> | |||||
</div> | |||||
<div class="ui hidden divider"></div> | |||||
<div class="center aligned field"> | |||||
<button class="fluid large ui blue button"> | |||||
{{if .LinkAccountMode}} | |||||
{{.i18n.Tr "auth.oauth_signup_submit"}} | |||||
{{else}} | |||||
{{.i18n.Tr "auth.create_new_account"}} | |||||
{{end}} | |||||
</button> | |||||
</div> | |||||
{{end}} | |||||
</form> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</div> | </div> | ||||
</div> | |||||
</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<script> | <script> | ||||
; (function() { | ; (function() { | ||||
var getUrlParams = function() { | var getUrlParams = function() { | ||||
@@ -53,8 +53,8 @@ export default { | |||||
index_web: '', | index_web: '', | ||||
repo_name_name: '', | repo_name_name: '', | ||||
alias:'', | alias:'', | ||||
IsPermit:false | |||||
}, | }, | ||||
IsPermit: false, | |||||
// rule1:[{min:3,max:5,message:'1',trigger:"blur"}], | // rule1:[{min:3,max:5,message:'1',trigger:"blur"}], | ||||
rule: { | rule: { | ||||
index_web: [ | index_web: [ | ||||
@@ -1455,7 +1455,7 @@ i.SUCCEEDED { | |||||
white-space: nowrap; | white-space: nowrap; | ||||
} | } | ||||
.text-span-new { | .text-span-new { | ||||
width: 800px; | |||||
overflow: hidden; | overflow: hidden; | ||||
text-overflow: ellipsis; | text-overflow: ellipsis; | ||||
height: 20%; | height: 20%; | ||||
@@ -375,7 +375,7 @@ export default { | |||||
location.href=`${AppSubUrl}/authentication/wechat/bind` | location.href=`${AppSubUrl}/authentication/wechat/bind` | ||||
} | } | ||||
if(err.response.status===401){ | if(err.response.status===401){ | ||||
location.href=`${AppSubUrl}/user/login?redirect_to=${location.origin}${location.pathname}?type=login` | |||||
location.href=`${AppSubUrl}/user/login?redirect_to=${encodeURIComponent(location.origin+location.pathname + '?type=login&card='+ this.selectIndex)}` | |||||
return | return | ||||
} | } | ||||
this.btnStatus[index]=0 | this.btnStatus[index]=0 | ||||
@@ -445,6 +445,7 @@ export default { | |||||
if(new URLSearchParams(window.location.search).get("type")==='login'){ | if(new URLSearchParams(window.location.search).get("type")==='login'){ | ||||
that.getNotebookInfo() | that.getNotebookInfo() | ||||
that.dialogVisible = true; | that.dialogVisible = true; | ||||
that.selectIndex = Number(new URLSearchParams(window.location.search).get("card")) | |||||
} | } | ||||
document | document | ||||
.querySelector("#notebook-debug") | .querySelector("#notebook-debug") | ||||