* adjust for task #46552.

This commit is contained in:
王怡栋
2021-12-29 09:49:43 +08:00
parent 0ba53391eb
commit 2e7530441b
6 changed files with 39 additions and 41 deletions

View File

@@ -2,10 +2,10 @@ $(function()
{
$('#gitlabID').change(function()
{
gitlabID = $('#gitlabID').val();
var gitlabID = $('#gitlabID').val();
if(gitlabID == '') return false;
url = createLink('repo', 'ajaxgetgitlabprojects', "gitlabID=" + gitlabID);
var url = createLink('repo', 'ajaxgetgitlabprojects', "gitlabID=" + gitlabID);
$.get(url, function(response)
{
$('#sourceProject').html('').append(response);
@@ -15,9 +15,9 @@ $(function()
$('#sourceProject,#targetProject').change(function()
{
sourceProject = $(this).val();
var sourceProject = $(this).val();
var branchSelect = $(this).parents('td').find('select[name*=Branch]');
branchUrl = createLink('gitlab', 'ajaxgetprojectbranches', "gitlabID=" + gitlabID + "&projectID=" + sourceProject);
var branchUrl = createLink('gitlab', 'ajaxgetprojectbranches', "gitlabID=" + gitlabID + "&projectID=" + sourceProject);
$.get(branchUrl, function(response)
{
branchSelect.html('').append(response);
@@ -28,15 +28,15 @@ $(function()
$('#sourceProject').change(function()
{
sourceProject = $(this).val();
projectUrl = createLink('mr', 'ajaxGetMRTargetProjects', "gitlabID=" + gitlabID + "&projectID=" + sourceProject);
var sourceProject = $(this).val();
var projectUrl = createLink('mr', 'ajaxGetMRTargetProjects', "gitlabID=" + gitlabID + "&projectID=" + sourceProject);
$.get(projectUrl, function(response)
{
$('#targetProject').html('').append(response);
$('#targetProject').chosen().trigger("chosen:updated");;
});
repoUrl = createLink('mr', 'ajaxGetRepoList', "gitlabID=" + gitlabID + "&projectID=" + sourceProject);
var repoUrl = createLink('mr', 'ajaxGetRepoList', "gitlabID=" + gitlabID + "&projectID=" + sourceProject);
$.get(repoUrl, function(response)
{
$('#repoID').html('').append(response);
@@ -48,7 +48,7 @@ $(function()
{
var gitlabID = $('#gitlabID').val();
var sourceProject = $('#sourceProject').val();
repoUrl = createLink('mr', 'ajaxCheckOpened', "gitlabID=" + gitlabID + "&projectID=" + sourceProject);
var repoUrl = createLink('mr', 'ajaxCheckSameOpened', "gitlabID=" + gitlabID + "&projectID=" + sourceProject);
var sourceBranch = $(this).val();
$.post(repoUrl, {"sourceBranch": sourceBranch}, function(response)
@@ -82,8 +82,8 @@ $(function()
$('#repoID').change(function()
{
repoID = $(this).val();
jobUrl = createLink('mr', 'ajaxGetJobList', "repoID=" + repoID);
var repoID = $(this).val();
var jobUrl = createLink('mr', 'ajaxGetJobList', "repoID=" + repoID);
$.get(jobUrl, function(response)
{
$('#jobID').html('').append(response);
@@ -93,8 +93,8 @@ $(function()
$('#jobID').change(function()
{
jobID = $(this).val();
compileUrl = createLink('mr', 'ajaxGetCompileList', "job=" + jobID);
var jobID = $(this).val();
var compileUrl = createLink('mr', 'ajaxGetCompileList', "job=" + jobID);
$.get(compileUrl, function(response)
{
$('#compile').html('').append(response);
@@ -102,20 +102,19 @@ $(function()
});
});
$("#needCI").change(function()
{
if(this.checked == false)
{
$("#jobID").prop("disabled", true);
$('#jobID').chosen().trigger("chosen:updated");;
$("#jobID").parent().parent().addClass('hidden');
}
if(this.checked == true)
{
$("#jobID").prop("disabled", false);
$('#jobID').chosen().trigger("chosen:updated");;
$("#jobID").parent().parent().removeClass('hidden');
}
});
$("#needCI").change(function()
{
if(this.checked == false)
{
$("#jobID").prop("disabled", true);
$('#jobID').chosen().trigger("chosen:updated");;
$("#jobID").parent().parent().addClass('hidden');
}
if(this.checked == true)
{
$("#jobID").prop("disabled", false);
$('#jobID').chosen().trigger("chosen:updated");;
$("#jobID").parent().parent().removeClass('hidden');
}
});
});