1 |
1 |
/* db_backup_create.js <?php
|
2 |
2 |
# --------------------------------------------------------------
|
3 |
|
# db_backup_create.js 2014-01-03 tb@gambio
|
|
3 |
# db_backup_create.js 2019-01-11 gambio
|
4 |
4 |
# Gambio GmbH
|
5 |
5 |
# http://www.gambio.de
|
6 |
|
# Copyright (c) 2014 Gambio GmbH
|
|
6 |
# Copyright (c) 2019 Gambio GmbH
|
7 |
7 |
# Released under the GNU General Public License (Version 2)
|
8 |
8 |
# [http://www.gnu.org/licenses/gpl-2.0.html]
|
9 |
9 |
# --------------------------------------------------------------
|
... | ... | |
26 |
26 |
timeout: 30000,
|
27 |
27 |
context: this,
|
28 |
28 |
success: function( p_response )
|
29 |
|
{
|
30 |
|
create_backup();
|
31 |
|
},
|
|
29 |
{
|
|
30 |
create_backup();
|
|
31 |
},
|
32 |
32 |
error: function( p_jqXHR, p_exception )
|
33 |
|
{
|
34 |
|
reset();
|
35 |
|
}
|
|
33 |
{
|
|
34 |
reset();
|
|
35 |
}
|
36 |
36 |
});
|
37 |
37 |
}
|
38 |
38 |
|
... | ... | |
41 |
41 |
$.ajax({
|
42 |
42 |
type: "GET",
|
43 |
43 |
url: "request_port.php?module=DBBackup&action=create_db_backup&page_token=" + jse.core.config.get('pageToken'),
|
44 |
|
timeout: 30000,
|
|
44 |
timeout: 300000,
|
45 |
45 |
context: this,
|
46 |
46 |
success: function( p_response )
|
47 |
|
{
|
48 |
|
if( $.type( p_response ) == "object" && ( p_response.status == "continue_backup" || p_response.status == "backup_done" ) )
|
49 |
|
{
|
50 |
|
$( ".progress_text", t_lightbox_package ).html( p_response.progress + "%" );
|
51 |
|
$( ".progress_job", t_lightbox_package ).html( p_response.job );
|
52 |
|
$( ".progress_marker", t_lightbox_package ).width( p_response.progress + "%" );
|
53 |
|
if( p_response.status == "continue_backup" )
|
54 |
|
{
|
55 |
|
create_backup();
|
56 |
|
}
|
57 |
|
else if( p_response.status == "backup_done" )
|
58 |
|
{
|
59 |
|
bundle_backup( 'zip' );
|
60 |
|
}
|
61 |
|
}
|
62 |
|
else
|
63 |
|
{
|
64 |
|
if( $.type( p_response ) == "object" )
|
65 |
|
{
|
66 |
|
var t_error = p_response.error_message;
|
67 |
|
if( $.trim( t_error ) == "" )
|
68 |
|
{
|
69 |
|
t_error = "Unbekannter Fehler!";
|
70 |
|
}
|
71 |
|
reset_backup( t_error );
|
72 |
|
}
|
73 |
|
else
|
74 |
|
{
|
75 |
|
reset_backup( p_response );
|
76 |
|
}
|
77 |
|
}
|
78 |
|
|
79 |
|
},
|
|
47 |
{
|
|
48 |
if( $.type( p_response ) == "object" && ( p_response.status == "continue_backup" || p_response.status == "backup_done" ) )
|
|
49 |
{
|
|
50 |
$( ".progress_text", t_lightbox_package ).html( p_response.progress + "%" );
|
|
51 |
$( ".progress_job", t_lightbox_package ).html( p_response.job );
|
|
52 |
$( ".progress_marker", t_lightbox_package ).width( p_response.progress + "%" );
|
|
53 |
if( p_response.status == "continue_backup" )
|
|
54 |
{
|
|
55 |
create_backup();
|
|
56 |
}
|
|
57 |
else if( p_response.status == "backup_done" )
|
|
58 |
{
|
|
59 |
bundle_backup( 'zip' );
|
|
60 |
}
|
|
61 |
}
|
|
62 |
else
|
|
63 |
{
|
|
64 |
if( $.type( p_response ) == "object" )
|
|
65 |
{
|
|
66 |
var t_error = p_response.error_message;
|
|
67 |
if( $.trim( t_error ) == "" )
|
|
68 |
{
|
|
69 |
t_error = "Unbekannter Fehler!";
|
|
70 |
}
|
|
71 |
reset_backup( t_error );
|
|
72 |
}
|
|
73 |
else
|
|
74 |
{
|
|
75 |
reset_backup( p_response );
|
|
76 |
}
|
|
77 |
}
|
|
78 |
|
|
79 |
},
|
80 |
80 |
error: function( p_jqXHR, p_exception )
|
81 |
|
{
|
82 |
|
reset_backup( "Unbekannter Fehler!" );
|
83 |
|
}
|
|
81 |
{
|
|
82 |
reset_backup( "Unbekannter Fehler!" );
|
|
83 |
}
|
84 |
84 |
});
|
85 |
85 |
}
|
86 |
86 |
|
... | ... | |
90 |
90 |
$.ajax({
|
91 |
91 |
type: "GET",
|
92 |
92 |
url: "request_port.php?module=DBBackup&action=bundle_db_backup&bundle_type=" + c_bundle_type + "&page_token=" + jse.core.config.get('pageToken'),
|
93 |
|
timeout: 30000,
|
|
93 |
timeout: 300000,
|
94 |
94 |
context: this,
|
95 |
95 |
success: function( p_response )
|
96 |
|
{
|
97 |
|
if( $.type( p_response ) != "object" || p_response.status == "error" )
|
98 |
|
{
|
99 |
|
if( c_bundle_type == 'zip' )
|
100 |
|
{
|
101 |
|
$( ".progress_marker", t_lightbox_package ).width( "97%" );
|
102 |
|
$( ".progress_text", t_lightbox_package ).html( "97%" );
|
103 |
|
bundle_backup( 'gzip' );
|
104 |
|
}
|
105 |
|
else if( c_bundle_type == 'gzip' )
|
106 |
|
{
|
107 |
|
$( ".progress_marker", t_lightbox_package ).width( "98%" );
|
108 |
|
$( ".progress_text", t_lightbox_package ).html( "98%" );
|
109 |
|
bundle_backup( 'sql' );
|
110 |
|
}
|
111 |
|
else if( c_bundle_type == 'sql' && $.type( p_response ) != "object" )
|
112 |
|
{
|
113 |
|
reset_backup( p_response );
|
114 |
|
}
|
115 |
|
else if( c_bundle_type == 'sql' && $.type( p_response ) == "object" )
|
116 |
|
{
|
117 |
|
reset_backup( p_response.error_message );
|
118 |
|
}
|
119 |
|
}
|
120 |
|
else if( p_response.status == "success" )
|
121 |
|
{
|
122 |
|
$( ".progress_marker", t_lightbox_package ).width( "99%" );
|
123 |
|
$( ".progress_text", t_lightbox_package ).html( "99%" );
|
124 |
|
$( ".progress_job", t_lightbox_package ).html( p_response.job );
|
125 |
|
reset_backup();
|
126 |
|
}
|
127 |
|
},
|
|
96 |
{
|
|
97 |
if( $.type( p_response ) != "object" || p_response.status == "error" )
|
|
98 |
{
|
|
99 |
if( c_bundle_type == 'zip' )
|
|
100 |
{
|
|
101 |
$( ".progress_marker", t_lightbox_package ).width( "98%" );
|
|
102 |
$( ".progress_text", t_lightbox_package ).html( "98%" );
|
|
103 |
bundle_backup( 'gzip' );
|
|
104 |
}
|
|
105 |
else if( c_bundle_type == 'gzip' )
|
|
106 |
{
|
|
107 |
$( ".progress_marker", t_lightbox_package ).width( "99%" );
|
|
108 |
$( ".progress_text", t_lightbox_package ).html( "99%" );
|
|
109 |
bundle_backup( 'sql' );
|
|
110 |
}
|
|
111 |
else if( c_bundle_type == 'sql' && $.type( p_response ) != "object" )
|
|
112 |
{
|
|
113 |
reset_backup( p_response );
|
|
114 |
}
|
|
115 |
else if( c_bundle_type == 'sql' && $.type( p_response ) == "object" )
|
|
116 |
{
|
|
117 |
reset_backup( p_response.error_message );
|
|
118 |
}
|
|
119 |
}
|
|
120 |
else if( p_response.status == "success" )
|
|
121 |
{
|
|
122 |
$( ".progress_marker", t_lightbox_package ).width( "99%" );
|
|
123 |
$( ".progress_text", t_lightbox_package ).html( "99%" );
|
|
124 |
$( ".progress_job", t_lightbox_package ).html( p_response.job );
|
|
125 |
reset_backup();
|
|
126 |
}
|
|
127 |
},
|
128 |
128 |
error: function( p_jqXHR, p_exception )
|
129 |
|
{
|
130 |
|
reset_backup( "Unbekannter Fehler!" );
|
131 |
|
}
|
|
129 |
{
|
|
130 |
reset_backup( "Unbekannter Fehler!" );
|
|
131 |
}
|
132 |
132 |
});
|
133 |
133 |
}
|
134 |
134 |
|
... | ... | |
145 |
145 |
timeout: 30000,
|
146 |
146 |
context: this,
|
147 |
147 |
success: function( p_response )
|
148 |
|
{
|
149 |
|
if( c_error == false )
|
150 |
|
{
|
151 |
|
$( ".progress_job", t_lightbox_package ).html( p_response.job );
|
152 |
|
$( "#db_backup_wrapper" ).html( p_response.html );
|
153 |
|
$( ".progress_marker", t_lightbox_package ).width( "100%" );
|
154 |
|
$( ".progress_text", t_lightbox_package ).html( "100%" );
|
155 |
|
}
|
156 |
|
else
|
157 |
|
{
|
158 |
|
$( ".db_backup_lightbox_error_message", t_lightbox_package ).html( c_error ).show();
|
159 |
|
$( ".db_backup_lightbox_process", t_lightbox_package ).hide();
|
160 |
|
}
|
161 |
|
$( ".button_right_container .lightbox_close", t_lightbox_package ).show();
|
162 |
|
},
|
|
148 |
{
|
|
149 |
if( c_error == false )
|
|
150 |
{
|
|
151 |
$( ".progress_job", t_lightbox_package ).html( p_response.job );
|
|
152 |
$( "#db_backup_wrapper" ).html( p_response.html );
|
|
153 |
$( ".progress_marker", t_lightbox_package ).width( "100%" );
|
|
154 |
$( ".progress_text", t_lightbox_package ).html( "100%" );
|
|
155 |
}
|
|
156 |
else
|
|
157 |
{
|
|
158 |
$( ".db_backup_lightbox_error_message", t_lightbox_package ).html( c_error ).show();
|
|
159 |
$( ".db_backup_lightbox_process", t_lightbox_package ).hide();
|
|
160 |
}
|
|
161 |
$( ".button_right_container .lightbox_close", t_lightbox_package ).show();
|
|
162 |
},
|
163 |
163 |
error: function( p_jqXHR, p_exception )
|
164 |
|
{
|
165 |
|
reset_backup( c_error );
|
166 |
|
}
|
|
164 |
{
|
|
165 |
reset_backup( c_error );
|
|
166 |
}
|
167 |
167 |
});
|
168 |
168 |
}
|
169 |
169 |
|