##// END OF EJS Templates
repo: when creating repos if we don't get JSON results, stop execution at refresh.
marcink -
r75:110fb2a4 default
parent child Browse files
Show More
@@ -1,74 +1,74 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="/base/base.html"/>
3 3
4 4 ## don't trigger flash messages on this page
5 5 <%def name="flash_msg()">
6 6 </%def>
7 7
8 8 <%def name="title()">
9 9 ${_('%s Creating repository') % c.repo_name}
10 10 %if c.rhodecode_name:
11 11 &middot; ${h.branding(c.rhodecode_name)}
12 12 %endif
13 13 </%def>
14 14
15 15 <%def name="breadcrumbs_links()">
16 16 ${_('Creating repository')} ${c.repo}
17 17 </%def>
18 18
19 19 <%def name="menu_bar_nav()">
20 20 ${self.menu_items(active='repositories')}
21 21 </%def>
22 22 <%def name="main()">
23 23 <div class="box">
24 24 <!-- box / title -->
25 25 <div class="title">
26 26 ${self.breadcrumbs()}
27 27 </div>
28 28
29 29 <div id="progress-message">
30 30 ${_('Repository "%(repo_name)s" is being created, you will be redirected when this process is finished.' % {'repo_name':c.repo_name})}
31 31 </div>
32 32
33 33 <div id="progress">
34 34 <div class="progress progress-striped active">
35 35 <div class="progress-bar progress-bar" role="progressbar"
36 36 aria-valuenow="100" aria-valuemin="0" aria-valuemax="100">
37 37 </div>
38 38 </div>
39 39 </div>
40 40 </div>
41 41 </%def>
42 42
43 43 <script>
44 44 (function worker() {
45 45 var skipCheck = false;
46 46 var url = "${h.url('repo_check_home', repo_name=c.repo_name, repo=c.repo, task_id=c.task_id)}";
47 47 $.ajax({
48 48 url: url,
49 49 complete: function(resp) {
50 50 if (resp.status == 200) {
51 51 var jsonResponse = resp.responseJSON;
52 52
53 if (jsonResponse === undefined){
54 setTimeout(function(){
53 if (jsonResponse === undefined) {
54 setTimeout(function () {
55 55 // we might have a backend problem, try dashboard again
56 56 window.location = "${h.url('summary_home', repo_name = c.repo)}";
57 }, 1000);
58 }
59
60 if (skipCheck || jsonResponse.result === true) {
61 // success, means go to dashboard
62 window.location = "${h.url('summary_home', repo_name = c.repo)}";
57 }, 3000);
63 58 } else {
64 // Schedule the next request when the current one's complete
65 setTimeout(worker, 1000);
59 if (skipCheck || jsonResponse.result === true) {
60 // success, means go to dashboard
61 window.location = "${h.url('summary_home', repo_name = c.repo)}";
62 } else {
63 // Schedule the next request when the current one's complete
64 setTimeout(worker, 1000);
65 }
66 66 }
67 67 }
68 68 else {
69 69 window.location = "${h.url('home')}";
70 70 }
71 71 }
72 72 });
73 73 })();
74 74 </script>
General Comments 0
You need to be logged in to leave comments. Login now