diff options
Diffstat (limited to 'plugins/MultiSites/vue/dist/MultiSites.umd.min.js')
-rw-r--r-- | plugins/MultiSites/vue/dist/MultiSites.umd.min.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/MultiSites/vue/dist/MultiSites.umd.min.js b/plugins/MultiSites/vue/dist/MultiSites.umd.min.js index 170f040f4a..4201bfffbe 100644 --- a/plugins/MultiSites/vue/dist/MultiSites.umd.min.js +++ b/plugins/MultiSites/vue/dist/MultiSites.umd.min.js @@ -10,7 +10,7 @@ * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var Pe=window,Te=Pe.NumberFormatter,Ae=function(){function e(){var t=this;Ee(this,e),Be(this,"privateState",Object(i["reactive"])({sites:[],isLoading:!1,pageSize:25,currentPage:0,totalVisits:"?",totalPageviews:"?",totalActions:"?",totalRevenue:"?",searchTerm:"",lastVisits:"?",lastVisitsDate:"?",numberOfSites:0,loadingMessage:Object(o["translate"])("MultiSites_LoadingWebsites"),reverse:!0,sortColumn:"nb_visits",refreshInterval:0,errorLoadingSites:!1})),Be(this,"refreshTimeout",null),Be(this,"fetchAbort",null),Be(this,"state",Object(i["computed"])((function(){return Object(i["readonly"])(t.privateState)}))),Be(this,"numberOfFilteredSites",Object(i["computed"])((function(){return t.state.value.numberOfSites}))),Be(this,"numberOfPages",Object(i["computed"])((function(){return Math.ceil(t.numberOfFilteredSites.value/t.state.value.pageSize-1)}))),Be(this,"currentPagingOffset",Object(i["computed"])((function(){return Math.ceil(t.state.value.currentPage*t.state.value.pageSize)}))),Be(this,"paginationLowerBound",Object(i["computed"])((function(){return t.currentPagingOffset.value+1}))),Be(this,"paginationUpperBound",Object(i["computed"])((function(){var e=t.currentPagingOffset.value+t.state.value.pageSize,n=t.numberOfFilteredSites.value;return e>n&&(e=n),e})))}return Me(e,[{key:"cancelRefereshInterval",value:function(){this.refreshTimeout&&(clearTimeout(this.refreshTimeout),this.refreshTimeout=null)}},{key:"updateWebsitesList",value:function(e){var t=this;if(e){var n=e.sites;n.forEach((function(e){if(1!==e.ratio&&"1"!==e.ratio){var n=Te.formatPercent(Math.round(100*parseInt(e.ratio,10))),r=null,a="0",i="0",s="0",l="0";if("nb_visits"!==t.state.value.sortColumn&&"visits_evolution"!==t.state.value.sortColumn||(a=Te.formatNumber(e.previous_nb_visits),i=Te.formatNumber(e.nb_visits),s=Te.formatPercent(e.visits_evolution),r=Object(o["translate"])("General_ColumnNbVisits"),l=Te.formatNumber(Math.round(parseInt(e.previous_nb_visits,10)*parseInt(e.ratio,10)))),"pageviews_evolution"===t.state.value.sortColumn&&(a="".concat(e.previous_Actions_nb_pageviews),i="".concat(e.nb_pageviews),s=Te.formatPercent(e.pageviews_evolution),r=Object(o["translate"])("General_ColumnPageviews"),l=Te.formatNumber(Math.round(parseInt(e.previous_Actions_nb_pageviews,10)*parseInt(e.ratio,10)))),"revenue_evolution"===t.state.value.sortColumn&&(a=Te.formatCurrency(e.previous_Goal_revenue,e.currencySymbol),i=Te.formatCurrency(e.revenue,e.currencySymbol),s=Te.formatPercent(e.revenue_evolution),r=Object(o["translate"])("General_ColumnRevenue"),l=Te.formatCurrency(Math.round(parseInt(e.previous_Goal_revenue,10)*parseInt(e.ratio,10)),e.currencySymbol)),r)switch(e.tooltip="".concat(Object(o["translate"])("MultiSites_EvolutionComparisonIncomplete",[n]),"\n"),e.tooltip+="".concat(Object(o["translate"])("MultiSites_EvolutionComparisonProportional",[n,"".concat(l),r,"".concat(a)]),"\n"),e.periodName){case"day":e.tooltip+=Object(o["translate"])("MultiSites_EvolutionComparisonDay",["".concat(i),r,"".concat(l),e.previousRange,"".concat(s)]);break;case"week":e.tooltip+=Object(o["translate"])("MultiSites_EvolutionComparisonWeek",["".concat(i),r,"".concat(l),e.previousRange,"".concat(s)]);break;case"month":e.tooltip+=Object(o["translate"])("MultiSites_EvolutionComparisonMonth",["".concat(i),r,"".concat(l),e.previousRange,"".concat(s)]);break;case"year":e.tooltip+=Object(o["translate"])("MultiSites_EvolutionComparisonYear",["".concat(i),r,"".concat(l),e.previousRange,"".concat(s)]);break;default:break}}})),this.privateState.totalVisits=e.totals.nb_visits,this.privateState.totalPageviews=e.totals.nb_pageviews,this.privateState.totalActions=e.totals.nb_actions,this.privateState.totalRevenue=e.totals.revenue,this.privateState.lastVisits=e.totals.nb_visits_lastdate,this.privateState.sites=n,this.privateState.numberOfSites=e.numSites,this.privateState.lastVisitsDate=e.lastDate}else this.onError()}},{key:"sortBy",value:function(e){this.state.value.sortColumn===e&&(this.privateState.reverse=!this.state.value.reverse),this.privateState.sortColumn=e,this.fetchAllSites()}},{key:"previousPage",value:function(){this.privateState.currentPage=this.state.value.currentPage-1,this.fetchAllSites()}},{key:"nextPage",value:function(){this.privateState.currentPage=this.state.value.currentPage+1,this.fetchAllSites()}},{key:"searchSite",value:function(e){this.privateState.searchTerm=e,this.privateState.currentPage=0,this.fetchAllSites()}},{key:"fetchAllSites",value:function(){var e=this;this.fetchAbort&&(this.fetchAbort.abort(),this.fetchAbort=null,this.cancelRefereshInterval()),this.privateState.isLoading=!0,this.privateState.errorLoadingSites=!1;var t={module:"MultiSites",action:"getAllWithGroups",hideMetricsDoc:"1",filter_sort_order:"asc",filter_limit:this.state.value.pageSize,filter_offset:this.currentPagingOffset.value,showColumns:["label","nb_visits","nb_pageviews","visits_evolution","visits_evolution_trend","pageviews_evolution","pageviews_evolution_trend","revenue_evolution","revenue_evolution_trend","nb_actions,revenue"].join(",")};return this.privateState.searchTerm&&(t.pattern=this.privateState.searchTerm),this.privateState.sortColumn&&(t.filter_sort_column=this.privateState.sortColumn),this.privateState.reverse&&(t.filter_sort_order="desc"),this.fetchAbort=new AbortController,o["AjaxHelper"].fetch(t,{abortController:this.fetchAbort}).then((function(t){e.updateWebsitesList(t)})).catch((function(){e.onError()})).finally((function(){e.privateState.isLoading=!1,e.fetchAbort=null,e.state.value.refreshInterval&&e.state.value.refreshInterval>0&&(e.cancelRefereshInterval(),e.refreshTimeout=setTimeout((function(){e.refreshTimeout=null,e.fetchAllSites()}),1e3*e.state.value.refreshInterval))}))}},{key:"onError",value:function(){this.privateState.errorLoadingSites=!0,this.privateState.sites=[]}},{key:"setRefreshInterval",value:function(e){this.privateState.refreshInterval=e}},{key:"setPageSize",value:function(e){this.privateState.pageSize=e}}]),e}(),De=new Ae,xe=Object(i["defineComponent"])({props:{displayRevenueColumn:Boolean,showSparklines:Boolean,dateSparkline:String,pageSize:Number,autoRefreshTodayReport:Number},components:{EnrichedHeadline:o["EnrichedHeadline"],ActivityIndicator:o["ActivityIndicator"],MultisitesSite:G},data:function(){return{evolutionSelector:"visits_evolution",searchTerm:""}},created:function(){this.pageSize&&De.setPageSize(this.pageSize),this.refresh(this.autoRefreshTodayReport)},methods:{refresh:function(e){De.setRefreshInterval(e),De.fetchAllSites()},sortBy:function(e){De.sortBy(e)},previousPage:function(){De.previousPage()},nextPage:function(){De.nextPage()},searchSite:function(){De.searchSite(this.searchTerm)}},computed:{hasSuperUserAccess:function(){return o["Matomo"].hasSuperUserAccess},date:function(){return o["MatomoUrl"].urlParsed.value.date},idSite:function(){return o["MatomoUrl"].urlParsed.value.idSite},url:function(){return o["Matomo"].piwik_url},period:function(){return o["Matomo"].period},areAdsForProfessionalServicesEnabled:function(){return o["Matomo"].config&&o["Matomo"].config.are_ads_enabled},sortColumn:function(){return De.state.value.sortColumn},reverse:function(){return De.state.value.reverse},smallTitleContent:function(){var e=De.state.value;return Object(o["translate"])("General_TotalVisitsPageviewsActionsRevenue","<strong>".concat(e.totalVisits,"</strong>"),"<strong>".concat(e.totalPageviews,"</strong>"),"<strong>".concat(e.totalActions,"</strong>"),"<strong>".concat(e.totalRevenue,"</strong>"))},smallTitleTooltip:function(){var e=De.state.value;return Object(o["translate"])("General_EvolutionSummaryGeneric",Object(o["translate"])("General_NVisits","".concat(e.totalVisits)),this.date,"".concat(e.lastVisits),e.lastVisitsDate,Object(o["getFormattedEvolution"])(e.totalVisits,e.lastVisits))},loadingMessage:function(){return De.state.value.loadingMessage},isLoading:function(){return De.state.value.isLoading},errorLoadingSites:function(){return De.state.value.errorLoadingSites},sites:function(){return De.state.value.sites},numberOfPages:function(){return De.numberOfPages.value},currentPage:function(){return De.state.value.currentPage},paginationLowerBound:function(){return De.paginationLowerBound.value},paginationUpperBound:function(){return De.paginationUpperBound.value},numberOfFilteredSites:function(){return De.numberOfFilteredSites.value},professionalHelpUrl:function(){return"https://matomo.org/support-plans/?pk_campaign=Help&pk_medium=AjaxError&pk_content=MultiSites&pk_source=Matomo_App"},addSiteUrl:function(){return"index.php?module=SitesManager&action=index&showaddsite=1&period=".concat(this.period,"&")+"date=".concat(this.date,"&idSite=").concat(this.idSite)}}});xe.render=Ne;var Ge=xe; + */var Pe=window,Te=Pe.NumberFormatter,Ae=function(){function e(){var t=this;Ee(this,e),Be(this,"privateState",Object(i["reactive"])({sites:[],isLoading:!1,pageSize:25,currentPage:0,totalVisits:"?",totalPageviews:"?",totalActions:"?",totalRevenue:"?",searchTerm:"",lastVisits:"?",lastVisitsDate:"?",numberOfSites:0,loadingMessage:Object(o["translate"])("MultiSites_LoadingWebsites"),reverse:!0,sortColumn:"nb_visits",refreshInterval:0,errorLoadingSites:!1})),Be(this,"refreshTimeout",null),Be(this,"fetchAbort",null),Be(this,"state",Object(i["computed"])((function(){return Object(i["readonly"])(t.privateState)}))),Be(this,"numberOfFilteredSites",Object(i["computed"])((function(){return t.state.value.numberOfSites}))),Be(this,"numberOfPages",Object(i["computed"])((function(){return Math.ceil(t.numberOfFilteredSites.value/t.state.value.pageSize-1)}))),Be(this,"currentPagingOffset",Object(i["computed"])((function(){return Math.ceil(t.state.value.currentPage*t.state.value.pageSize)}))),Be(this,"paginationLowerBound",Object(i["computed"])((function(){return t.currentPagingOffset.value+1}))),Be(this,"paginationUpperBound",Object(i["computed"])((function(){var e=t.currentPagingOffset.value+t.state.value.pageSize,n=t.numberOfFilteredSites.value;return e>n&&(e=n),e})))}return Me(e,[{key:"cancelRefereshInterval",value:function(){this.refreshTimeout&&(clearTimeout(this.refreshTimeout),this.refreshTimeout=null)}},{key:"updateWebsitesList",value:function(e){var t=this;if(e){var n=e.sites;n.forEach((function(e){if(1!==e.ratio&&"1"!==e.ratio){var n=Te.formatPercent(Math.round(100*parseInt(e.ratio,10))),r=null,a="0",i="0",s="0",l="0";if("nb_visits"!==t.state.value.sortColumn&&"visits_evolution"!==t.state.value.sortColumn||(a=Te.formatNumber(e.previous_nb_visits),i=Te.formatNumber(e.nb_visits),s=Te.formatPercent(e.visits_evolution),r=Object(o["translate"])("General_ColumnNbVisits"),l=Te.formatNumber(Math.round(parseInt(e.previous_nb_visits,10)*parseInt(e.ratio,10)))),"pageviews_evolution"===t.state.value.sortColumn&&(a="".concat(e.previous_Actions_nb_pageviews),i="".concat(e.nb_pageviews),s=Te.formatPercent(e.pageviews_evolution),r=Object(o["translate"])("General_ColumnPageviews"),l=Te.formatNumber(Math.round(parseInt(e.previous_Actions_nb_pageviews,10)*parseInt(e.ratio,10)))),"revenue_evolution"===t.state.value.sortColumn&&(a=Te.formatCurrency(e.previous_Goal_revenue,e.currencySymbol),i=Te.formatCurrency(e.revenue,e.currencySymbol),s=Te.formatPercent(e.revenue_evolution),r=Object(o["translate"])("General_ColumnRevenue"),l=Te.formatCurrency(Math.round(parseInt(e.previous_Goal_revenue,10)*parseInt(e.ratio,10)),e.currencySymbol)),r)switch(e.tooltip="".concat(Object(o["translate"])("MultiSites_EvolutionComparisonIncomplete",[n]),"\n"),e.tooltip+="".concat(Object(o["translate"])("MultiSites_EvolutionComparisonProportional",[n,"".concat(l),r,"".concat(a)]),"\n"),e.periodName){case"day":e.tooltip+=Object(o["translate"])("MultiSites_EvolutionComparisonDay",["".concat(i),r,"".concat(l),e.previousRange,"".concat(s)]);break;case"week":e.tooltip+=Object(o["translate"])("MultiSites_EvolutionComparisonWeek",["".concat(i),r,"".concat(l),e.previousRange,"".concat(s)]);break;case"month":e.tooltip+=Object(o["translate"])("MultiSites_EvolutionComparisonMonth",["".concat(i),r,"".concat(l),e.previousRange,"".concat(s)]);break;case"year":e.tooltip+=Object(o["translate"])("MultiSites_EvolutionComparisonYear",["".concat(i),r,"".concat(l),e.previousRange,"".concat(s)]);break;default:break}}})),this.privateState.totalVisits=e.totals.nb_visits,this.privateState.totalPageviews=e.totals.nb_pageviews,this.privateState.totalActions=e.totals.nb_actions,this.privateState.totalRevenue=e.totals.revenue,this.privateState.lastVisits=e.totals.nb_visits_lastdate,this.privateState.sites=n,this.privateState.numberOfSites=e.numSites,this.privateState.lastVisitsDate=e.lastDate}else this.onError()}},{key:"sortBy",value:function(e){this.state.value.sortColumn===e&&(this.privateState.reverse=!this.state.value.reverse),this.privateState.sortColumn=e,this.fetchAllSites()}},{key:"previousPage",value:function(){this.privateState.currentPage=this.state.value.currentPage-1,this.fetchAllSites()}},{key:"nextPage",value:function(){this.privateState.currentPage=this.state.value.currentPage+1,this.fetchAllSites()}},{key:"searchSite",value:function(e){this.privateState.searchTerm=e,this.privateState.currentPage=0,this.fetchAllSites()}},{key:"fetchAllSites",value:function(){var e=this;this.fetchAbort&&(this.fetchAbort.abort(),this.fetchAbort=null,this.cancelRefereshInterval()),this.privateState.isLoading=!0,this.privateState.errorLoadingSites=!1;var t={method:"MultiSites.getAllWithGroups",hideMetricsDoc:"1",filter_sort_order:"asc",filter_limit:this.state.value.pageSize,filter_offset:this.currentPagingOffset.value,showColumns:["label","nb_visits","nb_pageviews","visits_evolution","visits_evolution_trend","pageviews_evolution","pageviews_evolution_trend","revenue_evolution","revenue_evolution_trend","nb_actions,revenue"].join(",")};return this.privateState.searchTerm&&(t.pattern=this.privateState.searchTerm),this.privateState.sortColumn&&(t.filter_sort_column=this.privateState.sortColumn),this.privateState.reverse&&(t.filter_sort_order="desc"),this.fetchAbort=new AbortController,o["AjaxHelper"].fetch(t,{abortController:this.fetchAbort}).then((function(t){e.updateWebsitesList(t)})).catch((function(){e.onError()})).finally((function(){e.privateState.isLoading=!1,e.fetchAbort=null,e.state.value.refreshInterval&&e.state.value.refreshInterval>0&&(e.cancelRefereshInterval(),e.refreshTimeout=setTimeout((function(){e.refreshTimeout=null,e.fetchAllSites()}),1e3*e.state.value.refreshInterval))}))}},{key:"onError",value:function(){this.privateState.errorLoadingSites=!0,this.privateState.sites=[]}},{key:"setRefreshInterval",value:function(e){this.privateState.refreshInterval=e}},{key:"setPageSize",value:function(e){this.privateState.pageSize=e}}]),e}(),De=new Ae,xe=Object(i["defineComponent"])({props:{displayRevenueColumn:Boolean,showSparklines:Boolean,dateSparkline:String,pageSize:Number,autoRefreshTodayReport:Number},components:{EnrichedHeadline:o["EnrichedHeadline"],ActivityIndicator:o["ActivityIndicator"],MultisitesSite:G},data:function(){return{evolutionSelector:"visits_evolution",searchTerm:""}},created:function(){this.pageSize&&De.setPageSize(this.pageSize),this.refresh(this.autoRefreshTodayReport)},methods:{refresh:function(e){De.setRefreshInterval(e),De.fetchAllSites()},sortBy:function(e){De.sortBy(e)},previousPage:function(){De.previousPage()},nextPage:function(){De.nextPage()},searchSite:function(){De.searchSite(this.searchTerm)}},computed:{hasSuperUserAccess:function(){return o["Matomo"].hasSuperUserAccess},date:function(){return o["MatomoUrl"].urlParsed.value.date},idSite:function(){return o["MatomoUrl"].urlParsed.value.idSite},url:function(){return o["Matomo"].piwik_url},period:function(){return o["Matomo"].period},areAdsForProfessionalServicesEnabled:function(){return o["Matomo"].config&&o["Matomo"].config.are_ads_enabled},sortColumn:function(){return De.state.value.sortColumn},reverse:function(){return De.state.value.reverse},smallTitleContent:function(){var e=De.state.value;return Object(o["translate"])("General_TotalVisitsPageviewsActionsRevenue","<strong>".concat(e.totalVisits,"</strong>"),"<strong>".concat(e.totalPageviews,"</strong>"),"<strong>".concat(e.totalActions,"</strong>"),"<strong>".concat(e.totalRevenue,"</strong>"))},smallTitleTooltip:function(){var e=De.state.value;return Object(o["translate"])("General_EvolutionSummaryGeneric",Object(o["translate"])("General_NVisits","".concat(e.totalVisits)),this.date,"".concat(e.lastVisits),e.lastVisitsDate,Object(o["getFormattedEvolution"])(e.totalVisits,e.lastVisits))},loadingMessage:function(){return De.state.value.loadingMessage},isLoading:function(){return De.state.value.isLoading},errorLoadingSites:function(){return De.state.value.errorLoadingSites},sites:function(){return De.state.value.sites},numberOfPages:function(){return De.numberOfPages.value},currentPage:function(){return De.state.value.currentPage},paginationLowerBound:function(){return De.paginationLowerBound.value},paginationUpperBound:function(){return De.paginationUpperBound.value},numberOfFilteredSites:function(){return De.numberOfFilteredSites.value},professionalHelpUrl:function(){return"https://matomo.org/support-plans/?pk_campaign=Help&pk_medium=AjaxError&pk_content=MultiSites&pk_source=Matomo_App"},addSiteUrl:function(){return"index.php?module=SitesManager&action=index&showaddsite=1&period=".concat(this.period,"&")+"date=".concat(this.date,"&idSite=").concat(this.idSite)}}});xe.render=Ne;var Ge=xe; /*! * Matomo - free/libre analytics platform * |