2014-06-26 17:00:43 +02:00
var correct _install _progress = true ;
2015-06-30 12:59:23 +02:00
function form _upload ( homeurl ) {
2015-10-15 16:21:52 +02:00
var home _url = ( typeof homeurl !== 'undefined' ) ? homeurl + '/' : '' ;
2015-06-30 12:59:23 +02:00
2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
//Thanks to: http://tutorialzine.com/2013/05/mini-ajax-file-upload-form/
var ul = $ ( '#form-offline_update ul' ) ;
$ ( '#form-offline_update div' )
. prop ( "id" , "drop_file" ) ;
$ ( '#drop_file' )
. html ( drop _the _package _here _or +
' <a>' + browse _it + '</a>' +
'<input name="upfile" type="file" id="file-upfile" accept=".oum" class="sub file" />' ) ;
$ ( '#drop_file a' ) . click ( function ( ) {
// Simulate a click on the file input button to show the file browser dialog
$ ( this ) . parent ( ) . find ( 'input' ) . click ( ) ;
} ) ;
// Initialize the jQuery File Upload plugin
$ ( '#form-offline_update' ) . fileupload ( {
2015-10-15 16:21:52 +02:00
url : home _url + 'ajax.php?page=include/ajax/update_manager.ajax&upload_file=true' ,
2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
// This element will accept file drag/drop uploading
dropZone : $ ( '#drop_file' ) ,
// This function is called when a file is added to the queue;
// either via the browse button, or via drag/drop:
add : function ( e , data ) {
$ ( '#drop_file' ) . slideUp ( ) ;
var tpl = $ ( '<li>' +
'<input type="text" id="input-progress" ' +
'value="0" data-width="55" data-height="55" ' +
2015-06-30 13:20:20 +02:00
'data-fgColor="#80BA27" data-readOnly="1" ' +
'data-bgColor="#3E4043" />' +
2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
'<p></p><span></span>' +
'</li>' ) ;
// Append the file name and file size
tpl . find ( 'p' ) . text ( data . files [ 0 ] . name )
. append ( '<i>' + formatFileSize ( data . files [ 0 ] . size ) + '</i>' ) ;
// Add the HTML to the UL element
ul . html ( "" ) ;
data . context = tpl . appendTo ( ul ) ;
// Initialize the knob plugin
tpl . find ( 'input' ) . val ( 0 ) ;
tpl . find ( 'input' ) . knob ( {
'draw' : function ( ) {
$ ( this . i ) . val ( this . cv + '%' )
}
} ) ;
// Listen for clicks on the cancel icon
tpl . find ( 'span' ) . click ( function ( ) {
if ( tpl . hasClass ( 'working' ) && typeof jqXHR != 'undefined' ) {
jqXHR . abort ( ) ;
}
tpl . fadeOut ( function ( ) {
tpl . remove ( ) ;
$ ( '#drop_file' ) . slideDown ( ) ;
} ) ;
} ) ;
// Automatically upload the file once it is added to the queue
data . context . addClass ( 'working' ) ;
var jqXHR = data . submit ( ) ;
} ,
progress : function ( e , data ) {
// Calculate the completion percentage of the upload
var progress = parseInt ( data . loaded / data . total * 100 , 10 ) ;
// Update the hidden input field and trigger a change
// so that the jQuery knob plugin knows to update the dial
data . context . find ( 'input' ) . val ( progress ) . change ( ) ;
if ( progress == 100 ) {
data . context . removeClass ( 'working' ) ;
// Class loading while the zip is extracted
data . context . addClass ( 'loading' ) ;
}
} ,
fail : function ( e , data ) {
// Something has gone wrong!
data . context . removeClass ( 'working' ) ;
data . context . removeClass ( 'loading' ) ;
data . context . addClass ( 'error' ) ;
} ,
done : function ( e , data ) {
var res = JSON . parse ( data . result ) ;
if ( res . status == "success" ) {
data . context . removeClass ( 'loading' ) ;
data . context . addClass ( 'suc' ) ;
ul . find ( 'li' ) . find ( 'span' ) . unbind ( "click" ) ;
// Transform the file input zone to show messages
$ ( '#drop_file' ) . prop ( 'id' , 'log_zone' ) ;
// Success messages
$ ( '#log_zone' ) . html ( "<div>" + the _package _has _been _uploaded _successfully + "</div>" ) ;
$ ( '#log_zone' ) . append ( "<div>" + remember _that _this _package _will + "</div>" ) ;
$ ( '#log_zone' ) . append ( "<div>" + click _on _the _file _below _to _begin + "</div>" ) ;
// Show messages
$ ( '#log_zone' ) . slideDown ( 400 , function ( ) {
$ ( '#log_zone' ) . height ( 75 ) ;
$ ( '#log_zone' ) . css ( "overflow" , "auto" ) ;
} ) ;
// Bind the the begin of the installation to the package li
ul . find ( 'li' ) . css ( "cursor" , "pointer" ) ;
ul . find ( 'li' ) . click ( function ( ) {
ul . find ( 'li' ) . unbind ( "click" ) ;
ul . find ( 'li' ) . css ( "cursor" , "default" ) ;
// Change the log zone to show the copied files
$ ( '#log_zone' ) . html ( "" ) ;
$ ( '#log_zone' ) . slideUp ( 200 , function ( ) {
$ ( '#log_zone' ) . slideDown ( 200 , function ( ) {
$ ( '#log_zone' ) . height ( 200 ) ;
$ ( '#log_zone' ) . css ( "overflow" , "auto" ) ;
} ) ;
} ) ;
// Changed the data that shows the file li
data . context . find ( 'p' ) . text ( updating + "..." ) ;
data . context . find ( 'input' ) . val ( 0 ) . change ( ) ;
// Begin the installation
2015-06-30 12:59:23 +02:00
install _package ( res . package , homeurl ) ;
2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
} ) ;
}
else {
// Something has gone wrong!
data . context . removeClass ( 'loading' ) ;
data . context . addClass ( 'error' ) ;
ul . find ( 'li' ) . find ( 'span' ) . click (
function ( ) { window . location . reload ( ) ; } ) ;
// Transform the file input zone to show messages
$ ( '#drop_file' ) . prop ( 'id' , 'log_zone' ) ;
// Error messages
$ ( '#log_zone' ) . html ( "<div>" + res . message + "</div>" ) ;
// Show error messages
$ ( '#log_zone' ) . slideDown ( 400 , function ( ) {
$ ( '#log_zone' ) . height ( 75 ) ;
$ ( '#log_zone' ) . css ( "overflow" , "auto" ) ;
} ) ;
}
}
} ) ;
// Prevent the default action when a file is dropped on the window
$ ( document ) . on ( 'drop_file dragover' , function ( e ) {
e . preventDefault ( ) ;
} ) ;
}
// Helper function that formats the file sizes
function formatFileSize ( bytes ) {
if ( typeof bytes !== 'number' ) {
return '' ;
}
if ( bytes >= 1000000000 ) {
return ( bytes / 1000000000 ) . toFixed ( 2 ) + ' GB' ;
}
if ( bytes >= 1000000 ) {
return ( bytes / 1000000 ) . toFixed ( 2 ) + ' MB' ;
}
return ( bytes / 1000 ) . toFixed ( 2 ) + ' KB' ;
}
2015-06-30 12:59:23 +02:00
function install _package ( package , homeurl ) {
2015-10-15 16:21:52 +02:00
var home _url = ( typeof homeurl !== 'undefined' ) ? homeurl + '/' : '' ;
2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
2017-03-15 13:20:05 +01:00
$ ( "<div id='pkg_apply_dialog' class='dialog ui-dialog-content' title='" + package _available + "'></div>" ) . dialog ( {
2017-03-13 16:30:04 +01:00
resizable : true ,
draggable : true ,
modal : true ,
overlay : {
opacity : 0.5 ,
background : 'black'
} ,
width : 600 ,
2017-03-14 10:36:10 +01:00
height : 250 ,
2017-03-13 16:30:04 +01:00
buttons : {
2017-03-15 13:20:05 +01:00
"Ok" : function ( ) {
$ ( this ) . dialog ( "close" ) ;
2017-03-13 16:30:04 +01:00
var parameters = { } ;
parameters [ 'page' ] = 'include/ajax/update_manager.ajax' ;
parameters [ 'search_minor' ] = 1 ;
2017-03-16 19:14:19 +01:00
parameters [ 'package' ] = package ;
parameters [ 'ent' ] = 1 ;
2017-03-13 16:30:04 +01:00
$ . ajax ( {
type : 'POST' ,
url : home _url + 'ajax.php' ,
data : parameters ,
dataType : "json" ,
success : function ( data ) {
if ( data [ 'have_minor' ] ) {
2017-03-15 13:20:05 +01:00
$ ( "<div id='mr_dialog2' class='dialog ui-dialog-content' title='" + mr _available + "'></div>" ) . dialog ( {
2017-03-13 16:30:04 +01:00
resizable : true ,
draggable : true ,
modal : true ,
overlay : {
opacity : 0.5 ,
background : 'black'
} ,
width : 600 ,
2017-03-14 10:36:10 +01:00
height : 270 ,
2017-03-13 16:30:04 +01:00
buttons : {
2017-03-14 15:20:12 +01:00
"Apply MR" : function ( ) {
var err = [ ] ;
2017-03-16 19:14:19 +01:00
err = apply _minor _release ( data [ 'mr' ] , package , 1 , 1 ) ;
2017-03-14 13:52:29 +01:00
2017-03-14 15:20:12 +01:00
if ( ! err [ 'error' ] ) {
2017-03-15 13:20:05 +01:00
if ( err [ 'message' ] == 'bad_mr_filename' ) {
2017-03-14 15:20:12 +01:00
$ ( "#mr_dialog2" ) . dialog ( "close" ) ;
2017-03-15 13:20:05 +01:00
$ ( "<div id='bad_message' class='dialog ui-dialog-content' title='" + mr _available + "'></div>" ) . dialog ( {
2017-03-14 15:20:12 +01:00
resizable : true ,
draggable : true ,
modal : true ,
overlay : {
opacity : 0.5 ,
background : 'black'
} ,
width : 600 ,
height : 270 ,
buttons : {
"Apply" : function ( ) {
$ ( this ) . dialog ( "close" ) ;
2017-03-15 13:53:25 +01:00
$ ( "<div id='accept_package_mr_fail' class='dialog ui-dialog-content' title='" + mr _available + "'></div>" ) . dialog ( {
resizable : true ,
draggable : true ,
modal : true ,
overlay : {
opacity : 0.5 ,
background : 'black'
} ,
width : 600 ,
height : 250 ,
buttons : {
"Ok" : function ( ) {
$ ( this ) . dialog ( "close" ) ;
}
}
} ) ;
var dialog _accept _package _mr _fail _text = "<div>" ;
dialog _accept _package _mr _fail _text = dialog _accept _package _mr _fail _text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_info_mr.png'></div>" ;
dialog _accept _package _mr _fail _text = dialog _accept _package _mr _fail _text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>INFO</strong></h3>" ;
dialog _accept _package _mr _fail _text = dialog _accept _package _mr _fail _text + "<p style='font-family:Verdana; font-size:12pt;'>" + mr _not _accepted _code _yes + "</p></div>" ;
dialog _accept _package _mr _fail _text = dialog _accept _package _mr _fail _text + "</div>" ;
$ ( '#accept_package_mr_fail' ) . html ( dialog _accept _package _mr _fail _text ) ;
$ ( '#accept_package_mr_fail' ) . dialog ( 'open' ) ;
2017-03-14 15:20:12 +01:00
var parameters = { } ;
parameters [ 'page' ] = 'include/ajax/update_manager.ajax' ;
parameters [ 'install_package' ] = 1 ;
parameters [ 'package' ] = package ;
parameters [ 'accept' ] = 1 ;
$ ( '#form-offline_update ul' ) . find ( 'li' ) . removeClass ( 'suc' ) ;
$ ( '#form-offline_update ul' ) . find ( 'li' ) . addClass ( 'loading' ) ;
$ . ajax ( {
type : 'POST' ,
url : home _url + 'ajax.php' ,
data : parameters ,
dataType : "json" ,
success : function ( data ) {
$ ( '#form-offline_update ul' ) . find ( 'li' ) . removeClass ( 'loading' ) ;
if ( data . status == "success" ) {
2017-03-15 13:20:05 +01:00
$ ( "<div id='success_pkg' class='dialog ui-dialog-content' title='" + package _available + "'></div>" ) . dialog ( {
2017-03-14 15:20:12 +01:00
resizable : true ,
draggable : true ,
modal : true ,
overlay : {
opacity : 0.5 ,
background : 'black'
} ,
width : 600 ,
height : 250 ,
buttons : {
"Ok" : function ( ) {
$ ( this ) . dialog ( "close" ) ;
}
}
} ) ;
2017-03-14 13:52:29 +01:00
2017-03-14 15:20:12 +01:00
var dialog _success _pkg _text = "<div>" ;
dialog _success _pkg _text = dialog _success _pkg _text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_exito_mr.png'></div>" ;
dialog _success _pkg _text = dialog _success _pkg _text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>SUCCESS</strong></h3>" ;
2017-03-16 10:46:26 +01:00
dialog _success _pkg _text = dialog _success _pkg _text + "<p style='font-family:Verdana; font-size:12pt;'>" + package _success + "</p></div>" ;
2017-03-14 15:20:12 +01:00
dialog _success _pkg _text = dialog _success _pkg _text + "</div>" ;
$ ( '#success_pkg' ) . html ( dialog _success _pkg _text ) ;
$ ( '#success_pkg' ) . dialog ( 'open' ) ;
$ ( '#form-offline_update ul' ) . find ( 'li' ) . addClass ( 'suc' ) ;
$ ( '#form-offline_update ul' ) . find ( 'li' ) . find ( 'p' ) . html ( package _updated _successfully )
. append ( "<i>" + if _there _are _any _database _change + "</i>" ) ;
}
else {
2017-03-15 13:20:05 +01:00
$ ( "<div id='error_pkg' class='dialog ui-dialog-content' title='" + package _available + "'></div>" ) . dialog ( {
2017-03-14 15:20:12 +01:00
resizable : true ,
draggable : true ,
modal : true ,
overlay : {
opacity : 0.5 ,
background : 'black'
} ,
width : 600 ,
height : 250 ,
buttons : {
"Ok" : function ( ) {
$ ( this ) . dialog ( "close" ) ;
}
}
} ) ;
var dialog _error _pkg _text = "<div>" ;
dialog _error _pkg _text = dialog _error _pkg _text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_error_mr.png'></div>" ;
dialog _error _pkg _text = dialog _error _pkg _text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>" ;
2017-03-16 10:46:26 +01:00
dialog _error _pkg _text = dialog _error _pkg _text + "<p style='font-family:Verdana; font-size:12pt;'>" + package _error + "</p></div>" ;
2017-03-14 15:20:12 +01:00
dialog _error _pkg _text = dialog _error _pkg _text + "</div>" ;
$ ( '#error_pkg' ) . html ( dialog _error _pkg _text ) ;
$ ( '#error_pkg' ) . dialog ( 'open' ) ;
$ ( '#form-offline_update ul' ) . find ( 'li' ) . addClass ( 'error' ) ;
$ ( '#form-offline_update ul' ) . find ( 'li' ) . find ( 'p' ) . html ( package _not _updated )
. append ( "<i>" + data . message + "</i>" ) ;
}
$ ( '#form-offline_update ul' ) . find ( 'li' ) . css ( "cursor" , "pointer" ) ;
$ ( '#form-offline_update ul' ) . find ( 'li' ) . click ( function ( ) {
window . location . reload ( ) ;
} ) ;
}
} ) ;
// Check the status of the update
check _install _package ( package , homeurl ) ;
} ,
"Cancel" : function ( ) {
$ ( this ) . dialog ( "close" ) ;
2017-03-15 13:53:25 +01:00
$ ( "<div id='cancel_pkg' class='dialog ui-dialog-content' title='" + package _available + "'></div>" ) . dialog ( {
resizable : true ,
draggable : true ,
modal : true ,
overlay : {
opacity : 0.5 ,
background : 'black'
} ,
width : 600 ,
height : 220 ,
buttons : {
"Ok" : function ( ) {
$ ( this ) . dialog ( "close" ) ;
}
}
} ) ;
var dialog _cancel _pkg _text = "<div>" ;
dialog _cancel _pkg _text = dialog _cancel _pkg _text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_info_mr.png'></div>" ;
dialog _cancel _pkg _text = dialog _cancel _pkg _text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>INFO</strong></h3>" ;
dialog _cancel _pkg _text = dialog _cancel _pkg _text + "<p style='font-family:Verdana; font-size:12pt;'>" + package _cancel + "</p></div>" ;
dialog _cancel _pkg _text = dialog _cancel _pkg _text + "</div>" ;
$ ( '#cancel_pkg' ) . html ( dialog _cancel _pkg _text ) ;
$ ( '#cancel_pkg' ) . dialog ( 'open' ) ;
2017-03-15 13:20:05 +01:00
$ ( "#box_online .content" ) . html ( mr _not _accepted ) ;
2017-03-14 15:20:12 +01:00
}
2017-03-13 16:30:04 +01:00
}
2017-03-14 15:20:12 +01:00
} ) ;
var dialog _bad _message _text = "<div>" ;
dialog _bad _message _text = dialog _bad _message _text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_error_mr.png'></div>" ;
dialog _bad _message _text = dialog _bad _message _text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>" ;
2017-03-15 13:20:05 +01:00
dialog _bad _message _text = dialog _bad _message _text + "<p style='font-family:Verdana; font-size:12pt;'>" + bad _mr _file + "</p></div>" ;
2017-03-14 15:20:12 +01:00
dialog _bad _message _text = dialog _bad _message _text + "</div>" ;
$ ( '#bad_message' ) . html ( dialog _bad _message _text ) ;
$ ( '#bad_message' ) . dialog ( 'open' ) ;
}
else {
2017-03-15 13:20:05 +01:00
$ ( "#mr_dialog2" ) . dialog ( "close" ) ;
$ ( "<div id='success_mr' class='dialog ui-dialog-content' title='" + mr _available + "'></div>" ) . dialog ( {
resizable : true ,
draggable : true ,
modal : true ,
overlay : {
opacity : 0.5 ,
background : 'black'
} ,
width : 600 ,
height : 250 ,
buttons : {
"Ok" : function ( ) {
$ ( this ) . dialog ( "close" ) ;
}
}
} ) ;
var dialog _success _mr _text = "<div>" ;
dialog _success _mr _text = dialog _success _mr _text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_exito_mr.png'></div>" ;
dialog _success _mr _text = dialog _success _mr _text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>SUCCESS</strong></h3>" ;
dialog _success _mr _text = dialog _success _mr _text + "<p style='font-family:Verdana; font-size:12pt;'>" + mr _success + "</p></div>" ;
dialog _success _mr _text = dialog _success _mr _text + "</div>" ;
$ ( '#success_mr' ) . html ( dialog _success _mr _text ) ;
$ ( '#success_mr' ) . dialog ( 'open' ) ;
2017-03-14 15:20:12 +01:00
var parameters = { } ;
parameters [ 'page' ] = 'include/ajax/update_manager.ajax' ;
parameters [ 'install_package' ] = 1 ;
parameters [ 'package' ] = package ;
parameters [ 'accept' ] = 1 ;
$ ( '#form-offline_update ul' ) . find ( 'li' ) . removeClass ( 'suc' ) ;
$ ( '#form-offline_update ul' ) . find ( 'li' ) . addClass ( 'loading' ) ;
$ . ajax ( {
type : 'POST' ,
url : home _url + 'ajax.php' ,
data : parameters ,
dataType : "json" ,
success : function ( data ) {
$ ( '#form-offline_update ul' ) . find ( 'li' ) . removeClass ( 'loading' ) ;
if ( data . status == "success" ) {
2017-03-15 13:20:05 +01:00
$ ( "<div id='success_pkg' class='dialog ui-dialog-content' title='" + package _available + "'></div>" ) . dialog ( {
2017-03-14 15:20:12 +01:00
resizable : true ,
draggable : true ,
modal : true ,
overlay : {
opacity : 0.5 ,
background : 'black'
} ,
width : 600 ,
height : 250 ,
buttons : {
"Ok" : function ( ) {
$ ( this ) . dialog ( "close" ) ;
}
2017-03-14 13:52:29 +01:00
}
2017-03-14 15:20:12 +01:00
} ) ;
2017-03-14 13:52:29 +01:00
2017-03-14 15:20:12 +01:00
var dialog _success _pkg _text = "<div>" ;
dialog _success _pkg _text = dialog _success _pkg _text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_exito_mr.png'></div>" ;
dialog _success _pkg _text = dialog _success _pkg _text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>SUCCESS</strong></h3>" ;
2017-03-16 10:46:26 +01:00
dialog _success _pkg _text = dialog _success _pkg _text + "<p style='font-family:Verdana; font-size:12pt;'>" + package _success + "</p></div>" ;
2017-03-14 15:20:12 +01:00
dialog _success _pkg _text = dialog _success _pkg _text + "</div>" ;
$ ( '#success_pkg' ) . html ( dialog _success _pkg _text ) ;
$ ( '#success_pkg' ) . dialog ( 'open' ) ;
$ ( '#form-offline_update ul' ) . find ( 'li' ) . addClass ( 'suc' ) ;
$ ( '#form-offline_update ul' ) . find ( 'li' ) . find ( 'p' ) . html ( package _updated _successfully )
. append ( "<i>" + if _there _are _any _database _change + "</i>" ) ;
}
else {
2017-03-15 13:20:05 +01:00
$ ( "<div id='error_pkg' class='dialog ui-dialog-content' title='" + package _available + "'></div>" ) . dialog ( {
2017-03-14 15:20:12 +01:00
resizable : true ,
draggable : true ,
modal : true ,
overlay : {
opacity : 0.5 ,
background : 'black'
} ,
width : 600 ,
height : 250 ,
buttons : {
"Ok" : function ( ) {
$ ( this ) . dialog ( "close" ) ;
}
}
} ) ;
2017-03-14 13:52:29 +01:00
2017-03-14 15:20:12 +01:00
var dialog _error _pkg _text = "<div>" ;
dialog _error _pkg _text = dialog _error _pkg _text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_error_mr.png'></div>" ;
dialog _error _pkg _text = dialog _error _pkg _text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>" ;
2017-03-16 10:46:26 +01:00
dialog _error _pkg _text = dialog _error _pkg _text + "<p style='font-family:Verdana; font-size:12pt;'>" + package _error + "</p></div>" ;
2017-03-14 15:20:12 +01:00
dialog _error _pkg _text = dialog _error _pkg _text + "</div>" ;
$ ( '#error_pkg' ) . html ( dialog _error _pkg _text ) ;
$ ( '#error_pkg' ) . dialog ( 'open' ) ;
$ ( '#form-offline_update ul' ) . find ( 'li' ) . addClass ( 'error' ) ;
$ ( '#form-offline_update ul' ) . find ( 'li' ) . find ( 'p' ) . html ( package _not _updated )
. append ( "<i>" + data . message + "</i>" ) ;
}
$ ( '#form-offline_update ul' ) . find ( 'li' ) . css ( "cursor" , "pointer" ) ;
$ ( '#form-offline_update ul' ) . find ( 'li' ) . click ( function ( ) {
window . location . reload ( ) ;
} ) ;
2017-03-13 16:30:04 +01:00
}
2017-03-14 15:20:12 +01:00
} ) ;
// Check the status of the update
check _install _package ( package , homeurl ) ;
}
2017-03-13 16:30:04 +01:00
}
else {
2017-03-15 13:20:05 +01:00
$ ( "#mr_dialog2" ) . dialog ( "close" ) ;
$ ( "<div id='error_mr' class='dialog ui-dialog-content' title='" + mr _available + "'></div>" ) . dialog ( {
resizable : true ,
draggable : true ,
modal : true ,
overlay : {
opacity : 0.5 ,
background : 'black'
} ,
width : 600 ,
height : 250 ,
buttons : {
"Ok" : function ( ) {
$ ( this ) . dialog ( "close" ) ;
}
}
} ) ;
var dialog _error _mr _text = "<div>" ;
dialog _error _mr _text = dialog _error _mr _text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_error_mr.png'></div>" ;
dialog _error _mr _text = dialog _error _mr _text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>" ;
dialog _error _mr _text = dialog _error _mr _text + "<p style='font-family:Verdana; font-size:12pt;'>" + mr _error + "</p></div>" ;
dialog _error _mr _text = dialog _error _mr _text + "</div>" ;
$ ( '#error_mr' ) . html ( dialog _error _mr _text ) ;
$ ( '#error_mr' ) . dialog ( 'open' ) ;
2017-03-13 16:30:04 +01:00
$ ( '#form-offline_update ul' ) . find ( 'li' ) . addClass ( 'error' ) ;
$ ( '#form-offline_update ul' ) . find ( 'li' ) . find ( 'p' ) . html ( error _in _mr )
. append ( "<i>" + data . message + "</i>" ) ;
}
} ,
"Cancel" : function ( ) {
$ ( "#mr_dialog2" ) . dialog ( "close" ) ;
2017-03-14 10:36:10 +01:00
2017-03-15 13:20:05 +01:00
$ ( "<div id='cancel_mr' class='dialog ui-dialog-content' title='" + mr _available + "'></div>" ) . dialog ( {
2017-03-14 10:36:10 +01:00
resizable : true ,
2017-03-15 13:20:05 +01:00
draggable : true ,
modal : true ,
overlay : {
opacity : 0.5 ,
background : 'black'
} ,
width : 600 ,
height : 220 ,
buttons : {
"Ok" : function ( ) {
$ ( this ) . dialog ( "close" ) ;
}
}
2017-03-14 10:36:10 +01:00
} ) ;
var dialog _cancel _mr _text = "<div>" ;
dialog _cancel _mr _text = dialog _cancel _mr _text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_info_mr.png'></div>" ;
dialog _cancel _mr _text = dialog _cancel _mr _text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>INFO</strong></h3>" ;
2017-03-15 13:20:05 +01:00
dialog _cancel _mr _text = dialog _cancel _mr _text + "<p style='font-family:Verdana; font-size:12pt;'>" + mr _cancel + "</p></div>" ;
2017-03-14 10:36:10 +01:00
dialog _cancel _mr _text = dialog _cancel _mr _text + "</div>" ;
$ ( '#cancel_mr' ) . html ( dialog _cancel _mr _text ) ;
$ ( '#cancel_mr' ) . dialog ( 'open' ) ;
$ ( "#box_online .loading" ) . hide ( ) ;
$ ( "#box_online .downloading_package" ) . hide ( ) ;
$ ( "#box_online .content" ) . html ( "MR not accepted" ) ;
2017-03-13 16:30:04 +01:00
$ ( '#form-offline_update ul' ) . find ( 'li' ) . addClass ( 'error' ) ;
$ ( '#form-offline_update ul' ) . find ( 'li' ) . find ( 'p' ) . html ( error _in _mr _accept )
. append ( "<i>" + data . message + "</i>" ) ;
}
}
} ) ;
2017-03-14 10:36:10 +01:00
$ ( 'button:contains(Apply MR)' ) . attr ( "id" , "apply_rr_button" ) ;
2017-03-13 16:30:04 +01:00
$ ( 'button:contains(Cancel)' ) . attr ( "id" , "cancel_rr_button" ) ;
2017-03-15 13:20:05 +01:00
var dialog _have _mr _text = "<div>" ;
dialog _have _mr _text = dialog _have _mr _text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_warning_mr.png'></div>" ;
dialog _have _mr _text = dialog _have _mr _text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>There are a DB changes</strong></h3>" ;
dialog _have _mr _text = dialog _have _mr _text + "<p style='font-family:Verdana; font-size:12pt;'>" + text1 _mr _file + "</p>" ;
dialog _have _mr _text = dialog _have _mr _text + "<p style='font-family:Verdana; font-size:12pt;'>" + text2 _mr _file + "<a style='font-family:Verdana bold; font-size:12pt; color:#82B92E'href=\"index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list\">" + text3 _mr _file + "</a>" + text4 _mr _file + "</p></div>" ;
dialog _have _mr _text = dialog _have _mr _text + "</div>" ;
2017-03-14 10:36:10 +01:00
$ ( '#mr_dialog2' ) . html ( dialog _have _mr _mr _text ) ;
2017-03-13 16:30:04 +01:00
$ ( '#mr_dialog2' ) . dialog ( 'open' ) ;
}
else {
$ ( "#pkg_apply_dialog" ) . dialog ( "close" ) ;
var parameters = { } ;
parameters [ 'page' ] = 'include/ajax/update_manager.ajax' ;
parameters [ 'install_package' ] = 1 ;
parameters [ 'package' ] = package ;
parameters [ 'accept' ] = 1 ;
$ ( '#form-offline_update ul' ) . find ( 'li' ) . removeClass ( 'suc' ) ;
$ ( '#form-offline_update ul' ) . find ( 'li' ) . addClass ( 'loading' ) ;
$ . ajax ( {
type : 'POST' ,
url : home _url + 'ajax.php' ,
data : parameters ,
dataType : "json" ,
success : function ( data ) {
$ ( '#form-offline_update ul' ) . find ( 'li' ) . removeClass ( 'loading' ) ;
if ( data . status == "success" ) {
2017-03-15 13:20:05 +01:00
$ ( "<div id='success_pkg' class='dialog ui-dialog-content' title='" + package _available + "'></div>" ) . dialog ( {
2017-03-14 13:52:29 +01:00
resizable : true ,
draggable : true ,
modal : true ,
overlay : {
opacity : 0.5 ,
background : 'black'
} ,
width : 600 ,
height : 250 ,
buttons : {
"Ok" : function ( ) {
$ ( this ) . dialog ( "close" ) ;
}
}
} ) ;
var dialog _success _pkg _text = "<div>" ;
dialog _success _pkg _text = dialog _success _pkg _text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_exito_mr.png'></div>" ;
dialog _success _pkg _text = dialog _success _pkg _text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>SUCCESS</strong></h3>" ;
2017-03-16 10:46:26 +01:00
dialog _success _pkg _text = dialog _success _pkg _text + "<p style='font-family:Verdana; font-size:12pt;'>" + package _success + "</p></div>" ;
2017-03-14 13:52:29 +01:00
dialog _success _pkg _text = dialog _success _pkg _text + "</div>" ;
$ ( '#success_pkg' ) . html ( dialog _success _pkg _text ) ;
$ ( '#success_pkg' ) . dialog ( 'open' ) ;
2017-03-13 16:30:04 +01:00
$ ( '#form-offline_update ul' ) . find ( 'li' ) . addClass ( 'suc' ) ;
$ ( '#form-offline_update ul' ) . find ( 'li' ) . find ( 'p' ) . html ( package _updated _successfully )
. append ( "<i>" + if _there _are _any _database _change + "</i>" ) ;
}
else {
2017-03-15 13:20:05 +01:00
$ ( "<div id='error_pkg' class='dialog ui-dialog-content' title='" + package _available + "'></div>" ) . dialog ( {
2017-03-14 13:52:29 +01:00
resizable : true ,
draggable : true ,
modal : true ,
overlay : {
opacity : 0.5 ,
background : 'black'
} ,
width : 600 ,
height : 250 ,
buttons : {
"Ok" : function ( ) {
$ ( this ) . dialog ( "close" ) ;
}
}
} ) ;
var dialog _error _pkg _text = "<div>" ;
dialog _error _pkg _text = dialog _error _pkg _text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_error_mr.png'></div>" ;
dialog _error _pkg _text = dialog _error _pkg _text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>" ;
2017-03-16 10:46:26 +01:00
dialog _error _pkg _text = dialog _error _pkg _text + "<p style='font-family:Verdana; font-size:12pt;'>" + package _error + "</p></div>" ;
2017-03-14 13:52:29 +01:00
dialog _error _pkg _text = dialog _error _pkg _text + "</div>" ;
$ ( '#error_pkg' ) . html ( dialog _error _pkg _text ) ;
$ ( '#error_pkg' ) . dialog ( 'open' ) ;
2017-03-13 16:30:04 +01:00
$ ( '#form-offline_update ul' ) . find ( 'li' ) . addClass ( 'error' ) ;
$ ( '#form-offline_update ul' ) . find ( 'li' ) . find ( 'p' ) . html ( package _not _updated )
. append ( "<i>" + data . message + "</i>" ) ;
}
$ ( '#form-offline_update ul' ) . find ( 'li' ) . css ( "cursor" , "pointer" ) ;
$ ( '#form-offline_update ul' ) . find ( 'li' ) . click ( function ( ) {
window . location . reload ( ) ;
} ) ;
}
} ) ;
// Check the status of the update
check _install _package ( package , homeurl ) ;
}
}
} ) ;
} ,
"Cancel" : function ( ) {
$ ( this ) . dialog ( "close" ) ;
2017-03-15 13:20:05 +01:00
$ ( "<div id='cancel_pkg' class='dialog ui-dialog-content' title='" + package _available + "'></div>" ) . dialog ( {
2017-03-14 10:36:10 +01:00
resizable : true ,
2017-03-15 13:20:05 +01:00
draggable : true ,
modal : true ,
overlay : {
opacity : 0.5 ,
background : 'black'
} ,
width : 600 ,
height : 220 ,
buttons : {
"Ok" : function ( ) {
$ ( this ) . dialog ( "close" ) ;
}
}
2017-03-14 10:36:10 +01:00
} ) ;
var dialog _cancel _pkg _text = "<div>" ;
dialog _cancel _pkg _text = dialog _cancel _pkg _text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_info_mr.png'></div>" ;
dialog _cancel _pkg _text = dialog _cancel _pkg _text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>INFO</strong></h3>" ;
2017-03-15 13:20:05 +01:00
dialog _cancel _pkg _text = dialog _cancel _pkg _text + "<p style='font-family:Verdana; font-size:12pt;'>" + package _cancel + "</p></div>" ;
2017-03-14 10:36:10 +01:00
dialog _cancel _pkg _text = dialog _cancel _pkg _text + "</div>" ;
2017-03-13 16:30:04 +01:00
var parameters = { } ;
parameters [ 'page' ] = 'include/ajax/update_manager.ajax' ;
parameters [ 'install_package' ] = 1 ;
parameters [ 'package' ] = package ;
parameters [ 'accept' ] = 0 ;
$ ( '#form-offline_update ul' ) . find ( 'li' ) . removeClass ( 'suc' ) ;
$ ( '#form-offline_update ul' ) . find ( 'li' ) . addClass ( 'loading' ) ;
$ . ajax ( {
type : 'POST' ,
url : home _url + 'ajax.php' ,
data : parameters ,
dataType : "json" ,
success : function ( data ) {
$ ( '#form-offline_update ul' ) . find ( 'li' ) . removeClass ( 'loading' ) ;
if ( data . status == "success" ) {
$ ( '#form-offline_update ul' ) . find ( 'li' ) . addClass ( 'suc' ) ;
$ ( '#form-offline_update ul' ) . find ( 'li' ) . find ( 'p' ) . html ( package _updated _successfully )
. append ( "<i>" + if _there _are _any _database _change + "</i>" ) ;
}
else {
$ ( '#form-offline_update ul' ) . find ( 'li' ) . addClass ( 'error' ) ;
$ ( '#form-offline_update ul' ) . find ( 'li' ) . find ( 'p' ) . html ( package _not _updated )
. append ( "<i>" + data . message + "</i>" ) ;
}
$ ( '#form-offline_update ul' ) . find ( 'li' ) . css ( "cursor" , "pointer" ) ;
$ ( '#form-offline_update ul' ) . find ( 'li' ) . click ( function ( ) {
window . location . reload ( ) ;
} ) ;
}
} ) ;
// Check the status of the update
check _install _package ( package , homeurl ) ;
2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
}
}
} ) ;
2017-03-13 16:30:04 +01:00
2017-03-14 10:36:10 +01:00
var dialog _text = "<div>" ;
dialog _text = dialog _text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_info_mr.png'></div>" ;
2017-03-15 13:20:05 +01:00
dialog _text = dialog _text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>" + text1 _package _file + "</strong></h3>" ;
dialog _text = dialog _text + "<p style='font-family:Verdana; font-size:12pt;'>" + text2 _package _file + "</p></div>" ;
2017-03-14 10:36:10 +01:00
dialog _text = dialog _text + "</div>" ;
2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
2017-03-13 16:30:04 +01:00
$ ( '#pkg_apply_dialog' ) . html ( dialog _text ) ;
$ ( '#pkg_apply_dialog' ) . dialog ( 'open' ) ;
2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
}
2015-06-30 12:59:23 +02:00
function check _install _package ( package , homeurl ) {
2015-10-15 16:21:52 +02:00
var home _url = ( typeof homeurl !== 'undefined' ) ? homeurl += '/' : '' ;
2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
var parameters = { } ;
parameters [ 'page' ] = 'include/ajax/update_manager.ajax' ;
2014-06-09 18:11:58 +02:00
parameters [ 'check_install_package' ] = 1 ;
2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
parameters [ 'package' ] = package ;
$ . ajax ( {
type : 'POST' ,
2015-10-15 16:21:52 +02:00
url : home _url + 'ajax.php' ,
2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
data : parameters ,
dataType : "json" ,
success : function ( data ) {
// Print the updated files and take the scroll to the bottom
$ ( "#log_zone" ) . html ( data . info ) ;
$ ( "#log_zone" ) . scrollTop ( $ ( "#log_zone" ) . prop ( "scrollHeight" ) ) ;
// Change the progress bar
if ( $ ( '#form-offline_update ul' ) . find ( 'li' ) . hasClass ( 'suc' ) ) {
$ ( '#form-offline_update' ) . find ( 'ul' ) . find ( 'li' ) . find ( 'input' ) . val ( 100 ) . trigger ( 'change' ) ;
} else {
$ ( '#form-offline_update' ) . find ( 'ul' ) . find ( 'li' ) . find ( 'input' ) . val ( data [ 'progress' ] ) . trigger ( 'change' ) ;
}
// The class loading is present until the update ends
var isInstalling = $ ( '#form-offline_update ul' ) . find ( 'li' ) . hasClass ( 'loading' ) ;
if ( data . progress < 100 && isInstalling ) {
// Recursive call to check the update status
2015-06-30 12:59:23 +02:00
check _install _package ( package , homeurl ) ;
2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
}
}
} )
2014-06-10 14:57:17 +02:00
}
2015-06-30 12:59:23 +02:00
function check _online _free _packages ( homeurl ) {
2015-10-15 16:21:52 +02:00
var home _url = ( typeof homeurl !== 'undefined' ) ? homeurl + '/' : '' ;
2015-06-30 12:59:23 +02:00
2014-06-10 14:57:17 +02:00
$ ( "#box_online .checking_package" ) . show ( ) ;
var parameters = { } ;
parameters [ 'page' ] = 'include/ajax/update_manager.ajax' ;
parameters [ 'check_online_free_packages' ] = 1 ;
jQuery . post (
2015-10-15 16:21:52 +02:00
home _url + "ajax.php" ,
2014-06-10 14:57:17 +02:00
parameters ,
function ( data ) {
$ ( "#box_online .checking_package" ) . hide ( ) ;
$ ( "#box_online .loading" ) . hide ( ) ;
$ ( "#box_online .content" ) . html ( data ) ;
} ,
"html"
) ;
}
2015-06-30 12:59:23 +02:00
function update _last _package ( package , version , homeurl ) {
2015-10-15 16:21:52 +02:00
var home _url = ( typeof homeurl !== 'undefined' ) ? homeurl + '/' : '' ;
2015-06-30 12:59:23 +02:00
2014-06-10 14:57:17 +02:00
version _update = version ;
$ ( "#box_online .content" ) . html ( "" ) ;
$ ( "#box_online .loading" ) . show ( ) ;
$ ( "#box_online .download_package" ) . show ( ) ;
2017-03-16 18:07:19 +01:00
var parameters = { } ;
parameters [ 'page' ] = 'include/ajax/update_manager.ajax' ;
parameters [ 'update_last_free_package' ] = 1 ;
parameters [ 'package' ] = package ;
parameters [ 'version' ] = version ;
parameters [ 'accept' ] = 0 ;
jQuery . post (
home _url + "ajax.php" ,
parameters ,
function ( data ) {
if ( data [ 'in_progress' ] ) {
$ ( "#box_online .loading" ) . hide ( ) ;
$ ( "#box_online .download_package" ) . hide ( ) ;
$ ( "#box_online .content" ) . html ( data [ 'message' ] ) ;
var parameters2 = { } ;
parameters2 [ 'page' ] = 'include/ajax/update_manager.ajax' ;
parameters2 [ 'unzip_free_package' ] = 1 ;
parameters2 [ 'package' ] = package ;
parameters2 [ 'version' ] = version ;
jQuery . post (
home _url + "ajax.php" ,
parameters2 ,
function ( data ) {
if ( data [ 'correct' ] ) {
$ ( "#box_online .loading" ) . hide ( ) ;
$ ( "#box_online .download_package" ) . hide ( ) ;
$ ( "#box_online .content" ) . html ( data [ 'message' ] ) ;
install _free _package _prev _step ( package , version , homeurl ) ;
}
else {
$ ( "#box_online .content" ) . html ( data [ 'message' ] ) ;
}
} ,
"json"
) ;
}
else {
$ ( "#box_online .content" ) . html ( data [ 'message' ] ) ;
}
} ,
"json"
) ;
}
function check _progress _update ( homeurl ) {
var home _url = ( typeof homeurl !== 'undefined' ) ? homeurl + '/' : '' ;
if ( stop _check _progress ) {
return ;
}
var parameters = { } ;
parameters [ 'page' ] = 'include/ajax/update_manager.ajax' ;
parameters [ 'check_update_free_package' ] = 1 ;
jQuery . post (
home _url + "ajax.php" ,
parameters ,
function ( data ) {
if ( stop _check _progress ) {
return ;
}
if ( data [ 'correct' ] ) {
if ( data [ 'end' ] ) {
//$("#box_online .content").html(data['message']);
}
else {
$ ( "#box_online .progressbar" ) . show ( ) ;
$ ( "#box_online .progressbar .progressbar_img" ) . attr ( 'src' ,
data [ 'progressbar' ] ) ;
setTimeout ( function ( ) {
check _progress _update ( homeurl ) ;
} , 1000 ) ;
}
}
else {
correct _install _progress = false ;
$ ( "#box_online .content" ) . html ( data [ 'message' ] ) ;
}
} ,
"json"
) ;
}
function install _free _package _prev _step ( package , version , homeurl ) {
2017-03-15 13:20:05 +01:00
$ ( "<div id='pkg_apply_dialog' class='dialog ui-dialog-content' title='" + package _available + "'></div>" ) . dialog ( {
2017-03-10 14:01:24 +01:00
resizable : true ,
draggable : true ,
modal : true ,
overlay : {
opacity : 0.5 ,
background : 'black'
} ,
width : 600 ,
2017-03-14 10:36:10 +01:00
height : 250 ,
2017-03-10 14:01:24 +01:00
buttons : {
2017-03-14 10:36:10 +01:00
"OK" : function ( ) {
2017-03-10 14:01:24 +01:00
$ ( this ) . dialog ( "close" ) ;
var parameters = { } ;
parameters [ 'page' ] = 'include/ajax/update_manager.ajax' ;
2017-03-13 15:52:30 +01:00
parameters [ 'search_minor' ] = 1 ;
2017-03-16 18:23:07 +01:00
parameters [ 'ent' ] = 0 ;
parameters [ 'package' ] = package ;
2017-03-16 19:14:19 +01:00
parameters [ 'offline' ] = 0 ;
2014-06-10 14:57:17 +02:00
2017-03-10 14:01:24 +01:00
jQuery . post (
home _url + "ajax.php" ,
parameters ,
function ( data ) {
2017-03-13 15:52:30 +01:00
$ ( "#box_online .loading" ) . hide ( ) ;
$ ( "#box_online .downloading_package" ) . hide ( ) ;
if ( data [ 'have_minor' ] ) {
2017-03-15 13:20:05 +01:00
$ ( "<div id='mr_dialog2' class='dialog ui-dialog-content' title='" + mr _available + "'></div>" ) . dialog ( {
2017-03-13 15:52:30 +01:00
resizable : true ,
draggable : true ,
modal : true ,
overlay : {
opacity : 0.5 ,
background : 'black'
} ,
width : 600 ,
2017-03-14 10:36:10 +01:00
height : 270 ,
2017-03-13 15:52:30 +01:00
buttons : {
2017-03-14 10:36:10 +01:00
"Apply MR" : function ( ) {
2017-03-14 15:20:12 +01:00
var err = [ ] ;
2017-03-16 19:14:19 +01:00
err = apply _minor _release ( data [ 'mr' ] , package , 0 , 0 ) ;
2017-03-13 15:52:30 +01:00
2017-03-14 15:20:12 +01:00
if ( ! err [ 'error' ] ) {
2017-03-15 13:20:05 +01:00
if ( err [ 'message' ] == 'bad_mr_filename' ) {
2017-03-14 15:20:12 +01:00
$ ( "#mr_dialog2" ) . dialog ( "close" ) ;
2017-03-15 13:20:05 +01:00
$ ( "<div id='bad_message' class='dialog ui-dialog-content' title='" + mr _available + "'></div>" ) . dialog ( {
2017-03-14 15:20:12 +01:00
resizable : true ,
draggable : true ,
modal : true ,
overlay : {
opacity : 0.5 ,
background : 'black'
} ,
width : 600 ,
height : 270 ,
buttons : {
"Apply" : function ( ) {
$ ( this ) . dialog ( "close" ) ;
2017-03-15 13:53:25 +01:00
$ ( "<div id='accept_package_mr_fail' class='dialog ui-dialog-content' title='" + mr _available + "'></div>" ) . dialog ( {
resizable : true ,
draggable : true ,
modal : true ,
overlay : {
opacity : 0.5 ,
background : 'black'
} ,
width : 600 ,
height : 250 ,
buttons : {
"Ok" : function ( ) {
$ ( this ) . dialog ( "close" ) ;
}
}
} ) ;
var dialog _accept _package _mr _fail _text = "<div>" ;
dialog _accept _package _mr _fail _text = dialog _accept _package _mr _fail _text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_info_mr.png'></div>" ;
dialog _accept _package _mr _fail _text = dialog _accept _package _mr _fail _text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>INFO</strong></h3>" ;
dialog _accept _package _mr _fail _text = dialog _accept _package _mr _fail _text + "<p style='font-family:Verdana; font-size:12pt;'>" + mr _not _accepted _code _yes + "</p></div>" ;
dialog _accept _package _mr _fail _text = dialog _accept _package _mr _fail _text + "</div>" ;
$ ( '#accept_package_mr_fail' ) . html ( dialog _accept _package _mr _fail _text ) ;
$ ( '#accept_package_mr_fail' ) . dialog ( 'open' ) ;
2017-03-14 15:20:12 +01:00
var parameters2 = { } ;
parameters2 [ 'page' ] = 'include/ajax/update_manager.ajax' ;
parameters2 [ 'update_last_free_package' ] = 1 ;
parameters2 [ 'package' ] = package ;
parameters2 [ 'version' ] = version ;
parameters2 [ 'accept' ] = 1 ;
jQuery . post (
home _url + "ajax.php" ,
parameters2 ,
function ( data ) {
if ( data [ 'in_progress' ] ) {
$ ( "#box_online .loading" ) . hide ( ) ;
$ ( "#box_online .download_package" ) . hide ( ) ;
$ ( "#box_online .content" ) . html ( data [ 'message' ] ) ;
install _free _package ( package , version , homeurl ) ;
setTimeout ( function ( ) {
check _progress _update ( homeurl ) ;
} , 1000 ) ;
}
else {
$ ( "#box_online .content" ) . html ( data [ 'message' ] ) ;
}
} ,
"json"
) ;
} ,
"Cancel" : function ( ) {
$ ( this ) . dialog ( "close" ) ;
2017-03-15 13:53:25 +01:00
$ ( this ) . dialog ( "close" ) ;
$ ( "<div id='cancel_pkg' class='dialog ui-dialog-content' title='" + package _available + "'></div>" ) . dialog ( {
resizable : true ,
draggable : true ,
modal : true ,
overlay : {
opacity : 0.5 ,
background : 'black'
} ,
width : 600 ,
height : 220 ,
buttons : {
"Ok" : function ( ) {
$ ( this ) . dialog ( "close" ) ;
}
}
} ) ;
var dialog _cancel _pkg _text = "<div>" ;
dialog _cancel _pkg _text = dialog _cancel _pkg _text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_info_mr.png'></div>" ;
dialog _cancel _pkg _text = dialog _cancel _pkg _text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>INFO</strong></h3>" ;
dialog _cancel _pkg _text = dialog _cancel _pkg _text + "<p style='font-family:Verdana; font-size:12pt;'>" + package _cancel + "</p></div>" ;
dialog _cancel _pkg _text = dialog _cancel _pkg _text + "</div>" ;
$ ( '#cancel_pkg' ) . html ( dialog _cancel _pkg _text ) ;
$ ( '#cancel_pkg' ) . dialog ( 'open' ) ;
2017-03-15 13:20:05 +01:00
$ ( "#box_online .content" ) . html ( package _not _accepted ) ;
2017-03-14 15:20:12 +01:00
}
2017-03-13 15:52:30 +01:00
}
2017-03-14 15:20:12 +01:00
} ) ;
var dialog _bad _message _text = "<div>" ;
dialog _bad _message _text = dialog _bad _message _text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_error_mr.png'></div>" ;
dialog _bad _message _text = dialog _bad _message _text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>" ;
2017-03-15 13:20:05 +01:00
dialog _bad _message _text = dialog _bad _message _text + "<p style='font-family:Verdana; font-size:12pt;'>" + bad _mr _file + "</p></div>" ;
2017-03-14 15:20:12 +01:00
dialog _bad _message _text = dialog _bad _message _text + "</div>" ;
$ ( '#bad_message' ) . html ( dialog _bad _message _text ) ;
$ ( '#bad_message' ) . dialog ( 'open' ) ;
}
else {
2017-03-15 13:20:05 +01:00
$ ( "#mr_dialog2" ) . dialog ( "close" ) ;
$ ( "<div id='success_mr' class='dialog ui-dialog-content' title='" + mr _available + "'></div>" ) . dialog ( {
resizable : true ,
draggable : true ,
modal : true ,
overlay : {
opacity : 0.5 ,
background : 'black'
} ,
width : 600 ,
height : 250 ,
buttons : {
"Ok" : function ( ) {
$ ( this ) . dialog ( "close" ) ;
}
}
} ) ;
var dialog _success _mr _text = "<div>" ;
dialog _success _mr _text = dialog _success _mr _text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_exito_mr.png'></div>" ;
dialog _success _mr _text = dialog _success _mr _text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>SUCCESS</strong></h3>" ;
dialog _success _mr _text = dialog _success _mr _text + "<p style='font-family:Verdana; font-size:12pt;'>" + mr _success + "</p></div>" ;
dialog _success _mr _text = dialog _success _mr _text + "</div>" ;
$ ( '#success_mr' ) . html ( dialog _success _mr _text ) ;
$ ( '#success_mr' ) . dialog ( 'open' ) ;
2017-03-14 15:20:12 +01:00
var parameters2 = { } ;
parameters2 [ 'page' ] = 'include/ajax/update_manager.ajax' ;
parameters2 [ 'update_last_free_package' ] = 1 ;
parameters2 [ 'package' ] = package ;
parameters2 [ 'version' ] = version ;
parameters2 [ 'accept' ] = 1 ;
jQuery . post (
home _url + "ajax.php" ,
parameters2 ,
function ( data ) {
if ( data [ 'in_progress' ] ) {
$ ( "#box_online .loading" ) . hide ( ) ;
$ ( "#box_online .download_package" ) . hide ( ) ;
$ ( "#box_online .content" ) . html ( data [ 'message' ] ) ;
install _free _package ( package , version , homeurl ) ;
setTimeout ( function ( ) {
check _progress _update ( homeurl ) ;
} , 1000 ) ;
}
else {
$ ( "#box_online .content" ) . html ( data [ 'message' ] ) ;
}
} ,
"json"
) ;
}
2017-03-13 15:52:30 +01:00
}
else {
2017-03-15 13:20:05 +01:00
$ ( "#mr_dialog2" ) . dialog ( "close" ) ;
$ ( "<div id='error_mr' class='dialog ui-dialog-content' title='" + mr _available + "'></div>" ) . dialog ( {
resizable : true ,
draggable : true ,
modal : true ,
overlay : {
opacity : 0.5 ,
background : 'black'
} ,
width : 600 ,
height : 250 ,
buttons : {
"Ok" : function ( ) {
$ ( this ) . dialog ( "close" ) ;
}
}
} ) ;
var dialog _error _mr _text = "<div>" ;
dialog _error _mr _text = dialog _error _mr _text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_error_mr.png'></div>" ;
dialog _error _mr _text = dialog _error _mr _text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>" ;
dialog _error _mr _text = dialog _error _mr _text + "<p style='font-family:Verdana; font-size:12pt;'>" + mr _error + "</p></div>" ;
dialog _error _mr _text = dialog _error _mr _text + "</div>" ;
$ ( '#error_mr' ) . html ( dialog _error _mr _text ) ;
$ ( '#error_mr' ) . dialog ( 'open' ) ;
$ ( "#box_online .content" ) . html ( mr _error ) ;
2017-03-13 15:52:30 +01:00
}
} ,
"Cancel" : function ( ) {
$ ( this ) . dialog ( "close" ) ;
2017-03-14 10:36:10 +01:00
2017-03-15 13:20:05 +01:00
$ ( "<div id='cancel_mr' class='dialog ui-dialog-content' title='" + mr _available + "'></div>" ) . dialog ( {
2017-03-14 10:36:10 +01:00
resizable : true ,
2017-03-15 13:20:05 +01:00
draggable : true ,
modal : true ,
overlay : {
opacity : 0.5 ,
background : 'black'
} ,
width : 600 ,
height : 220 ,
buttons : {
"Ok" : function ( ) {
$ ( this ) . dialog ( "close" ) ;
}
}
2017-03-14 10:36:10 +01:00
} ) ;
var dialog _cancel _mr _text = "<div>" ;
dialog _cancel _mr _text = dialog _cancel _mr _text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_info_mr.png'></div>" ;
dialog _cancel _mr _text = dialog _cancel _mr _text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>INFO</strong></h3>" ;
2017-03-15 13:20:05 +01:00
dialog _cancel _mr _text = dialog _cancel _mr _text + "<p style='font-family:Verdana; font-size:12pt;'>" + mr _cancel + "</p></div>" ;
2017-03-14 10:36:10 +01:00
dialog _cancel _mr _text = dialog _cancel _mr _text + "</div>" ;
$ ( '#cancel_mr' ) . html ( dialog _cancel _mr _text ) ;
$ ( '#cancel_mr' ) . dialog ( 'open' ) ;
2017-03-13 15:52:30 +01:00
$ ( "#box_online .loading" ) . hide ( ) ;
$ ( "#box_online .downloading_package" ) . hide ( ) ;
$ ( "#box_online .content" ) . html ( "MR not accepted" ) ;
}
}
} ) ;
2017-03-14 10:36:10 +01:00
$ ( 'button:contains(Apply MR)' ) . attr ( "id" , "apply_rr_button" ) ;
2017-03-13 15:52:30 +01:00
$ ( 'button:contains(Cancel)' ) . attr ( "id" , "cancel_rr_button" ) ;
2017-03-10 14:01:24 +01:00
2017-03-15 13:20:05 +01:00
var dialog _have _mr _text = "<div>" ;
dialog _have _mr _text = dialog _have _mr _text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_warning_mr.png'></div>" ;
dialog _have _mr _text = dialog _have _mr _text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>There are a DB changes</strong></h3>" ;
dialog _have _mr _text = dialog _have _mr _text + "<p style='font-family:Verdana; font-size:12pt;'>" + text1 _mr _file + "</p>" ;
dialog _have _mr _text = dialog _have _mr _text + "<p style='font-family:Verdana; font-size:12pt;'>" + text2 _mr _file + "<a style='font-family:Verdana bold; font-size:12pt; color:#82B92E'href=\"index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list\">" + text3 _mr _file + "</a>" + text4 _mr _file + "</p></div>" ;
dialog _have _mr _text = dialog _have _mr _text + "</div>" ;
2017-03-14 10:36:10 +01:00
$ ( '#mr_dialog2' ) . html ( dialog _have _mr _mr _text ) ;
2017-03-13 15:52:30 +01:00
$ ( '#mr_dialog2' ) . dialog ( 'open' ) ;
2017-03-10 14:01:24 +01:00
}
else {
2017-03-13 15:52:30 +01:00
var parameters2 = { } ;
parameters2 [ 'page' ] = 'include/ajax/update_manager.ajax' ;
parameters2 [ 'update_last_free_package' ] = 1 ;
parameters2 [ 'package' ] = package ;
parameters2 [ 'version' ] = version ;
parameters2 [ 'accept' ] = 1 ;
jQuery . post (
home _url + "ajax.php" ,
parameters2 ,
function ( data ) {
if ( data [ 'in_progress' ] ) {
$ ( "#box_online .loading" ) . hide ( ) ;
$ ( "#box_online .download_package" ) . hide ( ) ;
$ ( "#box_online .content" ) . html ( data [ 'message' ] ) ;
install _free _package ( package , version , homeurl ) ;
setTimeout ( function ( ) {
check _progress _update ( homeurl ) ;
} , 1000 ) ;
}
else {
$ ( "#box_online .content" ) . html ( data [ 'message' ] ) ;
}
} ,
"json"
) ;
2017-03-10 14:01:24 +01:00
}
2017-03-13 15:52:30 +01:00
}
2017-03-10 14:01:24 +01:00
) ;
} ,
"Cancel" : function ( ) {
$ ( this ) . dialog ( "close" ) ;
2017-03-15 13:20:05 +01:00
$ ( "<div id='cancel_pkg' class='dialog ui-dialog-content' title='" + package _available + "'></div>" ) . dialog ( {
2017-03-14 10:36:10 +01:00
resizable : true ,
2017-03-15 13:20:05 +01:00
draggable : true ,
modal : true ,
overlay : {
opacity : 0.5 ,
background : 'black'
} ,
width : 600 ,
height : 220 ,
buttons : {
"Ok" : function ( ) {
$ ( this ) . dialog ( "close" ) ;
}
}
2017-03-14 10:36:10 +01:00
} ) ;
var dialog _cancel _pkg _text = "<div>" ;
dialog _cancel _pkg _text = dialog _cancel _pkg _text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_info_mr.png'></div>" ;
dialog _cancel _pkg _text = dialog _cancel _pkg _text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>INFO</strong></h3>" ;
2017-03-15 13:20:05 +01:00
dialog _cancel _pkg _text = dialog _cancel _pkg _text + "<p style='font-family:Verdana; font-size:12pt;'>" + package _cancel + "</p></div>" ;
2017-03-14 10:36:10 +01:00
dialog _cancel _pkg _text = dialog _cancel _pkg _text + "</div>" ;
$ ( '#cancel_pkg' ) . html ( dialog _cancel _pkg _text ) ;
$ ( '#cancel_pkg' ) . dialog ( 'open' ) ;
2017-03-10 14:01:24 +01:00
var parameters = { } ;
parameters [ 'page' ] = 'include/ajax/update_manager.ajax' ;
parameters [ 'update_last_free_package' ] = 1 ;
parameters [ 'package' ] = package ;
parameters [ 'version' ] = version ;
parameters [ 'accept' ] = 0 ;
2014-06-10 14:57:17 +02:00
2017-03-10 14:01:24 +01:00
jQuery . post (
home _url + "ajax.php" ,
parameters ,
function ( data ) {
if ( data [ 'in_progress' ] ) {
$ ( "#box_online .loading" ) . hide ( ) ;
$ ( "#box_online .download_package" ) . hide ( ) ;
$ ( "#box_online .content" ) . html ( data [ 'message' ] ) ;
install _free _package ( package , version , homeurl ) ;
setTimeout ( function ( ) {
check _progress _update ( homeurl ) ;
} , 1000 ) ;
}
else {
$ ( "#box_online .content" ) . html ( data [ 'message' ] ) ;
}
} ,
"json"
) ;
2014-06-10 14:57:17 +02:00
}
2017-03-10 14:01:24 +01:00
}
} ) ;
2017-03-14 10:36:10 +01:00
var dialog _text = "<div>" ;
dialog _text = dialog _text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_info_mr.png'></div>" ;
2017-03-15 13:20:05 +01:00
dialog _text = dialog _text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>" + text1 _package _file + "</strong></h3>" ;
dialog _text = dialog _text + "<p style='font-family:Verdana; font-size:12pt;'>" + text2 _package _file + "</p></div>" ;
2017-03-14 10:36:10 +01:00
dialog _text = dialog _text + "</div>" ;
2017-03-10 14:01:24 +01:00
$ ( '#pkg_apply_dialog' ) . html ( dialog _text ) ;
$ ( '#pkg_apply_dialog' ) . dialog ( 'open' ) ;
2014-06-10 14:57:17 +02:00
}
2015-06-30 12:59:23 +02:00
function install _free _package ( package , version , homeurl ) {
2015-10-15 16:21:52 +02:00
var home _url = ( typeof homeurl !== 'undefined' ) ? homeurl + '/' : '' ;
2015-06-30 12:59:23 +02:00
2014-06-10 14:57:17 +02:00
var parameters = { } ;
parameters [ 'page' ] = 'include/ajax/update_manager.ajax' ;
parameters [ 'install_free_package' ] = 1 ;
parameters [ 'package' ] = package ;
parameters [ 'version' ] = version ;
2014-06-26 17:00:43 +02:00
jQuery . ajax ( {
data : parameters ,
type : 'POST' ,
2015-10-15 16:21:52 +02:00
url : home _url + "ajax.php" ,
2014-06-26 17:00:43 +02:00
timeout : 600000 ,
dataType : "json" ,
error : function ( data ) {
2017-03-15 13:20:05 +01:00
$ ( "<div id='error_pkg' class='dialog ui-dialog-content' title='" + package _available + "'></div>" ) . dialog ( {
2017-03-14 13:52:29 +01:00
resizable : true ,
draggable : true ,
modal : true ,
overlay : {
opacity : 0.5 ,
background : 'black'
} ,
width : 600 ,
height : 250 ,
buttons : {
"Ok" : function ( ) {
$ ( this ) . dialog ( "close" ) ;
}
}
} ) ;
var dialog _error _pkg _text = "<div>" ;
dialog _error _pkg _text = dialog _error _pkg _text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_error_mr.png'></div>" ;
dialog _error _pkg _text = dialog _error _pkg _text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>" ;
2017-03-15 13:20:05 +01:00
dialog _error _pkg _text = dialog _error _pkg _text + "<p style='font-family:Verdana; font-size:12pt;'>" + data [ 'message' ] + "</p></div>" ;
2017-03-14 13:52:29 +01:00
dialog _error _pkg _text = dialog _error _pkg _text + "</div>" ;
$ ( '#error_pkg' ) . html ( dialog _error _pkg _text ) ;
$ ( '#error_pkg' ) . dialog ( 'open' ) ;
2014-06-26 17:00:43 +02:00
correct _install _progress = false ;
stop _check _progress = 1 ;
$ ( "#box_online .loading" ) . hide ( ) ;
2015-06-30 12:59:23 +02:00
$ ( "#box_online .progressbar" ) . hide ( ) ;
2014-06-26 17:00:43 +02:00
$ ( "#box_online .content" ) . html ( unknown _error _update _manager ) ;
} ,
success : function ( data ) {
if ( correct _install _progress ) {
if ( data [ "status" ] == "success" ) {
2017-03-15 13:20:05 +01:00
$ ( "<div id='success_pkg' class='dialog ui-dialog-content' title='" + package _available + "'></div>" ) . dialog ( {
2017-03-14 13:52:29 +01:00
resizable : true ,
draggable : true ,
modal : true ,
overlay : {
opacity : 0.5 ,
background : 'black'
} ,
width : 600 ,
height : 250 ,
buttons : {
"Ok" : function ( ) {
$ ( this ) . dialog ( "close" ) ;
}
}
} ) ;
var dialog _success _pkg _text = "<div>" ;
dialog _success _pkg _text = dialog _success _pkg _text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_exito_mr.png'></div>" ;
dialog _success _pkg _text = dialog _success _pkg _text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>SUCCESS</strong></h3>" ;
dialog _success _pkg _text = dialog _success _pkg _text + "<p style='font-family:Verdana; font-size:12pt;'>" + data [ 'message' ] + "</p></div>" ;
dialog _success _pkg _text = dialog _success _pkg _text + "</div>" ;
$ ( '#success_pkg' ) . html ( dialog _success _pkg _text ) ;
$ ( '#success_pkg' ) . dialog ( 'open' ) ;
2014-06-26 17:00:43 +02:00
$ ( "#box_online .loading" ) . hide ( ) ;
$ ( "#box_online .progressbar" ) . hide ( ) ;
$ ( "#box_online .content" ) . html ( data [ 'message' ] ) ;
stop _check _progress = 1 ;
}
else {
2017-03-15 13:20:05 +01:00
$ ( "<div id='error_pkg' class='dialog ui-dialog-content' title='" + package _available + "'></div>" ) . dialog ( {
2017-03-14 13:52:29 +01:00
resizable : true ,
draggable : true ,
modal : true ,
overlay : {
opacity : 0.5 ,
background : 'black'
} ,
width : 600 ,
height : 250 ,
buttons : {
"Ok" : function ( ) {
$ ( this ) . dialog ( "close" ) ;
}
}
} ) ;
var dialog _error _pkg _text = "<div>" ;
dialog _error _pkg _text = dialog _error _pkg _text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_error_mr.png'></div>" ;
dialog _error _pkg _text = dialog _error _pkg _text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>" ;
dialog _error _pkg _text = dialog _error _pkg _text + "<p style='font-family:Verdana; font-size:12pt;'>" + data [ 'message' ] + "</p></div>" ;
dialog _error _pkg _text = dialog _error _pkg _text + "</div>" ;
$ ( '#error_pkg' ) . html ( dialog _error _pkg _text ) ;
$ ( '#error_pkg' ) . dialog ( 'open' ) ;
2014-06-26 17:00:43 +02:00
$ ( "#box_online .loading" ) . hide ( ) ;
$ ( "#box_online .progressbar" ) . hide ( ) ;
$ ( "#box_online .content" ) . html ( data [ 'message' ] ) ;
stop _check _progress = 1 ;
}
2014-06-10 14:57:17 +02:00
}
else {
stop _check _progress = 1 ;
}
2014-06-26 17:00:43 +02:00
}
} ) ;
2017-03-13 15:52:30 +01:00
}
2017-03-16 19:14:19 +01:00
function apply _minor _release ( n _mr , pkg , ent , off ) {
2017-03-14 15:20:12 +01:00
var error = [ ] ;
error [ 'error' ] = false ;
2017-03-13 15:52:30 +01:00
$ ( '#mr_dialog2' ) . empty ( ) ;
$ . each ( n _mr , function ( i , mr ) {
var params = { } ;
params [ "updare_rr" ] = 1 ;
params [ "number" ] = mr ;
2017-03-16 18:23:07 +01:00
params [ "ent" ] = ent ;
2017-03-16 19:14:19 +01:00
params [ "pkg" ] = pkg ;
params [ "off" ] = off ;
2017-03-13 15:52:30 +01:00
params [ "page" ] = "include/ajax/rolling_release.ajax" ;
jQuery . ajax ( {
data : params ,
async : false ,
dataType : "html" ,
type : "POST" ,
url : "ajax.php" ,
success : function ( data ) {
2017-03-14 10:36:10 +01:00
$ ( '#mr_dialog2' ) . append ( "</div style='max-height:50px'>" ) ;
2017-03-14 15:20:12 +01:00
if ( data == 'bad_mr_filename' ) {
error [ 'error' ] = false ;
error [ 'message' ] = "bad_mr_filename" ;
}
else if ( data != "" ) {
2017-03-13 15:52:30 +01:00
$ ( '#mr_dialog2' ) . empty ( ) ;
2017-03-14 10:36:10 +01:00
$ ( '#mr_dialog2' ) . html ( data ) ;
2017-03-14 15:20:12 +01:00
error [ 'error' ] = true ;
2017-03-13 15:52:30 +01:00
}
else {
2017-03-15 13:20:05 +01:00
$ ( '#mr_dialog2' ) . append ( "<p style='font-family:Verdana; font-size:12pt;'>- " + applying _mr + " #" + mr + "</p>" ) ;
2017-03-13 15:52:30 +01:00
}
}
} ) ;
2017-03-15 13:20:05 +01:00
if ( error [ 'error' ] ) {
return false ;
}
else if ( error [ 'message' ] == "bad_mr_filename" ) {
2017-03-13 15:52:30 +01:00
return false ;
}
} ) ;
2017-03-14 10:36:10 +01:00
$ ( '#mr_dialog2' ) . append ( "</div>" ) ;
$ ( ".ui-dialog-buttonset" ) . empty ( ) ;
2017-03-13 15:52:30 +01:00
2017-03-15 13:20:05 +01:00
return error ;
2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
}