summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/importer_status.js.coffee
diff options
context:
space:
mode:
authorJob van der Voort <jobvandervoort@gmail.com>2015-04-21 16:21:51 +0200
committerJob van der Voort <jobvandervoort@gmail.com>2015-04-21 16:21:51 +0200
commita8e93b7f51d968c1380ed210499869b62b07fd15 (patch)
treec864e80dfd9cf4f83fcede678acc986e3a125bf5 /app/assets/javascripts/importer_status.js.coffee
parent0625b15a481b3a3edd88110b3c18031ad9068d2f (diff)
downloadgitlab-ce-7.10.0.rc5.tar.gz
Version 7.10.0.rc5v7.10.0.rc5
Diffstat (limited to 'app/assets/javascripts/importer_status.js.coffee')
-rw-r--r--app/assets/javascripts/importer_status.js.coffee35
1 files changed, 0 insertions, 35 deletions
diff --git a/app/assets/javascripts/importer_status.js.coffee b/app/assets/javascripts/importer_status.js.coffee
deleted file mode 100644
index be8d225e73b..00000000000
--- a/app/assets/javascripts/importer_status.js.coffee
+++ /dev/null
@@ -1,35 +0,0 @@
-class @ImporterStatus
- constructor: (@jobs_url, @import_url) ->
- this.initStatusPage()
- this.setAutoUpdate()
-
- initStatusPage: ->
- $(".js-add-to-import").click (event) =>
- new_namespace = null
- tr = $(event.currentTarget).closest("tr")
- id = tr.attr("id").replace("repo_", "")
- if tr.find(".import-target input").length > 0
- new_namespace = tr.find(".import-target input").prop("value")
- tr.find(".import-target").empty().append(new_namespace + "/" + tr.find(".import-target").data("project_name"))
- $.post @import_url, {repo_id: id, new_namespace: new_namespace}, dataType: 'script'
-
- $(".js-import-all").click (event) =>
- $(".js-add-to-import").each ->
- $(this).click()
-
- setAutoUpdate: ->
- setInterval (=>
- $.get @jobs_url, (data) =>
- $.each data, (i, job) =>
- job_item = $("#project_" + job.id)
- status_field = job_item.find(".job-status")
-
- if job.import_status == 'finished'
- job_item.removeClass("active").addClass("success")
- status_field.html('<span><i class="fa fa-check"></i> done</span>')
- else if job.import_status == 'started'
- status_field.html("<i class='fa fa-spinner fa-spin'></i> started")
- else
- status_field.html(job.import_status)
-
- ), 4000