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