%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/projetos/suporte.iigd.com.br.old/js/
Upload File :
Create Path :
Current File : /var/www/projetos/suporte.iigd.com.br.old/js/marketplace.min.js

/**
 * ---------------------------------------------------------------------
 *
 * GLPI - Gestionnaire Libre de Parc Informatique
 *
 * http://glpi-project.org
 *
 * @copyright 2015-2022 Teclib' and contributors.
 * @copyright 2003-2014 by the INDEPNET Development Team.
 * @licence   https://www.gnu.org/licenses/gpl-3.0.html
 *
 * ---------------------------------------------------------------------
 *
 * LICENSE
 *
 * This file is part of GLPI.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 * ---------------------------------------------------------------------
 */
var current_page=1;var ajax_url;var ajax_done=false;$(document).ready((function(){ajax_url=CFG_GLPI.root_doc+"/ajax/marketplace.php";$(document).on("click",".marketplace .modify_plugin",(function(){var a=$(this);var e=a.closest(".buttons");var t=a.closest("li.plugin");var i=a.children("i");var n=a.closest(".marketplace").hasClass("installed");var l=a.data("action");var s=t.data("key");i.removeClass().addClass("fas fa-spinner fa-spin");if(l==="download_plugin"||l==="update_plugin"){followDownloadProgress(a)}ajax_done=false;$.post(ajax_url,{action:l,key:s}).done((function(a){ajax_done=true;if(a.indexOf("cleaned")!==-1&&n){t.remove()}else{a=a.replace("cleaned","");e.html(a);displayAjaxMessageAfterRedirect();addTooltips()}}))}));$(document).on("select2:select",".marketplace .sort-control",(function(){filterPluginList()}));$(document).on("click",".marketplace .pagination li",(function(){var a=$(this);var e=a.data("page");if(a.hasClass("nav-disabled")||a.hasClass("current")||isNaN(e)){return}refreshPlugins(e)}));$(document).on("click",".marketplace .plugins-tags .tag",(function(){$(".marketplace:visible .plugins-tags .tag").removeClass("active");$(this).addClass("active");filterPluginList()}));var a;$(document).on("input",".marketplace .filter-list",(function(){clearTimeout(a);a=setTimeout((function(){filterPluginList()}),500)}));$(document).on("click",".marketplace .refresh-plugin-list",(function(){refreshPlugins(current_page,true)}))}));var filterPluginList=function(a,e){a=a||1;e=e||false;var t=$(".marketplace:visible");var i=t.find("ul.pagination");var n=t.find("ul.plugins");var l=t.find(".plugins-tags .tag.active");var s=l.length?l.data("tag"):"";var r=t.find(".filter-list").val();var o="sort-alpha-desc";if(t.find(".sort-control").length>0){o=t.find(".sort-control").select2("data")[0].element.value}n.append("<div class='loading-plugins'><i class='fas fa-spinner fa-pulse'></i></div>");i.find("li.current").removeClass("current");var c=$.get(ajax_url,{action:"refresh_plugin_list",tab:t.data("tab"),tag:s,filter:r,force:e?1:0,page:a,sort:o}).done((function(e){n.html(e);if(t.data("tab")==="installed"){return}var l=c.getResponseHeader("X-GLPI-Marketplace-Total");$.get(ajax_url,{action:"getPagination",page:a,total:l}).done((function(a){i.html(a)}))}));return c};var refreshPlugins=function(a,e){e=e||false;var t=$(".marketplace:visible .refresh-plugin-list");t.removeClass("fa-sync-alt").addClass("fa-spinner fa-spin");$.when(filterPluginList(a,e)).then((function(){t.removeClass("fa-spinner fa-spin").addClass("fa-sync-alt");current_page=a;addTooltips()}))};var addTooltips=function(){$(".qtip").remove();$(".marketplace:visible").find("[data-action][title], .add_tooltip").qtip({position:{viewport:$(window),my:"center left",at:"center right",adjust:{x:2,method:"flip"}},style:{classes:"qtip-dark"},show:{solo:true},hide:{event:"click mouseleave"}})};var followDownloadProgress=function(a){var e=a.closest(".buttons");var t=a.closest("li.plugin");var i=t.data("key");var n=$('<progress max="100" value="0"></progress>');e.html(n);function l(){setTimeout((function(){$.get(ajax_url,{action:"get_dl_progress",key:i}).done((function(a){n.attr("value",a);if(a<100){l()}else if(!ajax_done){e.html('<i class="fas fa-cog fa-spin"></i>');displayAjaxMessageAfterRedirect()}}))}),300)}l()};

Zerion Mini Shell 1.0