diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 98b2a92f0..2f57863e3 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -917,6 +917,9 @@ template.avatar = Avatar template.issue_labels = Issue Labels template.one_item = Must select at least one template item template.invalid = Must select a template repository +template.repo_adress=Adress +template.repo_path=path +template.repo_name=Name archive.title = This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests. archive.issue.nocomment = This repo is archived. You cannot comment on issues. diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index 053884c2b..e34092ac9 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -927,6 +927,9 @@ template.avatar=头像 template.issue_labels=任务标签 template.one_item=必须至少选择一个模板项 template.invalid=必须选择一个模板项目 +template.repo_adress=项目地址 +template.repo_path=项目地址 +template.repo_name=项目名称 archive.title=此项目已存档。您可以查看文件和克隆,但不能推送或创建任务/合并请求。 archive.issue.nocomment=此项目已存档,您不能在此任务添加评论。 diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl index 2d89bf661..3e55a24fa 100644 --- a/templates/repo/create.tmpl +++ b/templates/repo/create.tmpl @@ -10,13 +10,13 @@
{{template "base/alert" .}}
- +
- +
-
- - - +
@@ -203,44 +203,7 @@
{{template "base/footer" .}} \ No newline at end of file diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl index a9b637420..ecea30e52 100644 --- a/templates/repo/settings/options.tmpl +++ b/templates/repo/settings/options.tmpl @@ -11,11 +11,64 @@
{{.CsrfTokenHtml}} -
+ +
+ + +
+ +
+ +
+
+ + + +
+ +
/
+
+ + + +
+
+ +
+ + + +
{{SizeFmt .Repository.Size}} diff --git a/web_src/js/index.js b/web_src/js/index.js index 7d59cc0eb..68e7e8d7a 100755 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -4136,4 +4136,68 @@ $('.question.circle.icon').hover(function(){ //云脑详情页面跳转回上一个页面 $(".section.backTodeBug").attr("href",localStorage.getItem('all')) //新建调试取消跳转 -$(".ui.button.cancel").attr("href",localStorage.getItem('all')) \ No newline at end of file +$(".ui.button.cancel").attr("href",localStorage.getItem('all')) + + +function initcreateRepo(){ + let timeout; + let keydown_flag = false + $('#repo_name').keyup(function(e){ + keydown_flag = $('#repo_name').val() ? true : false + if(keydown_flag){ + $('#repoAdress').css("display","block") + $('#repoAdress span').text($('#repo_name').val()+'.git') + + } + }) + + // const createRepoAdress = () => { + // //在此处写调用的方法,可以实现仅最后一次操作生效 + // const aliasValue = $('#alias').val() + // const ownerValue = $('#uid').val() + // if(keydown_flag){ + // $('#repo_name').attr("placeholder","") + // } + // else if(aliasValue){ + // $('#repo_name').attr("placeholder","正在获取路径...") + // $.get(`${window.config.AppSubUrl}/repo/check_name?q=${aliasValue}&owner=${ownerValue }`,(data)=>{ + // const repo_name = data.name + // $('#repo_name').val(repo_name) + // $('#repoAdress').css("display","block") + // $('#repoAdress span').text("{{AppSubUrl}}/{{.ContextUser.ShortName 20}}/"+$('#repo_name').val()+'.git') + // }) + // }else{ + // $('#repo_name').val('') + // $('#repo_name').attr("placeholder","") + // } + // } + + $("#alias").on('input',function(){ + clearTimeout(timeout) + timeout = setTimeout(() => { + //在此处写调用的方法,可以实现仅最后一次操作生效 + const aliasValue = $('#alias').val() + const ownerValue = $('#uid').val() + if(keydown_flag){ + $('#repo_name').attr("placeholder","") + } + else if(aliasValue){ + $('#repo_name').attr("placeholder","正在获取路径...") + $.get(`${window.config.AppSubUrl}/repo/check_name?q=${aliasValue}&owner=${ownerValue }`,(data)=>{ + const repo_name = data.name + $('#repo_name').val(repo_name) + $('#repoAdress').css("display","block") + $('#repoAdress span').text("{{AppSubUrl}}/{{.ContextUser.ShortName 20}}/"+$('#repo_name').val()+'.git') + }) + }else{ + $('#repo_name').val('') + $('#repo_name').attr("placeholder","") + } + }, 500) + }) + +} + +initcreateRepo() + +