openbay_manage.twig (14681B)
1 {{ header }}{{ column_left }} 2 <div id="content"> 3 <div class="page-header"> 4 <div class="container-fluid"> 5 <div class="pull-right"> 6 <button type="submit" form="form-openbay" data-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary" onclick="validateForm(); return false;"><i class="fa fa-save"></i></button> 7 <a href="{{ cancel }}" data-toggle="tooltip" title="{{ button_cancel }}" class="btn btn-default"><i class="fa fa-reply"></i></a> 8 </div> 9 <h1>{{ heading_title }}</h1> 10 <ul class="breadcrumb"> 11 {% for breadcrumb in breadcrumbs %} 12 <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li> 13 {% endfor %} 14 </ul> 15 </div> 16 </div> 17 <div class="container-fluid"> 18 <form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-openbay" class="form-horizontal"> 19 <ul class="nav nav-tabs"> 20 <li class="active"><a href="#tab-update" data-toggle="tab">{{ tab_update }}</a></li> 21 <li><a href="#tab-setting" data-toggle="tab">{{ tab_setting }}</a></li> 22 <li><a href="#tab-developer" data-toggle="tab">{{ tab_developer }}</a></li> 23 </ul> 24 <div class="tab-content"> 25 <div class="tab-pane active" id="tab-update"> 26 <div class="alert alert-info text-left">{{ text_version_installed }}<span id="text-version">{{ feed_openbaypro_version }}</span></div> 27 <input type="hidden" name="feed_openbaypro_version" value="{{ feed_openbaypro_version }}" /> 28 29 <div class="container-fluid"> 30 <h4>{{ text_software_update }}</h4> 31 <p>{{ text_update_description }}</p> 32 <div class="well"> 33 <div class="alert alert-danger" id="update-error" style="display:none;"></div> 34 <div id="update-v2-box"> 35 <div class="form-group"> 36 <label class="col-sm-3 control-label" for="update-v2-beta"><span data-toggle="tooltip" title="{{ help_beta }}">{{ entry_beta }}</span></label> 37 <div class="col-sm-8"> 38 <select id="update-v2-beta" class="form-control"> 39 <option value="1">{{ text_yes }}</option> 40 <option value="0" selected="selected">{{ text_no }}</option> 41 </select> 42 </div> 43 </div> 44 <div class="form-group"> 45 <label class="col-sm-3 control-label" for="update-v2"><span data-toggle="tooltip" title="{{ help_easy_update }}">{{ entry_update }}</span></label> 46 <div class="col-sm-8"> 47 <button class="btn btn-primary" id="update-v2">{{ button_update }}</button> 48 </div> 49 </div> 50 </div> 51 <div id="update-v2-progress" style="display:none;"> 52 <div class="progress" style="height:50px;"> 53 <div class="progress-bar progress-bar-striped active progress-bar-info" role="progressbar" aria-valuenow="1" aria-valuemin="0" aria-valuemax="100" style="width: 0%;" id="loading-bar"></div> 54 </div> 55 <h4 class="text-center" id="update-text"></h4> 56 </div> 57 </div> 58 <h4>{{ text_patch_option }}</h4> 59 <p>{{ text_patch_description }}</p> 60 <div class="well"> 61 <div class="form-group"> 62 <label class="col-sm-3 control-label" for="button-patch"><span data-toggle="tooltip" title="{{ help_patch }}">{{ entry_patch }}</span></label> 63 <div class="col-sm-8"> 64 <button class="btn btn-primary" id="button-patch">{{ button_patch }}</button> 65 </div> 66 </div> 67 </div> 68 </div> 69 </div> 70 <div class="tab-pane" id="tab-setting"> 71 <div class="well"> 72 <div class="form-group"> 73 <label class="col-sm-2 control-label" for="input-language">{{ text_language }}</label> 74 <div class="col-sm-10"> 75 <select name="feed_openbaypro_language" id="input-language" class="form-control"> 76 {% for language_iso, language_text in api_languages %} 77 <option value="{{ language_iso }}" {% if language_iso == feed_openbaypro_language %} selected="selected"{% endif %}>{{ language_text }}</option> 78 {% endfor %} 79 </select> 80 </div> 81 </div> 82 <div class="form-group"> 83 <label class="col-sm-2 control-label" for="button-clear-faq"><span data-toggle="tooltip" title="{{ help_clear_faq }}">{{ text_clear_faq }}</span></label> 84 <div class="col-sm-10"> 85 <button class="btn btn-primary" id="button-clear-faq">{{ button_clear }}</button> 86 </div> 87 </div> 88 </div> 89 </div> 90 <div class="tab-pane" id="tab-developer"> 91 <div class="well"> 92 <div class="form-group"> 93 <label class="col-sm-2 control-label" for="button-clear-data"><span data-toggle="tooltip" title="{{ help_empty_data }}">{{ entry_empty_data }}</span></label> 94 <div class="col-sm-10"> <a class="btn btn-primary" id="button-clear-data">{{ button_clear }}</a> </div> 95 </div> 96 </div> 97 </div> 98 </div> 99 </form> 100 </div> 101 </div> 102 103 <script type="text/javascript"><!-- 104 $('#button-patch').bind('click', function(e) { 105 e.preventDefault(); 106 107 $.ajax({ 108 url: 'index.php?route=marketplace/openbay/patch&user_token={{ user_token }}', 109 type: 'post', 110 dataType: 'json', 111 beforeSend: function() { 112 $('#button-patch').empty().html('<i class="fa fa-cog fa-lg fa-spin"></i>'); 113 $("#button-patch").attr('disabled', 'disabled'); 114 }, 115 success: function() { 116 $('#button-patch').empty().removeClass('btn-primary').addClass('btn-success').html('{{ text_complete }}'); 117 alert('{{ text_patch_complete }}'); 118 }, 119 error: function (xhr, ajaxOptions, thrownError) { 120 $('#button-patch').empty().html('{{ button_patch }}'); 121 if (xhr.status != 0) { alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); } 122 } 123 }); 124 }); 125 126 $('#button-clear-faq').bind('click', function(e) { 127 e.preventDefault(); 128 129 $.ajax({ 130 url: 'index.php?route=marketplace/openbay/faqclear&user_token={{ user_token }}', 131 beforeSend: function() { 132 $('#button-clear-faq').empty().html('<i class="fa fa-cog fa-lg fa-spin"></i>'); 133 $("#button-clear-faq").attr('disabled','disabled'); 134 }, 135 type: 'post', 136 dataType: 'json', 137 success: function(json) { 138 $('#button-clear-faq').empty().removeClass('btn-primary').addClass('btn-success').html('{{ text_complete }}'); 139 alert('{{ text_clear_faq_complete }}'); 140 }, 141 error: function (xhr, ajaxOptions, thrownError) { 142 $('#button-clear-faq').empty().html('{{ button_clear }}'); 143 if (xhr.status != 0) { alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); } 144 } 145 }); 146 }); 147 148 $('#button-clear-data').bind('click', function(e) { 149 e.preventDefault(); 150 151 var pass = prompt("{{ entry_password_prompt }}", ""); 152 153 if (pass != '') { 154 $.ajax({ 155 url: 'index.php?route=marketplace/openbay/purge&user_token={{ user_token }}', 156 type: 'post', 157 dataType: 'json', 158 data: 'pass=' + pass, 159 beforeSend: function() { 160 $('#button-clear-data').empty().html('<i class="fa fa-cog fa-lg fa-spin"></i>'); 161 }, 162 success: function(json) { 163 setTimeout(function() { 164 alert(json.msg); 165 $('#button-clear-data').empty().html('{{ button_clear }}'); 166 }, 500); 167 }, 168 error: function (xhr, ajaxOptions, thrownError) { 169 if (xhr.status != 0) { alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); } 170 } 171 }); 172 } else { 173 alert('{{ text_action_warning }}'); 174 $('#button-clear-data').empty().html('{{ button_clear }}'); 175 } 176 }); 177 178 $('#update-v2').bind('click', function(e) { 179 e.preventDefault(); 180 181 var text_confirm = confirm('{{ text_confirm_backup }}'); 182 183 if (text_confirm == true) { 184 $('#update-error').hide(); 185 $('#update-v2-box').hide(); 186 $('#update-v2-progress').fadeIn(); 187 $('#update-text').text('{{ text_check_server }}'); 188 $('#loading-bar').css('width', '5%'); 189 190 var beta = $('#update-v2-beta :selected').val(); 191 192 updateCheckServer(beta); 193 } 194 }); 195 196 function updateCheckServer(beta) { 197 $.ajax({ 198 url: 'index.php?route=marketplace/openbay/update&stage=check_server&user_token={{ user_token }}&beta=' + beta, 199 type: 'post', 200 dataType: 'json', 201 beforeSend: function() { }, 202 success: function(json) { 203 if (json.error == 1) { 204 updateError(json.response); 205 } else { 206 $('#update-text').text(json.status_message); 207 $('#loading-bar').css('width', json.percent_complete + '%'); 208 updateCheckVersion(beta); 209 } 210 }, 211 error: function (xhr, ajaxOptions, thrownError) { 212 if (xhr.status != 0) { 213 alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); 214 } 215 } 216 }); 217 } 218 219 function updateCheckVersion(beta) { 220 $.ajax({ 221 url: 'index.php?route=marketplace/openbay/update&stage=check_version&user_token={{ user_token }}&beta=' + beta, 222 type: 'post', 223 dataType: 'json', 224 beforeSend: function() { }, 225 success: function(json) { 226 if (json.error == 1) { 227 $('#update-error').removeClass('alert-danger').addClass('alert-info').html('<i class="fa fa-check"></i> ' + json.response).show(); 228 $('#update-v2-progress').hide(); 229 $('#update-v2-box').fadeIn(); 230 } else { 231 $('#update-text').text(json.status_message); 232 $('#loading-bar').css('width', json.percent_complete + '%'); 233 updateDownload(beta); 234 } 235 }, 236 error: function (xhr, ajaxOptions, thrownError) { 237 if (xhr.status != 0) { 238 alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); 239 } 240 } 241 }); 242 } 243 244 function updateDownload(beta) { 245 $.ajax({ 246 url: 'index.php?route=marketplace/openbay/update&stage=download&user_token={{ user_token }}&beta=' + beta, 247 type: 'post', 248 dataType: 'json', 249 beforeSend: function() { }, 250 success: function(json) { 251 if (json.error == 1) { 252 updateError(json.response); 253 } else { 254 $('#update-text').text(json.status_message); 255 $('#loading-bar').css('width', json.percent_complete + '%'); 256 updateExtract(beta); 257 } 258 }, 259 error: function (xhr, ajaxOptions, thrownError) { 260 if (xhr.status != 0) { 261 alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); 262 } 263 } 264 }); 265 } 266 267 function updateExtract(beta) { 268 $.ajax({ 269 url: 'index.php?route=marketplace/openbay/update&stage=extract&user_token={{ user_token }}&beta=' + beta, 270 type: 'post', 271 dataType: 'json', 272 beforeSend: function() { }, 273 success: function(json) { 274 if (json.error == 1) { 275 updateError(json.response); 276 } else { 277 $('#update-text').text(json.status_message); 278 $('#loading-bar').css('width', json.percent_complete + '%'); 279 updateRemove(beta); 280 } 281 }, 282 error: function (xhr, ajaxOptions, thrownError) { 283 if (xhr.status != 0) { 284 alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); 285 } 286 } 287 }); 288 } 289 290 function updateRemove(beta) { 291 $.ajax({ 292 url: 'index.php?route=marketplace/openbay/update&stage=remove&user_token={{ user_token }}&beta=' + beta, 293 type: 'post', 294 dataType: 'json', 295 beforeSend: function() { }, 296 success: function(json) { 297 if (json.error == 1) { 298 $('#update-v2-progress').prepend('<div class="alert alert-warning">' + json.response + '</div>'); 299 } 300 301 $('#update-text').text(json.status_message); 302 $('#loading-bar').css('width', json.percent_complete + '%'); 303 updatePatch(beta); 304 }, 305 error: function (xhr, ajaxOptions, thrownError) { 306 if (xhr.status != 0) { 307 alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); 308 } 309 } 310 }); 311 } 312 313 function updatePatch(beta) { 314 $.ajax({ 315 url: 'index.php?route=marketplace/openbay/update&stage=run_patch&user_token={{ user_token }}&beta=' + beta, 316 type: 'post', 317 dataType: 'json', 318 beforeSend: function() { }, 319 success: function(json) { 320 if (json.error == 1) { 321 updateError(json.response); 322 } else { 323 $('#update-text').text(json.status_message); 324 $('#loading-bar').css('width', json.percent_complete + '%'); 325 updateVersion(beta); 326 } 327 }, 328 error: function (xhr, ajaxOptions, thrownError) { 329 if (xhr.status != 0) { 330 alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); 331 } 332 } 333 }); 334 } 335 336 function updateVersion(beta) { 337 $.ajax({ 338 url: 'index.php?route=marketplace/openbay/update&stage=update_version&user_token={{ user_token }}&beta=' + beta, 339 type: 'post', 340 dataType: 'json', 341 beforeSend: function() { }, 342 success: function(json) { 343 if (json.error == 1) { 344 updateError(json.response); 345 } else { 346 $('#update-text').text(json.status_message); 347 $('#text-version').text(json.response); 348 $('#loading-bar').css('width', json.percent_complete + '%').removeClass('progress-bar-info').addClass('progress-bar-success'); 349 } 350 }, 351 error: function (xhr, ajaxOptions, thrownError) { 352 if (xhr.status != 0) { 353 alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); 354 } 355 } 356 }); 357 } 358 359 function updateError(errors) { 360 $('#update-error').text(errors).show(); 361 362 $('#update-v2-progress').hide(); 363 $('#update-v2-box').fadeIn(); 364 } 365 366 function validateForm() { 367 $('#form-openbay').submit(); 368 } 369 //--></script> 370 {{ footer }}