PDF rausgenommen

This commit is contained in:
aschwarz
2023-01-23 11:03:31 +01:00
parent 82d562a322
commit a6523903eb
28078 changed files with 4247552 additions and 2 deletions

View File

@@ -0,0 +1,22 @@
/*!
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
(function () {
angular.module('piwikApp').controller('ManageCustomVarsController', ManageCustomVarsController);
ManageCustomVarsController.$inject = ['manageCustomVarsModel', 'piwik', '$filter'];
function ManageCustomVarsController(manageCustomVarsModel, piwik, $filter) {
manageCustomVarsModel.fetchUsages();
this.model = manageCustomVarsModel;
this.siteName = piwik.siteName;
this.scopes = [
{value: 'visit', name: _pk_translate('General_TrackingScopeVisit')},
{value: 'page', name: _pk_translate('General_TrackingScopePage')}
];
}
})();

View File

@@ -0,0 +1,63 @@
<div class="manageCustomVars">
<div piwik-content-intro>
<h2 piwik-enriched-headline
help-url="https://matomo.org/docs/custom-variables/">
{{ 'CustomVariables_CustomVariables'|translate }}
</h2>
<p>
<span ng-bind-html="'CustomVariables_ManageDescription'|translate:manageCustomVars.siteName"></span>
</p>
</div>
<div class="alert alert-info" ng-show="!manageCustomVars.model.isLoading && manageCustomVars.model.hasCustomVariablesInGeneral && !manageCustomVars.model.hasAtLeastOneUsage">
{{ 'CustomVariables_SlotsReportIsGeneratedOverTime'|translate }}
</div>
<div ng-repeat="scope in manageCustomVars.scopes">
<div piwik-content-block content-title="{{ 'CustomVariables_ScopeX'|translate:(scope.name) }}">
<table piwik-content-table>
<thead>
<tr>
<th>{{'CustomVariables_Index'|translate }}</th>
<th>{{'CustomVariables_Usages'|translate }}</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="3" ng-show="manageCustomVars.model.isLoading">{{ 'General_Loading'|translate }}</td>
</tr>
<tr ng-repeat="customVariables in manageCustomVars.model.customVariables|filter:{scope: scope.value}">
<td class="index">{{ customVariables.index }}</td>
<td>
<span ng-show="(customVariables.usages|length) === 0"
class="unused">{{'CustomVariables_Unused'|translate }}</span>
<span ng-show="customVariables.usages|length" ng-repeat="cvar in customVariables.usages|orderBy:'-nb_actions'">
<span title="{{ 'CustomVariables_UsageDetails'|translate:(cvar.nb_visits ? cvar.nb_visits : 0):(cvar.nb_actions ? cvar.nb_actions : 0) }}">{{ cvar.name }}</span><span ng-show="!$last">, </span>
</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div ng-show="!manageCustomVars.model.isLoading"
piwik-content-block
id="CustomVariablesCreateNewSlot"
content-title="{{ 'CustomVariables_CreateNewSlot'|translate }}">
<p ng-show="!manageCustomVars.model.isLoading">
{{ 'CustomVariables_CreatingCustomVariableTakesTime'|translate }}
<br /><br />
<span ng-bind-html="'CustomVariables_CurrentAvailableCustomVariables'|translate:('<strong>'+manageCustomVars.model.numSlotsAvailable+'</strong>')"></span>
<br />
<br />
{{ 'CustomVariables_ToCreateCustomVarExecute'|translate }}
<br />
<pre piwik-select-on-focus><code>./console customvariables:set-max-custom-variables {{ manageCustomVars.model.numSlotsAvailable + 1 }}</code></pre>
</p>
</div>
</div>

View File

@@ -0,0 +1,26 @@
/*!
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
/**
* Usage:
* <div piwik-manage-custom-vars>
*/
(function () {
angular.module('piwikApp').directive('piwikManageCustomVars', piwikManageCustomVars);
piwikManageCustomVars.$inject = ['piwik'];
function piwikManageCustomVars(piwik){
return {
restrict: 'A',
scope: {},
templateUrl: 'plugins/CustomVariables/angularjs/manage-custom-vars/manage-custom-vars.directive.html?cb=' + piwik.cacheBuster,
controller: 'ManageCustomVarsController',
controllerAs: 'manageCustomVars'
};
}
})();

View File

@@ -0,0 +1,18 @@
.manageCustomVars {
.unused {
color: @color-silver;
}
table, p {
width: 900px;
}
.alert-info {
margin-top: 15px;
}
.scope, .index {
width: 90px;
max-width: 90px;
}
}

View File

@@ -0,0 +1,59 @@
/*!
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
(function () {
angular.module('piwikApp').factory('manageCustomVarsModel', manageCustomVarsModel);
manageCustomVarsModel.$inject = ['piwikApi'];
function manageCustomVarsModel(piwikApi) {
var model = {
customVariables : [],
extractions : [],
isLoading: false,
fetchUsages: fetchUsages,
hasCustomVariablesInGeneral: false,
hasAtLeastOneUsage: false,
numSlotsAvailable: 5,
};
return model;
function fetchCustomVariables() {
return piwikApi.fetch({method: 'CustomVariables.getCustomVariables', period: 'year', date: 'today', filter_limit: 1})
.then(function (customVariables) {
model.hasCustomVariablesInGeneral = (customVariables && customVariables.length > 0);
});
}
function fetchUsages() {
model.isLoading = true;
fetchCustomVariables().then(function () {
return piwikApi.fetch({method: 'CustomVariables.getUsagesOfSlots', filter_limit: '-1'});
}).then(function (customVariables) {
model.customVariables = customVariables;
angular.forEach(customVariables, function (customVar) {
if (customVar.index > model.numSlotsAvailable) {
model.numSlotsAvailable = customVar.index;
}
if (customVar.usages && customVar.usages.length > 0) {
model.hasAtLeastOneUsage = true;
}
});
})['finally'](function () { // .finally() is not IE8 compatible see https://github.com/angular/angular.js/commit/f078762d48d0d5d9796dcdf2cb0241198677582c
model.isLoading = false;
});
}
}
})();