Commit 98aa4d1b authored by Recteur LP's avatar Recteur LP

better check plugins version

parent 9a06b5da
Pipeline #814 failed with stages
in 11 minutes and 32 seconds
/*! PyRmin.js 0.3.3 */
function callback_store_list(l){$("#plugins_choice").html("<option></option>"),$("#plugins_choice").css("display","block"),$.each(l.plugins,function(n){$("#plugins_choice").append($("<option></option>").attr("value",l.plugins[n].url+"/repository/archive.tar.gz").text(l.plugins[n].name+" "+l.plugins[n].tags[0].name)),$("ul#plugins_list li").each(function(t){if($(this).attr("data-namespace").toLowerCase()===l.plugins[n].name.toLowerCase()){var e=parseInt(l.plugins[n].tags[0].name.replace(/\./g,""),10)>parseInt($(this).attr("data-version").replace(/\./g,""),10)?"label-danger":"label-success";return $("#row_"+$(this).attr("data-namespace")+" .label-plugin-version").removeClass("label-info").addClass(e),!1}})})}$(document).ready(function(){pyrmin().add_vendor(["swal","select2","nunjucks","fileinput","chartjs","icheck"]),$("#settings_modal").on("show.bs.modal",function(t){var e=$(t.relatedTarget),n=e.data("namespace"),l=e.data("name")+" ("+n+")",a=$(this);a.find(".modal-title").text(l),a.find(".modal-body").empty(),config=pyrmin().get("/rest/settings/config/"+n).config,nunjucks.render("plugins/"+n+"/templates/settings.inc.html",{config:config},function(t,e){null===t?$("#settings_modal").find(".modal-body").html(e):$("#settings_modal").find(".modal-body").text(t)})}),$("#tar").fileinput({allowedFileExtensions:["tar.gz"]}),$("select").select2(),$("#install_btn").click(function(){var t=new FormData($("#install_form")[0]);if(mode=$("input[name='method']:checked").val(),"upload"===mode){if(0===$("#tar").get(0).files.length)return void $("#upload_form").addClass("has-error")}else if("url"===mode){if(""===$("#url").val())return void $("#url_form").addClass("has-error")}else if("store"===mode){if(""===$("#plugins_choice").val())return void $("#store_form_control").addClass("has-error");if($("#private_store_toggle").prop("checked")&&""===$("#store_token").val())return void $(".private_store_token").addClass("has-error")}$.ajax({url:"/rest/settings/install",type:"POST",data:t,cache:!1,contentType:!1,processData:!1,success:function(t,e){0===t.status?($("#install").modal("hide"),pyrmin().notify("success","OK","Plugin installed ! \n Please Reboot the Application")):pyrmin().notify("error","An error occur",t.error)},error:function(t,e){console.log(e),$("#install").modal("hide"),pyrmin().notify("error","An error occur","Response status code : "+e)}},"json")}),$("input[name='method']").on("ifChecked",function(t){$("#plugins_choice").css("display","none"),$("#upload_form").css("display","upload"===$(this).val()?"block":"none"),$("#url_form").css("display","url"===$(this).val()?"block":"none"),$("#store_form").css("display","store"===$(this).val()?"block":"none"),$("#install_btn").css("display","inline-block")}),$("#uninstall_btn").click(function(){plugin=$("#settings_modal .modal-title").html().split("(")[1].replace(")",""),swal({title:"Are you sure?",text:"Do you want to uninstall "+plugin+" plugins and all its files ?",type:"warning",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"Yes, delete it!",cancelButtonText:"Cancel",closeOnConfirm:!0,closeOnCancel:!0},function(t){t&&(data=pyrmin().get("/rest/settings/uninstall/"+plugin.toLowerCase()),console.log(data),0===data.status&&pyrmin().notify("success","Uninstall !",name+" plugin has been uninstalled."))})}),$("#reinstall_btn").click(function(){plugin=$("#settings_modal .modal-title").html().split("(")[1].replace(")",""),data=pyrmin().get("/rest/settings/reinstall/"+plugin.toLowerCase()),0===data.status?pyrmin().notify("success","Reinstall !",name+" plugin has been reinstalled."):pyrmin().notify("error","Cancelled","No action taken: "+data.error)}),$("#private_store_toggle").change(function(){$(".private_store").toggle(this.checked)}).change(),$(".icheck").iCheck({radioClass:"iradio_flat-blue"}),$("#login_btn").click(function(){var t=$("#store_token").val();""!==t?get_data(pyrmin().url+"/rest/download/plugins/?token="+t,callback_store_list):$(".private_store_token").addClass("has-error")}),get_data(pyrmin().url+"/rest/download/plugins/",callback_store_list)});
function callback_store_list(s){$("#plugins_choice").html("<option></option>"),$("#plugins_choice").css("display","block"),$.each(s.plugins,function(a){$("#plugins_choice").append($("<option></option>").attr("value",s.plugins[a].url+"/repository/archive.tar.gz").text(s.plugins[a].name+" "+s.plugins[a].tags[0].name)),$("ul#plugins_list li").each(function(t){if($(this).attr("data-namespace").toLowerCase()===s.plugins[a].name.toLowerCase()){var e=s.plugins[a].tags[0].name.split(".").map(return2digit),n=$(this).attr("data-version").split(".").map(return2digit),l=parseInt(e,10)>parseInt(n,10)?"label-danger":"label-success";return $("#row_"+$(this).attr("data-namespace")+" .label-plugin-version").removeClass("label-info").addClass(l),!1}})})}function return2digit(t){return 1==t.length?"0"+t:t}$(document).ready(function(){pyrmin().add_vendor(["swal","select2","nunjucks","fileinput","chartjs","icheck"]),$("#settings_modal").on("show.bs.modal",function(t){var e=$(t.relatedTarget),n=e.data("namespace"),l=e.data("name")+" ("+n+")",a=$(this);a.find(".modal-title").text(l),a.find(".modal-body").empty(),config=pyrmin().get("/rest/settings/config/"+n).config,nunjucks.render("plugins/"+n+"/templates/settings.inc.html",{config:config},function(t,e){null===t?$("#settings_modal").find(".modal-body").html(e):$("#settings_modal").find(".modal-body").text(t)})}),$("#tar").fileinput({allowedFileExtensions:["tar.gz"]}),$("select").select2(),$("#install_btn").click(function(){var t=new FormData($("#install_form")[0]);if(mode=$("input[name='method']:checked").val(),"upload"===mode){if(0===$("#tar").get(0).files.length)return void $("#upload_form").addClass("has-error")}else if("url"===mode){if(""===$("#url").val())return void $("#url_form").addClass("has-error")}else if("store"===mode){if(""===$("#plugins_choice").val())return void $("#store_form_control").addClass("has-error");if($("#private_store_toggle").prop("checked")&&""===$("#store_token").val())return void $(".private_store_token").addClass("has-error")}$.ajax({url:"/rest/settings/install",type:"POST",data:t,cache:!1,contentType:!1,processData:!1,success:function(t,e){0===t.status?($("#install").modal("hide"),pyrmin().notify("success","OK","Plugin installed ! \n Please Reboot the Application")):pyrmin().notify("error","An error occur",t.error)},error:function(t,e){console.log(e),$("#install").modal("hide"),pyrmin().notify("error","An error occur","Response status code : "+e)}},"json")}),$("input[name='method']").on("ifChecked",function(t){$("#plugins_choice").css("display","none"),$("#upload_form").css("display","upload"===$(this).val()?"block":"none"),$("#url_form").css("display","url"===$(this).val()?"block":"none"),$("#store_form").css("display","store"===$(this).val()?"block":"none"),$("#install_btn").css("display","inline-block")}),$("#uninstall_btn").click(function(){plugin=$("#settings_modal .modal-title").html().split("(")[1].replace(")",""),swal({title:"Are you sure?",text:"Do you want to uninstall "+plugin+" plugins and all its files ?",type:"warning",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"Yes, delete it!",cancelButtonText:"Cancel",closeOnConfirm:!0,closeOnCancel:!0},function(t){t&&(data=pyrmin().get("/rest/settings/uninstall/"+plugin.toLowerCase()),console.log(data),0===data.status&&pyrmin().notify("success","Uninstall !",name+" plugin has been uninstalled."))})}),$("#reinstall_btn").click(function(){plugin=$("#settings_modal .modal-title").html().split("(")[1].replace(")",""),data=pyrmin().get("/rest/settings/reinstall/"+plugin.toLowerCase()),0===data.status?pyrmin().notify("success","Reinstall !",name+" plugin has been reinstalled."):pyrmin().notify("error","Cancelled","No action taken: "+data.error)}),$("#private_store_toggle").change(function(){$(".private_store").toggle(this.checked)}).change(),$(".icheck").iCheck({radioClass:"iradio_flat-blue"}),$("#login_btn").click(function(){var t=$("#store_token").val();""!==t?get_data(pyrmin().url+"/rest/download/plugins/?token="+t,callback_store_list):$(".private_store_token").addClass("has-error")}),get_data(pyrmin().url+"/rest/download/plugins/",callback_store_list)});
//# sourceMappingURL=settings.min.js.map
\ No newline at end of file
{"version":3,"sources":["../../../src/js/settings.js"],"names":["callback_store_list","data","$","html","css","each","plugins","plugin","append","attr","url","text","name","tags","i","this","toLowerCase","labelclass","parseInt","replace","removeClass","addClass","document","ready","pyrmin","add_vendor","on","event","button","relatedTarget","namespace","modal","find","empty","config","get","nunjucks","render","err","res","fileinput","allowedFileExtensions","select2","click","formData","FormData","mode","val","files","length","prop","ajax","type","cache","contentType","processData","success","status","notify","error","console","log","split","swal","title","showCancelButton","confirmButtonColor","confirmButtonText","cancelButtonText","closeOnConfirm","closeOnCancel","isConfirm","change","toggle","checked","iCheck","radioClass","token","get_data"],"mappings":";AA+IA,SAASA,oBAA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C,MAAmB,QAAQ,QAClE7C,EAAE,eAAeE,IAAI,UAA8B,UAAlBF,EAAEa,MAAMgC,MAAqB,QAAQ,QACtE7C,EAAE,gBAAgBE,IAAI,UAAW,kBAIrCF,EAAE,kBAAkByC,MAAM,WACtBpC,OAASL,EAAE,gCAAgCC,OAAO2D,MAAM,KAAK,GAAG3C,QAAQ,IAAK,IAC7E4C,KAAK,CACDC,MAAO,gBACPrD,KAAM,4BAA8BJ,OAAS,+BAC7C6C,KAAM,UACNa,kBAAkB,EAClBC,mBAAoB,UACpBC,kBAAmB,kBACnBC,iBAAkB,SAClBC,gBAAgB,EAChBC,eAAe,GAChB,SAASC,GACJA,IACAtE,KAAOuB,SAASW,IAAI,4BAA8B5B,OAAOS,eACzD4C,QAAQC,IAAI5D,MACO,IAAhBA,KAAKwD,QAAcjC,SAASkC,OAAO,UAAW,cAAe9C,KAAO,sCAMnFV,EAAE,kBAAkByC,MAAM,WACtBpC,OAASL,EAAE,gCAAgCC,OAAO2D,MAAM,KAAK,GAAG3C,QAAQ,IAAK,IAC7ElB,KAAOuB,SAASW,IAAI,4BAA8B5B,OAAOS,eACtC,IAAhBf,KAAKwD,OAAcjC,SAASkC,OAAO,UAAW,cAAe9C,KAAO,iCAClEY,SAASkC,OAAO,QAAS,YAAa,oBAAsBzD,KAAK0D,SAG1EzD,EAAE,yBAAyBsE,OAAO,WAChCtE,EAAE,kBAAkBuE,OAAO1D,KAAK2D,WAC/BF,SAEHtE,EAAE,WAAWyE,OAAO,CAClBC,WAAY,qBAId1E,EAAE,cAAcyC,MAAM,WAClB,IAAIkC,EAAQ3E,EAAE,gBAAgB6C,MACjB,KAAV8B,EAKCC,SAAStD,SAASd,IAAM,iCAAmCmE,EAAO7E,qBAJlEE,EAAE,wBAAwBmB,SAAS,eAU3CyD,SAAStD,SAASd,IAAM,0BAA2BV","file":"settings.min.js"}
\ No newline at end of file
{"version":3,"sources":["../../../src/js/settings.js"],"names":["callback_store_list","data","$","html","css","each","plugins","plugin","append","attr","url","text","name","tags","i","this","toLowerCase","latest","split","map","return2digit","installed","labelclass","parseInt","removeClass","addClass","x","length","document","ready","pyrmin","add_vendor","on","event","button","relatedTarget","namespace","modal","find","empty","config","get","nunjucks","render","err","res","fileinput","allowedFileExtensions","select2","click","formData","FormData","mode","val","files","prop","ajax","type","cache","contentType","processData","success","status","notify","error","console","log","replace","swal","title","showCancelButton","confirmButtonColor","confirmButtonText","cancelButtonText","closeOnConfirm","closeOnCancel","isConfirm","change","toggle","checked","iCheck","radioClass","token","get_data"],"mappings":";AA+IA,SAASA,oBAAoBC,GACzBC,EAAE,mBAAmBC,KAAK,qBAC1BD,EAAE,mBAAmBE,IAAI,UAAW,SACpCF,EAAEG,KAAKJ,EAAKK,QAAS,SAASC,GAC1BL,EAAE,mBACGM,OAAON,EAAE,qBACTO,KAAK,QAAQR,EAAKK,QAAQC,GAAQG,IAAM,8BACxCC,KAAKV,EAAKK,QAAQC,GAAQK,KAAO,IAAMX,EAAKK,QAAQC,GAAQM,KAAK,GAAGD,OAEzEV,EAAE,sBAAsBG,KAAK,SAASS,GAClC,GAAGZ,EAAEa,MAAMN,KAAK,kBAAkBO,gBAAkBf,EAAKK,QAAQC,GAAQK,KAAKI,cAAe,CACzF,IAAIC,EAAShB,EAAKK,QAAQC,GAAQM,KAAK,GAAGD,KAAKM,MAAM,KAAKC,IAAIC,cAC1DC,EAAYnB,EAAEa,MAAMN,KAAK,gBAAgBS,MAAM,KAAKC,IAAIC,cACxDE,EAAcC,SAASN,EAAQ,IAAMM,SAASF,EAAW,IAAO,eAAiB,gBAErF,OADAnB,EAAE,QAAUA,EAAEa,MAAMN,KAAK,kBAAoB,0BAA0Be,YAAY,cAAcC,SAASH,IACnG,OAMvB,SAASF,aAAaM,GAClB,OAAkB,GAAVA,EAAEC,OAAa,IAAMD,EAAIA,EAnKrCxB,EAAE0B,UAAUC,MAAM,WAEdC,SAASC,WAAW,CAAC,OAAQ,UAAW,WAAY,YAAa,UAAW,WAG5E7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KAAO,iCAClEkB,SAASiC,OAAO,QAAS,YAAa,oBAAsB9D,KAAK+D,SAG1E9D,EAAE,yBAAyB2E,OAAO,WAChC3E,EAAE,kBAAkB4E,OAAO/D,KAAKgE,WAC/BF,SAEH3E,EAAE,WAAW8E,OAAO,CAClBC,WAAY,qBAId/E,EAAE,cAAc+C,MAAM,WAClB,IAAIiC,EAAQhF,EAAE,gBAAgBmD,MACjB,KAAV6B,EAKCC,SAASrD,SAASpB,IAAM,iCAAmCwE,EAAOlF,qBAJlEE,EAAE,wBAAwBuB,SAAS,eAU3C0D,SAASrD,SAASpB,IAAM,0BAA2BV","file":"settings.min.js"}
\ No newline at end of file
......@@ -152,10 +152,16 @@ function callback_store_list(data) {
$('ul#plugins_list li').each(function(i) {
if($(this).attr('data-namespace').toLowerCase() === data.plugins[plugin].name.toLowerCase()) {
var labelclass = (parseInt(data.plugins[plugin].tags[0].name.replace(/\./g, ''), 10) > parseInt($(this).attr('data-version').replace(/\./g, ''), 10)) ? 'label-danger' : 'label-success';
var latest = data.plugins[plugin].tags[0].name.split('.').map(return2digit);
var installed = $(this).attr('data-version').split('.').map(return2digit);
var labelclass = (parseInt(latest, 10) > parseInt(installed, 10)) ? 'label-danger' : 'label-success';
$('#row_' + $(this).attr('data-namespace') + ' .label-plugin-version').removeClass("label-info").addClass(labelclass);
return false;
}
});
});
}
function return2digit(x) {
return (x.length==1) ? '0' + x : x;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment