Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordizzy <diosmosis@users.noreply.github.com>2022-02-07 14:32:15 +0300
committerGitHub <noreply@github.com>2022-02-07 14:32:15 +0300
commit80a47f8d658d20e5db41b22fc82c4931911b35dd (patch)
treec1e1ffb6fd8f596f1d8b886ab4da40ab8191050a /plugins/SitesManager
parentfe01191727b60903c296299cc000c223f2a1f416 (diff)
[Vue] migrate sitesmanager controller and twig templates to Vue components (#18564)
* fix error when enrichedheadline is used in modal * add polyfill min.js * remove two todos * fix widget url logic * update some screenshots and fix sanitization/escape issue * update screenshots * rebuild vue * fix url location updating regression in MatomoUrl.updateLocation use * submodule * update screenshots and fix possible error in json parse * built vue files * Merge branch 'vue-period-selector-regression' into vue-reporting-menu * rebuild vue * use correct variable * rebuild vue * fix widget url logic * segment parameter can be undefined now for some reason * fix ngmodel binding in siteselector adapter (for last time hopefully) * the original site selector only set the first site to the first site in the initial sites query if there was only one site in the entire matomo instance * fix sitesmanager ui test failure * fix usersettings test failure * rebuild vue * more siteselector tweaks. * build CoreHome * more siteselector tweaks. * another siteselector issue * update screenshots * update screenshot and try to fix random failure * fix some issues in widget.vue when containerid is specified * fix couple tests * fix several test failures * fix string concat * fix test failure * extra change * fix last change and random failure * styling fix * fix last fix * real fix this time * fix stray request * proper fix * update build files * try to fix random failure * do not submit form * check for api errors in promise chain in ajaxhelper.ts * force a digest after a location change * use proper abortcontroller method instead of promise hack, have to add new polyfill + try to fix random test failure * some UI test fixes * fix some report export issues * several save button fixes + make replace approximation in createAngularJsAdapter better * fix sparkline * apply after manual click triggering in savebutton * css fixes and piwik-content-table was never applied by angularjs in installtion * rebuild vue * add names to divs so they can still be queried as they were in angularjs * rebuild vue * rebuild vue * now that format_metrics checkbox works, need to check it * small delay before processing first popover * fix dropdown class/directive name * fix overlay test * remove unintended changes * remove unintended changes * migrate archiving controller * do not do a passthrough transpile of vue typescript, and fix many typescript errors in existing code * more typescript fixes * even more fixes * workarounds to fix recursive typing issues * get corehome to build w/ full typescript build and output type definitions to local dir * get outputted typings to be used when compiling other plugins and fix typescript issues in CorePluginsAdmin * readd corehome umd * fix typescript errors in ExampleVue plugin * fix feedback typescript errors * rebuild * migrate branding controller and get to build * fix issues and get to work * rebuild * fix notification scroll * migrate smtp settings controller in coreadminhome * get to work * migrate js tracking code generator and get to build * migrate image tracking code generator and get to build * get to work in UI * get UI tests to pass locally * forgot to add files + rebuild vue * update screenshots * Show a summary of new features (#18065) * Added "What is new" notification display, populated by a new event * Removed test example event hook * Added support for applying a link attribute to menu items, fixes layout issue for mobile with html menu items * Updated UI test screenshots * Revert accidental edit * Hide the "What's new" icon if there are no new features to show * Changed to use changes.json, track user last viewed, added ui test * Fix UserManager unit tests broken by new ts_changes_viewed user field * Moved getChanges to separate helper class, added unit test, added user view access check * Updated to add new changes table and populate only on plugin update/install * Added missing fixture class, updated UI screenshots * Updated matomo font to add ringing bell and new releases icons * Fix for integration test * Reworked class structure, removed unnecessary angular directive, merged templates, other tidy ups * built vue files * built vue files * Added null user check, missing table exception handling, show plugin name in change title, better handling of missing change fields * Added sample changes file, moved UserChanges db code to changes model, added return type hints, better db error code handling, various other improvements * Revert accidental UI screenshot commit * Fix for incorrect link name parameter in sample changes, switched back to using $db->query for INSERT IGNORE * Integration test fix, UI screenshot updates * Test fix * Added link styling, show CoreHome changes without plugin prefix in title * Update UI test screenshot * Added styles to the popover, added event for filtering changes * Test fix * UI test screenshot updates Co-authored-by: sgiehl <stefan@matomo.org> Co-authored-by: bx80 <bx80@users.noreply.github.com> * Update test translation (#18531) update a test failed XML * updates all submodules (#18541) Co-authored-by: diosmosis <diosmosis@users.noreply.github.com> * Translations update from Hosted Weblate (#18529) * Translated using Weblate (Greek) Currently translated at 100.0% (162 of 162 strings) Translation: Matomo/Plugin CoreAdminHome Translate-URL: https://hosted.weblate.org/projects/matomo/plugin-coreadminhome/el/ [ci skip] Co-authored-by: Hosted Weblate <hosted@weblate.org> Co-authored-by: Vasilis Lourdas <dev@lourdas.eu> * Translated using Weblate (Chinese (Simplified)) Currently translated at 83.9% (136 of 162 strings) Translation: Matomo/Plugin CoreAdminHome Translate-URL: https://hosted.weblate.org/projects/matomo/plugin-coreadminhome/zh_Hans/ [ci skip] Translated using Weblate (Chinese (Simplified)) Currently translated at 99.6% (620 of 622 strings) Translation: Matomo/Matomo Base Translate-URL: https://hosted.weblate.org/projects/matomo/matomo-base/zh_Hans/ [ci skip] Co-authored-by: Hosted Weblate <hosted@weblate.org> Co-authored-by: 刘韬 <lyuutau@outlook.com> * Update translation files Updated by "Squash Git commits" hook in Weblate. Translation: Matomo/Plugin CoreAdminHome Translate-URL: https://hosted.weblate.org/projects/matomo/plugin-coreadminhome/ [ci skip] Co-authored-by: Vasilis Lourdas <dev@lourdas.eu> Co-authored-by: 刘韬 <lyuutau@outlook.com> * [Vue] migrate report export directive and popover (#18440) * update files * sidenav start * make getRef a utility method * tweak * add return type * finish converting side-nav directive * starting on reporting menu conversion * remove unused properties * convert reporting pages service * migrate report metadata store * remove angularjs files * migrating reporting pages store * make store adapters more immutable * get service adapters to work * fix a UI test * another html fix * migrate most of reporting menu directive and model * Use themed font family for input forms to override materialize.css styling * rebuild vue * add a missing div * ui test fixes * update styling * get to build * get to load in the UI w/o error * clone result of functions * fix compile issue * migrate widget loader and get to load in UI * rebuild vue * migrate widgetcontainer * migrate widget bydimension container * migrate widget + add tooltips directive * quick fix * Updating version to 4.6.0 * loading in page * update expected screenshot * add wait just in case travis is slow * fix ordering bug * add another wait * rebuild vue * css tweak * fix some bugs and tests * undo screenshot changes * Menus test passing locally * [Vue] date picker viewDate property is not kept up to date (#18385) * viewDate ref is not kept up to date * rebuild corehome * reporting menu subcategory items are meant to be normal links * update some screenshots * use innerText instead of text() since angularjs maintains newlines in HTML that vue does not add * trigger angularjs digest after ajaxhelper request * rebuild vue * update screenshots, fix bug in link generation in reporting menu and allow syncing multiple screenshot regexes at a time * undo box-shadow change for UI tests * fix more issues & update more tests * update some screenshots * fix some tests * rebuild CoreHome * quick fix * built vue files * fix angularjs issue * add comment * update umd files * 4.6.1-rc1 * 4.6.1 * fix field array title * apply some pr feedback * apply more pr feedback * another fix * tweak * fix ng-change not executed before ng-model * fix another set of issues * fix another issue * rebuild vue * better ng-change/ng-model fix * update some screenshots * rebuild vue * remove some TODOs * initiate initial ng-change ONLY for site selectors where this behavior applies * emit/broadcast on correct scope in wrapper * rebuild vue * fix some issues * couple more fixes * fix another title issue * rebuild vue * do not report on ajax errors in notifications if not logged in * migrate reporting page and model * rebuild vue * create sites selector model adapter * fix siteselector vue bug, initial site is only set if there is just one site available * rebuild vue * migrate plugin settings directive * remove TODO * migrate plugin filter directive * migrate two more plugins directives * migrate save button * fix a bunch of bugs * fix another widget bug * allow change event name between angularjs and vue * rebuild vue * migrate plugin form directive * get to work * migrate select-on-focus directive and start migrating report-export directive * finish migrating report export directive & popover component + create reusable function to create vue app and add globals to it * rebuild vue * remove angularjs files and move less contents to vue dir * built vue files * fix function signature * fix vue warning * fix ajax request race condition * rebuild vue * add new notification type "help" so the help notification is not cleared when clearing transient notifications * fix some bugs and tests * update screenshot * update screenshot & fix a test * allow using unminified jquery ui + fix bug in last fix * fix error when enrichedheadline is used in modal * add polyfill min.js * remove two todos * fix widget url logic * update some screenshots and fix sanitization/escape issue * update screenshots * rebuild vue * fix url location updating regression in MatomoUrl.updateLocation use * submodule * update screenshots and fix possible error in json parse * built vue files * Merge branch 'vue-period-selector-regression' into vue-reporting-menu * rebuild vue * use correct variable * rebuild vue * fix widget url logic * segment parameter can be undefined now for some reason * fix ngmodel binding in siteselector adapter (for last time hopefully) * the original site selector only set the first site to the first site in the initial sites query if there was only one site in the entire matomo instance * fix sitesmanager ui test failure * fix usersettings test failure * rebuild vue * more siteselector tweaks. * build CoreHome * more siteselector tweaks. * another siteselector issue * update screenshots * update screenshot and try to fix random failure * fix some issues in widget.vue when containerid is specified * fix couple tests * fix several test failures * fix string concat * fix test failure * extra change * fix last change and random failure * styling fix * fix last fix * real fix this time * fix stray request * proper fix * update build files * try to fix random failure * do not submit form * check for api errors in promise chain in ajaxhelper.ts * force a digest after a location change * use proper abortcontroller method instead of promise hack, have to add new polyfill + try to fix random test failure * some UI test fixes * fix some report export issues * several save button fixes + make replace approximation in createAngularJsAdapter better * apply after manual click triggering in savebutton * add names to divs so they can still be queried as they were in angularjs * rebuild vue * now that format_metrics checkbox works, need to check it * fix unintended changes * updated expected screenshots * update two more * go back to previous format_metrics behavior in popover Co-authored-by: Justin Velluppillai <justin@innocraft.com> Co-authored-by: justinvelluppillai <justinvelluppillai@users.noreply.github.com> Co-authored-by: Matthieu Aubry <mattab@users.noreply.github.com> * [Vue] remove support in vue for FormField.allSettings (#18542) * deprecate support in vue for FormField.allSettings since deep watching the property doesnt quite work * built vue files * update screenshots * update screenshot * Show a summary of new features (#18065) * Added "What is new" notification display, populated by a new event * Removed test example event hook * Added support for applying a link attribute to menu items, fixes layout issue for mobile with html menu items * Updated UI test screenshots * Revert accidental edit * Hide the "What's new" icon if there are no new features to show * Changed to use changes.json, track user last viewed, added ui test * Fix UserManager unit tests broken by new ts_changes_viewed user field * Moved getChanges to separate helper class, added unit test, added user view access check * Updated to add new changes table and populate only on plugin update/install * Added missing fixture class, updated UI screenshots * Updated matomo font to add ringing bell and new releases icons * Fix for integration test * Reworked class structure, removed unnecessary angular directive, merged templates, other tidy ups * built vue files * built vue files * Added null user check, missing table exception handling, show plugin name in change title, better handling of missing change fields * Added sample changes file, moved UserChanges db code to changes model, added return type hints, better db error code handling, various other improvements * Revert accidental UI screenshot commit * Fix for incorrect link name parameter in sample changes, switched back to using $db->query for INSERT IGNORE * Integration test fix, UI screenshot updates * Test fix * Added link styling, show CoreHome changes without plugin prefix in title * Update UI test screenshot * Added styles to the popover, added event for filtering changes * Test fix * UI test screenshot updates Co-authored-by: sgiehl <stefan@matomo.org> Co-authored-by: bx80 <bx80@users.noreply.github.com> * Update test translation (#18531) update a test failed XML * updates all submodules (#18541) Co-authored-by: diosmosis <diosmosis@users.noreply.github.com> * Translations update from Hosted Weblate (#18529) * Translated using Weblate (Greek) Currently translated at 100.0% (162 of 162 strings) Translation: Matomo/Plugin CoreAdminHome Translate-URL: https://hosted.weblate.org/projects/matomo/plugin-coreadminhome/el/ [ci skip] Co-authored-by: Hosted Weblate <hosted@weblate.org> Co-authored-by: Vasilis Lourdas <dev@lourdas.eu> * Translated using Weblate (Chinese (Simplified)) Currently translated at 83.9% (136 of 162 strings) Translation: Matomo/Plugin CoreAdminHome Translate-URL: https://hosted.weblate.org/projects/matomo/plugin-coreadminhome/zh_Hans/ [ci skip] Translated using Weblate (Chinese (Simplified)) Currently translated at 99.6% (620 of 622 strings) Translation: Matomo/Matomo Base Translate-URL: https://hosted.weblate.org/projects/matomo/matomo-base/zh_Hans/ [ci skip] Co-authored-by: Hosted Weblate <hosted@weblate.org> Co-authored-by: 刘韬 <lyuutau@outlook.com> * Update translation files Updated by "Squash Git commits" hook in Weblate. Translation: Matomo/Plugin CoreAdminHome Translate-URL: https://hosted.weblate.org/projects/matomo/plugin-coreadminhome/ [ci skip] Co-authored-by: Vasilis Lourdas <dev@lourdas.eu> Co-authored-by: 刘韬 <lyuutau@outlook.com> * [Vue] migrate report export directive and popover (#18440) * update files * sidenav start * make getRef a utility method * tweak * add return type * finish converting side-nav directive * starting on reporting menu conversion * remove unused properties * convert reporting pages service * migrate report metadata store * remove angularjs files * migrating reporting pages store * make store adapters more immutable * get service adapters to work * fix a UI test * another html fix * migrate most of reporting menu directive and model * Use themed font family for input forms to override materialize.css styling * rebuild vue * add a missing div * ui test fixes * update styling * get to build * get to load in the UI w/o error * clone result of functions * fix compile issue * migrate widget loader and get to load in UI * rebuild vue * migrate widgetcontainer * migrate widget bydimension container * migrate widget + add tooltips directive * quick fix * Updating version to 4.6.0 * loading in page * update expected screenshot * add wait just in case travis is slow * fix ordering bug * add another wait * rebuild vue * css tweak * fix some bugs and tests * undo screenshot changes * Menus test passing locally * [Vue] date picker viewDate property is not kept up to date (#18385) * viewDate ref is not kept up to date * rebuild corehome * reporting menu subcategory items are meant to be normal links * update some screenshots * use innerText instead of text() since angularjs maintains newlines in HTML that vue does not add * trigger angularjs digest after ajaxhelper request * rebuild vue * update screenshots, fix bug in link generation in reporting menu and allow syncing multiple screenshot regexes at a time * undo box-shadow change for UI tests * fix more issues & update more tests * update some screenshots * fix some tests * rebuild CoreHome * quick fix * built vue files * fix angularjs issue * add comment * update umd files * 4.6.1-rc1 * 4.6.1 * fix field array title * apply some pr feedback * apply more pr feedback * another fix * tweak * fix ng-change not executed before ng-model * fix another set of issues * fix another issue * rebuild vue * better ng-change/ng-model fix * update some screenshots * rebuild vue * remove some TODOs * initiate initial ng-change ONLY for site selectors where this behavior applies * emit/broadcast on correct scope in wrapper * rebuild vue * fix some issues * couple more fixes * fix another title issue * rebuild vue * do not report on ajax errors in notifications if not logged in * migrate reporting page and model * rebuild vue * create sites selector model adapter * fix siteselector vue bug, initial site is only set if there is just one site available * rebuild vue * migrate plugin settings directive * remove TODO * migrate plugin filter directive * migrate two more plugins directives * migrate save button * fix a bunch of bugs * fix another widget bug * allow change event name between angularjs and vue * rebuild vue * migrate plugin form directive * get to work * migrate select-on-focus directive and start migrating report-export directive * finish migrating report export directive & popover component + create reusable function to create vue app and add globals to it * rebuild vue * remove angularjs files and move less contents to vue dir * built vue files * fix function signature * fix vue warning * fix ajax request race condition * rebuild vue * add new notification type "help" so the help notification is not cleared when clearing transient notifications * fix some bugs and tests * update screenshot * update screenshot & fix a test * allow using unminified jquery ui + fix bug in last fix * fix error when enrichedheadline is used in modal * add polyfill min.js * remove two todos * fix widget url logic * update some screenshots and fix sanitization/escape issue * update screenshots * rebuild vue * fix url location updating regression in MatomoUrl.updateLocation use * submodule * update screenshots and fix possible error in json parse * built vue files * Merge branch 'vue-period-selector-regression' into vue-reporting-menu * rebuild vue * use correct variable * rebuild vue * fix widget url logic * segment parameter can be undefined now for some reason * fix ngmodel binding in siteselector adapter (for last time hopefully) * the original site selector only set the first site to the first site in the initial sites query if there was only one site in the entire matomo instance * fix sitesmanager ui test failure * fix usersettings test failure * rebuild vue * more siteselector tweaks. * build CoreHome * more siteselector tweaks. * another siteselector issue * update screenshots * update screenshot and try to fix random failure * fix some issues in widget.vue when containerid is specified * fix couple tests * fix several test failures * fix string concat * fix test failure * extra change * fix last change and random failure * styling fix * fix last fix * real fix this time * fix stray request * proper fix * update build files * try to fix random failure * do not submit form * check for api errors in promise chain in ajaxhelper.ts * force a digest after a location change * use proper abortcontroller method instead of promise hack, have to add new polyfill + try to fix random test failure * some UI test fixes * fix some report export issues * several save button fixes + make replace approximation in createAngularJsAdapter better * apply after manual click triggering in savebutton * add names to divs so they can still be queried as they were in angularjs * rebuild vue * now that format_metrics checkbox works, need to check it * fix unintended changes * updated expected screenshots * update two more * go back to previous format_metrics behavior in popover Co-authored-by: Justin Velluppillai <justin@innocraft.com> Co-authored-by: justinvelluppillai <justinvelluppillai@users.noreply.github.com> Co-authored-by: Matthieu Aubry <mattab@users.noreply.github.com> * [Vue] remove support in vue for FormField.allSettings (#18542) * deprecate support in vue for FormField.allSettings since deep watching the property doesnt quite work * built vue files * update screenshots * update screenshot * fix tests * rebuild * rebuild * order plugins by dependencies in vue:build and fix warning in corehome build * built vue files * built vue files * remove unused imports * built vue files * remove multilinefield component, fieldtextareaarray does the same thing * edit-trigger is not used anywhere * migrate sitetypes model to store * do not load nonexistant files * remove reference nonexistant files * start converting sitefields component * more work on sitefields component * undo submodule change * rebuild * get sitesmanager to build * get SiteFields component to work in UI * datepicker does not format times * export other stores * fix some typing issues and rebuild * start on site management conversion * add more comma delimited props to list + remove controller JS * rebuild * convert sites manager controller to sitesmanagement component * remove TODOs * finish migrating sitesmanager * remove some TODO * get to build * fixes from testing * rebuild * rebuild and fix issue w/ globalsettings hash detection * fix bug and rebuild * fix bug and rebuild * fix issue * fix issues and rebuild * fix ui test * fix UI test failure * fixing some issues * complete fixes * fix some more issues * fix ui test failures * another fix * several more fixes * fix delete dialog * more fixes * more fixes * fix another ui test + update other UI tests * fixing edisiteid handling * fix UI tests somre more * in groupedsetting handle templateFile property for angularjs BC * rebuild vue * fix view tracking code link * Update screenshot. * update screenshot Co-authored-by: Ben Burgess <88810029+bx80@users.noreply.github.com> Co-authored-by: sgiehl <stefan@matomo.org> Co-authored-by: bx80 <bx80@users.noreply.github.com> Co-authored-by: Peter Zhang <peter@innocraft.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Weblate (bot) <hosted@weblate.org> Co-authored-by: Vasilis Lourdas <dev@lourdas.eu> Co-authored-by: 刘韬 <lyuutau@outlook.com> Co-authored-by: Justin Velluppillai <justin@innocraft.com> Co-authored-by: justinvelluppillai <justinvelluppillai@users.noreply.github.com> Co-authored-by: Matthieu Aubry <mattab@users.noreply.github.com>
Diffstat (limited to 'plugins/SitesManager')
-rw-r--r--plugins/SitesManager/SitesManager.php13
-rw-r--r--plugins/SitesManager/angularjs/sites-manager/api-core.service.js29
-rw-r--r--plugins/SitesManager/angularjs/sites-manager/api-helper.service.js74
-rw-r--r--plugins/SitesManager/angularjs/sites-manager/api-site.service.js44
-rw-r--r--plugins/SitesManager/angularjs/sites-manager/sites-manager-admin-sites-model.js115
-rw-r--r--plugins/SitesManager/angularjs/sites-manager/sites-manager.controller.js271
-rw-r--r--plugins/SitesManager/templates/global-settings.html96
-rw-r--r--plugins/SitesManager/templates/globalSettings.twig2
-rw-r--r--plugins/SitesManager/templates/help/excluded-ip-help.html7
-rw-r--r--plugins/SitesManager/templates/help/excluded-query-parameters-help.html7
-rw-r--r--plugins/SitesManager/templates/help/excluded-user-agents-help.html8
-rw-r--r--plugins/SitesManager/templates/help/timezone-help.html10
-rw-r--r--plugins/SitesManager/templates/index.html8
-rw-r--r--plugins/SitesManager/templates/index.twig2
-rw-r--r--plugins/SitesManager/templates/loading.html6
-rw-r--r--plugins/SitesManager/templates/sites-list/add-entity-dialog.html18
-rw-r--r--plugins/SitesManager/templates/sites-list/add-site-link.html33
-rw-r--r--plugins/SitesManager/templates/sites-list/site-search-field.html64
-rw-r--r--plugins/SitesManager/templates/sites-list/sites-list.html15
-rw-r--r--plugins/SitesManager/templates/sites-manager-header.html20
-rw-r--r--plugins/SitesManager/tests/UI/SitesManager_spec.js1
-rw-r--r--plugins/SitesManager/tests/UI/expected-screenshots/SitesManager_search.png4
-rw-r--r--plugins/SitesManager/tests/UI/expected-screenshots/SitesManager_site_edit_url.png4
-rw-r--r--plugins/SitesManager/vue/dist/SitesManager.umd.js1189
-rw-r--r--plugins/SitesManager/vue/dist/SitesManager.umd.min.js24
-rw-r--r--plugins/SitesManager/vue/src/CurrencyStore/CurrencyStore.ts9
-rw-r--r--plugins/SitesManager/vue/src/GlobalSettingsStore/GlobalSettings.ts19
-rw-r--r--plugins/SitesManager/vue/src/GlobalSettingsStore/GlobalSettingsStore.ts94
-rw-r--r--plugins/SitesManager/vue/src/ManageGlobalSettings/ManageGlobalSettings.adapter.ts15
-rw-r--r--plugins/SitesManager/vue/src/ManageGlobalSettings/ManageGlobalSettings.vue352
-rw-r--r--plugins/SitesManager/vue/src/SiteFields/SiteFields.adapter.ts98
-rw-r--r--plugins/SitesManager/vue/src/SiteFields/SiteFields.vue22
-rw-r--r--plugins/SitesManager/vue/src/SiteTypesStore/SiteTypesStore.ts23
-rw-r--r--plugins/SitesManager/vue/src/SitesManagement/ButtonBar.vue167
-rw-r--r--plugins/SitesManager/vue/src/SitesManagement/SitesManagement.adapter.ts15
-rw-r--r--plugins/SitesManager/vue/src/SitesManagement/SitesManagement.vue453
-rw-r--r--plugins/SitesManager/vue/src/TimezoneStore/TimezoneStore.ts36
-rw-r--r--plugins/SitesManager/vue/src/index.ts6
38 files changed, 2344 insertions, 1029 deletions
diff --git a/plugins/SitesManager/SitesManager.php b/plugins/SitesManager/SitesManager.php
index ba575ae21b..cb1680c6da 100644
--- a/plugins/SitesManager/SitesManager.php
+++ b/plugins/SitesManager/SitesManager.php
@@ -48,7 +48,6 @@ class SitesManager extends \Piwik\Plugin
public function registerEvents()
{
return array(
- 'AssetManager.getJavaScriptFiles' => 'getJsFiles',
'AssetManager.getStylesheetFiles' => 'getStylesheetFiles',
'Tracker.Cache.getSiteAttributes' => array('function' => 'recordWebsiteDataInCache', 'before' => true),
'Tracker.setTrackerCacheGeneral' => 'setTrackerCacheGeneral',
@@ -163,18 +162,6 @@ class SitesManager extends \Piwik\Plugin
}
/**
- * Get JavaScript files
- */
- public function getJsFiles(&$jsFiles)
- {
- $jsFiles[] = "plugins/SitesManager/angularjs/sites-manager/api-helper.service.js";
- $jsFiles[] = "plugins/SitesManager/angularjs/sites-manager/api-site.service.js";
- $jsFiles[] = "plugins/SitesManager/angularjs/sites-manager/api-core.service.js";
- $jsFiles[] = "plugins/SitesManager/angularjs/sites-manager/sites-manager-admin-sites-model.js";
- $jsFiles[] = "plugins/SitesManager/angularjs/sites-manager/sites-manager.controller.js";
- }
-
- /**
* Hooks when a website tracker cache is flushed (website updated, cache deleted, or empty cache)
* Will record in the tracker config file all data needed for this website in Tracker.
*
diff --git a/plugins/SitesManager/angularjs/sites-manager/api-core.service.js b/plugins/SitesManager/angularjs/sites-manager/api-core.service.js
deleted file mode 100644
index 021f2731cf..0000000000
--- a/plugins/SitesManager/angularjs/sites-manager/api-core.service.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/*!
- * Matomo - free/libre analytics platform
- *
- * @link https://matomo.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-(function () {
- // can probably be shared
- angular.module('piwikApp').factory('coreAPI', CoreAPIFactory);
-
- CoreAPIFactory.$inject = ['sitesManagerApiHelper'];
-
- function CoreAPIFactory(api) {
-
- return {
- getIpFromHeader: getIpFromHeader(),
- isPluginActivated: isPluginActivated()
- };
-
- function getIpFromHeader() {
- return api.fetchApi('API.getIpFromHeader', api.valueAdaptor);
- }
-
- function isPluginActivated() {
- return api.fetchApi('API.isPluginActivated', api.valueAdaptor);
- }
- }
-
-})();
diff --git a/plugins/SitesManager/angularjs/sites-manager/api-helper.service.js b/plugins/SitesManager/angularjs/sites-manager/api-helper.service.js
deleted file mode 100644
index 3b37d04655..0000000000
--- a/plugins/SitesManager/angularjs/sites-manager/api-helper.service.js
+++ /dev/null
@@ -1,74 +0,0 @@
-/*!
- * Matomo - free/libre analytics platform
- *
- * @link https://matomo.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-(function () {
- // can probably be renamed and shared
- angular.module('piwikApp').factory('sitesManagerApiHelper', SitesManagerAPIHelperFactory);
-
- SitesManagerAPIHelperFactory.$inject = ['piwikApi'];
-
- function SitesManagerAPIHelperFactory(piwikApi) {
-
- return {
- fetch: fetch,
- commaDelimitedFieldToArray: commaDelimitedFieldToArray,
- fetchApi: fetchApi,
- fetchAction: fetchAction,
- singleObjectAdaptor: singleObjectAdaptor,
- valueAdaptor: valueAdaptor,
- noop: noop
- };
-
- function fetch (endpoint, jsonResponseAdaptor, params) {
-
- return function (clientHandover, additionalParams) {
-
- params = angular.extend(params || {}, additionalParams || {});
-
- var requestDefinition = angular.extend(endpoint, params);
-
- var responseHandler = function (response) {
-
- response = jsonResponseAdaptor(response);
-
- clientHandover(response);
- };
-
- piwikApi.fetch(requestDefinition).then(responseHandler);
- };
- }
-
- function commaDelimitedFieldToArray (value) {
-
- if(!value)
- return [];
-
- return value.split(',');
- }
-
- function fetchApi(apiMethod, jsonResponseAdaptor, params) {
-
- return fetch({method: apiMethod}, jsonResponseAdaptor, params);
- }
-
- function fetchAction(module, action, jsonResponseAdaptor, params) {
-
- return fetch({module: module, action: action}, jsonResponseAdaptor, params);
- }
-
- function singleObjectAdaptor(response) {
- return response[0];
- }
-
- function valueAdaptor(response) {
- return response.value;
- }
-
- function noop(response) {
- return response;
- }
- }
-})();
diff --git a/plugins/SitesManager/angularjs/sites-manager/api-site.service.js b/plugins/SitesManager/angularjs/sites-manager/api-site.service.js
deleted file mode 100644
index 21c007f32d..0000000000
--- a/plugins/SitesManager/angularjs/sites-manager/api-site.service.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/*!
- * Matomo - free/libre analytics platform
- *
- * @link https://matomo.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-(function () {
- angular.module('piwikApp').factory('sitesManagerAPI', SitesManagerAPIFactory);
-
- SitesManagerAPIFactory.$inject = ['sitesManagerApiHelper'];
-
- function SitesManagerAPIFactory(api) {
-
- return {
- getCurrencyList: getCurrencyList(),
- getTimezonesList: getTimezonesList(),
- isTimezoneSupportEnabled: isTimezoneSupportEnabled(),
- getGlobalSettings: getGlobalSettings(),
- getSitesIdWithAdminAccess: getSitesIdWithAdminAccess()
- };
-
- function getSitesIdWithAdminAccess () {
- return api.fetchApi('SitesManager.getSitesIdWithAdminAccess', api.noop, {
- filter_limit: '-1',
- });
- }
- function getCurrencyList () {
- return api.fetchApi('SitesManager.getCurrencyList', api.noop);
- }
-
- function getTimezonesList () {
- return api.fetchApi('SitesManager.getTimezonesList', api.noop);
- }
-
- function isTimezoneSupportEnabled () {
- return api.fetchApi('SitesManager.isTimezoneSupportEnabled', api.valueAdaptor);
- }
-
- function getGlobalSettings () {
- return api.fetchAction('SitesManager', 'getGlobalSettings', api.noop);
- }
- }
-
-})();
diff --git a/plugins/SitesManager/angularjs/sites-manager/sites-manager-admin-sites-model.js b/plugins/SitesManager/angularjs/sites-manager/sites-manager-admin-sites-model.js
deleted file mode 100644
index ce2c4aa24f..0000000000
--- a/plugins/SitesManager/angularjs/sites-manager/sites-manager-admin-sites-model.js
+++ /dev/null
@@ -1,115 +0,0 @@
-/**
- * Model for Sites Manager. Fetches only sites one has at least Admin permission.
- */
-(function () {
- angular.module('piwikApp').factory('sitesManagerAdminSitesModel', sitesManagerAdminSitesModel);
-
- sitesManagerAdminSitesModel.$inject = ['piwikApi'];
-
- function sitesManagerAdminSitesModel(piwikApi)
- {
- var model = {
- sites : [],
- searchTerm : '',
- isLoading : false,
- pageSize : 10,
- currentPage : 0,
- offsetStart : 0,
- offsetEnd : 10,
- hasPrev : false,
- hasNext : false,
- previousPage: previousPage,
- nextPage: nextPage,
- searchSite: searchSite,
- fetchLimitedSitesWithAdminAccess: fetchLimitedSitesWithAdminAccess
- };
-
- return model;
-
- function onError ()
- {
- setSites([]);
- }
-
- function setSites(sites)
- {
- model.sites = sites;
-
- var numSites = sites.length;
- model.offsetStart = model.currentPage * model.pageSize + 1;
- model.offsetEnd = model.offsetStart + numSites - 1;
- model.hasPrev = model.currentPage >= 1;
- model.hasNext = numSites === model.pageSize;
- }
-
- function setCurrentPage(page)
- {
- if (page < 0) {
- page = 0;
- }
-
- model.currentPage = page;
- }
-
- function previousPage()
- {
- setCurrentPage(model.currentPage - 1);
- fetchLimitedSitesWithAdminAccess();
- }
-
- function nextPage()
- {
- setCurrentPage(model.currentPage + 1);
- fetchLimitedSitesWithAdminAccess();
- }
-
- function searchSite (term)
- {
- model.searchTerm = term;
- setCurrentPage(0);
- fetchLimitedSitesWithAdminAccess();
- }
-
- function fetchLimitedSitesWithAdminAccess(callback)
- {
- if (model.isLoading) {
- piwikApi.abort();
- }
-
- model.isLoading = true;
-
- var limit = model.pageSize;
- var offset = model.currentPage * model.pageSize;
-
- var params = {
- method: 'SitesManager.getSitesWithAdminAccess',
- fetchAliasUrls: true,
- limit: limit + offset, // this is applied in SitesManager.getSitesWithAdminAccess API
- filter_offset: offset, // filter_offset and filter_limit is applied in response builder
- filter_limit: limit
- };
-
- if (model.searchTerm) {
- params.pattern = model.searchTerm;
- }
-
- return piwikApi.fetch(params).then(function (sites) {
-
- if (!sites) {
- onError();
- return;
- }
-
- setSites(sites);
-
- }, onError).finally(function () {
- if (callback) {
- callback();
- }
-
- model.isLoading = false;
- });
- }
-
- }
-})();
diff --git a/plugins/SitesManager/angularjs/sites-manager/sites-manager.controller.js b/plugins/SitesManager/angularjs/sites-manager/sites-manager.controller.js
deleted file mode 100644
index 32cebbff4c..0000000000
--- a/plugins/SitesManager/angularjs/sites-manager/sites-manager.controller.js
+++ /dev/null
@@ -1,271 +0,0 @@
-/*!
- * Matomo - free/libre analytics platform
- *
- * @link https://matomo.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-(function () {
- angular.module('piwikApp').controller('SitesManagerController', SitesManagerController);
-
- SitesManagerController.$inject = ['$scope', '$filter', 'coreAPI', 'sitesManagerAPI', 'piwikApi', 'sitesManagerAdminSitesModel', 'piwik', 'sitesManagerApiHelper', 'sitesManagerTypeModel', '$rootScope', '$window'];
-
- function SitesManagerController($scope, $filter, coreAPI, sitesManagerAPI, piwikApi, adminSites, piwik, sitesManagerApiHelper, sitesManagerTypeModel, $rootScope, $window) {
-
- var translate = $filter('translate');
-
- $scope.globalSettings = {};
-
- $rootScope.$on('$locationChangeSuccess', function () {
- if (piwik.hasSuperUserAccess) {
- // as we are not using a router yet...
- if ($window.location.hash === '#globalSettings' || $window.location.hash === '#/globalSettings') {
- broadcast.propagateNewPage('action=globalSettings');
- }
- }
- });
-
- var init = function () {
-
- $scope.period = piwik.broadcast.getValueFromUrl('period');
- $scope.date = piwik.broadcast.getValueFromUrl('date');
- $scope.adminSites = adminSites;
- $scope.hasSuperUserAccess = piwik.hasSuperUserAccess;
- $scope.redirectParams = {showaddsite: false};
- $scope.cacheBuster = piwik.cacheBuster;
- $scope.totalNumberOfSites = '?';
-
- initSelectLists();
- initUtcTime();
- initUserIP();
- initIsTimezoneSupportEnabled();
- initGlobalParams();
-
- initActions();
- };
-
- var initActions = function () {
-
- $scope.cancelEditSite = cancelEditSite;
- $scope.addSite = addSite;
- $scope.addNewEntity = addNewEntity;
- $scope.saveGlobalSettings = saveGlobalSettings;
- $scope.lookupCurrentEditSite = lookupCurrentEditSite;
- };
-
- var initAvailableTypes = function () {
- return sitesManagerTypeModel.fetchAvailableTypes().then(function (types) {
- $scope.availableTypes = types;
- $scope.typeForNewEntity = 'website';
-
- return types;
- });
- };
-
- var initSelectLists = function() {
-
- initCurrencyList();
- initTimezones();
- };
-
- var initGlobalParams = function() {
-
- showLoading();
-
- var availableTypesPromise = initAvailableTypes();
-
- sitesManagerAPI.getGlobalSettings(function(globalSettings) {
-
- $scope.globalSettings = globalSettings;
-
- $scope.globalSettings.searchKeywordParametersGlobal = sitesManagerApiHelper.commaDelimitedFieldToArray($scope.globalSettings.searchKeywordParametersGlobal);
- $scope.globalSettings.searchCategoryParametersGlobal = sitesManagerApiHelper.commaDelimitedFieldToArray($scope.globalSettings.searchCategoryParametersGlobal);
- $scope.globalSettings.excludedIpsGlobal = sitesManagerApiHelper.commaDelimitedFieldToArray($scope.globalSettings.excludedIpsGlobal);
- $scope.globalSettings.excludedQueryParametersGlobal = sitesManagerApiHelper.commaDelimitedFieldToArray($scope.globalSettings.excludedQueryParametersGlobal);
- $scope.globalSettings.excludedUserAgentsGlobal = sitesManagerApiHelper.commaDelimitedFieldToArray($scope.globalSettings.excludedUserAgentsGlobal);
-
- hideLoading();
-
- initKeepURLFragmentsList();
-
- adminSites.fetchLimitedSitesWithAdminAccess(function () {
- availableTypesPromise.then(function () {
- triggerAddSiteIfRequested();
- });
- });
- sitesManagerAPI.getSitesIdWithAdminAccess(function (siteIds) {
- if (siteIds && siteIds.length) {
- $scope.totalNumberOfSites = siteIds.length;
- }
- });
- });
- };
-
- var triggerAddSiteIfRequested = function() {
- var search = String(window.location.search);
- var searchParams = piwik.helper.getArrayFromQueryString(search);
-
- var forcedEditSiteId = sitesManagerTypeModel.getEditSiteIdParameter();
-
- if(searchParams.showaddsite == 1) {
- addNewEntity();
- } else if(forcedEditSiteId) {
- adminSites.search = parseInt(forcedEditSiteId, 10);
- adminSites.searchSite(adminSites.search);
- }
- };
-
- var initUtcTime = function() {
-
- var currentDate = new Date();
-
- $scope.utcTime = new Date(
- currentDate.getUTCFullYear(),
- currentDate.getUTCMonth(),
- currentDate.getUTCDate(),
- currentDate.getUTCHours(),
- currentDate.getUTCMinutes(),
- currentDate.getUTCSeconds()
- );
- };
-
- var initIsTimezoneSupportEnabled = function() {
-
- sitesManagerAPI.isTimezoneSupportEnabled(function (timezoneSupportEnabled) {
- $scope.timezoneSupportEnabled = timezoneSupportEnabled;
- });
- };
-
- var initTimezones = function() {
-
- sitesManagerAPI.getTimezonesList(
-
- function (timezones) {
-
- var scopeTimezones = [];
- $scope.timezones = [];
-
- angular.forEach(timezones, function(groupTimezones, timezoneGroup) {
-
- angular.forEach(groupTimezones, function(label, code) {
-
- scopeTimezones.push({
- group: timezoneGroup,
- key: code,
- value: label
- });
- });
- });
-
- $scope.timezones = scopeTimezones;
- }
- );
- };
-
- var initUserIP = function() {
-
- coreAPI.getIpFromHeader(function(ip) {
- $scope.currentIpAddress = ip;
- });
- };
-
- var initKeepURLFragmentsList = function() {
- $scope.keepURLFragmentsOptions = [
- {key: 0, value: ($scope.globalSettings.keepURLFragmentsGlobal ? translate('General_Yes') : translate('General_No')) + ' (' + translate('General_Default') + ')'},
- {key: 1, value: translate('General_Yes')},
- {key: 2, value: translate('General_No')}
- ];
- };
-
- var addNewEntity = function () {
- sitesManagerTypeModel.hasMultipleTypes().then(function (hasMultipleTypes) {
- if (hasMultipleTypes) {
- $scope.showAddSiteDialog = true;
- } else if ($scope.availableTypes.length === 1) {
- var type = $scope.availableTypes[0].id;
- addSite(type);
- }
- });
- };
-
- var addSite = function(type) {
-
- var parameters = {isAllowed: true, measurableType: type};
- $rootScope.$emit('SitesManager.initAddSite', parameters);
- if (parameters && !parameters.isAllowed) {
- return;
- }
-
- if (!type) {
- type = 'website'; // todo shall we really hard code this or trigger an exception or so?
- }
-
- $scope.adminSites.sites.unshift({type: type});
- };
-
- var saveGlobalSettings = function() {
-
- var ajaxHandler = new ajaxHelper();
-
- ajaxHandler.addParams({
- module: 'SitesManager',
- format: 'json',
- action: 'setGlobalSettings'
- }, 'GET');
-
- ajaxHandler.addParams({
- timezone: $scope.globalSettings.defaultTimezone,
- currency: $scope.globalSettings.defaultCurrency,
- excludedIps: $scope.globalSettings.excludedIpsGlobal.join(','),
- excludedQueryParameters: $scope.globalSettings.excludedQueryParametersGlobal.join(','),
- excludedUserAgents: $scope.globalSettings.excludedUserAgentsGlobal.join(','),
- keepURLFragments: $scope.globalSettings.keepURLFragmentsGlobal ? 1 : 0,
- searchKeywordParameters: $scope.globalSettings.searchKeywordParametersGlobal.join(','),
- searchCategoryParameters: $scope.globalSettings.searchCategoryParametersGlobal.join(',')
- }, 'POST');
- ajaxHandler.withTokenInUrl();
- ajaxHandler.redirectOnSuccess($scope.redirectParams);
- ajaxHandler.setLoadingElement();
- ajaxHandler.send();
- };
-
- var cancelEditSite = function (site) {
-
- var idSite = site.idsite;
- if (idSite) {
- var siteElement = $('.site[idsite=' + idSite + ']');
- if (siteElement[0]) {
- // todo move this into a directive
- siteElement[0].scrollIntoView();
- }
- }
-
- $scope.adminSites.sites = $scope.adminSites.sites.filter(function (s) { return !!s.idsite; });
- };
-
- var lookupCurrentEditSite = function () {
-
- var sitesInEditMode = $scope.adminSites.sites.filter(function(site) {
- return site.editMode;
- });
-
- return sitesInEditMode[0];
- };
-
- var initCurrencyList = function () {
-
- sitesManagerAPI.getCurrencyList(function (currencies) {
- $scope.currencies = currencies;
- });
- };
-
- var showLoading = function() {
- $scope.loading = true;
- };
-
- var hideLoading = function() {
- $scope.loading = false;
- };
-
- init();
- }
-})();
diff --git a/plugins/SitesManager/templates/global-settings.html b/plugins/SitesManager/templates/global-settings.html
deleted file mode 100644
index a25d3d5f31..0000000000
--- a/plugins/SitesManager/templates/global-settings.html
+++ /dev/null
@@ -1,96 +0,0 @@
-<div ng-controller="SitesManagerController" class="SitesManager">
-<div ng-show="hasSuperUserAccess" piwik-content-block content-title="{{ 'SitesManager_GlobalWebsitesSettings' | translate }}">
-
- <a name="globalSettings" id="globalSettings"></a>
-
- <div id="excludedIpsGlobalHelp" class="inline-help-node">
- <div ng-include="'plugins/SitesManager/templates/help/excluded-ip-help.html'"></div>
- </div>
-
- <div id="excludedQueryParametersGlobalHelp" class="inline-help-node">
- <div ng-include="'plugins/SitesManager/templates/help/excluded-query-parameters-help.html'"></div>
- </div>
-
- <div id="excludedUserAgentsGlobalHelp" class="inline-help-node">
- <div ng-include="'plugins/SitesManager/templates/help/excluded-user-agents-help.html'"></div>
- </div>
-
- <div id="timezoneHelp" class="inline-help-node">
- <div ng-include="'plugins/SitesManager/templates/help/timezone-help.html'"></div>
- </div>
-
- <div id="keepURLFragmentsHelp" class="inline-help-node">
- <div ng-bind-html="'SitesManager_KeepURLFragmentsHelp'|translate:'<em>#</em>':'<em>example.org/index.html#first_section</em>':'<em>example.org/index.html</em>'"></div>
- <div>{{ 'SitesManager_KeepURLFragmentsHelp2'|translate }}</div>
- </div>
-
- <div piwik-field uicontrol="textarea" name="excludedIpsGlobal"
- var-type="array"
- ng-model="globalSettings.excludedIpsGlobal"
- data-title="{{ 'SitesManager_ListOfIpsToBeExcludedOnAllWebsites'|translate }}"
- introduction="{{ 'SitesManager_GlobalListExcludedIps'|translate }}"
- inline-help="#excludedIpsGlobalHelp">
- </div>
-
- <div piwik-field uicontrol="textarea" name="excludedQueryParametersGlobal"
- var-type="array"
- ng-model="globalSettings.excludedQueryParametersGlobal"
- data-title="{{ 'SitesManager_ListOfQueryParametersToBeExcludedOnAllWebsites'|translate }}"
- introduction="{{ 'SitesManager_GlobalListExcludedQueryParameters'|translate }}"
- inline-help="#excludedQueryParametersGlobalHelp">
- </div>
-
- <div piwik-field uicontrol="textarea" name="excludedUserAgentsGlobal"
- var-type="array"
- ng-model="globalSettings.excludedUserAgentsGlobal"
- data-title="{{ 'SitesManager_GlobalListExcludedUserAgents_Desc'|translate }}"
- introduction="{{ 'SitesManager_GlobalListExcludedUserAgents'|translate }}"
- inline-help="#excludedUserAgentsGlobalHelp">
- </div>
-
- <div piwik-field uicontrol="checkbox" name="keepURLFragmentsGlobal"
- ng-model="globalSettings.keepURLFragmentsGlobal"
- data-title="{{ 'SitesManager_KeepURLFragmentsLong'|translate }}"
- introduction="{{ 'SitesManager_KeepURLFragments'|translate }}"
- inline-help="#keepURLFragmentsHelp">
- </div>
-
- <h3>{{ 'SitesManager_TrackingSiteSearch'|translate }}</h3>
-
- <p>{{ 'SitesManager_SiteSearchUse' | translate }}</p>
- <div class="alert alert-info">
- {{ 'SitesManager_SearchParametersNote'|translate }} {{ 'SitesManager_SearchParametersNote2'|translate }}
- </div>
-
- <div piwik-field uicontrol="text" name="searchKeywordParametersGlobal" var-type="array"
- ng-model="globalSettings.searchKeywordParametersGlobal"
- data-title="{{ 'SitesManager_SearchKeywordLabel'|translate }}"
- inline-help="{{ 'SitesManager_SearchKeywordParametersDesc' | translate }}">
- </div>
-
- <div piwik-field uicontrol="text" name="searchCategoryParametersGlobal" var-type="array"
- ng-model="globalSettings.searchCategoryParametersGlobal"
- data-title="{{ 'SitesManager_SearchCategoryLabel'|translate }}"
- inline-help="{{ 'Goals_Optional'|translate }} {{ 'SitesManager_SearchCategoryDesc'|translate }} {{ 'SitesManager_SearchCategoryParametersDesc'|translate }}">
- </div>
-
- <div piwik-field uicontrol="select" name="defaultTimezone"
- ng-model="globalSettings.defaultTimezone"
- options="timezones"
- data-title="{{ 'SitesManager_SelectDefaultTimezone'|translate }}"
- introduction="{{ 'SitesManager_DefaultTimezoneForNewWebsites'|translate }}"
- inline-help="#timezoneHelp">
- </div>
-
- <div piwik-field uicontrol="select" name="defaultCurrency"
- ng-model="globalSettings.defaultCurrency"
- options="currencies"
- data-title="{{ 'SitesManager_SelectDefaultCurrency'|translate }}"
- introduction="{{ 'SitesManager_DefaultCurrencyForNewWebsites'|translate }}"
- inline-help="{{ 'SitesManager_CurrencySymbolWillBeUsedForGoals' | translate }}">
- </div>
-
- <div piwik-save-button onconfirm="saveGlobalSettings()"></div>
-
-</div></div>
-</div>
diff --git a/plugins/SitesManager/templates/globalSettings.twig b/plugins/SitesManager/templates/globalSettings.twig
index cf7b13ff10..915e5b9743 100644
--- a/plugins/SitesManager/templates/globalSettings.twig
+++ b/plugins/SitesManager/templates/globalSettings.twig
@@ -4,6 +4,6 @@
{% block content %}
- <div ng-include="'plugins/SitesManager/templates/global-settings.html?cb={{ cacheBuster }}'"></div>
+ <div matomo-global-settings></div>
{% endblock %}
diff --git a/plugins/SitesManager/templates/help/excluded-ip-help.html b/plugins/SitesManager/templates/help/excluded-ip-help.html
deleted file mode 100644
index df371f5473..0000000000
--- a/plugins/SitesManager/templates/help/excluded-ip-help.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<div>
- {{ 'SitesManager_HelpExcludedIpAddresses' | translate : '1.2.3.4/24' : '1.2.3.*' : '1.2.*.*' }}
-
- <br/><br/>
-
- <span ng-bind-html="'SitesManager_YourCurrentIpAddressIs'|translate:'<i>' + currentIpAddress + '</i>'"></span>
-</div>
diff --git a/plugins/SitesManager/templates/help/excluded-query-parameters-help.html b/plugins/SitesManager/templates/help/excluded-query-parameters-help.html
deleted file mode 100644
index c316c38737..0000000000
--- a/plugins/SitesManager/templates/help/excluded-query-parameters-help.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<div>
- {{ 'SitesManager_ListOfQueryParametersToExclude'|translate:'/^sess.*|.*[dD]ate$/' }}
-
- <br/><br/>
-
- {{ 'SitesManager_PiwikWillAutomaticallyExcludeCommonSessionParameters'|translate:'phpsessid, sessionid, ...' }}
-</div>
diff --git a/plugins/SitesManager/templates/help/excluded-user-agents-help.html b/plugins/SitesManager/templates/help/excluded-user-agents-help.html
deleted file mode 100644
index ef2fa2aad4..0000000000
--- a/plugins/SitesManager/templates/help/excluded-user-agents-help.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<div>
- {{ 'SitesManager_GlobalExcludedUserAgentHelp1'|translate }}
-
- <br/><br/>
-
- {{ 'SitesManager_GlobalListExcludedUserAgents_Desc'|translate }} {{ 'SitesManager_GlobalExcludedUserAgentHelp2'|translate }}
- {{ 'SitesManager_GlobalExcludedUserAgentHelp3'|translate:'/bot|spider|crawl|scanner/i' }}
-</div>
diff --git a/plugins/SitesManager/templates/help/timezone-help.html b/plugins/SitesManager/templates/help/timezone-help.html
deleted file mode 100644
index f834b7ff15..0000000000
--- a/plugins/SitesManager/templates/help/timezone-help.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<div>
- <span ng-if="!timezoneSupportEnabled">
- {{ 'SitesManager_AdvancedTimezoneSupportNotFound'|translate }}
- <br/>
- </span>
-
- {{ 'SitesManager_UTCTimeIs'| translate : (utcTime | date : 'yyyy-MM-dd HH:mm:ss') }}
- <br/>
- {{ 'SitesManager_ChangingYourTimezoneWillOnlyAffectDataForward'|translate }}
-</div>
diff --git a/plugins/SitesManager/templates/index.html b/plugins/SitesManager/templates/index.html
deleted file mode 100644
index 42e4d426f9..0000000000
--- a/plugins/SitesManager/templates/index.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<div ng-controller="SitesManagerController" class="SitesManager">
- <div ng-include="'plugins/SitesManager/templates/sites-manager-header.html?cb=' + cacheBuster" class="sites-manager-header"></div>
- <div ng-include="'plugins/SitesManager/templates/loading.html?cb=' + cacheBuster"></div>
- <div ng-include="'plugins/SitesManager/templates/sites-list/add-site-link.html?cb=' + cacheBuster"></div>
- <div ng-include="'plugins/SitesManager/templates/sites-list/add-entity-dialog.html?cb=' + cacheBuster"></div>
- <div ng-include="'plugins/SitesManager/templates/sites-list/sites-list.html?cb=' + cacheBuster"></div>
- <div class="bottomButtonBar" ng-include="'plugins/SitesManager/templates/sites-list/add-site-link.html?cb=' + cacheBuster"></div>
-</div>
diff --git a/plugins/SitesManager/templates/index.twig b/plugins/SitesManager/templates/index.twig
index 7935ae8a0d..a611f03fa7 100644
--- a/plugins/SitesManager/templates/index.twig
+++ b/plugins/SitesManager/templates/index.twig
@@ -4,6 +4,6 @@
{% block content %}
- <div ng-include="'plugins/SitesManager/templates/index.html?cb={{ cacheBuster }}'"></div>
+ <div matomo-sites-management></div>
{% endblock %}
diff --git a/plugins/SitesManager/templates/loading.html b/plugins/SitesManager/templates/loading.html
deleted file mode 100644
index 9f2440787f..0000000000
--- a/plugins/SitesManager/templates/loading.html
+++ /dev/null
@@ -1,6 +0,0 @@
-<div ng-class="{'hide_only': !loading && !adminSites.isLoading}">
- <div class="loadingPiwik">
- <img src="plugins/Morpheus/images/loading-blue.gif" alt="{{ 'General_LoadingData'|translate }}" />
- {{ 'General_LoadingData'|translate }}
- </div>
-</div> \ No newline at end of file
diff --git a/plugins/SitesManager/templates/sites-list/add-entity-dialog.html b/plugins/SitesManager/templates/sites-list/add-entity-dialog.html
deleted file mode 100644
index 9c9f6a5244..0000000000
--- a/plugins/SitesManager/templates/sites-list/add-entity-dialog.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<div piwik-dialog="$parent.showAddSiteDialog" class="ui-confirm">
-
- <h2>{{ 'SitesManager_ChooseMeasurableTypeHeadline'|translate }}</h2>
-
- <p>
- <div class="center">
- <button type="button"
- ng-repeat="type in availableTypes"
- title="{{ type.description }}"
- class="modal-close btn"
- style="margin-left: 20px;"
- ng-click="addSite(type.id);"
- aria-disabled="false">
- <span class="ui-button-text">{{ type.name }}</span>
- </button>
- </div>
- </p>
-</div> \ No newline at end of file
diff --git a/plugins/SitesManager/templates/sites-list/add-site-link.html b/plugins/SitesManager/templates/sites-list/add-site-link.html
deleted file mode 100644
index af0266816b..0000000000
--- a/plugins/SitesManager/templates/sites-list/add-site-link.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<div ng-show="!siteIsBeingEdited" class="sitesButtonBar clearfix">
-
- <a ng-show="hasSuperUserAccess && availableTypes"
- class="btn addSite"
- ng-click="addNewEntity()" tabindex="1">
- {{ availableTypes.length > 1 ? ('SitesManager_AddMeasurable'|translate) : ('SitesManager_AddSite'|translate) }}
- </a>
-
- <div class="search" ng-show="adminSites.hasPrev || adminSites.hasNext || adminSites.searchTerm">
- <input ng-model="adminSites.search" piwik-onenter="adminSites.searchSite(adminSites.search)"
- placeholder="{{ 'Actions_SubmenuSitesearch' | translate }}" type="text">
- <img ng-click="adminSites.searchSite(adminSites.search)" title="{{ 'General_ClickToSearch' | translate }}"
- class="search_ico" src="plugins/Morpheus/images/search_ico.png"/>
- </div>
-
- <div class="paging" ng-show="adminSites.hasPrev || adminSites.hasNext">
- <a class="btn prev" ng-disabled="!adminSites.hasPrev" ng-click="adminSites.previousPage()">
- <span style="cursor:pointer;">&#171; {{ 'General_Previous'|translate }}</span>
- </a>
- <span class="counter" ng-show="adminSites.hasPrev || adminSites.hasNext">
- <span ng-if="adminSites.searchTerm">
- {{ 'General_PaginationWithoutTotal'|translate:adminSites.offsetStart:adminSites.offsetEnd }}
- </span>
- <span ng-if="!adminSites.searchTerm">
- {{ 'General_Pagination'|translate:adminSites.offsetStart:adminSites.offsetEnd:totalNumberOfSites }}
- </span>
- </span>
- <a class="btn next" ng-disabled="!adminSites.hasNext" ng-click="adminSites.nextPage()">
- <span style="cursor:pointer;" class="pointer">{{ 'General_Next'|translate }} &#187;</span>
- </a>
- </div>
-
-</div>
diff --git a/plugins/SitesManager/templates/sites-list/site-search-field.html b/plugins/SitesManager/templates/sites-list/site-search-field.html
deleted file mode 100644
index c75901672b..0000000000
--- a/plugins/SitesManager/templates/sites-list/site-search-field.html
+++ /dev/null
@@ -1,64 +0,0 @@
-<div class="form-group">
- <label>{{ 'Actions_SubmenuSitesearch'|translate }}</label>
- <div class="form-help">
- {{ 'SitesManager_SiteSearchUse'|translate }}
- </div>
- <select ng-options="option.key as option.value for option in siteSearchOptions" ng-model="site.sitesearch"></select>
-</div>
-
-<div ng-if="site.sitesearch">
-
- <div ng-show="globalSettings.searchKeywordParametersGlobal.length" class="form-group">
-
- <label class="checkbox">
- <input type="checkbox" ng-model="site.useDefaultSiteSearchParams">
-
- <span ng-show="hasSuperUserAccess"
- ng-bind-html="'SitesManager_SearchUseDefault'|translate:'<a href=\'#globalSettings\'>':'</a>'">
- </span>
- <span ng-hide="hasSuperUserAccess">
- {{ 'SitesManager_SearchUseDefault' | translate:'':'' }}
- </span>
- </label>
-
- <span ng-show="site.useDefaultSiteSearchParams" class="form-description">
-
- {{ 'SitesManager_SearchKeywordLabel' | translate }}
- ({{ 'General_Default' | translate }}) :
-
- <span ng-repeat="param in globalSettings.searchKeywordParametersGlobal">
- {{ param }}<span ng-show="!$last">, </span>
- </span>
-
- <span ng-show="globalSettings.searchCategoryParametersGlobal.length">
- & {{ 'SitesManager_SearchCategoryLabel' | translate }} :
- <span ng-repeat="param in globalSettings.searchCategoryParametersGlobal">
- {{ param }}<span ng-show="!$last">, </span>
- </span>
- </span>
-
- </span>
-
- </div>
-
- <div ng-hide="site.useDefaultSiteSearchParams">
-
- <div class="form-group">
- <label>{{ 'SitesManager_SearchKeywordLabel' | translate }}</label>
- <div class="form-help">
- {{ 'SitesManager_SearchKeywordParametersDesc' | translate }}
- </div>
- <input ng-list ng-model="site.sitesearch_keyword_parameters">
- </div>
-
- <div class="form-group">
- <label>{{ 'SitesManager_SearchCategoryLabel' | translate }}</label>
- <div class="form-help">
- {{ 'Goals_Optional' | translate }} {{ 'SitesManager_SearchCategoryParametersDesc' | translate }}
- </div>
- <input ng-list ng-model="site.sitesearch_category_parameters">
- </div>
-
- </div>
-
-</div>
diff --git a/plugins/SitesManager/templates/sites-list/sites-list.html b/plugins/SitesManager/templates/sites-list/sites-list.html
deleted file mode 100644
index 6a0d9227e3..0000000000
--- a/plugins/SitesManager/templates/sites-list/sites-list.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<div class="sitesManagerList">
-
- <p ng-if="adminSites.searchTerm && 0 === adminSites.sites.length && !adminSites.isLoading">
- {{ 'SitesManager_NotFound'|translate }} <strong>{{ adminSites.searchTerm }}</strong>
- </p>
-
- <div
- ng-repeat="site in adminSites.sites"
- matomo-site-fields
- site="site"
- timezone-support-enabled="timezoneSupportEnabled"
- utc-time="utcTime"
- global-settings="globalSettings"
- ></div>
-</div>
diff --git a/plugins/SitesManager/templates/sites-manager-header.html b/plugins/SitesManager/templates/sites-manager-header.html
deleted file mode 100644
index e031e4f08f..0000000000
--- a/plugins/SitesManager/templates/sites-manager-header.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<div piwik-content-intro>
- <h2
- ng-show="availableTypes"
- piwik-enriched-headline
- help-url="https://matomo.org/docs/manage-websites/"
- feature-name="{{ 'SitesManager_WebsitesManagement'|translate }}">
- {{ 'SitesManager_XManagement'|translate:(availableTypes.length > 1 ? ('General_Measurables'|translate) : ('SitesManager_Sites'|translate)) }}
- </h2>
-
- <p>
- {{ 'SitesManager_MainDescription'|translate }}
-
- <span ng-bind-html="'SitesManager_YouCurrentlyHaveAccessToNWebsites'|translate:'<strong>' + totalNumberOfSites + '</strong>'"></span>
-
- <span ng-show="hasSuperUserAccess">
- <br/>
- <span ng-bind-html="'SitesManager_SuperUserAccessCan'|translate:'<a href=\'#globalSettings\'>':'</a>'"></span>
- </span>
- </p>
-</div> \ No newline at end of file
diff --git a/plugins/SitesManager/tests/UI/SitesManager_spec.js b/plugins/SitesManager/tests/UI/SitesManager_spec.js
index 6ae5979163..94d1f25afb 100644
--- a/plugins/SitesManager/tests/UI/SitesManager_spec.js
+++ b/plugins/SitesManager/tests/UI/SitesManager_spec.js
@@ -37,6 +37,7 @@ describe("SitesManager", function () {
async function searchForText(textToAppendToSearchField)
{
await (await page.jQuery('.SitesManager .search:first input')).type(textToAppendToSearchField);
+ await page.waitForTimeout(100);
await (await page.jQuery('.SitesManager .search:first img')).click();
}
diff --git a/plugins/SitesManager/tests/UI/expected-screenshots/SitesManager_search.png b/plugins/SitesManager/tests/UI/expected-screenshots/SitesManager_search.png
index 4c33ecd3a9..6aeaab6f92 100644
--- a/plugins/SitesManager/tests/UI/expected-screenshots/SitesManager_search.png
+++ b/plugins/SitesManager/tests/UI/expected-screenshots/SitesManager_search.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:8868d0b416bdf584f500325d7bcd3fb2e266d897458323ba65075d1069324e37
-size 176254
+oid sha256:2ff3428209c201b6a82b66723d9fcc7dee1c6609d29565da9842719eef6cb19e
+size 176301
diff --git a/plugins/SitesManager/tests/UI/expected-screenshots/SitesManager_site_edit_url.png b/plugins/SitesManager/tests/UI/expected-screenshots/SitesManager_site_edit_url.png
index a79bb81a2f..891834b2c4 100644
--- a/plugins/SitesManager/tests/UI/expected-screenshots/SitesManager_site_edit_url.png
+++ b/plugins/SitesManager/tests/UI/expected-screenshots/SitesManager_site_edit_url.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:f346b6766c2b1712a249c8d7732ac00406c15a291875282773a88c2959e34286
-size 331766
+oid sha256:50e9b492ac0e36727fce571beb6c4ee7fad2e4d54a3c5cebb4f41bb545af4f14
+size 330106
diff --git a/plugins/SitesManager/vue/dist/SitesManager.umd.js b/plugins/SitesManager/vue/dist/SitesManager.umd.js
index adc5fc99e5..990d04d64b 100644
--- a/plugins/SitesManager/vue/dist/SitesManager.umd.js
+++ b/plugins/SitesManager/vue/dist/SitesManager.umd.js
@@ -126,9 +126,10 @@ __webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, "SiteTypesStore", function() { return /* reexport */ src_SiteTypesStore_SiteTypesStore; });
-__webpack_require__.d(__webpack_exports__, "SiteFields", function() { return /* reexport */ SiteFields; });
__webpack_require__.d(__webpack_exports__, "CurrencyStore", function() { return /* reexport */ src_CurrencyStore_CurrencyStore; });
__webpack_require__.d(__webpack_exports__, "TimezoneStore", function() { return /* reexport */ src_TimezoneStore_TimezoneStore; });
+__webpack_require__.d(__webpack_exports__, "SitesManagement", function() { return /* reexport */ SitesManagement; });
+__webpack_require__.d(__webpack_exports__, "ManageGlobalSettings", function() { return /* reexport */ ManageGlobalSettings; });
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
// This file is imported into lib/wc client bundles.
@@ -179,6 +180,7 @@ var SiteTypesStore_SiteTypesStore = /*#__PURE__*/function () {
_classCallCheck(this, SiteTypesStore);
_defineProperty(this, "state", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["reactive"])({
+ isLoading: false,
typesById: {}
}));
@@ -186,6 +188,10 @@ var SiteTypesStore_SiteTypesStore = /*#__PURE__*/function () {
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(_this.state).typesById;
}));
+ _defineProperty(this, "isLoading", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () {
+ return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(_this.state).isLoading;
+ }));
+
_defineProperty(this, "types", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () {
return Object.values(_this.typesById.value);
}));
@@ -204,6 +210,7 @@ var SiteTypesStore_SiteTypesStore = /*#__PURE__*/function () {
return Promise.resolve(this.response);
}
+ this.state.isLoading = true;
this.response = external_CoreHome_["AjaxHelper"].fetch({
method: 'API.getAvailableMeasurableTypes',
filter_limit: '-1'
@@ -212,15 +219,25 @@ var SiteTypesStore_SiteTypesStore = /*#__PURE__*/function () {
_this2.state.typesById[type.id] = type;
});
return _this2.types.value;
+ }).finally(function () {
+ _this2.state.isLoading = false;
});
return this.response;
}
}, {
key: "getEditSiteIdParameter",
value: function getEditSiteIdParameter() {
- var editsiteid = external_CoreHome_["MatomoUrl"].hashParsed.value.editsiteid;
+ // parse query directly because #/editsiteid=N was supported alongside #/?editsiteid=N
+ var m = external_CoreHome_["MatomoUrl"].hashQuery.value.match(/editsiteid=([0-9]+)/);
+
+ if (!m) {
+ return undefined;
+ }
- if (editsiteid && $.isNumeric(editsiteid)) {
+ var isShowAddSite = external_CoreHome_["MatomoUrl"].urlParsed.value.showaddsite === '1' || external_CoreHome_["MatomoUrl"].urlParsed.value.showaddsite === 'true';
+ var editsiteid = m[1];
+
+ if (editsiteid && $.isNumeric(editsiteid) && !isShowAddSite) {
return editsiteid;
}
@@ -278,45 +295,392 @@ function sitesManagerTypeModelAdapter() {
}
window.angular.module('piwikApp.service').factory('sitesManagerTypeModel', sitesManagerTypeModelAdapter);
-// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/SitesManager/vue/src/SiteFields/SiteFields.vue?vue&type=template&id=0cf86fbc
+// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/SitesManager/vue/src/SitesManagement/SitesManagement.vue?vue&type=template&id=3a67fc1f
-var _hoisted_1 = ["idsite", "type"];
+var _hoisted_1 = {
+ class: "SitesManager",
+ ref: "root"
+};
var _hoisted_2 = {
+ class: "sites-manager-header"
+};
+var _hoisted_3 = ["innerHTML"];
+
+var _hoisted_4 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1);
+
+var _hoisted_5 = ["innerHTML"];
+var _hoisted_6 = {
+ class: "loadingPiwik"
+};
+var _hoisted_7 = ["alt"];
+var _hoisted_8 = {
+ class: "ui-confirm"
+};
+var _hoisted_9 = {
+ class: "center"
+};
+var _hoisted_10 = ["title", "onClick"];
+var _hoisted_11 = {
+ class: "ui-button-text"
+};
+var _hoisted_12 = {
+ class: "sitesManagerList"
+};
+var _hoisted_13 = {
+ key: 0
+};
+var _hoisted_14 = {
+ class: "bottomButtonBar"
+};
+function render(_ctx, _cache, $props, $setup, $data, $options) {
+ var _this = this;
+
+ var _component_EnrichedHeadline = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("EnrichedHeadline");
+
+ var _component_ButtonBar = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ButtonBar");
+
+ var _component_MatomoDialog = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("MatomoDialog");
+
+ var _component_SiteFields = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("SiteFields");
+
+ var _directive_content_intro = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("content-intro");
+
+ return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_EnrichedHeadline, {
+ "help-url": 'https://matomo.org/docs/manage-websites/',
+ "feature-name": _ctx.translate('SitesManager_WebsitesManagement')
+ }, {
+ default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () {
+ return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.headlineText), 1)];
+ }),
+ _: 1
+ }, 8, ["help-url", "feature-name"])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.availableTypes.length]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_MainDescription')) + " ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", {
+ innerHTML: _ctx.$sanitize(_ctx.mainDescription)
+ }, null, 8, _hoisted_3), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, [_hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", {
+ innerHTML: _ctx.superUserAccessMessage
+ }, null, 8, _hoisted_5)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.hasSuperUserAccess]])])], 512), [[_directive_content_intro]])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", {
+ class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])({
+ hide_only: !_ctx.isLoading
+ })
+ }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", {
+ src: "plugins/Morpheus/images/loading-blue.gif",
+ alt: _ctx.translate('General_LoadingData')
+ }, null, 8, _hoisted_7), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_LoadingData')), 1)])], 2)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_ButtonBar, {
+ "site-is-being-edited": _ctx.isSiteBeingEdited,
+ "has-prev": _ctx.hasPrev,
+ hasNext: _ctx.hasNext,
+ "offset-start": _ctx.offsetStart,
+ "offset-end": _ctx.offsetEnd,
+ "total-number-of-sites": _ctx.totalNumberOfSites,
+ "is-loading": _ctx.isLoading,
+ "search-term": _ctx.searchTerm,
+ "is-searching": !!_ctx.activeSearchTerm,
+ "onUpdate:searchTerm": _cache[0] || (_cache[0] = function ($event) {
+ return _ctx.searchTerm = $event;
+ }),
+ onAdd: _cache[1] || (_cache[1] = function ($event) {
+ return _ctx.addNewEntity();
+ }),
+ onSearch: _cache[2] || (_cache[2] = function ($event) {
+ return _ctx.searchSites($event);
+ }),
+ onPrev: _cache[3] || (_cache[3] = function ($event) {
+ return _ctx.previousPage();
+ }),
+ onNext: _cache[4] || (_cache[4] = function ($event) {
+ return _ctx.nextPage();
+ })
+ }, null, 8, ["site-is-being-edited", "has-prev", "hasNext", "offset-start", "offset-end", "total-number-of-sites", "is-loading", "search-term", "is-searching"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_MatomoDialog, {
+ modelValue: _ctx.showAddSiteDialog,
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = function ($event) {
+ return _ctx.showAddSiteDialog = $event;
+ })
+ }, {
+ default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () {
+ return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_8, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_ChooseMeasurableTypeHeadline')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_9, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.availableTypes, function (type) {
+ return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("button", {
+ type: "button",
+ key: type.id,
+ title: type.description,
+ class: "modal-close btn",
+ style: {
+ "margin-left": "20px"
+ },
+ onClick: function onClick($event) {
+ _ctx.addSite(type.id);
+ },
+ "aria-disabled": "false"
+ }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", _hoisted_11, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(type.name), 1)], 8, _hoisted_10);
+ }), 128))])])])])];
+ }),
+ _: 1
+ }, 8, ["modelValue"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_12, [_ctx.activeSearchTerm && 0 === _ctx.sites.length && !_ctx.isLoading ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", _hoisted_13, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_NotFound')) + " ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("strong", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.activeSearchTerm), 1)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.sites, function (site, index) {
+ return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", {
+ key: site.idsite
+ }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_SiteFields, {
+ site: site,
+ "timezone-support-enabled": _ctx.timezoneSupportEnabled,
+ "utc-time": _ctx.utcTime,
+ "global-settings": _ctx.globalSettings,
+ onEditSite: _cache[6] || (_cache[6] = function ($event) {
+ return _this.isSiteBeingEdited = true;
+ }),
+ onCancelEditSite: _cache[7] || (_cache[7] = function ($event) {
+ return _ctx.afterCancelEdit($event);
+ }),
+ onDelete: _cache[8] || (_cache[8] = function ($event) {
+ return _ctx.afterDelete($event);
+ }),
+ onSave: function onSave($event) {
+ return _ctx.afterSave($event.site, $event.settingValues, index, $event.isNew);
+ }
+ }, null, 8, ["site", "timezone-support-enabled", "utc-time", "global-settings", "onSave"])]);
+ }), 128))]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_14, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_ButtonBar, {
+ "site-is-being-edited": _ctx.isSiteBeingEdited,
+ "has-prev": _ctx.hasPrev,
+ hasNext: _ctx.hasNext,
+ "offset-start": _ctx.offsetStart,
+ "offset-end": _ctx.offsetEnd,
+ "total-number-of-sites": _ctx.totalNumberOfSites,
+ "is-loading": _ctx.isLoading,
+ "search-term": _ctx.searchTerm,
+ "is-searching": !!_ctx.activeSearchTerm,
+ "onUpdate:searchTerm": _cache[9] || (_cache[9] = function ($event) {
+ return _ctx.searchTerm = $event;
+ }),
+ onAdd: _cache[10] || (_cache[10] = function ($event) {
+ return _ctx.addNewEntity();
+ }),
+ onSearch: _cache[11] || (_cache[11] = function ($event) {
+ return _ctx.searchSites($event);
+ }),
+ onPrev: _cache[12] || (_cache[12] = function ($event) {
+ return _ctx.previousPage();
+ }),
+ onNext: _cache[13] || (_cache[13] = function ($event) {
+ return _ctx.nextPage();
+ })
+ }, null, 8, ["site-is-being-edited", "has-prev", "hasNext", "offset-start", "offset-end", "total-number-of-sites", "is-loading", "search-term", "is-searching"])])], 512);
+}
+// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/SitesManagement/SitesManagement.vue?vue&type=template&id=3a67fc1f
+
+// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/SitesManager/vue/src/SitesManagement/ButtonBar.vue?vue&type=template&id=1fc4f3b2
+
+var ButtonBarvue_type_template_id_1fc4f3b2_hoisted_1 = {
+ class: "sitesButtonBar clearfix"
+};
+var ButtonBarvue_type_template_id_1fc4f3b2_hoisted_2 = {
+ class: "search"
+};
+var ButtonBarvue_type_template_id_1fc4f3b2_hoisted_3 = ["value", "placeholder", "disabled"];
+var ButtonBarvue_type_template_id_1fc4f3b2_hoisted_4 = ["title"];
+var ButtonBarvue_type_template_id_1fc4f3b2_hoisted_5 = {
+ class: "paging"
+};
+var ButtonBarvue_type_template_id_1fc4f3b2_hoisted_6 = ["disabled"];
+var ButtonBarvue_type_template_id_1fc4f3b2_hoisted_7 = {
+ style: {
+ "cursor": "pointer"
+ }
+};
+var ButtonBarvue_type_template_id_1fc4f3b2_hoisted_8 = {
+ class: "counter"
+};
+var ButtonBarvue_type_template_id_1fc4f3b2_hoisted_9 = ["disabled"];
+var ButtonBarvue_type_template_id_1fc4f3b2_hoisted_10 = {
+ style: {
+ "cursor": "pointer"
+ },
+ class: "pointer"
+};
+function ButtonBarvue_type_template_id_1fc4f3b2_render(_ctx, _cache, $props, $setup, $data, $options) {
+ return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", ButtonBarvue_type_template_id_1fc4f3b2_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", {
+ class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["btn addSite", {
+ disabled: _ctx.siteIsBeingEdited
+ }]),
+ onClick: _cache[0] || (_cache[0] = function ($event) {
+ return _ctx.addNewEntity();
+ }),
+ tabindex: "1"
+ }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.availableTypes.length > 1 ? _ctx.translate('SitesManager_AddMeasurable') : _ctx.translate('SitesManager_AddSite')), 3), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.hasSuperUserAccess && _ctx.availableTypes]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", ButtonBarvue_type_template_id_1fc4f3b2_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", {
+ value: _ctx.searchTerm,
+ onKeydown: _cache[1] || (_cache[1] = function ($event) {
+ return _ctx.onKeydown($event);
+ }),
+ placeholder: _ctx.translate('Actions_SubmenuSitesearch'),
+ type: "text",
+ disabled: _ctx.siteIsBeingEdited
+ }, null, 40, ButtonBarvue_type_template_id_1fc4f3b2_hoisted_3), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", {
+ onClick: _cache[2] || (_cache[2] = function ($event) {
+ return _ctx.searchSite();
+ }),
+ title: _ctx.translate('General_ClickToSearch'),
+ class: "search_ico",
+ src: "plugins/Morpheus/images/search_ico.png"
+ }, null, 8, ButtonBarvue_type_template_id_1fc4f3b2_hoisted_4)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.hasPrev || _ctx.hasNext || _ctx.isSearching]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", ButtonBarvue_type_template_id_1fc4f3b2_hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", {
+ class: "btn prev",
+ disabled: _ctx.hasPrev && !_ctx.isLoading && !_ctx.siteIsBeingEdited ? undefined : true,
+ onClick: _cache[3] || (_cache[3] = function ($event) {
+ return _ctx.previousPage();
+ })
+ }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", ButtonBarvue_type_template_id_1fc4f3b2_hoisted_7, "« " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Previous')), 1)], 8, ButtonBarvue_type_template_id_1fc4f3b2_hoisted_6), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", ButtonBarvue_type_template_id_1fc4f3b2_hoisted_8, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.paginationText), 1)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.hasPrev || _ctx.hasNext]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", {
+ class: "btn next",
+ disabled: _ctx.hasNext && !_ctx.isLoading && !_ctx.siteIsBeingEdited ? undefined : true,
+ onClick: _cache[4] || (_cache[4] = function ($event) {
+ return _ctx.nextPage();
+ })
+ }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", ButtonBarvue_type_template_id_1fc4f3b2_hoisted_10, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Next')) + " »", 1)], 8, ButtonBarvue_type_template_id_1fc4f3b2_hoisted_9)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.hasPrev || _ctx.hasNext]])]);
+}
+// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/SitesManagement/ButtonBar.vue?vue&type=template&id=1fc4f3b2
+
+// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/SitesManager/vue/src/SitesManagement/ButtonBar.vue?vue&type=script&lang=ts
+
+
+
+/* harmony default export */ var ButtonBarvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({
+ props: {
+ siteIsBeingEdited: {
+ type: Boolean,
+ required: true
+ },
+ hasPrev: {
+ type: Boolean,
+ required: true
+ },
+ hasNext: {
+ type: Boolean,
+ required: true
+ },
+ offsetStart: {
+ type: Number,
+ required: true
+ },
+ offsetEnd: {
+ type: Number,
+ required: true
+ },
+ totalNumberOfSites: {
+ type: Number
+ },
+ isLoading: {
+ type: Boolean,
+ required: true
+ },
+ searchTerm: {
+ type: String,
+ required: true
+ },
+ isSearching: {
+ type: Boolean,
+ required: true
+ }
+ },
+ emits: ['add', 'search', 'prev', 'next', 'update:searchTerm'],
+ created: function created() {
+ this.onKeydown = Object(external_CoreHome_["debounce"])(this.onKeydown, 50);
+ },
+ computed: {
+ hasSuperUserAccess: function hasSuperUserAccess() {
+ return external_CoreHome_["Matomo"].hasSuperUserAccess;
+ },
+ availableTypes: function availableTypes() {
+ return src_SiteTypesStore_SiteTypesStore.types.value;
+ },
+ paginationText: function paginationText() {
+ var text;
+
+ if (this.isSearching) {
+ text = Object(external_CoreHome_["translate"])('General_PaginationWithoutTotal', "".concat(this.offsetStart), "".concat(this.offsetEnd));
+ } else {
+ text = Object(external_CoreHome_["translate"])('General_Pagination', "".concat(this.offsetStart), "".concat(this.offsetEnd), this.totalNumberOfSites === null ? '?' : "".concat(this.totalNumberOfSites));
+ }
+
+ return " ".concat(text, " ");
+ }
+ },
+ methods: {
+ addNewEntity: function addNewEntity() {
+ this.$emit('add');
+ },
+ searchSite: function searchSite() {
+ if (this.siteIsBeingEdited) {
+ return;
+ }
+
+ this.$emit('search');
+ },
+ previousPage: function previousPage() {
+ this.$emit('prev');
+ },
+ nextPage: function nextPage() {
+ this.$emit('next');
+ },
+ onKeydown: function onKeydown(event) {
+ var _this = this;
+
+ setTimeout(function () {
+ if (event.key === 'Enter') {
+ _this.searchSiteOnEnter(event);
+
+ return;
+ }
+
+ _this.$emit('update:searchTerm', event.target.value);
+ });
+ },
+ searchSiteOnEnter: function searchSiteOnEnter(event) {
+ event.preventDefault();
+ this.searchSite();
+ }
+ }
+}));
+// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/SitesManagement/ButtonBar.vue?vue&type=script&lang=ts
+
+// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/SitesManagement/ButtonBar.vue
+
+
+
+ButtonBarvue_type_script_lang_ts.render = ButtonBarvue_type_template_id_1fc4f3b2_render
+
+/* harmony default export */ var ButtonBar = (ButtonBarvue_type_script_lang_ts);
+// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/SitesManager/vue/src/SiteFields/SiteFields.vue?vue&type=template&id=a905ccac
+
+var SiteFieldsvue_type_template_id_a905ccac_hoisted_1 = ["idsite", "type"];
+var SiteFieldsvue_type_template_id_a905ccac_hoisted_2 = {
class: "card-content"
};
-var _hoisted_3 = {
+var SiteFieldsvue_type_template_id_a905ccac_hoisted_3 = {
key: 0,
class: "row"
};
-var _hoisted_4 = {
+var SiteFieldsvue_type_template_id_a905ccac_hoisted_4 = {
class: "col m3"
};
-var _hoisted_5 = {
+var SiteFieldsvue_type_template_id_a905ccac_hoisted_5 = {
class: "title"
};
-var _hoisted_6 = {
+var SiteFieldsvue_type_template_id_a905ccac_hoisted_6 = {
class: "title"
};
-var _hoisted_7 = ["target", "title", "href"];
-var _hoisted_8 = {
+var SiteFieldsvue_type_template_id_a905ccac_hoisted_7 = ["target", "title", "href"];
+var SiteFieldsvue_type_template_id_a905ccac_hoisted_8 = {
class: "col m4"
};
-var _hoisted_9 = {
+var SiteFieldsvue_type_template_id_a905ccac_hoisted_9 = {
class: "title"
};
-var _hoisted_10 = {
+var SiteFieldsvue_type_template_id_a905ccac_hoisted_10 = {
class: "title"
};
-var _hoisted_11 = {
+var SiteFieldsvue_type_template_id_a905ccac_hoisted_11 = {
class: "title"
};
-var _hoisted_12 = {
+var SiteFieldsvue_type_template_id_a905ccac_hoisted_12 = {
class: "title"
};
-var _hoisted_13 = {
+var SiteFieldsvue_type_template_id_a905ccac_hoisted_13 = {
class: "col m4"
};
-var _hoisted_14 = {
+var SiteFieldsvue_type_template_id_a905ccac_hoisted_14 = {
class: "title"
};
@@ -394,7 +758,7 @@ var _hoisted_41 = {
};
var _hoisted_42 = ["value"];
var _hoisted_43 = ["value"];
-function render(_ctx, _cache, $props, $setup, $data, $options) {
+function SiteFieldsvue_type_template_id_a905ccac_render(_ctx, _cache, $props, $setup, $data, $options) {
var _ctx$theSite$excluded,
_ctx$theSite$excluded2,
_ctx$theSite$excluded3,
@@ -413,12 +777,13 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
'editingSite': !!_ctx.editMode
}]),
idsite: _ctx.theSite.idsite,
- type: _ctx.theSite.type
- }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_2, [!_ctx.editMode ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_4, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h4", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.theSite.name), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", _hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Id')) + ":", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.theSite.idsite), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", _hoisted_6, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_Type')) + ":", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.currentType.name), 1)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.availableTypes.length > 1]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", {
+ type: _ctx.theSite.type,
+ ref: "root"
+ }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteFieldsvue_type_template_id_a905ccac_hoisted_2, [!_ctx.editMode ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", SiteFieldsvue_type_template_id_a905ccac_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteFieldsvue_type_template_id_a905ccac_hoisted_4, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h4", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.theSite.name), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", SiteFieldsvue_type_template_id_a905ccac_hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Id')) + ":", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.theSite.idsite), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", SiteFieldsvue_type_template_id_a905ccac_hoisted_6, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_Type')) + ":", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.currentType.name), 1)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.availableTypes.length > 1]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", {
target: _ctx.isInternalSetupUrl ? '_self' : '_blank',
title: _ctx.translate('SitesManager_ShowTrackingTag'),
href: _ctx.setupUrl
- }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_ShowTrackingTag')), 9, _hoisted_7)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.theSite.idsite && _ctx.howToSetupUrl]])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_8, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", _hoisted_9, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_Timezone')) + ":", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.theSite.timezone_name), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", _hoisted_10, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_Currency')) + ":", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.theSite.currency_name), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", _hoisted_11, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('Goals_Ecommerce')) + ":", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Yes')), 1)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.theSite.ecommerce === 1 || _ctx.theSite.ecommerce === '1']]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", _hoisted_12, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('Actions_SubmenuSitesearch')) + ":", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Yes')), 1)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.theSite.sitesearch === 1 || _ctx.theSite.sitesearch === '1']])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_13, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", _hoisted_14, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_Urls')), 1), _hoisted_15, (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.theSite.alias_urls, function (url, index) {
+ }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_ShowTrackingTag')), 9, SiteFieldsvue_type_template_id_a905ccac_hoisted_7)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.theSite.idsite && _ctx.howToSetupUrl]])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteFieldsvue_type_template_id_a905ccac_hoisted_8, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", SiteFieldsvue_type_template_id_a905ccac_hoisted_9, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_Timezone')) + ":", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.theSite.timezone_name), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", SiteFieldsvue_type_template_id_a905ccac_hoisted_10, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_Currency')) + ":", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.theSite.currency_name), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", SiteFieldsvue_type_template_id_a905ccac_hoisted_11, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('Goals_Ecommerce')) + ":", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Yes')), 1)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.theSite.ecommerce === 1 || _ctx.theSite.ecommerce === '1']]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", SiteFieldsvue_type_template_id_a905ccac_hoisted_12, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('Actions_SubmenuSitesearch')) + ":", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Yes')), 1)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.theSite.sitesearch === 1 || _ctx.theSite.sitesearch === '1']])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteFieldsvue_type_template_id_a905ccac_hoisted_13, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", SiteFieldsvue_type_template_id_a905ccac_hoisted_14, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_Urls')), 1), _hoisted_15, (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.theSite.alias_urls, function (url, index) {
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", {
key: url
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", {
@@ -511,9 +876,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
}, null, 8, _hoisted_43)])];
}),
_: 1
- }, 8, ["modelValue"])], 10, _hoisted_1);
+ }, 8, ["modelValue"])], 10, SiteFieldsvue_type_template_id_a905ccac_hoisted_1);
}
-// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/SiteFields/SiteFields.vue?vue&type=template&id=0cf86fbc
+// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/SiteFields/SiteFields.vue?vue&type=template&id=a905ccac
// EXTERNAL MODULE: external "CorePluginsAdmin"
var external_CorePluginsAdmin_ = __webpack_require__("a5a2");
@@ -555,14 +920,31 @@ var TimezoneStore_TimezoneStore = /*#__PURE__*/function () {
TimezoneStore_classCallCheck(this, TimezoneStore);
TimezoneStore_defineProperty(this, "privateState", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["reactive"])({
- timezones: []
+ isLoading: false,
+ timezones: [],
+ timezoneSupportEnabled: false
+ }));
+
+ TimezoneStore_defineProperty(this, "state", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () {
+ return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(_this.privateState);
}));
TimezoneStore_defineProperty(this, "timezones", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () {
- return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(_this.privateState).timezones;
+ return _this.state.value.timezones;
+ }));
+
+ TimezoneStore_defineProperty(this, "timezoneSupportEnabled", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () {
+ return _this.state.value.timezoneSupportEnabled;
}));
- this.fetchTimezones();
+ TimezoneStore_defineProperty(this, "isLoading", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () {
+ return _this.state.value.isLoading;
+ }));
+
+ this.privateState.isLoading = true;
+ Promise.all([this.checkTimezoneSupportEnabled(), this.fetchTimezones()]).finally(function () {
+ _this.privateState.isLoading = false;
+ });
}
TimezoneStore_createClass(TimezoneStore, [{
@@ -570,7 +952,7 @@ var TimezoneStore_TimezoneStore = /*#__PURE__*/function () {
value: function fetchTimezones() {
var _this2 = this;
- external_CoreHome_["AjaxHelper"].fetch({
+ return external_CoreHome_["AjaxHelper"].fetch({
method: 'SitesManager.getTimezonesList'
}).then(function (grouped) {
var flattened = [];
@@ -594,6 +976,17 @@ var TimezoneStore_TimezoneStore = /*#__PURE__*/function () {
_this2.privateState.timezones = flattened;
});
}
+ }, {
+ key: "checkTimezoneSupportEnabled",
+ value: function checkTimezoneSupportEnabled() {
+ var _this3 = this;
+
+ return external_CoreHome_["AjaxHelper"].fetch({
+ method: 'SitesManager.isTimezoneSupportEnabled'
+ }).then(function (response) {
+ _this3.privateState.timezoneSupportEnabled = response.value;
+ });
+ }
}]);
return TimezoneStore;
@@ -625,6 +1018,7 @@ var CurrencyStore_CurrencyStore = /*#__PURE__*/function () {
CurrencyStore_classCallCheck(this, CurrencyStore);
CurrencyStore_defineProperty(this, "privateState", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["reactive"])({
+ isLoading: false,
currencies: {}
}));
@@ -632,6 +1026,10 @@ var CurrencyStore_CurrencyStore = /*#__PURE__*/function () {
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(_this.privateState).currencies;
}));
+ CurrencyStore_defineProperty(this, "isLoading", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () {
+ return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(_this.privateState).isLoading;
+ }));
+
this.fetchCurrencies();
}
@@ -640,10 +1038,13 @@ var CurrencyStore_CurrencyStore = /*#__PURE__*/function () {
value: function fetchCurrencies() {
var _this2 = this;
+ this.privateState.isLoading = true;
external_CoreHome_["AjaxHelper"].fetch({
method: 'SitesManager.getCurrencyList'
}).then(function (currencies) {
_this2.privateState.currencies = currencies;
+ }).finally(function () {
+ _this2.privateState.isLoading = false;
});
}
}]);
@@ -722,7 +1123,7 @@ function isSiteNew(site) {
GroupedSettings: external_CorePluginsAdmin_["GroupedSettings"],
ActivityIndicator: external_CoreHome_["ActivityIndicator"]
},
- emits: ['delete', 'cancelEditSite', 'save'],
+ emits: ['delete', 'editSite', 'cancelEditSite', 'save'],
created: function created() {
this.onSiteChanged();
},
@@ -766,6 +1167,9 @@ function isSiteNew(site) {
var _this = this;
this.editMode = true;
+ this.$emit('editSite', {
+ idSite: this.theSite.idsite
+ });
this.measurableSettings = [];
if (isSiteNew(this.theSite)) {
@@ -845,7 +1249,16 @@ function isSiteNew(site) {
_this2.editMode = false;
if (!_this2.theSite.idsite && response && response.value) {
- _this2.theSite.idsite = response.value;
+ _this2.theSite.idsite = "".concat(response.value);
+ }
+
+ var timezoneInfo = src_TimezoneStore_TimezoneStore.timezones.value.find(function (t) {
+ return t.code === _this2.theSite.timezone;
+ });
+ _this2.theSite.timezone_name = (timezoneInfo === null || timezoneInfo === void 0 ? void 0 : timezoneInfo.label) || _this2.theSite.timezone;
+
+ if (_this2.theSite.currency) {
+ _this2.theSite.currency_name = src_CurrencyStore_CurrencyStore.currencies.value[_this2.theSite.currency];
}
var notificationId = external_CoreHome_["NotificationsStore"].show({
@@ -859,14 +1272,18 @@ function isSiteNew(site) {
_this2.$emit('save', {
site: _this2.theSite,
- settingValues: values.settingValues
+ settingValues: values.settingValues,
+ isNew: isNew
});
});
},
cancelEditSite: function cancelEditSite(site) {
this.editMode = false;
src_SiteTypesStore_SiteTypesStore.removeEditSiteIdParameterFromHash();
- this.$emit('cancelEditSite', site);
+ this.$emit('cancelEditSite', {
+ site: site,
+ element: this.$refs.root
+ });
},
deleteSite: function deleteSite() {
var _this3 = this;
@@ -962,10 +1379,18 @@ function isSiteNew(site) {
-SiteFieldsvue_type_script_lang_ts.render = render
+SiteFieldsvue_type_script_lang_ts.render = SiteFieldsvue_type_template_id_a905ccac_render
/* harmony default export */ var SiteFields = (SiteFieldsvue_type_script_lang_ts);
-// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/SiteFields/SiteFields.adapter.ts
+// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/GlobalSettingsStore/GlobalSettingsStore.ts
+function GlobalSettingsStore_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function GlobalSettingsStore_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
+
+function GlobalSettingsStore_createClass(Constructor, protoProps, staticProps) { if (protoProps) GlobalSettingsStore_defineProperties(Constructor.prototype, protoProps); if (staticProps) GlobalSettingsStore_defineProperties(Constructor, staticProps); return Constructor; }
+
+function GlobalSettingsStore_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
+
/*!
* Matomo - free/libre analytics platform
*
@@ -974,37 +1399,314 @@ SiteFieldsvue_type_script_lang_ts.render = render
*/
-/* harmony default export */ var SiteFields_adapter = (Object(external_CoreHome_["createAngularJsAdapter"])({
- component: SiteFields,
- scope: {
- site: {
- angularJsBind: '<'
+
+var GlobalSettingsStore_GlobalSettingsStore = /*#__PURE__*/function () {
+ function GlobalSettingsStore() {
+ var _this = this;
+
+ GlobalSettingsStore_classCallCheck(this, GlobalSettingsStore);
+
+ GlobalSettingsStore_defineProperty(this, "privateState", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["reactive"])({
+ isLoading: false,
+ globalSettings: {
+ keepURLFragmentsGlobal: false,
+ defaultCurrency: '',
+ defaultTimezone: '',
+ excludedIpsGlobal: '',
+ excludedQueryParametersGlobal: '',
+ excludedUserAgentsGlobal: '',
+ searchKeywordParametersGlobal: '',
+ searchCategoryParametersGlobal: ''
+ }
+ }));
+
+ GlobalSettingsStore_defineProperty(this, "isLoading", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () {
+ return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(_this.privateState).isLoading;
+ }));
+
+ GlobalSettingsStore_defineProperty(this, "globalSettings", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () {
+ return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(_this.privateState).globalSettings;
+ }));
+
+ this.fetchGlobalSettings();
+ }
+
+ GlobalSettingsStore_createClass(GlobalSettingsStore, [{
+ key: "saveGlobalSettings",
+ value: function saveGlobalSettings(settings) {
+ var _this2 = this;
+
+ this.privateState.isLoading = true;
+ return external_CoreHome_["AjaxHelper"].post({
+ module: 'SitesManager',
+ format: 'json',
+ action: 'setGlobalSettings'
+ }, settings, {
+ withTokenInUrl: true
+ }).finally(function () {
+ _this2.privateState.isLoading = false;
+ });
+ }
+ }, {
+ key: "fetchGlobalSettings",
+ value: function fetchGlobalSettings() {
+ var _this3 = this;
+
+ this.privateState.isLoading = true;
+ external_CoreHome_["AjaxHelper"].fetch({
+ module: 'SitesManager',
+ action: 'getGlobalSettings'
+ }).then(function (response) {
+ _this3.privateState.globalSettings = Object.assign(Object.assign({}, response), {}, {
+ // the API can return false for these
+ excludedIpsGlobal: response.excludedIpsGlobal || '',
+ excludedQueryParametersGlobal: response.excludedQueryParametersGlobal || '',
+ excludedUserAgentsGlobal: response.excludedUserAgentsGlobal || '',
+ searchKeywordParametersGlobal: response.searchKeywordParametersGlobal || '',
+ searchCategoryParametersGlobal: response.searchCategoryParametersGlobal || ''
+ });
+ }).finally(function () {
+ _this3.privateState.isLoading = false;
+ });
+ }
+ }]);
+
+ return GlobalSettingsStore;
+}();
+
+/* harmony default export */ var src_GlobalSettingsStore_GlobalSettingsStore = (Object(external_CoreHome_["lazyInitSingleton"])(GlobalSettingsStore_GlobalSettingsStore));
+// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/SitesManager/vue/src/SitesManagement/SitesManagement.vue?vue&type=script&lang=ts
+
+
+
+
+
+
+
+/* harmony default export */ var SitesManagementvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({
+ props: {
+ // TypeScript can't add state types if there are no properties (probably a bug in Vue)
+ // so we add one dummy property to get the compile to work
+ dummy: String
+ },
+ components: {
+ MatomoDialog: external_CoreHome_["MatomoDialog"],
+ ButtonBar: ButtonBar,
+ SiteFields: SiteFields,
+ EnrichedHeadline: external_CoreHome_["EnrichedHeadline"]
+ },
+ directives: {
+ ContentIntro: external_CoreHome_["ContentIntro"]
+ },
+ data: function data() {
+ var currentDate = new Date();
+ var utcTime = new Date(currentDate.getUTCFullYear(), currentDate.getUTCMonth(), currentDate.getUTCDate(), currentDate.getUTCHours(), currentDate.getUTCMinutes(), currentDate.getUTCSeconds());
+ return {
+ pageSize: 10,
+ currentPage: 0,
+ showAddSiteDialog: false,
+ searchTerm: '',
+ activeSearchTerm: '',
+ fetchedSites: [],
+ isLoadingInitialEntities: false,
+ utcTime: utcTime,
+ totalNumberOfSites: null,
+ isSiteBeingEdited: false,
+ fetchLimitedSitesAbortController: null
+ };
+ },
+ created: function created() {
+ var _this = this;
+
+ this.isLoadingInitialEntities = true;
+ Promise.all([src_SiteTypesStore_SiteTypesStore.fetchAvailableTypes(), this.fetchLimitedSitesWithAdminAccess(), this.getTotalNumberOfSites()]).then(function () {
+ _this.triggerAddSiteIfRequested();
+ }).finally(function () {
+ _this.isLoadingInitialEntities = false;
+ }); // if hash is #globalSettings, redirect to globalSettings action (we don't do it on
+ // page load so the back button still works)
+
+ Object(external_commonjs_vue_commonjs2_vue_root_Vue_["watch"])(function () {
+ return external_CoreHome_["MatomoUrl"].hashQuery.value;
+ }, function () {
+ _this.checkGlobalSettingsHash();
+ });
+ },
+ computed: {
+ sites: function sites() {
+ var emptyIdSiteRows = this.fetchedSites.filter(function (s) {
+ return !s.idsite;
+ }).length;
+ return this.fetchedSites.slice(0, this.pageSize + emptyIdSiteRows);
},
- timezoneSupportEnabled: {
- angularJsBind: '<'
+ isLoading: function isLoading() {
+ return !!this.fetchLimitedSitesAbortController || this.isLoadingInitialEntities || this.totalNumberOfSites === null || src_SiteTypesStore_SiteTypesStore.isLoading.value || src_TimezoneStore_TimezoneStore.isLoading.value || src_GlobalSettingsStore_GlobalSettingsStore.isLoading.value;
},
- utcTime: {
- angularJsBind: '<'
+ availableTypes: function availableTypes() {
+ return src_SiteTypesStore_SiteTypesStore.types.value;
},
- globalSettings: {
- angularJsBind: '<'
+ timezoneSupportEnabled: function timezoneSupportEnabled() {
+ return src_TimezoneStore_TimezoneStore.timezoneSupportEnabled.value;
+ },
+ globalSettings: function globalSettings() {
+ return src_GlobalSettingsStore_GlobalSettingsStore.globalSettings.value;
+ },
+ headlineText: function headlineText() {
+ return Object(external_CoreHome_["translate"])('SitesManager_XManagement', this.availableTypes.length > 1 ? Object(external_CoreHome_["translate"])('General_Measurables') : Object(external_CoreHome_["translate"])('SitesManager_Sites'));
+ },
+ mainDescription: function mainDescription() {
+ return Object(external_CoreHome_["translate"])('SitesManager_YouCurrentlyHaveAccessToNWebsites', "<strong>".concat(this.totalNumberOfSites, "</strong>"));
+ },
+ hasSuperUserAccess: function hasSuperUserAccess() {
+ return external_CoreHome_["Matomo"].hasSuperUserAccess;
+ },
+ superUserAccessMessage: function superUserAccessMessage() {
+ return Object(external_CoreHome_["translate"])('SitesManager_SuperUserAccessCan', '<a href=\'#globalSettings\'>', '</a>');
+ },
+ hasPrev: function hasPrev() {
+ return this.currentPage >= 1;
+ },
+ hasNext: function hasNext() {
+ return this.fetchedSites.filter(function (s) {
+ return !!s.idsite;
+ }).length >= this.pageSize + 1;
+ },
+ offsetStart: function offsetStart() {
+ return this.currentPage * this.pageSize + 1;
+ },
+ offsetEnd: function offsetEnd() {
+ return this.offsetStart + this.sites.filter(function (s) {
+ return !!s.idsite;
+ }).length - 1;
}
},
- directiveName: 'matomoSiteFields',
- $inject: ['$timeout'],
- events: {
- cancelEditSite: function cancelEditSite(site, vm, scope) {
- scope.$parent.cancelEditSite(site);
- },
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- delete: function _delete(site, vm, scope) {
- var redirectParams = scope.redirectParams; // if the current idSite in the URL is the site we're deleting, then we have to make to
+ methods: {
+ checkGlobalSettingsHash: function checkGlobalSettingsHash() {
+ var newHash = external_CoreHome_["MatomoUrl"].hashQuery.value;
+
+ if (external_CoreHome_["Matomo"].hasSuperUserAccess && (newHash === 'globalSettings' || newHash === '/globalSettings')) {
+ external_CoreHome_["MatomoUrl"].updateLocation(Object.assign(Object.assign({}, external_CoreHome_["MatomoUrl"].urlParsed.value), {}, {
+ action: 'globalSettings'
+ }));
+ }
+ },
+ addNewEntity: function addNewEntity() {
+ if (this.availableTypes.length > 1) {
+ this.showAddSiteDialog = true;
+ } else if (this.availableTypes.length === 1) {
+ this.addSite(this.availableTypes[0].id);
+ }
+ },
+ addSite: function addSite(typeId) {
+ var type = typeId;
+ var parameters = {
+ isAllowed: true,
+ measurableType: type
+ };
+ external_CoreHome_["Matomo"].postEvent('SitesManager.initAddSite', parameters); // TODO: test this
+
+ if (parameters && !parameters.isAllowed) {
+ return;
+ }
+
+ if (!type) {
+ type = 'website'; // todo shall we really hard code this or trigger an exception or so?
+ }
+
+ this.fetchedSites.unshift({
+ type: type
+ });
+ this.isSiteBeingEdited = true;
+ },
+ afterCancelEdit: function afterCancelEdit(_ref) {
+ var site = _ref.site,
+ element = _ref.element;
+ this.isSiteBeingEdited = false;
+
+ if (!site.idsite) {
+ this.fetchedSites = this.fetchedSites.filter(function (s) {
+ return !!s.idsite;
+ });
+ return;
+ }
+
+ element.scrollIntoView();
+ },
+ fetchLimitedSitesWithAdminAccess: function fetchLimitedSitesWithAdminAccess() {
+ var _this2 = this;
+
+ var searchTerm = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
+
+ if (this.fetchLimitedSitesAbortController) {
+ this.fetchLimitedSitesAbortController.abort();
+ }
+
+ this.fetchLimitedSitesAbortController = new AbortController();
+ var limit = this.pageSize + 1;
+ var offset = this.currentPage * this.pageSize;
+ var params = {
+ method: 'SitesManager.getSitesWithAdminAccess',
+ fetchAliasUrls: 1,
+ limit: limit + offset,
+ filter_offset: offset,
+ filter_limit: limit
+ };
+
+ if (searchTerm) {
+ params.pattern = searchTerm;
+ }
+
+ return external_CoreHome_["AjaxHelper"].fetch(params).then(function (sites) {
+ _this2.fetchedSites = sites || [];
+ }).then(function (sites) {
+ _this2.activeSearchTerm = searchTerm;
+ return sites;
+ }).finally(function () {
+ _this2.fetchLimitedSitesAbortController = null;
+ });
+ },
+ getTotalNumberOfSites: function getTotalNumberOfSites() {
+ var _this3 = this;
+
+ return external_CoreHome_["AjaxHelper"].fetch({
+ method: 'SitesManager.getSitesIdWithAdminAccess',
+ filter_limit: '-1'
+ }).then(function (sites) {
+ _this3.totalNumberOfSites = sites.length;
+ });
+ },
+ triggerAddSiteIfRequested: function triggerAddSiteIfRequested() {
+ var forcedEditSiteId = src_SiteTypesStore_SiteTypesStore.getEditSiteIdParameter();
+ var showaddsite = external_CoreHome_["MatomoUrl"].urlParsed.value.showaddsite;
+
+ if (showaddsite === '1') {
+ this.addNewEntity();
+ } else if (forcedEditSiteId) {
+ this.searchTerm = forcedEditSiteId;
+ this.fetchLimitedSitesWithAdminAccess(this.searchTerm);
+ }
+ },
+ previousPage: function previousPage() {
+ this.currentPage = Math.max(0, this.currentPage - 1);
+ this.fetchLimitedSitesWithAdminAccess(this.activeSearchTerm);
+ },
+ nextPage: function nextPage() {
+ this.currentPage = Math.max(0, this.currentPage + 1);
+ this.fetchLimitedSitesWithAdminAccess(this.activeSearchTerm);
+ },
+ searchSites: function searchSites() {
+ this.currentPage = 0;
+ this.fetchLimitedSitesWithAdminAccess(this.searchTerm);
+ },
+ afterDelete: function afterDelete(site) {
+ var redirectParams = {
+ showaddsite: 0
+ }; // if the current idSite in the URL is the site we're deleting, then we have to make to
// change it. otherwise, if a user goes to another page, the invalid idSite may cause
// a fatal error.
- if (external_CoreHome_["MatomoUrl"].urlParsed.value.idSite === site.idsite) {
- var sites = scope.adminSites.sites;
- var otherSite = sites.find(function (s) {
+ if (external_CoreHome_["MatomoUrl"].urlParsed.value.idSite === "".concat(site.idsite)) {
+ var otherSite = this.sites.find(function (s) {
return s.idsite !== site.idsite;
});
@@ -1015,14 +1717,9 @@ SiteFieldsvue_type_script_lang_ts.render = render
}
}
- external_CoreHome_["MatomoUrl"].updateUrl(Object.assign(Object.assign({}, external_CoreHome_["MatomoUrl"].urlParsed.value), {}, {
- redirectParams: redirectParams
- }), external_CoreHome_["MatomoUrl"].hashParsed.value);
+ external_CoreHome_["Matomo"].helper.redirect(redirectParams);
},
- save: function save(_ref, vm, // eslint-disable-next-line @typescript-eslint/no-explicit-any
- scope, element, attrs, controller, $timeout) {
- var site = _ref.site,
- settingValues = _ref.settingValues;
+ afterSave: function afterSave(site, settingValues, index, isNew) {
var texttareaArrayParams = ['excluded_ips', 'excluded_parameters', 'excluded_user_agents', 'sitesearch_keyword_parameters', 'sitesearch_category_parameters'];
var newSite = Object.assign({}, site);
Object.values(settingValues).forEach(function (settings) {
@@ -1038,12 +1735,370 @@ SiteFieldsvue_type_script_lang_ts.render = render
}
});
});
- window.$.extend(scope.site, newSite);
- $timeout();
- vm.site = newSite;
+ this.fetchedSites[index] = newSite;
+
+ if (isNew && this.totalNumberOfSites !== null) {
+ this.totalNumberOfSites += 1;
+ }
+
+ console.log('here?');
+ this.isSiteBeingEdited = false;
+ }
+ }
+}));
+// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/SitesManagement/SitesManagement.vue?vue&type=script&lang=ts
+
+// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/SitesManagement/SitesManagement.vue
+
+
+
+SitesManagementvue_type_script_lang_ts.render = render
+
+/* harmony default export */ var SitesManagement = (SitesManagementvue_type_script_lang_ts);
+// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/SitesManagement/SitesManagement.adapter.ts
+/*!
+ * Matomo - free/libre analytics platform
+ *
+ * @link https://matomo.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+
+/* harmony default export */ var SitesManagement_adapter = (Object(external_CoreHome_["createAngularJsAdapter"])({
+ component: SitesManagement,
+ scope: {},
+ directiveName: 'matomoSitesManagement'
+}));
+// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/SitesManager/vue/src/ManageGlobalSettings/ManageGlobalSettings.vue?vue&type=template&id=1bcd889c
+
+var ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_1 = {
+ class: "SitesManager"
+};
+
+var ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_2 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", {
+ name: "globalSettings",
+ id: "globalSettings"
+}, null, -1);
+
+var ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_3 = {
+ id: "excludedIpsGlobalHelp",
+ class: "inline-help-node"
+};
+
+var ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_4 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1);
+
+var ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_5 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1);
+
+var ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_6 = ["innerHTML"];
+var ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_7 = {
+ id: "excludedQueryParametersGlobalHelp",
+ class: "inline-help-node"
+};
+
+var ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_8 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1);
+
+var ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_9 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1);
+
+var ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_10 = {
+ id: "excludedUserAgentsGlobalHelp",
+ class: "inline-help-node"
+};
+
+var ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_11 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1);
+
+var ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_12 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1);
+
+var ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_13 = {
+ id: "timezoneHelp",
+ class: "inline-help-node"
+};
+var ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_14 = {
+ key: 0
+};
+
+var ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_15 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1);
+
+var ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_16 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1);
+
+var ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_17 = {
+ id: "keepURLFragmentsHelp",
+ class: "inline-help-node"
+};
+var ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_18 = ["innerHTML"];
+var ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_19 = {
+ class: "alert alert-info"
+};
+function ManageGlobalSettingsvue_type_template_id_1bcd889c_render(_ctx, _cache, $props, $setup, $data, $options) {
+ var _component_Field = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Field");
+
+ var _component_SaveButton = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("SaveButton");
+
+ var _component_ContentBlock = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ContentBlock");
+
+ return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_ContentBlock, {
+ "content-title": _ctx.translate('SitesManager_GlobalWebsitesSettings')
+ }, {
+ default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () {
+ return [ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_2, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_HelpExcludedIpAddresses', '1.2.3.4/24', '1.2.3.*', '1.2.*.*')) + " ", 1), ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_4, ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", {
+ innerHTML: _ctx.yourCurrentIpAddressIs
+ }, null, 8, ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_6)])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_7, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_ListOfQueryParametersToExclude', '/^sess.*|.*[dD]ate$/')) + " ", 1), ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_8, ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_9, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_PiwikWillAutomaticallyExcludeCommonSessionParameters', 'phpsessid, sessionid, ...')), 1)])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_10, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_GlobalExcludedUserAgentHelp1')) + " ", 1), ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_11, ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_12, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_GlobalListExcludedUserAgents_Desc')) + " " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_GlobalExcludedUserAgentHelp2')) + " " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_GlobalExcludedUserAgentHelp3', '/bot|spider|crawl|scanner/i')), 1)])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_13, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [!_ctx.timezoneSupportEnabled ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_14, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_AdvancedTimezoneSupportNotFound')) + " ", 1), ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_15])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_UTCTimeIs', _ctx.utcTimeDate)) + " ", 1), ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_16, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_ChangingYourTimezoneWillOnlyAffectDataForward')), 1)])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_17, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", {
+ innerHTML: _ctx.keepUrlFragmentHelp
+ }, null, 8, ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_18), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_KeepURLFragmentsHelp2')), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, {
+ uicontrol: "textarea",
+ name: "excludedIpsGlobal",
+ "var-type": "array",
+ modelValue: _ctx.excludedIpsGlobal,
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
+ return _ctx.excludedIpsGlobal = $event;
+ }),
+ title: _ctx.translate('SitesManager_ListOfIpsToBeExcludedOnAllWebsites'),
+ introduction: _ctx.translate('SitesManager_GlobalListExcludedIps'),
+ "inline-help": '#excludedIpsGlobalHelp',
+ disabled: _ctx.isLoading
+ }, null, 8, ["modelValue", "title", "introduction", "disabled"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, {
+ uicontrol: "textarea",
+ name: "excludedQueryParametersGlobal",
+ "var-type": "array",
+ modelValue: _ctx.excludedQueryParametersGlobal,
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = function ($event) {
+ return _ctx.excludedQueryParametersGlobal = $event;
+ }),
+ title: _ctx.translate('SitesManager_ListOfQueryParametersToBeExcludedOnAllWebsites'),
+ introduction: _ctx.translate('SitesManager_GlobalListExcludedQueryParameters'),
+ "inline-help": '#excludedQueryParametersGlobalHelp',
+ disabled: _ctx.isLoading
+ }, null, 8, ["modelValue", "title", "introduction", "disabled"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, {
+ uicontrol: "textarea",
+ name: "excludedUserAgentsGlobal",
+ "var-type": "array",
+ modelValue: _ctx.excludedUserAgentsGlobal,
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = function ($event) {
+ return _ctx.excludedUserAgentsGlobal = $event;
+ }),
+ title: _ctx.translate('SitesManager_GlobalListExcludedUserAgents_Desc'),
+ introduction: _ctx.translate('SitesManager_GlobalListExcludedUserAgents'),
+ "inline-help": '#excludedUserAgentsGlobalHelp',
+ disabled: _ctx.isLoading
+ }, null, 8, ["modelValue", "title", "introduction", "disabled"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, {
+ uicontrol: "checkbox",
+ name: "keepURLFragmentsGlobal",
+ modelValue: _ctx.keepURLFragmentsGlobal,
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = function ($event) {
+ return _ctx.keepURLFragmentsGlobal = $event;
+ }),
+ title: _ctx.translate('SitesManager_KeepURLFragmentsLong'),
+ introduction: _ctx.translate('SitesManager_KeepURLFragments'),
+ "inline-help": '#keepURLFragmentsHelp',
+ disabled: _ctx.isLoading
+ }, null, 8, ["modelValue", "title", "introduction", "disabled"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h3", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_TrackingSiteSearch')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_SiteSearchUse')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", ManageGlobalSettingsvue_type_template_id_1bcd889c_hoisted_19, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_SearchParametersNote')) + " " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_SearchParametersNote2')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, {
+ uicontrol: "text",
+ name: "searchKeywordParametersGlobal",
+ "var-type": "array",
+ modelValue: _ctx.searchKeywordParametersGlobal,
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = function ($event) {
+ return _ctx.searchKeywordParametersGlobal = $event;
+ }),
+ title: _ctx.translate('SitesManager_SearchKeywordLabel'),
+ "inline-help": _ctx.translate('SitesManager_SearchKeywordParametersDesc'),
+ disabled: _ctx.isLoading
+ }, null, 8, ["modelValue", "title", "inline-help", "disabled"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, {
+ uicontrol: "text",
+ name: "searchCategoryParametersGlobal",
+ "var-type": "array",
+ modelValue: _ctx.searchCategoryParametersGlobal,
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = function ($event) {
+ return _ctx.searchCategoryParametersGlobal = $event;
+ }),
+ title: _ctx.translate('SitesManager_SearchCategoryLabel'),
+ "inline-help": _ctx.searchCategoryParamsInlineHelp,
+ disabled: _ctx.isLoading
+ }, null, 8, ["modelValue", "title", "inline-help", "disabled"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, {
+ uicontrol: "select",
+ name: "defaultTimezone",
+ options: _ctx.timezoneOptions,
+ title: _ctx.translate('SitesManager_SelectDefaultTimezone'),
+ introduction: _ctx.translate('SitesManager_DefaultTimezoneForNewWebsites'),
+ "inline-help": '#timezoneHelp',
+ disabled: _ctx.isLoading,
+ modelValue: _ctx.defaultTimezone,
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = function ($event) {
+ return _ctx.defaultTimezone = $event;
+ })
+ }, null, 8, ["options", "title", "introduction", "disabled", "modelValue"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, {
+ uicontrol: "select",
+ name: "defaultCurrency",
+ modelValue: _ctx.defaultCurrency,
+ "onUpdate:modelValue": _cache[7] || (_cache[7] = function ($event) {
+ return _ctx.defaultCurrency = $event;
+ }),
+ options: _ctx.currencies,
+ title: _ctx.translate('SitesManager_SelectDefaultCurrency'),
+ introduction: _ctx.translate('SitesManager_DefaultCurrencyForNewWebsites'),
+ "inline-help": _ctx.translate('SitesManager_CurrencySymbolWillBeUsedForGoals'),
+ disabled: _ctx.isLoading
+ }, null, 8, ["modelValue", "options", "title", "introduction", "inline-help", "disabled"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_SaveButton, {
+ saving: _ctx.isSaving,
+ onConfirm: _cache[8] || (_cache[8] = function ($event) {
+ return _ctx.saveGlobalSettings();
+ })
+ }, null, 8, ["saving"])];
+ }),
+ _: 1
+ }, 8, ["content-title"]), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.hasSuperUserAccess]])]);
+}
+// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/ManageGlobalSettings/ManageGlobalSettings.vue?vue&type=template&id=1bcd889c
+
+// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/SitesManager/vue/src/ManageGlobalSettings/ManageGlobalSettings.vue?vue&type=script&lang=ts
+
+
+
+
+
+
+/* harmony default export */ var ManageGlobalSettingsvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({
+ props: {
+ // TypeScript can't add state types if there are no properties (probably a bug in Vue)
+ // so we add one dummy property to get the compile to work
+ dummy: String
+ },
+ components: {
+ ContentBlock: external_CoreHome_["ContentBlock"],
+ Field: external_CorePluginsAdmin_["Field"],
+ SaveButton: external_CorePluginsAdmin_["SaveButton"]
+ },
+ data: function data() {
+ var currentDate = new Date();
+ var utcTime = new Date(currentDate.getUTCFullYear(), currentDate.getUTCMonth(), currentDate.getUTCDate(), currentDate.getUTCHours(), currentDate.getUTCMinutes(), currentDate.getUTCSeconds());
+ var settings = src_GlobalSettingsStore_GlobalSettingsStore.globalSettings.value;
+ return {
+ currentIpAddress: null,
+ utcTime: utcTime,
+ keepURLFragmentsGlobal: settings.keepURLFragmentsGlobal,
+ defaultTimezone: settings.defaultTimezone,
+ defaultCurrency: settings.defaultCurrency,
+ excludedIpsGlobal: (settings.excludedIpsGlobal || '').split(','),
+ excludedQueryParametersGlobal: (settings.excludedQueryParametersGlobal || '').split(','),
+ excludedUserAgentsGlobal: (settings.excludedUserAgentsGlobal || '').split(','),
+ searchKeywordParametersGlobal: (settings.searchKeywordParametersGlobal || '').split(','),
+ searchCategoryParametersGlobal: (settings.searchCategoryParametersGlobal || '').split(','),
+ isSaving: false
+ };
+ },
+ created: function created() {
+ var _this = this;
+
+ Object(external_commonjs_vue_commonjs2_vue_root_Vue_["watch"])(function () {
+ return src_GlobalSettingsStore_GlobalSettingsStore.globalSettings.value;
+ }, function (settings) {
+ _this.keepURLFragmentsGlobal = settings.keepURLFragmentsGlobal;
+ _this.defaultTimezone = settings.defaultTimezone;
+ _this.defaultCurrency = settings.defaultCurrency;
+ _this.excludedIpsGlobal = (settings.excludedIpsGlobal || '').split(',');
+ _this.excludedQueryParametersGlobal = (settings.excludedQueryParametersGlobal || '').split(',');
+ _this.excludedUserAgentsGlobal = (settings.excludedUserAgentsGlobal || '').split(',');
+ _this.searchKeywordParametersGlobal = (settings.searchKeywordParametersGlobal || '').split(',');
+ _this.searchCategoryParametersGlobal = (settings.searchCategoryParametersGlobal || '').split(',');
+ });
+ external_CoreHome_["AjaxHelper"].fetch({
+ method: 'API.getIpFromHeader'
+ }).then(function (response) {
+ _this.currentIpAddress = response.value;
+ });
+ },
+ methods: {
+ saveGlobalSettings: function saveGlobalSettings() {
+ this.isSaving = true;
+ src_GlobalSettingsStore_GlobalSettingsStore.saveGlobalSettings({
+ keepURLFragments: this.keepURLFragmentsGlobal,
+ currency: this.defaultCurrency,
+ timezone: this.defaultTimezone,
+ excludedIps: this.excludedIpsGlobal.join(','),
+ excludedQueryParameters: this.excludedQueryParametersGlobal.join(','),
+ excludedUserAgents: this.excludedUserAgentsGlobal.join(','),
+ searchKeywordParameters: this.searchKeywordParametersGlobal.join(','),
+ searchCategoryParameters: this.searchCategoryParametersGlobal.join(',')
+ }).then(function () {
+ external_CoreHome_["Matomo"].helper.redirect({
+ showaddsite: false
+ });
+ });
+ }
+ },
+ computed: {
+ isLoading: function isLoading() {
+ return src_GlobalSettingsStore_GlobalSettingsStore.isLoading.value || src_TimezoneStore_TimezoneStore.isLoading.value || src_CurrencyStore_CurrencyStore.isLoading.value;
+ },
+ timezones: function timezones() {
+ return src_TimezoneStore_TimezoneStore.timezones.value;
+ },
+ timezoneOptions: function timezoneOptions() {
+ return this.timezones.map(function (_ref) {
+ var group = _ref.group,
+ label = _ref.label,
+ code = _ref.code;
+ return {
+ group: group,
+ key: label,
+ value: code
+ };
+ });
+ },
+ currencies: function currencies() {
+ return src_CurrencyStore_CurrencyStore.currencies.value;
+ },
+ hasSuperUserAccess: function hasSuperUserAccess() {
+ return external_CoreHome_["Matomo"].hasSuperUserAccess;
+ },
+ yourCurrentIpAddressIs: function yourCurrentIpAddressIs() {
+ return Object(external_CoreHome_["translate"])('SitesManager_YourCurrentIpAddressIs', "<i>".concat(this.currentIpAddress, "</i>"));
+ },
+ timezoneSupportEnabled: function timezoneSupportEnabled() {
+ return src_TimezoneStore_TimezoneStore.timezoneSupportEnabled.value;
+ },
+ utcTimeDate: function utcTimeDate() {
+ var utcTime = this.utcTime;
+
+ var formatTimePart = function formatTimePart(n) {
+ return n.toString().padStart(2, '0');
+ };
+
+ var hours = formatTimePart(utcTime.getHours());
+ var minutes = formatTimePart(utcTime.getMinutes());
+ var seconds = formatTimePart(utcTime.getSeconds());
+ return "".concat(Object(external_CoreHome_["format"])(this.utcTime), " ").concat(hours, ":").concat(minutes, ":").concat(seconds);
+ },
+ keepUrlFragmentHelp: function keepUrlFragmentHelp() {
+ return Object(external_CoreHome_["translate"])('SitesManager_KeepURLFragmentsHelp', '<em>#</em>', '<em>example.org/index.html#first_section</em>', '<em>example.org/index.html</em>');
+ },
+ searchCategoryParamsInlineHelp: function searchCategoryParamsInlineHelp() {
+ var parts = [Object(external_CoreHome_["translate"])('Goals_Optional'), Object(external_CoreHome_["translate"])('SitesManager_SearchCategoryDesc'), Object(external_CoreHome_["translate"])('SitesManager_SearchCategoryParametersDesc')];
+ return parts.join(' ');
}
}
}));
+// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/ManageGlobalSettings/ManageGlobalSettings.vue?vue&type=script&lang=ts
+
+// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/ManageGlobalSettings/ManageGlobalSettings.vue
+
+
+
+ManageGlobalSettingsvue_type_script_lang_ts.render = ManageGlobalSettingsvue_type_template_id_1bcd889c_render
+
+/* harmony default export */ var ManageGlobalSettings = (ManageGlobalSettingsvue_type_script_lang_ts);
+// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/ManageGlobalSettings/ManageGlobalSettings.adapter.ts
+/*!
+ * Matomo - free/libre analytics platform
+ *
+ * @link https://matomo.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+
+/* harmony default export */ var ManageGlobalSettings_adapter = (Object(external_CoreHome_["createAngularJsAdapter"])({
+ component: ManageGlobalSettings,
+ scope: {},
+ directiveName: 'matomoGlobalSettings'
+}));
// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/index.ts
/*!
* Matomo - free/libre analytics platform
@@ -1057,6 +2112,8 @@ SiteFieldsvue_type_script_lang_ts.render = render
+
+
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js
diff --git a/plugins/SitesManager/vue/dist/SitesManager.umd.min.js b/plugins/SitesManager/vue/dist/SitesManager.umd.min.js
index efcc80b604..60f1c2fee0 100644
--- a/plugins/SitesManager/vue/dist/SitesManager.umd.min.js
+++ b/plugins/SitesManager/vue/dist/SitesManager.umd.min.js
@@ -1,33 +1,45 @@
-(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin"],t):"object"===typeof exports?exports["SitesManager"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["SitesManager"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,n){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/SitesManager/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},a5a2:function(e,t){e.exports=n},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"SiteTypesStore",(function(){return p})),n.d(t,"SiteFields",(function(){return Ae})),n.d(t,"CurrencyStore",(function(){return Ve})),n.d(t,"TimezoneStore",(function(){return ge})),"undefined"!==typeof window){var i=window.document.currentScript,r=i&&i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);r&&(n.p=r[1])}var a=n("19dc"),o=n("8bbf");function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function s(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}
+(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin"],t):"object"===typeof exports?exports["SitesManager"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["SitesManager"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,n){return function(e){var t={};function n(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(a,i,function(t){return e[t]}.bind(null,i));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/SitesManager/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},a5a2:function(e,t){e.exports=n},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"SiteTypesStore",(function(){return h})),n.d(t,"CurrencyStore",(function(){return Xe})),n.d(t,"TimezoneStore",(function(){return Re})),n.d(t,"SitesManagement",(function(){return gt})),n.d(t,"ManageGlobalSettings",(function(){return Lt})),"undefined"!==typeof window){var a=window.document.currentScript,i=a&&a.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(n.p=i[1])}var r=n("19dc"),l=n("8bbf");function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function c(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */var d=window,m=d.$,b=function(){function e(){var t=this;l(this,e),u(this,"state",Object(o["reactive"])({typesById:{}})),u(this,"typesById",Object(o["computed"])((function(){return Object(o["readonly"])(t.state).typesById}))),u(this,"types",Object(o["computed"])((function(){return Object.values(t.typesById.value)}))),u(this,"response",void 0),this.fetchAvailableTypes()}return s(e,[{key:"fetchAvailableTypes",value:function(){var e=this;return this.response?Promise.resolve(this.response):(this.response=a["AjaxHelper"].fetch({method:"API.getAvailableMeasurableTypes",filter_limit:"-1"}).then((function(t){return t.forEach((function(t){e.state.typesById[t.id]=t})),e.types.value})),this.response)}},{key:"getEditSiteIdParameter",value:function(){var e=a["MatomoUrl"].hashParsed.value.editsiteid;if(e&&m.isNumeric(e))return e}},{key:"removeEditSiteIdParameterFromHash",value:function(){var e=Object.assign({},a["MatomoUrl"].hashParsed.value);delete e.editsiteid,a["MatomoUrl"].updateHash(e)}}]),e}(),p=Object(a["lazyInitSingleton"])(b);
+ */var d=window,b=d.$,m=function(){function e(){var t=this;o(this,e),u(this,"state",Object(l["reactive"])({isLoading:!1,typesById:{}})),u(this,"typesById",Object(l["computed"])((function(){return Object(l["readonly"])(t.state).typesById}))),u(this,"isLoading",Object(l["computed"])((function(){return Object(l["readonly"])(t.state).isLoading}))),u(this,"types",Object(l["computed"])((function(){return Object.values(t.typesById.value)}))),u(this,"response",void 0),this.fetchAvailableTypes()}return c(e,[{key:"fetchAvailableTypes",value:function(){var e=this;return this.response?Promise.resolve(this.response):(this.state.isLoading=!0,this.response=r["AjaxHelper"].fetch({method:"API.getAvailableMeasurableTypes",filter_limit:"-1"}).then((function(t){return t.forEach((function(t){e.state.typesById[t.id]=t})),e.types.value})).finally((function(){e.state.isLoading=!1})),this.response)}},{key:"getEditSiteIdParameter",value:function(){var e=r["MatomoUrl"].hashQuery.value.match(/editsiteid=([0-9]+)/);if(e){var t="1"===r["MatomoUrl"].urlParsed.value.showaddsite||"true"===r["MatomoUrl"].urlParsed.value.showaddsite,n=e[1];return n&&b.isNumeric(n)&&!t?n:void 0}}},{key:"removeEditSiteIdParameterFromHash",value:function(){var e=Object.assign({},r["MatomoUrl"].hashParsed.value);delete e.editsiteid,r["MatomoUrl"].updateHash(e)}}]),e}(),h=Object(r["lazyInitSingleton"])(m);
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
-function f(){return{get typesById(){return Object(a["clone"])(p.typesById.value)},fetchTypeById:function(e){var t=this;return p.fetchAvailableTypes().then((function(){return Object(a["cloneThenApply"])(t.typesById[e])}))},fetchAvailableTypes:function(){return p.fetchAvailableTypes().then((function(e){return Object(a["cloneThenApply"])(e)}))},hasMultipleTypes:function(){return p.fetchAvailableTypes().then((function(e){return e&&Object.keys(e).length>1}))},removeEditSiteIdParameterFromHash:p.removeEditSiteIdParameterFromHash.bind(p),getEditSiteIdParameter:p.getEditSiteIdParameter.bind(p)}}window.angular.module("piwikApp.service").factory("sitesManagerTypeModel",f);var h=["idsite","type"],j={class:"card-content"},g={key:0,class:"row"},S={class:"col m3"},y={class:"title"},O={class:"title"},v=["target","title","href"],E={class:"col m4"},V={class:"title"},N={class:"title"},T={class:"title"},w={class:"title"},_={class:"col m4"},M={class:"title"},x=Object(o["createTextVNode"])(": "),k=["href"],D={key:0},C={class:"title"},A={key:1},I={class:"title"},B={key:2},P={class:"title"},U={class:"col m1 text-right"},z=["title"],H=Object(o["createElementVNode"])("span",{class:"icon-edit"},null,-1),F=[H],G=["title"],$=Object(o["createElementVNode"])("span",{class:"icon-delete"},null,-1),q=[$],L={key:1},J={class:"form-group row"},Y={class:"col s12 m6 input-field"},R=["placeholder"],W=Object(o["createElementVNode"])("div",{class:"col s12 m6"},null,-1),K={id:"timezoneHelpText",class:"inline-help-node"},Q={key:0},X=Object(o["createElementVNode"])("br",null,null,-1),Z=Object(o["createElementVNode"])("br",null,null,-1),ee={class:"editingSiteFooter"},te=["value"],ne={class:"ui-confirm"},ie=["value"],re=["value"];function ae(e,t,n,i,r,a){var l,c,s,u=this,d=Object(o["resolveComponent"])("ActivityIndicator"),m=Object(o["resolveComponent"])("GroupedSettings"),b=Object(o["resolveComponent"])("Field"),p=Object(o["resolveComponent"])("MatomoDialog");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:Object(o["normalizeClass"])(["site card hoverable",{editingSite:!!e.editMode}]),idsite:e.theSite.idsite,type:e.theSite.type},[Object(o["createElementVNode"])("div",j,[e.editMode?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",g,[Object(o["createElementVNode"])("div",S,[Object(o["createElementVNode"])("h4",null,Object(o["toDisplayString"])(e.theSite.name),1),Object(o["createElementVNode"])("ul",null,[Object(o["createElementVNode"])("li",null,[Object(o["createElementVNode"])("span",y,Object(o["toDisplayString"])(e.translate("General_Id"))+":",1),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.theSite.idsite),1)]),Object(o["withDirectives"])(Object(o["createElementVNode"])("li",null,[Object(o["createElementVNode"])("span",O,Object(o["toDisplayString"])(e.translate("SitesManager_Type"))+":",1),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.currentType.name),1)],512),[[o["vShow"],e.availableTypes.length>1]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("li",null,[Object(o["createElementVNode"])("a",{target:e.isInternalSetupUrl?"_self":"_blank",title:e.translate("SitesManager_ShowTrackingTag"),href:e.setupUrl},Object(o["toDisplayString"])(e.translate("SitesManager_ShowTrackingTag")),9,v)],512),[[o["vShow"],e.theSite.idsite&&e.howToSetupUrl]])])]),Object(o["createElementVNode"])("div",E,[Object(o["createElementVNode"])("ul",null,[Object(o["createElementVNode"])("li",null,[Object(o["createElementVNode"])("span",V,Object(o["toDisplayString"])(e.translate("SitesManager_Timezone"))+":",1),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.theSite.timezone_name),1)]),Object(o["createElementVNode"])("li",null,[Object(o["createElementVNode"])("span",N,Object(o["toDisplayString"])(e.translate("SitesManager_Currency"))+":",1),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.theSite.currency_name),1)]),Object(o["withDirectives"])(Object(o["createElementVNode"])("li",null,[Object(o["createElementVNode"])("span",T,Object(o["toDisplayString"])(e.translate("Goals_Ecommerce"))+":",1),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_Yes")),1)],512),[[o["vShow"],1===e.theSite.ecommerce||"1"===e.theSite.ecommerce]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("li",null,[Object(o["createElementVNode"])("span",w,Object(o["toDisplayString"])(e.translate("Actions_SubmenuSitesearch"))+":",1),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_Yes")),1)],512),[[o["vShow"],1===e.theSite.sitesearch||"1"===e.theSite.sitesearch]])])]),Object(o["createElementVNode"])("div",_,[Object(o["createElementVNode"])("ul",null,[Object(o["createElementVNode"])("li",null,[Object(o["createElementVNode"])("span",M,Object(o["toDisplayString"])(e.translate("SitesManager_Urls")),1),x,(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.theSite.alias_urls,(function(t,n){return Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:t},[Object(o["createElementVNode"])("a",{target:"_blank",rel:"noreferrer noopener",href:t},Object(o["toDisplayString"])(t)+Object(o["toDisplayString"])(n===e.theSite.alias_urls.length-1?"":", "),9,k)])})),128))]),null!==(l=e.theSite.excluded_ips)&&void 0!==l&&l.length?(Object(o["openBlock"])(),Object(o["createElementBlock"])("li",D,[Object(o["createElementVNode"])("span",C,Object(o["toDisplayString"])(e.translate("SitesManager_ExcludedIps"))+":",1),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.theSite.excluded_ips.split(/\s*,\s*/g).join(", ")),1)])):Object(o["createCommentVNode"])("",!0),null!==(c=e.theSite.excluded_parameters)&&void 0!==c&&c.length?(Object(o["openBlock"])(),Object(o["createElementBlock"])("li",A,[Object(o["createElementVNode"])("span",I,Object(o["toDisplayString"])(e.translate("SitesManager_ExcludedParameters"))+":",1),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.theSite.excluded_parameters.split(/\s*,\s*/g).join(", ")),1)])):Object(o["createCommentVNode"])("",!0),null!==(s=e.theSite.excluded_user_agents)&&void 0!==s&&s.length?(Object(o["openBlock"])(),Object(o["createElementBlock"])("li",B,[Object(o["createElementVNode"])("span",P,Object(o["toDisplayString"])(e.translate("SitesManager_ExcludedUserAgents"))+":",1),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.theSite.excluded_user_agents.split(/\s*,\s*/g).join(", ")),1)])):Object(o["createCommentVNode"])("",!0)])]),Object(o["createElementVNode"])("div",U,[Object(o["createElementVNode"])("ul",null,[Object(o["createElementVNode"])("li",null,[Object(o["createElementVNode"])("button",{class:"table-action",onClick:t[0]||(t[0]=function(t){return e.editSite()}),title:e.translate("General_Edit")},F,8,z)]),Object(o["createElementVNode"])("li",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("button",{class:"table-action",onClick:t[1]||(t[1]=function(e){return u.showRemoveDialog=!0}),title:e.translate("General_Delete")},q,8,G),[[o["vShow"],e.theSite.idsite]])])])])])),e.editMode?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",L,[Object(o["createElementVNode"])("div",J,[Object(o["createElementVNode"])("div",Y,[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{type:"text","onUpdate:modelValue":t[2]||(t[2]=function(t){return e.theSite.name=t}),maxlength:"90",placeholder:e.translate("General_Name")},null,8,R),[[o["vModelText"],e.theSite.name]]),Object(o["createElementVNode"])("label",null,Object(o["toDisplayString"])(e.translate("General_Name")),1)]),W]),Object(o["createVNode"])(d,{loading:e.isLoading},null,8,["loading"]),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.measurableSettings,(function(t){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{key:t.pluginName},[Object(o["createVNode"])(m,{"group-name":t.pluginName,settings:t.settings,"all-setting-values":e.settingValues,onChange:function(n){return e.settingValues["".concat(t.pluginName,".").concat(n.name)]=n.value}},null,8,["group-name","settings","all-setting-values","onChange"])])})),128)),Object(o["createVNode"])(b,{uicontrol:"select",name:"currency",modelValue:e.theSite.currency,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.theSite.currency=t}),title:e.translate("SitesManager_Currency"),"inline-help":e.translate("SitesManager_CurrencySymbolWillBeUsedForGoals"),options:e.currencies},null,8,["modelValue","title","inline-help","options"]),Object(o["createVNode"])(b,{uicontrol:"select",name:"timezone",modelValue:e.theSite.timezone,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.theSite.timezone=t}),title:e.translate("SitesManager_Timezone"),"inline-help":"#timezoneHelpText",options:e.timezones},null,8,["modelValue","title","options"]),Object(o["createElementVNode"])("div",K,[Object(o["createElementVNode"])("div",null,[e.timezoneSupportEnabled?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",Q,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("SitesManager_AdvancedTimezoneSupportNotFound"))+" ",1),X])),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.utcTimeIs)+" ",1),Z,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("SitesManager_ChangingYourTimezoneWillOnlyAffectDataForward")),1)])]),Object(o["createElementVNode"])("div",ee,[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{type:"submit",class:"btn",value:e.translate("General_Save"),onClick:t[5]||(t[5]=function(t){return e.saveSite()})},null,8,te),[[o["vShow"],!e.isLoading]]),Object(o["createElementVNode"])("button",{class:"btn btn-link",onClick:t[6]||(t[6]=function(t){return e.cancelEditSite(e.site)})},Object(o["toDisplayString"])(e.translate("General_Cancel","","")),1)])])):Object(o["createCommentVNode"])("",!0)]),Object(o["createVNode"])(p,{modelValue:e.showRemoveDialog,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.showRemoveDialog=t}),onYes:t[8]||(t[8]=function(t){return e.deleteSite()})},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("div",ne,[Object(o["createElementVNode"])("h2",null,Object(o["toDisplayString"])(e.removeDialogTitle),1),Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("SitesManager_DeleteSiteExplanation")),1),Object(o["createElementVNode"])("input",{type:"button",value:e.translate("General_Yes"),role:"yes"},null,8,ie),Object(o["createElementVNode"])("input",{type:"button",value:e.translate("General_No"),role:"no"},null,8,re)])]})),_:1},8,["modelValue"])],10,h)}var oe=n("a5a2");function le(e,t){return me(e)||de(e,t)||se(e,t)||ce()}function ce(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function se(e,t){if(e){if("string"===typeof e)return ue(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ue(e,t):void 0}}function ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function de(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(i=n.next()).done);o=!0)if(a.push(i.value),t&&a.length===t)break}catch(c){l=!0,r=c}finally{try{o||null==n["return"]||n["return"]()}finally{if(l)throw r}}return a}}function me(e){if(Array.isArray(e))return e}function be(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pe(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function fe(e,t,n){return t&&pe(e.prototype,t),n&&pe(e,n),e}function he(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}
+function p(){return{get typesById(){return Object(r["clone"])(h.typesById.value)},fetchTypeById:function(e){var t=this;return h.fetchAvailableTypes().then((function(){return Object(r["cloneThenApply"])(t.typesById[e])}))},fetchAvailableTypes:function(){return h.fetchAvailableTypes().then((function(e){return Object(r["cloneThenApply"])(e)}))},hasMultipleTypes:function(){return h.fetchAvailableTypes().then((function(e){return e&&Object.keys(e).length>1}))},removeEditSiteIdParameterFromHash:h.removeEditSiteIdParameterFromHash.bind(h),getEditSiteIdParameter:h.getEditSiteIdParameter.bind(h)}}window.angular.module("piwikApp.service").factory("sitesManagerTypeModel",p);var g={class:"SitesManager",ref:"root"},f={class:"sites-manager-header"},S=["innerHTML"],j=Object(l["createElementVNode"])("br",null,null,-1),O=["innerHTML"],v={class:"loadingPiwik"},y=["alt"],E={class:"ui-confirm"},N={class:"center"},V=["title","onClick"],T={class:"ui-button-text"},x={class:"sitesManagerList"},M={key:0},w={class:"bottomButtonBar"};function A(e,t,n,a,i,r){var o=this,s=Object(l["resolveComponent"])("EnrichedHeadline"),c=Object(l["resolveComponent"])("ButtonBar"),u=Object(l["resolveComponent"])("MatomoDialog"),d=Object(l["resolveComponent"])("SiteFields"),b=Object(l["resolveDirective"])("content-intro");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",g,[Object(l["createElementVNode"])("div",f,[Object(l["withDirectives"])(Object(l["createElementVNode"])("div",null,[Object(l["withDirectives"])(Object(l["createElementVNode"])("h2",null,[Object(l["createVNode"])(s,{"help-url":"https://matomo.org/docs/manage-websites/","feature-name":e.translate("SitesManager_WebsitesManagement")},{default:Object(l["withCtx"])((function(){return[Object(l["createTextVNode"])(Object(l["toDisplayString"])(e.headlineText),1)]})),_:1},8,["help-url","feature-name"])],512),[[l["vShow"],e.availableTypes.length]]),Object(l["createElementVNode"])("p",null,[Object(l["createTextVNode"])(Object(l["toDisplayString"])(e.translate("SitesManager_MainDescription"))+" ",1),Object(l["createElementVNode"])("span",{innerHTML:e.$sanitize(e.mainDescription)},null,8,S),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",null,[j,Object(l["createElementVNode"])("span",{innerHTML:e.superUserAccessMessage},null,8,O)],512),[[l["vShow"],e.hasSuperUserAccess]])])],512),[[b]])]),Object(l["createElementVNode"])("div",null,[Object(l["createElementVNode"])("div",{class:Object(l["normalizeClass"])({hide_only:!e.isLoading})},[Object(l["createElementVNode"])("div",v,[Object(l["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:e.translate("General_LoadingData")},null,8,y),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("General_LoadingData")),1)])],2)]),Object(l["createElementVNode"])("div",null,[Object(l["createVNode"])(c,{"site-is-being-edited":e.isSiteBeingEdited,"has-prev":e.hasPrev,hasNext:e.hasNext,"offset-start":e.offsetStart,"offset-end":e.offsetEnd,"total-number-of-sites":e.totalNumberOfSites,"is-loading":e.isLoading,"search-term":e.searchTerm,"is-searching":!!e.activeSearchTerm,"onUpdate:searchTerm":t[0]||(t[0]=function(t){return e.searchTerm=t}),onAdd:t[1]||(t[1]=function(t){return e.addNewEntity()}),onSearch:t[2]||(t[2]=function(t){return e.searchSites(t)}),onPrev:t[3]||(t[3]=function(t){return e.previousPage()}),onNext:t[4]||(t[4]=function(t){return e.nextPage()})},null,8,["site-is-being-edited","has-prev","hasNext","offset-start","offset-end","total-number-of-sites","is-loading","search-term","is-searching"])]),Object(l["createVNode"])(u,{modelValue:e.showAddSiteDialog,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.showAddSiteDialog=t})},{default:Object(l["withCtx"])((function(){return[Object(l["createElementVNode"])("div",E,[Object(l["createElementVNode"])("div",null,[Object(l["createElementVNode"])("h2",null,Object(l["toDisplayString"])(e.translate("SitesManager_ChooseMeasurableTypeHeadline")),1),Object(l["createElementVNode"])("div",N,[Object(l["createElementVNode"])("p",null,[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.availableTypes,(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("button",{type:"button",key:t.id,title:t.description,class:"modal-close btn",style:{"margin-left":"20px"},onClick:function(n){e.addSite(t.id)},"aria-disabled":"false"},[Object(l["createElementVNode"])("span",T,Object(l["toDisplayString"])(t.name),1)],8,V)})),128))])])])])]})),_:1},8,["modelValue"]),Object(l["createElementVNode"])("div",x,[e.activeSearchTerm&&0===e.sites.length&&!e.isLoading?(Object(l["openBlock"])(),Object(l["createElementBlock"])("p",M,[Object(l["createTextVNode"])(Object(l["toDisplayString"])(e.translate("SitesManager_NotFound"))+" ",1),Object(l["createElementVNode"])("strong",null,Object(l["toDisplayString"])(e.activeSearchTerm),1)])):Object(l["createCommentVNode"])("",!0),(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.sites,(function(n,a){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",{key:n.idsite},[Object(l["createVNode"])(d,{site:n,"timezone-support-enabled":e.timezoneSupportEnabled,"utc-time":e.utcTime,"global-settings":e.globalSettings,onEditSite:t[6]||(t[6]=function(e){return o.isSiteBeingEdited=!0}),onCancelEditSite:t[7]||(t[7]=function(t){return e.afterCancelEdit(t)}),onDelete:t[8]||(t[8]=function(t){return e.afterDelete(t)}),onSave:function(t){return e.afterSave(t.site,t.settingValues,a,t.isNew)}},null,8,["site","timezone-support-enabled","utc-time","global-settings","onSave"])])})),128))]),Object(l["createElementVNode"])("div",w,[Object(l["createVNode"])(c,{"site-is-being-edited":e.isSiteBeingEdited,"has-prev":e.hasPrev,hasNext:e.hasNext,"offset-start":e.offsetStart,"offset-end":e.offsetEnd,"total-number-of-sites":e.totalNumberOfSites,"is-loading":e.isLoading,"search-term":e.searchTerm,"is-searching":!!e.activeSearchTerm,"onUpdate:searchTerm":t[9]||(t[9]=function(t){return e.searchTerm=t}),onAdd:t[10]||(t[10]=function(t){return e.addNewEntity()}),onSearch:t[11]||(t[11]=function(t){return e.searchSites(t)}),onPrev:t[12]||(t[12]=function(t){return e.previousPage()}),onNext:t[13]||(t[13]=function(t){return e.nextPage()})},null,8,["site-is-being-edited","has-prev","hasNext","offset-start","offset-end","total-number-of-sites","is-loading","search-term","is-searching"])])],512)}var C={class:"sitesButtonBar clearfix"},_={class:"search"},P=["value","placeholder","disabled"],D=["title"],G={class:"paging"},U=["disabled"],k={style:{cursor:"pointer"}},L={class:"counter"},I=["disabled"],B={style:{cursor:"pointer"},class:"pointer"};function z(e,t,n,a,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",C,[Object(l["withDirectives"])(Object(l["createElementVNode"])("a",{class:Object(l["normalizeClass"])(["btn addSite",{disabled:e.siteIsBeingEdited}]),onClick:t[0]||(t[0]=function(t){return e.addNewEntity()}),tabindex:"1"},Object(l["toDisplayString"])(e.availableTypes.length>1?e.translate("SitesManager_AddMeasurable"):e.translate("SitesManager_AddSite")),3),[[l["vShow"],e.hasSuperUserAccess&&e.availableTypes]]),Object(l["withDirectives"])(Object(l["createElementVNode"])("div",_,[Object(l["createElementVNode"])("input",{value:e.searchTerm,onKeydown:t[1]||(t[1]=function(t){return e.onKeydown(t)}),placeholder:e.translate("Actions_SubmenuSitesearch"),type:"text",disabled:e.siteIsBeingEdited},null,40,P),Object(l["createElementVNode"])("img",{onClick:t[2]||(t[2]=function(t){return e.searchSite()}),title:e.translate("General_ClickToSearch"),class:"search_ico",src:"plugins/Morpheus/images/search_ico.png"},null,8,D)],512),[[l["vShow"],e.hasPrev||e.hasNext||e.isSearching]]),Object(l["withDirectives"])(Object(l["createElementVNode"])("div",G,[Object(l["createElementVNode"])("a",{class:"btn prev",disabled:!(e.hasPrev&&!e.isLoading&&!e.siteIsBeingEdited)||void 0,onClick:t[3]||(t[3]=function(t){return e.previousPage()})},[Object(l["createElementVNode"])("span",k,"« "+Object(l["toDisplayString"])(e.translate("General_Previous")),1)],8,U),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",L,[Object(l["createElementVNode"])("span",null,Object(l["toDisplayString"])(e.paginationText),1)],512),[[l["vShow"],e.hasPrev||e.hasNext]]),Object(l["createElementVNode"])("a",{class:"btn next",disabled:!(e.hasNext&&!e.isLoading&&!e.siteIsBeingEdited)||void 0,onClick:t[4]||(t[4]=function(t){return e.nextPage()})},[Object(l["createElementVNode"])("span",B,Object(l["toDisplayString"])(e.translate("General_Next"))+" »",1)],8,I)],512),[[l["vShow"],e.hasPrev||e.hasNext]])])}var H=Object(l["defineComponent"])({props:{siteIsBeingEdited:{type:Boolean,required:!0},hasPrev:{type:Boolean,required:!0},hasNext:{type:Boolean,required:!0},offsetStart:{type:Number,required:!0},offsetEnd:{type:Number,required:!0},totalNumberOfSites:{type:Number},isLoading:{type:Boolean,required:!0},searchTerm:{type:String,required:!0},isSearching:{type:Boolean,required:!0}},emits:["add","search","prev","next","update:searchTerm"],created:function(){this.onKeydown=Object(r["debounce"])(this.onKeydown,50)},computed:{hasSuperUserAccess:function(){return r["Matomo"].hasSuperUserAccess},availableTypes:function(){return h.types.value},paginationText:function(){var e;return e=this.isSearching?Object(r["translate"])("General_PaginationWithoutTotal","".concat(this.offsetStart),"".concat(this.offsetEnd)):Object(r["translate"])("General_Pagination","".concat(this.offsetStart),"".concat(this.offsetEnd),null===this.totalNumberOfSites?"?":"".concat(this.totalNumberOfSites))," ".concat(e," ")}},methods:{addNewEntity:function(){this.$emit("add")},searchSite:function(){this.siteIsBeingEdited||this.$emit("search")},previousPage:function(){this.$emit("prev")},nextPage:function(){this.$emit("next")},onKeydown:function(e){var t=this;setTimeout((function(){"Enter"!==e.key?t.$emit("update:searchTerm",e.target.value):t.searchSiteOnEnter(e)}))},searchSiteOnEnter:function(e){e.preventDefault(),this.searchSite()}}});H.render=z;var F=H,K=["idsite","type"],W={class:"card-content"},R={key:0,class:"row"},Q={class:"col m3"},q={class:"title"},$={class:"title"},Y=["target","title","href"],J={class:"col m4"},X={class:"title"},Z={class:"title"},ee={class:"title"},te={class:"title"},ne={class:"col m4"},ae={class:"title"},ie=Object(l["createTextVNode"])(": "),re=["href"],le={key:0},oe={class:"title"},se={key:1},ce={class:"title"},ue={key:2},de={class:"title"},be={class:"col m1 text-right"},me=["title"],he=Object(l["createElementVNode"])("span",{class:"icon-edit"},null,-1),pe=[he],ge=["title"],fe=Object(l["createElementVNode"])("span",{class:"icon-delete"},null,-1),Se=[fe],je={key:1},Oe={class:"form-group row"},ve={class:"col s12 m6 input-field"},ye=["placeholder"],Ee=Object(l["createElementVNode"])("div",{class:"col s12 m6"},null,-1),Ne={id:"timezoneHelpText",class:"inline-help-node"},Ve={key:0},Te=Object(l["createElementVNode"])("br",null,null,-1),xe=Object(l["createElementVNode"])("br",null,null,-1),Me={class:"editingSiteFooter"},we=["value"],Ae={class:"ui-confirm"},Ce=["value"],_e=["value"];function Pe(e,t,n,a,i,r){var o,s,c,u=this,d=Object(l["resolveComponent"])("ActivityIndicator"),b=Object(l["resolveComponent"])("GroupedSettings"),m=Object(l["resolveComponent"])("Field"),h=Object(l["resolveComponent"])("MatomoDialog");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",{class:Object(l["normalizeClass"])(["site card hoverable",{editingSite:!!e.editMode}]),idsite:e.theSite.idsite,type:e.theSite.type,ref:"root"},[Object(l["createElementVNode"])("div",W,[e.editMode?Object(l["createCommentVNode"])("",!0):(Object(l["openBlock"])(),Object(l["createElementBlock"])("div",R,[Object(l["createElementVNode"])("div",Q,[Object(l["createElementVNode"])("h4",null,Object(l["toDisplayString"])(e.theSite.name),1),Object(l["createElementVNode"])("ul",null,[Object(l["createElementVNode"])("li",null,[Object(l["createElementVNode"])("span",q,Object(l["toDisplayString"])(e.translate("General_Id"))+":",1),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.theSite.idsite),1)]),Object(l["withDirectives"])(Object(l["createElementVNode"])("li",null,[Object(l["createElementVNode"])("span",$,Object(l["toDisplayString"])(e.translate("SitesManager_Type"))+":",1),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.currentType.name),1)],512),[[l["vShow"],e.availableTypes.length>1]]),Object(l["withDirectives"])(Object(l["createElementVNode"])("li",null,[Object(l["createElementVNode"])("a",{target:e.isInternalSetupUrl?"_self":"_blank",title:e.translate("SitesManager_ShowTrackingTag"),href:e.setupUrl},Object(l["toDisplayString"])(e.translate("SitesManager_ShowTrackingTag")),9,Y)],512),[[l["vShow"],e.theSite.idsite&&e.howToSetupUrl]])])]),Object(l["createElementVNode"])("div",J,[Object(l["createElementVNode"])("ul",null,[Object(l["createElementVNode"])("li",null,[Object(l["createElementVNode"])("span",X,Object(l["toDisplayString"])(e.translate("SitesManager_Timezone"))+":",1),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.theSite.timezone_name),1)]),Object(l["createElementVNode"])("li",null,[Object(l["createElementVNode"])("span",Z,Object(l["toDisplayString"])(e.translate("SitesManager_Currency"))+":",1),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.theSite.currency_name),1)]),Object(l["withDirectives"])(Object(l["createElementVNode"])("li",null,[Object(l["createElementVNode"])("span",ee,Object(l["toDisplayString"])(e.translate("Goals_Ecommerce"))+":",1),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("General_Yes")),1)],512),[[l["vShow"],1===e.theSite.ecommerce||"1"===e.theSite.ecommerce]]),Object(l["withDirectives"])(Object(l["createElementVNode"])("li",null,[Object(l["createElementVNode"])("span",te,Object(l["toDisplayString"])(e.translate("Actions_SubmenuSitesearch"))+":",1),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("General_Yes")),1)],512),[[l["vShow"],1===e.theSite.sitesearch||"1"===e.theSite.sitesearch]])])]),Object(l["createElementVNode"])("div",ne,[Object(l["createElementVNode"])("ul",null,[Object(l["createElementVNode"])("li",null,[Object(l["createElementVNode"])("span",ae,Object(l["toDisplayString"])(e.translate("SitesManager_Urls")),1),ie,(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.theSite.alias_urls,(function(t,n){return Object(l["openBlock"])(),Object(l["createElementBlock"])("span",{key:t},[Object(l["createElementVNode"])("a",{target:"_blank",rel:"noreferrer noopener",href:t},Object(l["toDisplayString"])(t)+Object(l["toDisplayString"])(n===e.theSite.alias_urls.length-1?"":", "),9,re)])})),128))]),null!==(o=e.theSite.excluded_ips)&&void 0!==o&&o.length?(Object(l["openBlock"])(),Object(l["createElementBlock"])("li",le,[Object(l["createElementVNode"])("span",oe,Object(l["toDisplayString"])(e.translate("SitesManager_ExcludedIps"))+":",1),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.theSite.excluded_ips.split(/\s*,\s*/g).join(", ")),1)])):Object(l["createCommentVNode"])("",!0),null!==(s=e.theSite.excluded_parameters)&&void 0!==s&&s.length?(Object(l["openBlock"])(),Object(l["createElementBlock"])("li",se,[Object(l["createElementVNode"])("span",ce,Object(l["toDisplayString"])(e.translate("SitesManager_ExcludedParameters"))+":",1),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.theSite.excluded_parameters.split(/\s*,\s*/g).join(", ")),1)])):Object(l["createCommentVNode"])("",!0),null!==(c=e.theSite.excluded_user_agents)&&void 0!==c&&c.length?(Object(l["openBlock"])(),Object(l["createElementBlock"])("li",ue,[Object(l["createElementVNode"])("span",de,Object(l["toDisplayString"])(e.translate("SitesManager_ExcludedUserAgents"))+":",1),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.theSite.excluded_user_agents.split(/\s*,\s*/g).join(", ")),1)])):Object(l["createCommentVNode"])("",!0)])]),Object(l["createElementVNode"])("div",be,[Object(l["createElementVNode"])("ul",null,[Object(l["createElementVNode"])("li",null,[Object(l["createElementVNode"])("button",{class:"table-action",onClick:t[0]||(t[0]=function(t){return e.editSite()}),title:e.translate("General_Edit")},pe,8,me)]),Object(l["createElementVNode"])("li",null,[Object(l["withDirectives"])(Object(l["createElementVNode"])("button",{class:"table-action",onClick:t[1]||(t[1]=function(e){return u.showRemoveDialog=!0}),title:e.translate("General_Delete")},Se,8,ge),[[l["vShow"],e.theSite.idsite]])])])])])),e.editMode?(Object(l["openBlock"])(),Object(l["createElementBlock"])("div",je,[Object(l["createElementVNode"])("div",Oe,[Object(l["createElementVNode"])("div",ve,[Object(l["withDirectives"])(Object(l["createElementVNode"])("input",{type:"text","onUpdate:modelValue":t[2]||(t[2]=function(t){return e.theSite.name=t}),maxlength:"90",placeholder:e.translate("General_Name")},null,8,ye),[[l["vModelText"],e.theSite.name]]),Object(l["createElementVNode"])("label",null,Object(l["toDisplayString"])(e.translate("General_Name")),1)]),Ee]),Object(l["createVNode"])(d,{loading:e.isLoading},null,8,["loading"]),(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.measurableSettings,(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",{key:t.pluginName},[Object(l["createVNode"])(b,{"group-name":t.pluginName,settings:t.settings,"all-setting-values":e.settingValues,onChange:function(n){return e.settingValues["".concat(t.pluginName,".").concat(n.name)]=n.value}},null,8,["group-name","settings","all-setting-values","onChange"])])})),128)),Object(l["createVNode"])(m,{uicontrol:"select",name:"currency",modelValue:e.theSite.currency,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.theSite.currency=t}),title:e.translate("SitesManager_Currency"),"inline-help":e.translate("SitesManager_CurrencySymbolWillBeUsedForGoals"),options:e.currencies},null,8,["modelValue","title","inline-help","options"]),Object(l["createVNode"])(m,{uicontrol:"select",name:"timezone",modelValue:e.theSite.timezone,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.theSite.timezone=t}),title:e.translate("SitesManager_Timezone"),"inline-help":"#timezoneHelpText",options:e.timezones},null,8,["modelValue","title","options"]),Object(l["createElementVNode"])("div",Ne,[Object(l["createElementVNode"])("div",null,[e.timezoneSupportEnabled?Object(l["createCommentVNode"])("",!0):(Object(l["openBlock"])(),Object(l["createElementBlock"])("span",Ve,[Object(l["createTextVNode"])(Object(l["toDisplayString"])(e.translate("SitesManager_AdvancedTimezoneSupportNotFound"))+" ",1),Te])),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.utcTimeIs)+" ",1),xe,Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("SitesManager_ChangingYourTimezoneWillOnlyAffectDataForward")),1)])]),Object(l["createElementVNode"])("div",Me,[Object(l["withDirectives"])(Object(l["createElementVNode"])("input",{type:"submit",class:"btn",value:e.translate("General_Save"),onClick:t[5]||(t[5]=function(t){return e.saveSite()})},null,8,we),[[l["vShow"],!e.isLoading]]),Object(l["createElementVNode"])("button",{class:"btn btn-link",onClick:t[6]||(t[6]=function(t){return e.cancelEditSite(e.site)})},Object(l["toDisplayString"])(e.translate("General_Cancel","","")),1)])])):Object(l["createCommentVNode"])("",!0)]),Object(l["createVNode"])(h,{modelValue:e.showRemoveDialog,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.showRemoveDialog=t}),onYes:t[8]||(t[8]=function(t){return e.deleteSite()})},{default:Object(l["withCtx"])((function(){return[Object(l["createElementVNode"])("div",Ae,[Object(l["createElementVNode"])("h2",null,Object(l["toDisplayString"])(e.removeDialogTitle),1),Object(l["createElementVNode"])("p",null,Object(l["toDisplayString"])(e.translate("SitesManager_DeleteSiteExplanation")),1),Object(l["createElementVNode"])("input",{type:"button",value:e.translate("General_Yes"),role:"yes"},null,8,Ce),Object(l["createElementVNode"])("input",{type:"button",value:e.translate("General_No"),role:"no"},null,8,_e)])]})),_:1},8,["modelValue"])],10,K)}var De=n("a5a2");function Ge(e,t){return Be(e)||Ie(e,t)||ke(e,t)||Ue()}function Ue(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ke(e,t){if(e){if("string"===typeof e)return Le(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Le(e,t):void 0}}function Le(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function Ie(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,i,r=[],l=!0,o=!1;try{for(n=n.call(e);!(l=(a=n.next()).done);l=!0)if(r.push(a.value),t&&r.length===t)break}catch(s){o=!0,i=s}finally{try{l||null==n["return"]||n["return"]()}finally{if(o)throw i}}return r}}function Be(e){if(Array.isArray(e))return e}function ze(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function He(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Fe(e,t,n){return t&&He(e.prototype,t),n&&He(e,n),e}function Ke(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */var je=function(){function e(){var t=this;be(this,e),he(this,"privateState",Object(o["reactive"])({timezones:[]})),he(this,"timezones",Object(o["computed"])((function(){return Object(o["readonly"])(t.privateState).timezones}))),this.fetchTimezones()}return fe(e,[{key:"fetchTimezones",value:function(){var e=this;a["AjaxHelper"].fetch({method:"SitesManager.getTimezonesList"}).then((function(t){var n=[];Object.entries(t).forEach((function(e){var t=le(e,2),i=t[0],r=t[1];Object.entries(r).forEach((function(e){var t=le(e,2),r=t[0],a=t[1];n.push({group:i,label:r,code:a})}))})),e.privateState.timezones=n}))}}]),e}(),ge=Object(a["lazyInitSingleton"])(je);function Se(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ye(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Oe(e,t,n){return t&&ye(e.prototype,t),n&&ye(e,n),e}function ve(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}
+ */var We=function(){function e(){var t=this;ze(this,e),Ke(this,"privateState",Object(l["reactive"])({isLoading:!1,timezones:[],timezoneSupportEnabled:!1})),Ke(this,"state",Object(l["computed"])((function(){return Object(l["readonly"])(t.privateState)}))),Ke(this,"timezones",Object(l["computed"])((function(){return t.state.value.timezones}))),Ke(this,"timezoneSupportEnabled",Object(l["computed"])((function(){return t.state.value.timezoneSupportEnabled}))),Ke(this,"isLoading",Object(l["computed"])((function(){return t.state.value.isLoading}))),this.privateState.isLoading=!0,Promise.all([this.checkTimezoneSupportEnabled(),this.fetchTimezones()]).finally((function(){t.privateState.isLoading=!1}))}return Fe(e,[{key:"fetchTimezones",value:function(){var e=this;return r["AjaxHelper"].fetch({method:"SitesManager.getTimezonesList"}).then((function(t){var n=[];Object.entries(t).forEach((function(e){var t=Ge(e,2),a=t[0],i=t[1];Object.entries(i).forEach((function(e){var t=Ge(e,2),i=t[0],r=t[1];n.push({group:a,label:i,code:r})}))})),e.privateState.timezones=n}))}},{key:"checkTimezoneSupportEnabled",value:function(){var e=this;return r["AjaxHelper"].fetch({method:"SitesManager.isTimezoneSupportEnabled"}).then((function(t){e.privateState.timezoneSupportEnabled=t.value}))}}]),e}(),Re=Object(r["lazyInitSingleton"])(We);function Qe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qe(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function $e(e,t,n){return t&&qe(e.prototype,t),n&&qe(e,n),e}function Ye(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */var Ee=function(){function e(){var t=this;Se(this,e),ve(this,"privateState",Object(o["reactive"])({currencies:{}})),ve(this,"currencies",Object(o["computed"])((function(){return Object(o["readonly"])(t.privateState).currencies}))),this.fetchCurrencies()}return Oe(e,[{key:"fetchCurrencies",value:function(){var e=this;a["AjaxHelper"].fetch({method:"SitesManager.getCurrencyList"}).then((function(t){e.privateState.currencies=t}))}}]),e}(),Ve=Object(a["lazyInitSingleton"])(Ee);function Ne(e,t){return xe(e)||Me(e,t)||we(e,t)||Te()}function Te(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function we(e,t){if(e){if("string"===typeof e)return _e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_e(e,t):void 0}}function _e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Me(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(i=n.next()).done);o=!0)if(a.push(i.value),t&&a.length===t)break}catch(c){l=!0,r=c}finally{try{o||null==n["return"]||n["return"]()}finally{if(l)throw r}}return a}}function xe(e){if(Array.isArray(e))return e}var ke=Object(o["computed"])((function(){return ge.timezones.value.map((function(e){var t=e.group,n=e.label,i=e.code;return{group:t,key:n,value:i}}))}));function De(e){return"undefined"===typeof e.idsite}var Ce=Object(o["defineComponent"])({props:{site:{type:Object,required:!0},timezoneSupportEnabled:{type:Boolean},utcTime:{type:Date,required:!0},globalSettings:{type:Object,required:!0}},data:function(){return{isLoading:!1,editMode:!1,theSite:Object.assign({},this.site),measurableSettings:[],settingValues:{},showRemoveDialog:!1}},components:{MatomoDialog:a["MatomoDialog"],Field:oe["Field"],GroupedSettings:oe["GroupedSettings"],ActivityIndicator:a["ActivityIndicator"]},emits:["delete","cancelEditSite","save"],created:function(){this.onSiteChanged()},watch:{site:function(){this.onSiteChanged()},measurableSettings:function(e){if(e.length){var t={};e.forEach((function(e){e.settings.forEach((function(n){t["".concat(e.pluginName,".").concat(n.name)]=n.value}))})),this.settingValues=t}}},methods:{onSiteChanged:function(){var e=this.site;this.theSite=Object.assign({},e);var t=De(e);if(t){var n=this.globalSettings;this.theSite.timezone=n.defaultTimezone,this.theSite.currency=n.defaultCurrency}var i=p.getEditSiteIdParameter();(t||i&&"".concat(e.idsite)===i)&&this.editSite()},editSite:function(){var e=this;if(this.editMode=!0,this.measurableSettings=[],De(this.theSite)){if(!this.currentType)return;this.measurableSettings=this.currentType.settings||[]}else this.isLoading=!0,a["AjaxHelper"].fetch({method:"SitesManager.getSiteSettings",idSite:this.theSite.idsite}).then((function(t){e.measurableSettings=t})).finally((function(){e.isLoading=!1}))},saveSite:function(){var e=this,t={siteName:this.theSite.name,timezone:this.theSite.timezone,currency:this.theSite.currency,type:this.theSite.type,settingValues:{}},n=De(this.theSite),i="SitesManager.addSite";n||(i="SitesManager.updateSite",t.idSite=this.theSite.idsite),Object.entries(this.settingValues).forEach((function(e){var n=Ne(e,2),i=n[0],r=n[1],a=i.split("."),o=Ne(a,2),l=o[0],c=o[1],s=t.settingValues;s[l]||(s[l]=[]);var u=r;!1===r?u="0":!0===r?u="1":Array.isArray(r)&&(u=r.filter((function(e){return!!e}))),s[l].push({name:c,value:u})})),a["AjaxHelper"].post({method:i},t).then((function(i){e.editMode=!1,!e.theSite.idsite&&i&&i.value&&(e.theSite.idsite=i.value);var r=a["NotificationsStore"].show({message:n?Object(a["translate"])("SitesManager_WebsiteCreated"):Object(a["translate"])("SitesManager_WebsiteUpdated"),context:"success",id:"websitecreated",type:"transient"});a["NotificationsStore"].scrollToNotification(r),p.removeEditSiteIdParameterFromHash(),e.$emit("save",{site:e.theSite,settingValues:t.settingValues})}))},cancelEditSite:function(e){this.editMode=!1,p.removeEditSiteIdParameterFromHash(),this.$emit("cancelEditSite",e)},deleteSite:function(){var e=this;a["AjaxHelper"].fetch({idSite:this.theSite.idsite,module:"API",format:"json",method:"SitesManager.deleteSite"}).then((function(){e.$emit("delete",e.theSite)}))}},computed:{availableTypes:function(){return p.types.value},setupUrl:function(){var e=this.theSite,t="",n="";return this.isInternalSetupUrl&&(t=a["MatomoUrl"].stringify({idSite:e.idsite,period:a["MatomoUrl"].parsed.value.period,date:a["MatomoUrl"].parsed.value.date,updated:"false"}),n=-1===this.howToSetupUrl.indexOf("?")?"?":"&"),"".concat(this.howToSetupUrl).concat(n).concat(t)},utcTimeIs:function(){var e=this.utcTime,t=function(e){return e.toString().padStart(2,"0")},n=t(e.getHours()),i=t(e.getMinutes()),r=t(e.getSeconds()),o="".concat(Object(a["format"])(this.utcTime)," ").concat(n,":").concat(i,":").concat(r);return Object(a["translate"])("SitesManager_UTCTimeIs",o)},timezones:function(){return ke.value},currencies:function(){return Ve.currencies.value},currentType:function(){var e=this.site,t=p.typesById.value[e.type];return t||{name:e.type}},howToSetupUrl:function(){var e=this.currentType;if(e)return e.howToSetupUrl},isInternalSetupUrl:function(){var e=this.howToSetupUrl;return!!e&&"?"==="".concat(e).substring(0,1)},removeDialogTitle:function(){return Object(a["translate"])("SitesManager_DeleteConfirm",'"'.concat(this.theSite.name,'" (idSite = ').concat(this.theSite.idsite,")"))}}});Ce.render=ae;var Ae=Ce;
+ */var Je=function(){function e(){var t=this;Qe(this,e),Ye(this,"privateState",Object(l["reactive"])({isLoading:!1,currencies:{}})),Ye(this,"currencies",Object(l["computed"])((function(){return Object(l["readonly"])(t.privateState).currencies}))),Ye(this,"isLoading",Object(l["computed"])((function(){return Object(l["readonly"])(t.privateState).isLoading}))),this.fetchCurrencies()}return $e(e,[{key:"fetchCurrencies",value:function(){var e=this;this.privateState.isLoading=!0,r["AjaxHelper"].fetch({method:"SitesManager.getCurrencyList"}).then((function(t){e.privateState.currencies=t})).finally((function(){e.privateState.isLoading=!1}))}}]),e}(),Xe=Object(r["lazyInitSingleton"])(Je);function Ze(e,t){return it(e)||at(e,t)||tt(e,t)||et()}function et(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function tt(e,t){if(e){if("string"===typeof e)return nt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nt(e,t):void 0}}function nt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function at(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,i,r=[],l=!0,o=!1;try{for(n=n.call(e);!(l=(a=n.next()).done);l=!0)if(r.push(a.value),t&&r.length===t)break}catch(s){o=!0,i=s}finally{try{l||null==n["return"]||n["return"]()}finally{if(o)throw i}}return r}}function it(e){if(Array.isArray(e))return e}var rt=Object(l["computed"])((function(){return Re.timezones.value.map((function(e){var t=e.group,n=e.label,a=e.code;return{group:t,key:n,value:a}}))}));function lt(e){return"undefined"===typeof e.idsite}var ot=Object(l["defineComponent"])({props:{site:{type:Object,required:!0},timezoneSupportEnabled:{type:Boolean},utcTime:{type:Date,required:!0},globalSettings:{type:Object,required:!0}},data:function(){return{isLoading:!1,editMode:!1,theSite:Object.assign({},this.site),measurableSettings:[],settingValues:{},showRemoveDialog:!1}},components:{MatomoDialog:r["MatomoDialog"],Field:De["Field"],GroupedSettings:De["GroupedSettings"],ActivityIndicator:r["ActivityIndicator"]},emits:["delete","editSite","cancelEditSite","save"],created:function(){this.onSiteChanged()},watch:{site:function(){this.onSiteChanged()},measurableSettings:function(e){if(e.length){var t={};e.forEach((function(e){e.settings.forEach((function(n){t["".concat(e.pluginName,".").concat(n.name)]=n.value}))})),this.settingValues=t}}},methods:{onSiteChanged:function(){var e=this.site;this.theSite=Object.assign({},e);var t=lt(e);if(t){var n=this.globalSettings;this.theSite.timezone=n.defaultTimezone,this.theSite.currency=n.defaultCurrency}var a=h.getEditSiteIdParameter();(t||a&&"".concat(e.idsite)===a)&&this.editSite()},editSite:function(){var e=this;if(this.editMode=!0,this.$emit("editSite",{idSite:this.theSite.idsite}),this.measurableSettings=[],lt(this.theSite)){if(!this.currentType)return;this.measurableSettings=this.currentType.settings||[]}else this.isLoading=!0,r["AjaxHelper"].fetch({method:"SitesManager.getSiteSettings",idSite:this.theSite.idsite}).then((function(t){e.measurableSettings=t})).finally((function(){e.isLoading=!1}))},saveSite:function(){var e=this,t={siteName:this.theSite.name,timezone:this.theSite.timezone,currency:this.theSite.currency,type:this.theSite.type,settingValues:{}},n=lt(this.theSite),a="SitesManager.addSite";n||(a="SitesManager.updateSite",t.idSite=this.theSite.idsite),Object.entries(this.settingValues).forEach((function(e){var n=Ze(e,2),a=n[0],i=n[1],r=a.split("."),l=Ze(r,2),o=l[0],s=l[1],c=t.settingValues;c[o]||(c[o]=[]);var u=i;!1===i?u="0":!0===i?u="1":Array.isArray(i)&&(u=i.filter((function(e){return!!e}))),c[o].push({name:s,value:u})})),r["AjaxHelper"].post({method:a},t).then((function(a){e.editMode=!1,!e.theSite.idsite&&a&&a.value&&(e.theSite.idsite="".concat(a.value));var i=Re.timezones.value.find((function(t){return t.code===e.theSite.timezone}));e.theSite.timezone_name=(null===i||void 0===i?void 0:i.label)||e.theSite.timezone,e.theSite.currency&&(e.theSite.currency_name=Xe.currencies.value[e.theSite.currency]);var l=r["NotificationsStore"].show({message:n?Object(r["translate"])("SitesManager_WebsiteCreated"):Object(r["translate"])("SitesManager_WebsiteUpdated"),context:"success",id:"websitecreated",type:"transient"});r["NotificationsStore"].scrollToNotification(l),h.removeEditSiteIdParameterFromHash(),e.$emit("save",{site:e.theSite,settingValues:t.settingValues,isNew:n})}))},cancelEditSite:function(e){this.editMode=!1,h.removeEditSiteIdParameterFromHash(),this.$emit("cancelEditSite",{site:e,element:this.$refs.root})},deleteSite:function(){var e=this;r["AjaxHelper"].fetch({idSite:this.theSite.idsite,module:"API",format:"json",method:"SitesManager.deleteSite"}).then((function(){e.$emit("delete",e.theSite)}))}},computed:{availableTypes:function(){return h.types.value},setupUrl:function(){var e=this.theSite,t="",n="";return this.isInternalSetupUrl&&(t=r["MatomoUrl"].stringify({idSite:e.idsite,period:r["MatomoUrl"].parsed.value.period,date:r["MatomoUrl"].parsed.value.date,updated:"false"}),n=-1===this.howToSetupUrl.indexOf("?")?"?":"&"),"".concat(this.howToSetupUrl).concat(n).concat(t)},utcTimeIs:function(){var e=this.utcTime,t=function(e){return e.toString().padStart(2,"0")},n=t(e.getHours()),a=t(e.getMinutes()),i=t(e.getSeconds()),l="".concat(Object(r["format"])(this.utcTime)," ").concat(n,":").concat(a,":").concat(i);return Object(r["translate"])("SitesManager_UTCTimeIs",l)},timezones:function(){return rt.value},currencies:function(){return Xe.currencies.value},currentType:function(){var e=this.site,t=h.typesById.value[e.type];return t||{name:e.type}},howToSetupUrl:function(){var e=this.currentType;if(e)return e.howToSetupUrl},isInternalSetupUrl:function(){var e=this.howToSetupUrl;return!!e&&"?"==="".concat(e).substring(0,1)},removeDialogTitle:function(){return Object(r["translate"])("SitesManager_DeleteConfirm",'"'.concat(this.theSite.name,'" (idSite = ').concat(this.theSite.idsite,")"))}}});ot.render=Pe;var st=ot;function ct(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ut(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function dt(e,t,n){return t&&ut(e.prototype,t),n&&ut(e,n),e}function bt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */Object(a["createAngularJsAdapter"])({component:Ae,scope:{site:{angularJsBind:"<"},timezoneSupportEnabled:{angularJsBind:"<"},utcTime:{angularJsBind:"<"},globalSettings:{angularJsBind:"<"}},directiveName:"matomoSiteFields",$inject:["$timeout"],events:{cancelEditSite:function(e,t,n){n.$parent.cancelEditSite(e)},delete:function(e,t,n){var i=n.redirectParams;if(a["MatomoUrl"].urlParsed.value.idSite===e.idsite){var r=n.adminSites.sites,o=r.find((function(t){return t.idsite!==e.idsite}));o&&(i=Object.assign(Object.assign({},i),{},{idSite:o.idsite}))}a["MatomoUrl"].updateUrl(Object.assign(Object.assign({},a["MatomoUrl"].urlParsed.value),{},{redirectParams:i}),a["MatomoUrl"].hashParsed.value)},save:function(e,t,n,i,r,a,o){var l=e.site,c=e.settingValues,s=["excluded_ips","excluded_parameters","excluded_user_agents","sitesearch_keyword_parameters","sitesearch_category_parameters"],u=Object.assign({},l);Object.values(c).forEach((function(e){e.forEach((function(e){"urls"===e.name?u.alias_urls=e.value:-1!==s.indexOf(e.name)?u[e.name]=e.value.join(", "):u[e.name]=e.value}))})),window.$.extend(n.site,u),o(),t.site=u}}})}})}));
+ */var mt=function(){function e(){var t=this;ct(this,e),bt(this,"privateState",Object(l["reactive"])({isLoading:!1,globalSettings:{keepURLFragmentsGlobal:!1,defaultCurrency:"",defaultTimezone:"",excludedIpsGlobal:"",excludedQueryParametersGlobal:"",excludedUserAgentsGlobal:"",searchKeywordParametersGlobal:"",searchCategoryParametersGlobal:""}})),bt(this,"isLoading",Object(l["computed"])((function(){return Object(l["readonly"])(t.privateState).isLoading}))),bt(this,"globalSettings",Object(l["computed"])((function(){return Object(l["readonly"])(t.privateState).globalSettings}))),this.fetchGlobalSettings()}return dt(e,[{key:"saveGlobalSettings",value:function(e){var t=this;return this.privateState.isLoading=!0,r["AjaxHelper"].post({module:"SitesManager",format:"json",action:"setGlobalSettings"},e,{withTokenInUrl:!0}).finally((function(){t.privateState.isLoading=!1}))}},{key:"fetchGlobalSettings",value:function(){var e=this;this.privateState.isLoading=!0,r["AjaxHelper"].fetch({module:"SitesManager",action:"getGlobalSettings"}).then((function(t){e.privateState.globalSettings=Object.assign(Object.assign({},t),{},{excludedIpsGlobal:t.excludedIpsGlobal||"",excludedQueryParametersGlobal:t.excludedQueryParametersGlobal||"",excludedUserAgentsGlobal:t.excludedUserAgentsGlobal||"",searchKeywordParametersGlobal:t.searchKeywordParametersGlobal||"",searchCategoryParametersGlobal:t.searchCategoryParametersGlobal||""})})).finally((function(){e.privateState.isLoading=!1}))}}]),e}(),ht=Object(r["lazyInitSingleton"])(mt),pt=Object(l["defineComponent"])({props:{dummy:String},components:{MatomoDialog:r["MatomoDialog"],ButtonBar:F,SiteFields:st,EnrichedHeadline:r["EnrichedHeadline"]},directives:{ContentIntro:r["ContentIntro"]},data:function(){var e=new Date,t=new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds());return{pageSize:10,currentPage:0,showAddSiteDialog:!1,searchTerm:"",activeSearchTerm:"",fetchedSites:[],isLoadingInitialEntities:!1,utcTime:t,totalNumberOfSites:null,isSiteBeingEdited:!1,fetchLimitedSitesAbortController:null}},created:function(){var e=this;this.isLoadingInitialEntities=!0,Promise.all([h.fetchAvailableTypes(),this.fetchLimitedSitesWithAdminAccess(),this.getTotalNumberOfSites()]).then((function(){e.triggerAddSiteIfRequested()})).finally((function(){e.isLoadingInitialEntities=!1})),Object(l["watch"])((function(){return r["MatomoUrl"].hashQuery.value}),(function(){e.checkGlobalSettingsHash()}))},computed:{sites:function(){var e=this.fetchedSites.filter((function(e){return!e.idsite})).length;return this.fetchedSites.slice(0,this.pageSize+e)},isLoading:function(){return!!this.fetchLimitedSitesAbortController||this.isLoadingInitialEntities||null===this.totalNumberOfSites||h.isLoading.value||Re.isLoading.value||ht.isLoading.value},availableTypes:function(){return h.types.value},timezoneSupportEnabled:function(){return Re.timezoneSupportEnabled.value},globalSettings:function(){return ht.globalSettings.value},headlineText:function(){return Object(r["translate"])("SitesManager_XManagement",this.availableTypes.length>1?Object(r["translate"])("General_Measurables"):Object(r["translate"])("SitesManager_Sites"))},mainDescription:function(){return Object(r["translate"])("SitesManager_YouCurrentlyHaveAccessToNWebsites","<strong>".concat(this.totalNumberOfSites,"</strong>"))},hasSuperUserAccess:function(){return r["Matomo"].hasSuperUserAccess},superUserAccessMessage:function(){return Object(r["translate"])("SitesManager_SuperUserAccessCan","<a href='#globalSettings'>","</a>")},hasPrev:function(){return this.currentPage>=1},hasNext:function(){return this.fetchedSites.filter((function(e){return!!e.idsite})).length>=this.pageSize+1},offsetStart:function(){return this.currentPage*this.pageSize+1},offsetEnd:function(){return this.offsetStart+this.sites.filter((function(e){return!!e.idsite})).length-1}},methods:{checkGlobalSettingsHash:function(){var e=r["MatomoUrl"].hashQuery.value;!r["Matomo"].hasSuperUserAccess||"globalSettings"!==e&&"/globalSettings"!==e||r["MatomoUrl"].updateLocation(Object.assign(Object.assign({},r["MatomoUrl"].urlParsed.value),{},{action:"globalSettings"}))},addNewEntity:function(){this.availableTypes.length>1?this.showAddSiteDialog=!0:1===this.availableTypes.length&&this.addSite(this.availableTypes[0].id)},addSite:function(e){var t=e,n={isAllowed:!0,measurableType:t};r["Matomo"].postEvent("SitesManager.initAddSite",n),n&&!n.isAllowed||(t||(t="website"),this.fetchedSites.unshift({type:t}),this.isSiteBeingEdited=!0)},afterCancelEdit:function(e){var t=e.site,n=e.element;this.isSiteBeingEdited=!1,t.idsite?n.scrollIntoView():this.fetchedSites=this.fetchedSites.filter((function(e){return!!e.idsite}))},fetchLimitedSitesWithAdminAccess:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.fetchLimitedSitesAbortController&&this.fetchLimitedSitesAbortController.abort(),this.fetchLimitedSitesAbortController=new AbortController;var n=this.pageSize+1,a=this.currentPage*this.pageSize,i={method:"SitesManager.getSitesWithAdminAccess",fetchAliasUrls:1,limit:n+a,filter_offset:a,filter_limit:n};return t&&(i.pattern=t),r["AjaxHelper"].fetch(i).then((function(t){e.fetchedSites=t||[]})).then((function(n){return e.activeSearchTerm=t,n})).finally((function(){e.fetchLimitedSitesAbortController=null}))},getTotalNumberOfSites:function(){var e=this;return r["AjaxHelper"].fetch({method:"SitesManager.getSitesIdWithAdminAccess",filter_limit:"-1"}).then((function(t){e.totalNumberOfSites=t.length}))},triggerAddSiteIfRequested:function(){var e=h.getEditSiteIdParameter(),t=r["MatomoUrl"].urlParsed.value.showaddsite;"1"===t?this.addNewEntity():e&&(this.searchTerm=e,this.fetchLimitedSitesWithAdminAccess(this.searchTerm))},previousPage:function(){this.currentPage=Math.max(0,this.currentPage-1),this.fetchLimitedSitesWithAdminAccess(this.activeSearchTerm)},nextPage:function(){this.currentPage=Math.max(0,this.currentPage+1),this.fetchLimitedSitesWithAdminAccess(this.activeSearchTerm)},searchSites:function(){this.currentPage=0,this.fetchLimitedSitesWithAdminAccess(this.searchTerm)},afterDelete:function(e){var t={showaddsite:0};if(r["MatomoUrl"].urlParsed.value.idSite==="".concat(e.idsite)){var n=this.sites.find((function(t){return t.idsite!==e.idsite}));n&&(t=Object.assign(Object.assign({},t),{},{idSite:n.idsite}))}r["Matomo"].helper.redirect(t)},afterSave:function(e,t,n,a){var i=["excluded_ips","excluded_parameters","excluded_user_agents","sitesearch_keyword_parameters","sitesearch_category_parameters"],r=Object.assign({},e);Object.values(t).forEach((function(e){e.forEach((function(e){"urls"===e.name?r.alias_urls=e.value:-1!==i.indexOf(e.name)?r[e.name]=e.value.join(", "):r[e.name]=e.value}))})),this.fetchedSites[n]=r,a&&null!==this.totalNumberOfSites&&(this.totalNumberOfSites+=1),console.log("here?"),this.isSiteBeingEdited=!1}}});pt.render=A;var gt=pt,ft=(Object(r["createAngularJsAdapter"])({component:gt,scope:{},directiveName:"matomoSitesManagement"}),{class:"SitesManager"}),St=Object(l["createElementVNode"])("a",{name:"globalSettings",id:"globalSettings"},null,-1),jt={id:"excludedIpsGlobalHelp",class:"inline-help-node"},Ot=Object(l["createElementVNode"])("br",null,null,-1),vt=Object(l["createElementVNode"])("br",null,null,-1),yt=["innerHTML"],Et={id:"excludedQueryParametersGlobalHelp",class:"inline-help-node"},Nt=Object(l["createElementVNode"])("br",null,null,-1),Vt=Object(l["createElementVNode"])("br",null,null,-1),Tt={id:"excludedUserAgentsGlobalHelp",class:"inline-help-node"},xt=Object(l["createElementVNode"])("br",null,null,-1),Mt=Object(l["createElementVNode"])("br",null,null,-1),wt={id:"timezoneHelp",class:"inline-help-node"},At={key:0},Ct=Object(l["createElementVNode"])("br",null,null,-1),_t=Object(l["createElementVNode"])("br",null,null,-1),Pt={id:"keepURLFragmentsHelp",class:"inline-help-node"},Dt=["innerHTML"],Gt={class:"alert alert-info"};
+/*!
+ * Matomo - free/libre analytics platform
+ *
+ * @link https://matomo.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */function Ut(e,t,n,a,i,r){var o=Object(l["resolveComponent"])("Field"),s=Object(l["resolveComponent"])("SaveButton"),c=Object(l["resolveComponent"])("ContentBlock");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",ft,[Object(l["withDirectives"])(Object(l["createVNode"])(c,{"content-title":e.translate("SitesManager_GlobalWebsitesSettings")},{default:Object(l["withCtx"])((function(){return[St,Object(l["createElementVNode"])("div",jt,[Object(l["createElementVNode"])("div",null,[Object(l["createTextVNode"])(Object(l["toDisplayString"])(e.translate("SitesManager_HelpExcludedIpAddresses","1.2.3.4/24","1.2.3.*","1.2.*.*"))+" ",1),Ot,vt,Object(l["createElementVNode"])("span",{innerHTML:e.yourCurrentIpAddressIs},null,8,yt)])]),Object(l["createElementVNode"])("div",Et,[Object(l["createElementVNode"])("div",null,[Object(l["createTextVNode"])(Object(l["toDisplayString"])(e.translate("SitesManager_ListOfQueryParametersToExclude","/^sess.*|.*[dD]ate$/"))+" ",1),Nt,Vt,Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("SitesManager_PiwikWillAutomaticallyExcludeCommonSessionParameters","phpsessid, sessionid, ...")),1)])]),Object(l["createElementVNode"])("div",Tt,[Object(l["createElementVNode"])("div",null,[Object(l["createTextVNode"])(Object(l["toDisplayString"])(e.translate("SitesManager_GlobalExcludedUserAgentHelp1"))+" ",1),xt,Mt,Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("SitesManager_GlobalListExcludedUserAgents_Desc"))+" "+Object(l["toDisplayString"])(e.translate("SitesManager_GlobalExcludedUserAgentHelp2"))+" "+Object(l["toDisplayString"])(e.translate("SitesManager_GlobalExcludedUserAgentHelp3","/bot|spider|crawl|scanner/i")),1)])]),Object(l["createElementVNode"])("div",wt,[Object(l["createElementVNode"])("div",null,[e.timezoneSupportEnabled?Object(l["createCommentVNode"])("",!0):(Object(l["openBlock"])(),Object(l["createElementBlock"])("span",At,[Object(l["createTextVNode"])(Object(l["toDisplayString"])(e.translate("SitesManager_AdvancedTimezoneSupportNotFound"))+" ",1),Ct])),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("SitesManager_UTCTimeIs",e.utcTimeDate))+" ",1),_t,Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("SitesManager_ChangingYourTimezoneWillOnlyAffectDataForward")),1)])]),Object(l["createElementVNode"])("div",Pt,[Object(l["createElementVNode"])("div",{innerHTML:e.keepUrlFragmentHelp},null,8,Dt),Object(l["createElementVNode"])("div",null,Object(l["toDisplayString"])(e.translate("SitesManager_KeepURLFragmentsHelp2")),1)]),Object(l["createElementVNode"])("div",null,[Object(l["createVNode"])(o,{uicontrol:"textarea",name:"excludedIpsGlobal","var-type":"array",modelValue:e.excludedIpsGlobal,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.excludedIpsGlobal=t}),title:e.translate("SitesManager_ListOfIpsToBeExcludedOnAllWebsites"),introduction:e.translate("SitesManager_GlobalListExcludedIps"),"inline-help":"#excludedIpsGlobalHelp",disabled:e.isLoading},null,8,["modelValue","title","introduction","disabled"])]),Object(l["createElementVNode"])("div",null,[Object(l["createVNode"])(o,{uicontrol:"textarea",name:"excludedQueryParametersGlobal","var-type":"array",modelValue:e.excludedQueryParametersGlobal,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.excludedQueryParametersGlobal=t}),title:e.translate("SitesManager_ListOfQueryParametersToBeExcludedOnAllWebsites"),introduction:e.translate("SitesManager_GlobalListExcludedQueryParameters"),"inline-help":"#excludedQueryParametersGlobalHelp",disabled:e.isLoading},null,8,["modelValue","title","introduction","disabled"])]),Object(l["createElementVNode"])("div",null,[Object(l["createVNode"])(o,{uicontrol:"textarea",name:"excludedUserAgentsGlobal","var-type":"array",modelValue:e.excludedUserAgentsGlobal,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.excludedUserAgentsGlobal=t}),title:e.translate("SitesManager_GlobalListExcludedUserAgents_Desc"),introduction:e.translate("SitesManager_GlobalListExcludedUserAgents"),"inline-help":"#excludedUserAgentsGlobalHelp",disabled:e.isLoading},null,8,["modelValue","title","introduction","disabled"])]),Object(l["createElementVNode"])("div",null,[Object(l["createVNode"])(o,{uicontrol:"checkbox",name:"keepURLFragmentsGlobal",modelValue:e.keepURLFragmentsGlobal,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.keepURLFragmentsGlobal=t}),title:e.translate("SitesManager_KeepURLFragmentsLong"),introduction:e.translate("SitesManager_KeepURLFragments"),"inline-help":"#keepURLFragmentsHelp",disabled:e.isLoading},null,8,["modelValue","title","introduction","disabled"])]),Object(l["createElementVNode"])("h3",null,Object(l["toDisplayString"])(e.translate("SitesManager_TrackingSiteSearch")),1),Object(l["createElementVNode"])("p",null,Object(l["toDisplayString"])(e.translate("SitesManager_SiteSearchUse")),1),Object(l["createElementVNode"])("div",Gt,Object(l["toDisplayString"])(e.translate("SitesManager_SearchParametersNote"))+" "+Object(l["toDisplayString"])(e.translate("SitesManager_SearchParametersNote2")),1),Object(l["createElementVNode"])("div",null,[Object(l["createVNode"])(o,{uicontrol:"text",name:"searchKeywordParametersGlobal","var-type":"array",modelValue:e.searchKeywordParametersGlobal,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.searchKeywordParametersGlobal=t}),title:e.translate("SitesManager_SearchKeywordLabel"),"inline-help":e.translate("SitesManager_SearchKeywordParametersDesc"),disabled:e.isLoading},null,8,["modelValue","title","inline-help","disabled"])]),Object(l["createElementVNode"])("div",null,[Object(l["createVNode"])(o,{uicontrol:"text",name:"searchCategoryParametersGlobal","var-type":"array",modelValue:e.searchCategoryParametersGlobal,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.searchCategoryParametersGlobal=t}),title:e.translate("SitesManager_SearchCategoryLabel"),"inline-help":e.searchCategoryParamsInlineHelp,disabled:e.isLoading},null,8,["modelValue","title","inline-help","disabled"])]),Object(l["createElementVNode"])("div",null,[Object(l["createVNode"])(o,{uicontrol:"select",name:"defaultTimezone",options:e.timezoneOptions,title:e.translate("SitesManager_SelectDefaultTimezone"),introduction:e.translate("SitesManager_DefaultTimezoneForNewWebsites"),"inline-help":"#timezoneHelp",disabled:e.isLoading,modelValue:e.defaultTimezone,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.defaultTimezone=t})},null,8,["options","title","introduction","disabled","modelValue"])]),Object(l["createElementVNode"])("div",null,[Object(l["createVNode"])(o,{uicontrol:"select",name:"defaultCurrency",modelValue:e.defaultCurrency,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.defaultCurrency=t}),options:e.currencies,title:e.translate("SitesManager_SelectDefaultCurrency"),introduction:e.translate("SitesManager_DefaultCurrencyForNewWebsites"),"inline-help":e.translate("SitesManager_CurrencySymbolWillBeUsedForGoals"),disabled:e.isLoading},null,8,["modelValue","options","title","introduction","inline-help","disabled"])]),Object(l["createVNode"])(s,{saving:e.isSaving,onConfirm:t[8]||(t[8]=function(t){return e.saveGlobalSettings()})},null,8,["saving"])]})),_:1},8,["content-title"]),[[l["vShow"],e.hasSuperUserAccess]])])}var kt=Object(l["defineComponent"])({props:{dummy:String},components:{ContentBlock:r["ContentBlock"],Field:De["Field"],SaveButton:De["SaveButton"]},data:function(){var e=new Date,t=new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds()),n=ht.globalSettings.value;return{currentIpAddress:null,utcTime:t,keepURLFragmentsGlobal:n.keepURLFragmentsGlobal,defaultTimezone:n.defaultTimezone,defaultCurrency:n.defaultCurrency,excludedIpsGlobal:(n.excludedIpsGlobal||"").split(","),excludedQueryParametersGlobal:(n.excludedQueryParametersGlobal||"").split(","),excludedUserAgentsGlobal:(n.excludedUserAgentsGlobal||"").split(","),searchKeywordParametersGlobal:(n.searchKeywordParametersGlobal||"").split(","),searchCategoryParametersGlobal:(n.searchCategoryParametersGlobal||"").split(","),isSaving:!1}},created:function(){var e=this;Object(l["watch"])((function(){return ht.globalSettings.value}),(function(t){e.keepURLFragmentsGlobal=t.keepURLFragmentsGlobal,e.defaultTimezone=t.defaultTimezone,e.defaultCurrency=t.defaultCurrency,e.excludedIpsGlobal=(t.excludedIpsGlobal||"").split(","),e.excludedQueryParametersGlobal=(t.excludedQueryParametersGlobal||"").split(","),e.excludedUserAgentsGlobal=(t.excludedUserAgentsGlobal||"").split(","),e.searchKeywordParametersGlobal=(t.searchKeywordParametersGlobal||"").split(","),e.searchCategoryParametersGlobal=(t.searchCategoryParametersGlobal||"").split(",")})),r["AjaxHelper"].fetch({method:"API.getIpFromHeader"}).then((function(t){e.currentIpAddress=t.value}))},methods:{saveGlobalSettings:function(){this.isSaving=!0,ht.saveGlobalSettings({keepURLFragments:this.keepURLFragmentsGlobal,currency:this.defaultCurrency,timezone:this.defaultTimezone,excludedIps:this.excludedIpsGlobal.join(","),excludedQueryParameters:this.excludedQueryParametersGlobal.join(","),excludedUserAgents:this.excludedUserAgentsGlobal.join(","),searchKeywordParameters:this.searchKeywordParametersGlobal.join(","),searchCategoryParameters:this.searchCategoryParametersGlobal.join(",")}).then((function(){r["Matomo"].helper.redirect({showaddsite:!1})}))}},computed:{isLoading:function(){return ht.isLoading.value||Re.isLoading.value||Xe.isLoading.value},timezones:function(){return Re.timezones.value},timezoneOptions:function(){return this.timezones.map((function(e){var t=e.group,n=e.label,a=e.code;return{group:t,key:n,value:a}}))},currencies:function(){return Xe.currencies.value},hasSuperUserAccess:function(){return r["Matomo"].hasSuperUserAccess},yourCurrentIpAddressIs:function(){return Object(r["translate"])("SitesManager_YourCurrentIpAddressIs","<i>".concat(this.currentIpAddress,"</i>"))},timezoneSupportEnabled:function(){return Re.timezoneSupportEnabled.value},utcTimeDate:function(){var e=this.utcTime,t=function(e){return e.toString().padStart(2,"0")},n=t(e.getHours()),a=t(e.getMinutes()),i=t(e.getSeconds());return"".concat(Object(r["format"])(this.utcTime)," ").concat(n,":").concat(a,":").concat(i)},keepUrlFragmentHelp:function(){return Object(r["translate"])("SitesManager_KeepURLFragmentsHelp","<em>#</em>","<em>example.org/index.html#first_section</em>","<em>example.org/index.html</em>")},searchCategoryParamsInlineHelp:function(){var e=[Object(r["translate"])("Goals_Optional"),Object(r["translate"])("SitesManager_SearchCategoryDesc"),Object(r["translate"])("SitesManager_SearchCategoryParametersDesc")];return e.join(" ")}}});kt.render=Ut;var Lt=kt;
+/*!
+ * Matomo - free/libre analytics platform
+ *
+ * @link https://matomo.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */Object(r["createAngularJsAdapter"])({component:Lt,scope:{},directiveName:"matomoGlobalSettings"})}})}));
//# sourceMappingURL=SitesManager.umd.min.js.map \ No newline at end of file
diff --git a/plugins/SitesManager/vue/src/CurrencyStore/CurrencyStore.ts b/plugins/SitesManager/vue/src/CurrencyStore/CurrencyStore.ts
index e8a594ba83..dc27cd2f9b 100644
--- a/plugins/SitesManager/vue/src/CurrencyStore/CurrencyStore.ts
+++ b/plugins/SitesManager/vue/src/CurrencyStore/CurrencyStore.ts
@@ -9,27 +9,34 @@ import { reactive, readonly, computed } from 'vue';
import { AjaxHelper, lazyInitSingleton } from 'CoreHome';
interface CurrencyStoreState {
+ isLoading: boolean;
currencies: Record<string, string>;
}
class CurrencyStore {
private privateState = reactive<CurrencyStoreState>({
+ isLoading: false,
currencies: {},
});
readonly currencies = computed(() => readonly(this.privateState).currencies);
+ readonly isLoading = computed(() => readonly(this.privateState).isLoading);
+
constructor() {
this.fetchCurrencies();
}
private fetchCurrencies() {
+ this.privateState.isLoading = true;
AjaxHelper.fetch<CurrencyStoreState['currencies']>({
method: 'SitesManager.getCurrencyList',
}).then((currencies) => {
this.privateState.currencies = currencies;
+ }).finally(() => {
+ this.privateState.isLoading = false;
});
}
}
-export default lazyInitSingleton(CurrencyStore);
+export default lazyInitSingleton(CurrencyStore) as CurrencyStore;
diff --git a/plugins/SitesManager/vue/src/GlobalSettingsStore/GlobalSettings.ts b/plugins/SitesManager/vue/src/GlobalSettingsStore/GlobalSettings.ts
new file mode 100644
index 0000000000..12d2edbf1a
--- /dev/null
+++ b/plugins/SitesManager/vue/src/GlobalSettingsStore/GlobalSettings.ts
@@ -0,0 +1,19 @@
+/*!
+ * Matomo - free/libre analytics platform
+ *
+ * @link https://matomo.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+interface GlobalSettings {
+ keepURLFragmentsGlobal: boolean;
+ defaultCurrency: string;
+ defaultTimezone: string;
+ excludedIpsGlobal?: string;
+ excludedQueryParametersGlobal?: string;
+ excludedUserAgentsGlobal?: string;
+ searchKeywordParametersGlobal?: string;
+ searchCategoryParametersGlobal?: string;
+}
+
+export default GlobalSettings;
diff --git a/plugins/SitesManager/vue/src/GlobalSettingsStore/GlobalSettingsStore.ts b/plugins/SitesManager/vue/src/GlobalSettingsStore/GlobalSettingsStore.ts
new file mode 100644
index 0000000000..384ec5a38f
--- /dev/null
+++ b/plugins/SitesManager/vue/src/GlobalSettingsStore/GlobalSettingsStore.ts
@@ -0,0 +1,94 @@
+/*!
+ * Matomo - free/libre analytics platform
+ *
+ * @link https://matomo.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+import {
+ reactive,
+ readonly,
+ computed,
+} from 'vue';
+import { AjaxHelper, lazyInitSingleton } from 'CoreHome';
+import GlobalSettings from './GlobalSettings';
+
+interface GlobalSettingsStoreState {
+ isLoading: boolean;
+ globalSettings: GlobalSettings;
+}
+
+interface SaveGlobalSettingsParams {
+ keepURLFragments: boolean;
+ currency: string;
+ timezone: string;
+ excludedIps: string;
+ excludedQueryParameters: string;
+ excludedUserAgents: string;
+ searchKeywordParameters: string;
+ searchCategoryParameters: string;
+}
+
+class GlobalSettingsStore {
+ private privateState = reactive<GlobalSettingsStoreState>({
+ isLoading: false,
+ globalSettings: {
+ keepURLFragmentsGlobal: false,
+ defaultCurrency: '',
+ defaultTimezone: '',
+ excludedIpsGlobal: '',
+ excludedQueryParametersGlobal: '',
+ excludedUserAgentsGlobal: '',
+ searchKeywordParametersGlobal: '',
+ searchCategoryParametersGlobal: '',
+ },
+ });
+
+ readonly isLoading = computed(() => readonly(this.privateState).isLoading);
+
+ readonly globalSettings = computed(() => readonly(this.privateState).globalSettings);
+
+ constructor() {
+ this.fetchGlobalSettings();
+ }
+
+ public saveGlobalSettings(settings: SaveGlobalSettingsParams) {
+ this.privateState.isLoading = true;
+ return AjaxHelper.post(
+ {
+ module: 'SitesManager',
+ format: 'json',
+ action: 'setGlobalSettings',
+ },
+ settings,
+ {
+ withTokenInUrl: true,
+ },
+ ).finally(() => {
+ this.privateState.isLoading = false;
+ });
+ }
+
+ private fetchGlobalSettings() {
+ this.privateState.isLoading = true;
+ AjaxHelper.fetch<GlobalSettings>({
+ module: 'SitesManager',
+ action: 'getGlobalSettings',
+ }).then((response) => {
+ this.privateState.globalSettings = {
+ ...response,
+
+ // the API can return false for these
+ excludedIpsGlobal: response.excludedIpsGlobal || '',
+ excludedQueryParametersGlobal: response.excludedQueryParametersGlobal || '',
+ excludedUserAgentsGlobal: response.excludedUserAgentsGlobal || '',
+ searchKeywordParametersGlobal: response.searchKeywordParametersGlobal || '',
+ searchCategoryParametersGlobal: response.searchCategoryParametersGlobal || '',
+ };
+ }).finally(() => {
+ this.privateState.isLoading = false;
+ });
+ }
+}
+
+export default lazyInitSingleton(GlobalSettingsStore) as GlobalSettingsStore;
diff --git a/plugins/SitesManager/vue/src/ManageGlobalSettings/ManageGlobalSettings.adapter.ts b/plugins/SitesManager/vue/src/ManageGlobalSettings/ManageGlobalSettings.adapter.ts
new file mode 100644
index 0000000000..8f6b18c9a9
--- /dev/null
+++ b/plugins/SitesManager/vue/src/ManageGlobalSettings/ManageGlobalSettings.adapter.ts
@@ -0,0 +1,15 @@
+/*!
+ * Matomo - free/libre analytics platform
+ *
+ * @link https://matomo.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+import { createAngularJsAdapter } from 'CoreHome';
+import ManageGlobalSettings from './ManageGlobalSettings.vue';
+
+export default createAngularJsAdapter({
+ component: ManageGlobalSettings,
+ scope: {},
+ directiveName: 'matomoGlobalSettings',
+});
diff --git a/plugins/SitesManager/vue/src/ManageGlobalSettings/ManageGlobalSettings.vue b/plugins/SitesManager/vue/src/ManageGlobalSettings/ManageGlobalSettings.vue
new file mode 100644
index 0000000000..65a3a04373
--- /dev/null
+++ b/plugins/SitesManager/vue/src/ManageGlobalSettings/ManageGlobalSettings.vue
@@ -0,0 +1,352 @@
+<!--
+ Matomo - free/libre analytics platform
+ @link https://matomo.org
+ @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+-->
+
+<template>
+ <div class="SitesManager">
+ <ContentBlock
+ v-show="hasSuperUserAccess"
+ :content-title="translate('SitesManager_GlobalWebsitesSettings')"
+ >
+ <a name="globalSettings" id="globalSettings"></a>
+
+ <div id="excludedIpsGlobalHelp" class="inline-help-node">
+ <div>
+ {{ translate(
+ 'SitesManager_HelpExcludedIpAddresses',
+ '1.2.3.4/24',
+ '1.2.3.*',
+ '1.2.*.*',
+ ) }}
+
+ <br/><br/>
+
+ <span v-html="yourCurrentIpAddressIs"></span>
+ </div>
+ </div>
+
+ <div id="excludedQueryParametersGlobalHelp" class="inline-help-node">
+ <div>
+ {{ translate('SitesManager_ListOfQueryParametersToExclude', '/^sess.*|.*[dD]ate$/') }}
+
+ <br/><br/>
+
+ {{ translate(
+ 'SitesManager_PiwikWillAutomaticallyExcludeCommonSessionParameters',
+ 'phpsessid, sessionid, ...',
+ ) }}
+ </div>
+ </div>
+
+ <div id="excludedUserAgentsGlobalHelp" class="inline-help-node">
+ <div>
+ {{ translate('SitesManager_GlobalExcludedUserAgentHelp1') }}
+
+ <br/><br/>
+
+ {{ translate('SitesManager_GlobalListExcludedUserAgents_Desc') }}
+ {{ translate('SitesManager_GlobalExcludedUserAgentHelp2') }}
+ {{ translate(
+ 'SitesManager_GlobalExcludedUserAgentHelp3',
+ '/bot|spider|crawl|scanner/i',
+ ) }}
+ </div>
+ </div>
+
+ <div id="timezoneHelp" class="inline-help-node">
+ <div>
+ <span v-if="!timezoneSupportEnabled">
+ {{ translate('SitesManager_AdvancedTimezoneSupportNotFound') }}
+ <br/>
+ </span>
+
+ {{ translate('SitesManager_UTCTimeIs', utcTimeDate) }}
+ <br/>
+ {{ translate('SitesManager_ChangingYourTimezoneWillOnlyAffectDataForward') }}
+ </div>
+ </div>
+
+ <div id="keepURLFragmentsHelp" class="inline-help-node">
+ <div v-html="keepUrlFragmentHelp"></div>
+ <div>{{ translate('SitesManager_KeepURLFragmentsHelp2') }}</div>
+ </div>
+
+ <div>
+ <Field
+ uicontrol="textarea"
+ name="excludedIpsGlobal"
+ var-type="array"
+ v-model="excludedIpsGlobal"
+ :title="translate('SitesManager_ListOfIpsToBeExcludedOnAllWebsites')"
+ :introduction="translate('SitesManager_GlobalListExcludedIps')"
+ :inline-help="'#excludedIpsGlobalHelp'"
+ :disabled="isLoading"
+ />
+ </div>
+
+ <div>
+ <Field
+ uicontrol="textarea"
+ name="excludedQueryParametersGlobal"
+ var-type="array"
+ v-model="excludedQueryParametersGlobal"
+ :title="translate('SitesManager_ListOfQueryParametersToBeExcludedOnAllWebsites')"
+ :introduction="translate('SitesManager_GlobalListExcludedQueryParameters')"
+ :inline-help="'#excludedQueryParametersGlobalHelp'"
+ :disabled="isLoading"
+ />
+ </div>
+
+ <div>
+ <Field
+ uicontrol="textarea"
+ name="excludedUserAgentsGlobal"
+ var-type="array"
+ v-model="excludedUserAgentsGlobal"
+ :title="translate('SitesManager_GlobalListExcludedUserAgents_Desc')"
+ :introduction="translate('SitesManager_GlobalListExcludedUserAgents')"
+ :inline-help="'#excludedUserAgentsGlobalHelp'"
+ :disabled="isLoading"
+ />
+ </div>
+
+ <div>
+ <Field
+ uicontrol="checkbox"
+ name="keepURLFragmentsGlobal"
+ v-model="keepURLFragmentsGlobal"
+ :title="translate('SitesManager_KeepURLFragmentsLong')"
+ :introduction="translate('SitesManager_KeepURLFragments')"
+ :inline-help="'#keepURLFragmentsHelp'"
+ :disabled="isLoading"
+ />
+ </div>
+
+ <h3>{{ translate('SitesManager_TrackingSiteSearch') }}</h3>
+
+ <p>{{ translate('SitesManager_SiteSearchUse') }}</p>
+ <div class="alert alert-info">
+ {{ translate('SitesManager_SearchParametersNote') }}
+ {{ translate('SitesManager_SearchParametersNote2') }}
+ </div>
+
+ <div>
+ <Field
+ uicontrol="text"
+ name="searchKeywordParametersGlobal"
+ var-type="array"
+ v-model="searchKeywordParametersGlobal"
+ :title="translate('SitesManager_SearchKeywordLabel')"
+ :inline-help="translate('SitesManager_SearchKeywordParametersDesc')"
+ :disabled="isLoading"
+ />
+ </div>
+
+ <div>
+ <Field
+ uicontrol="text"
+ name="searchCategoryParametersGlobal"
+ var-type="array"
+ v-model="searchCategoryParametersGlobal"
+ :title="translate('SitesManager_SearchCategoryLabel')"
+ :inline-help="searchCategoryParamsInlineHelp"
+ :disabled="isLoading"
+ />
+ </div>
+
+ <div>
+ <Field
+ uicontrol="select"
+ name="defaultTimezone"
+ :options="timezoneOptions"
+ :title="translate('SitesManager_SelectDefaultTimezone')"
+ :introduction="translate('SitesManager_DefaultTimezoneForNewWebsites')"
+ :inline-help="'#timezoneHelp'"
+ :disabled="isLoading"
+ v-model="defaultTimezone"
+ />
+ </div>
+
+ <div>
+ <Field
+ uicontrol="select"
+ name="defaultCurrency"
+ v-model="defaultCurrency"
+ :options="currencies"
+ :title="translate('SitesManager_SelectDefaultCurrency')"
+ :introduction="translate('SitesManager_DefaultCurrencyForNewWebsites')"
+ :inline-help="translate('SitesManager_CurrencySymbolWillBeUsedForGoals')"
+ :disabled="isLoading"
+ />
+ </div>
+
+ <SaveButton :saving="isSaving" @confirm="saveGlobalSettings()"/>
+ </ContentBlock>
+ </div>
+</template>
+
+<script lang="ts">
+import { defineComponent, watch } from 'vue';
+import {
+ Matomo,
+ ContentBlock,
+ translate,
+ format,
+ AjaxHelper,
+} from 'CoreHome';
+import { Field, SaveButton } from 'CorePluginsAdmin';
+import TimezoneStore from '../TimezoneStore/TimezoneStore';
+import CurrencyStore from '../CurrencyStore/CurrencyStore';
+import GlobalSettingsStore from '../GlobalSettingsStore/GlobalSettingsStore';
+
+interface GlobalSettingsState {
+ currentIpAddress: null|string;
+ utcTime: Date;
+ keepURLFragmentsGlobal: boolean;
+ defaultCurrency: string;
+ defaultTimezone: string;
+ excludedIpsGlobal: string[];
+ excludedQueryParametersGlobal: string[];
+ excludedUserAgentsGlobal: string[];
+ searchKeywordParametersGlobal: string[];
+ searchCategoryParametersGlobal: string[];
+ isSaving: boolean;
+}
+
+interface IpFromHeaderResponse {
+ value: string;
+}
+
+export default defineComponent({
+ props: {
+ // TypeScript can't add state types if there are no properties (probably a bug in Vue)
+ // so we add one dummy property to get the compile to work
+ dummy: String,
+ },
+ components: {
+ ContentBlock,
+ Field,
+ SaveButton,
+ },
+ data(): GlobalSettingsState {
+ const currentDate = new Date();
+ const utcTime = new Date(
+ currentDate.getUTCFullYear(),
+ currentDate.getUTCMonth(),
+ currentDate.getUTCDate(),
+ currentDate.getUTCHours(),
+ currentDate.getUTCMinutes(),
+ currentDate.getUTCSeconds(),
+ );
+
+ const settings = GlobalSettingsStore.globalSettings.value;
+
+ return {
+ currentIpAddress: null,
+ utcTime,
+ keepURLFragmentsGlobal: settings.keepURLFragmentsGlobal,
+ defaultTimezone: settings.defaultTimezone,
+ defaultCurrency: settings.defaultCurrency,
+ excludedIpsGlobal: (settings.excludedIpsGlobal || '').split(','),
+ excludedQueryParametersGlobal:
+ (settings.excludedQueryParametersGlobal || '').split(','),
+ excludedUserAgentsGlobal: (settings.excludedUserAgentsGlobal || '').split(','),
+ searchKeywordParametersGlobal:
+ (settings.searchKeywordParametersGlobal || '').split(','),
+ searchCategoryParametersGlobal:
+ (settings.searchCategoryParametersGlobal || '').split(','),
+ isSaving: false,
+ };
+ },
+ created() {
+ watch(() => GlobalSettingsStore.globalSettings.value, (settings) => {
+ this.keepURLFragmentsGlobal = settings.keepURLFragmentsGlobal;
+ this.defaultTimezone = settings.defaultTimezone;
+ this.defaultCurrency = settings.defaultCurrency;
+ this.excludedIpsGlobal = (settings.excludedIpsGlobal || '').split(',');
+ this.excludedQueryParametersGlobal = (settings.excludedQueryParametersGlobal || '')
+ .split(',');
+ this.excludedUserAgentsGlobal = (settings.excludedUserAgentsGlobal || '').split(',');
+ this.searchKeywordParametersGlobal = (settings.searchKeywordParametersGlobal || '')
+ .split(',');
+ this.searchCategoryParametersGlobal = (settings.searchCategoryParametersGlobal || '')
+ .split(',');
+ });
+
+ AjaxHelper.fetch<IpFromHeaderResponse>({ method: 'API.getIpFromHeader' }).then((response) => {
+ this.currentIpAddress = response.value;
+ });
+ },
+ methods: {
+ saveGlobalSettings() {
+ this.isSaving = true;
+ GlobalSettingsStore.saveGlobalSettings({
+ keepURLFragments: this.keepURLFragmentsGlobal,
+ currency: this.defaultCurrency,
+ timezone: this.defaultTimezone,
+ excludedIps: this.excludedIpsGlobal.join(','),
+ excludedQueryParameters: this.excludedQueryParametersGlobal.join(','),
+ excludedUserAgents: this.excludedUserAgentsGlobal.join(','),
+ searchKeywordParameters: this.searchKeywordParametersGlobal.join(','),
+ searchCategoryParameters: this.searchCategoryParametersGlobal.join(','),
+ }).then(() => {
+ Matomo.helper.redirect({ showaddsite: false });
+ });
+ },
+ },
+ computed: {
+ isLoading() {
+ return GlobalSettingsStore.isLoading.value
+ || TimezoneStore.isLoading.value
+ || CurrencyStore.isLoading.value;
+ },
+ timezones() {
+ return TimezoneStore.timezones.value;
+ },
+ timezoneOptions() {
+ return this.timezones.map(({ group, label, code }) => ({ group, key: label, value: code }));
+ },
+ currencies() {
+ return CurrencyStore.currencies.value;
+ },
+ hasSuperUserAccess() {
+ return Matomo.hasSuperUserAccess;
+ },
+ yourCurrentIpAddressIs() {
+ return translate('SitesManager_YourCurrentIpAddressIs', `<i>${this.currentIpAddress}</i>`);
+ },
+ timezoneSupportEnabled() {
+ return TimezoneStore.timezoneSupportEnabled.value;
+ },
+ utcTimeDate() {
+ const { utcTime } = this;
+
+ const formatTimePart = (n: number) => n.toString().padStart(2, '0');
+
+ const hours = formatTimePart(utcTime.getHours());
+ const minutes = formatTimePart(utcTime.getMinutes());
+ const seconds = formatTimePart(utcTime.getSeconds());
+
+ return `${format(this.utcTime)} ${hours}:${minutes}:${seconds}`;
+ },
+ keepUrlFragmentHelp() {
+ return translate(
+ 'SitesManager_KeepURLFragmentsHelp',
+ '<em>#</em>',
+ '<em>example.org/index.html#first_section</em>',
+ '<em>example.org/index.html</em>',
+ );
+ },
+ searchCategoryParamsInlineHelp() {
+ const parts = [
+ translate('Goals_Optional'),
+ translate('SitesManager_SearchCategoryDesc'),
+ translate('SitesManager_SearchCategoryParametersDesc'),
+ ];
+ return parts.join(' ');
+ },
+ },
+});
+</script>
diff --git a/plugins/SitesManager/vue/src/SiteFields/SiteFields.adapter.ts b/plugins/SitesManager/vue/src/SiteFields/SiteFields.adapter.ts
deleted file mode 100644
index 76638453ab..0000000000
--- a/plugins/SitesManager/vue/src/SiteFields/SiteFields.adapter.ts
+++ /dev/null
@@ -1,98 +0,0 @@
-/*!
- * Matomo - free/libre analytics platform
- *
- * @link https://matomo.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-
-import { ITimeoutService } from 'angular';
-import { createAngularJsAdapter, Site, MatomoUrl } from 'CoreHome';
-import { Setting } from 'CorePluginsAdmin';
-import SiteFields from './SiteFields.vue';
-
-export default createAngularJsAdapter<[ITimeoutService]>({
- component: SiteFields,
- scope: {
- site: {
- angularJsBind: '<',
- },
- timezoneSupportEnabled: {
- angularJsBind: '<',
- },
- utcTime: {
- angularJsBind: '<',
- },
- globalSettings: {
- angularJsBind: '<',
- },
- },
- directiveName: 'matomoSiteFields',
- $inject: ['$timeout'],
- events: {
- cancelEditSite(site: Site, vm, scope: any) {
- scope.$parent.cancelEditSite(site);
- },
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- delete(site: Site, vm, scope: any) {
- let { redirectParams } = scope;
-
- // if the current idSite in the URL is the site we're deleting, then we have to make to
- // change it. otherwise, if a user goes to another page, the invalid idSite may cause
- // a fatal error.
- if (MatomoUrl.urlParsed.value.idSite === site.idsite) {
- const sites = scope.adminSites.sites as Site[];
- const otherSite = sites.find((s) => s.idsite !== site.idsite);
-
- if (otherSite) {
- redirectParams = { ...redirectParams, idSite: otherSite.idsite };
- }
- }
-
- MatomoUrl.updateUrl(
- {
- ...MatomoUrl.urlParsed.value,
- redirectParams,
- },
- MatomoUrl.hashParsed.value,
- );
- },
- save(
- { site, settingValues }: { site: Site, settingValues: Record<string, Setting[]> },
- vm,
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- scope: any,
- element,
- attrs,
- controller,
- $timeout,
- ) {
- const texttareaArrayParams = [
- 'excluded_ips',
- 'excluded_parameters',
- 'excluded_user_agents',
- 'sitesearch_keyword_parameters',
- 'sitesearch_category_parameters',
- ];
-
- const newSite: Site = { ...site };
- Object.values(settingValues).forEach((settings) => {
- settings.forEach((setting) => {
- if (setting.name === 'urls') {
- newSite.alias_urls = setting.value as string[];
- } else if (texttareaArrayParams.indexOf(setting.name) !== -1) {
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- (newSite as any)[setting.name] = (setting.value as string[]).join(', ');
- } else {
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- (newSite as any)[setting.name] = setting.value;
- }
- });
- });
-
- window.$.extend(scope.site, newSite);
- $timeout();
-
- vm.site = newSite;
- },
- },
-});
diff --git a/plugins/SitesManager/vue/src/SiteFields/SiteFields.vue b/plugins/SitesManager/vue/src/SiteFields/SiteFields.vue
index cc375d9c8c..1e8d47a55f 100644
--- a/plugins/SitesManager/vue/src/SiteFields/SiteFields.vue
+++ b/plugins/SitesManager/vue/src/SiteFields/SiteFields.vue
@@ -10,6 +10,7 @@
:idsite="theSite.idsite"
:type="theSite.type"
:class="{ 'editingSite': !!editMode }"
+ ref="root"
>
<div class="card-content">
<div class="row" v-if="!editMode">
@@ -226,7 +227,7 @@ interface SiteFieldsState {
}
interface CreateEditSiteResponse {
- value: string;
+ value: string|number;
}
const timezoneOptions = computed(
@@ -275,7 +276,7 @@ export default defineComponent({
GroupedSettings,
ActivityIndicator,
},
- emits: ['delete', 'cancelEditSite', 'save'],
+ emits: ['delete', 'editSite', 'cancelEditSite', 'save'],
created() {
this.onSiteChanged();
},
@@ -321,6 +322,8 @@ export default defineComponent({
editSite() {
this.editMode = true;
+ this.$emit('editSite', { idSite: this.theSite.idsite });
+
this.measurableSettings = [];
if (isSiteNew(this.theSite)) {
@@ -392,7 +395,16 @@ export default defineComponent({
this.editMode = false;
if (!this.theSite.idsite && response && response.value) {
- this.theSite.idsite = response.value;
+ this.theSite.idsite = `${response.value}`;
+ }
+
+ const timezoneInfo = TimezoneStore.timezones.value.find(
+ (t) => t.code === this.theSite.timezone,
+ );
+ this.theSite.timezone_name = timezoneInfo?.label || this.theSite.timezone;
+
+ if (this.theSite.currency) {
+ this.theSite.currency_name = CurrencyStore.currencies.value[this.theSite.currency];
}
const notificationId = NotificationsStore.show({
@@ -407,7 +419,7 @@ export default defineComponent({
SiteTypesStore.removeEditSiteIdParameterFromHash();
- this.$emit('save', { site: this.theSite, settingValues: values.settingValues });
+ this.$emit('save', { site: this.theSite, settingValues: values.settingValues, isNew });
});
},
cancelEditSite(site: Site) {
@@ -415,7 +427,7 @@ export default defineComponent({
SiteTypesStore.removeEditSiteIdParameterFromHash();
- this.$emit('cancelEditSite', site);
+ this.$emit('cancelEditSite', { site, element: this.$refs.root as HTMLElement });
},
deleteSite() {
AjaxHelper.fetch({
diff --git a/plugins/SitesManager/vue/src/SiteTypesStore/SiteTypesStore.ts b/plugins/SitesManager/vue/src/SiteTypesStore/SiteTypesStore.ts
index e21e7d4e7d..93abe1c8d1 100644
--- a/plugins/SitesManager/vue/src/SiteTypesStore/SiteTypesStore.ts
+++ b/plugins/SitesManager/vue/src/SiteTypesStore/SiteTypesStore.ts
@@ -14,6 +14,7 @@ import { AjaxHelper, MatomoUrl, lazyInitSingleton } from 'CoreHome';
import SiteType from './SiteType';
interface SiteTypesStoreState {
+ isLoading: boolean;
typesById: Record<string, SiteType>;
}
@@ -23,11 +24,14 @@ const { $ } = window;
class SiteTypesStore {
private state = reactive<SiteTypesStoreState>({
+ isLoading: false,
typesById: {},
});
public readonly typesById = computed(() => readonly(this.state).typesById);
+ public readonly isLoading = computed(() => readonly(this.state).isLoading);
+
public readonly types = computed(() => Object.values(this.typesById.value));
private response?: Promise<SiteTypesStore['types']['value']>;
@@ -41,6 +45,7 @@ class SiteTypesStore {
return Promise.resolve(this.response);
}
+ this.state.isLoading = true;
this.response = AjaxHelper.fetch<AvailableTypesResponse>({
method: 'API.getAvailableMeasurableTypes',
filter_limit: '-1',
@@ -50,16 +55,28 @@ class SiteTypesStore {
});
return this.types.value;
+ }).finally(() => {
+ this.state.isLoading = false;
});
return this.response;
}
public getEditSiteIdParameter(): string|undefined {
- const editsiteid = MatomoUrl.hashParsed.value.editsiteid as string;
- if (editsiteid && $.isNumeric(editsiteid)) {
+ // parse query directly because #/editsiteid=N was supported alongside #/?editsiteid=N
+ const m = MatomoUrl.hashQuery.value.match(/editsiteid=([0-9]+)/);
+ if (!m) {
+ return undefined;
+ }
+
+ const isShowAddSite = MatomoUrl.urlParsed.value.showaddsite === '1'
+ || MatomoUrl.urlParsed.value.showaddsite === 'true';
+
+ const editsiteid = m[1];
+ if (editsiteid && $.isNumeric(editsiteid) && !isShowAddSite) {
return editsiteid;
}
+
return undefined;
}
@@ -70,4 +87,4 @@ class SiteTypesStore {
}
}
-export default lazyInitSingleton(SiteTypesStore);
+export default lazyInitSingleton(SiteTypesStore) as SiteTypesStore;
diff --git a/plugins/SitesManager/vue/src/SitesManagement/ButtonBar.vue b/plugins/SitesManager/vue/src/SitesManagement/ButtonBar.vue
new file mode 100644
index 0000000000..d88f4f901f
--- /dev/null
+++ b/plugins/SitesManager/vue/src/SitesManagement/ButtonBar.vue
@@ -0,0 +1,167 @@
+<!--
+ Matomo - free/libre analytics platform
+ @link https://matomo.org
+ @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+-->
+
+<template>
+ <div class="sitesButtonBar clearfix">
+
+ <a v-show="hasSuperUserAccess && availableTypes"
+ class="btn addSite"
+ :class="{ disabled: siteIsBeingEdited }"
+ @click="addNewEntity()"
+ tabindex="1"
+ >
+ {{ availableTypes.length > 1
+ ? translate('SitesManager_AddMeasurable')
+ : translate('SitesManager_AddSite') }}
+ </a>
+
+ <div class="search" v-show="hasPrev || hasNext || isSearching">
+ <input
+ :value="searchTerm"
+ @keydown="onKeydown($event)"
+ :placeholder="translate('Actions_SubmenuSitesearch')"
+ type="text"
+ :disabled="siteIsBeingEdited"
+ />
+ <img
+ @click="searchSite()"
+ :title="translate('General_ClickToSearch')"
+ class="search_ico"
+ src="plugins/Morpheus/images/search_ico.png"
+ />
+ </div>
+
+ <div class="paging" v-show="hasPrev || hasNext">
+ <a
+ class="btn prev"
+ :disabled="(hasPrev && !isLoading) && !siteIsBeingEdited ? undefined : true"
+ @click="previousPage()"
+ >
+ <span style="cursor:pointer;">&#171; {{ translate('General_Previous') }}</span>
+ </a>
+ <span class="counter" v-show="hasPrev || hasNext">
+ <span>
+ {{ paginationText }}
+ </span>
+ </span>
+ <a
+ class="btn next"
+ :disabled="(hasNext && !isLoading) && !siteIsBeingEdited ? undefined : true"
+ @click="nextPage()"
+ >
+ <span style="cursor:pointer;" class="pointer">{{ translate('General_Next') }} &#187;</span>
+ </a>
+ </div>
+ </div>
+</template>
+
+<script lang="ts">
+import { defineComponent } from 'vue';
+import { Matomo, translate, debounce } from 'CoreHome';
+import SiteTypesStore from '../SiteTypesStore/SiteTypesStore';
+
+export default defineComponent({
+ props: {
+ siteIsBeingEdited: {
+ type: Boolean,
+ required: true,
+ },
+ hasPrev: {
+ type: Boolean,
+ required: true,
+ },
+ hasNext: {
+ type: Boolean,
+ required: true,
+ },
+ offsetStart: {
+ type: Number,
+ required: true,
+ },
+ offsetEnd: {
+ type: Number,
+ required: true,
+ },
+ totalNumberOfSites: {
+ type: Number,
+ },
+ isLoading: {
+ type: Boolean,
+ required: true,
+ },
+ searchTerm: {
+ type: String,
+ required: true,
+ },
+ isSearching: {
+ type: Boolean,
+ required: true,
+ },
+ },
+ emits: ['add', 'search', 'prev', 'next', 'update:searchTerm'],
+ created() {
+ this.onKeydown = debounce(this.onKeydown, 50);
+ },
+ computed: {
+ hasSuperUserAccess() {
+ return Matomo.hasSuperUserAccess;
+ },
+ availableTypes() {
+ return SiteTypesStore.types.value;
+ },
+ paginationText() {
+ let text: string;
+ if (this.isSearching) {
+ text = translate(
+ 'General_PaginationWithoutTotal',
+ `${this.offsetStart}`,
+ `${this.offsetEnd}`,
+ );
+ } else {
+ text = translate(
+ 'General_Pagination',
+ `${this.offsetStart}`,
+ `${this.offsetEnd}`,
+ this.totalNumberOfSites === null ? '?' : `${this.totalNumberOfSites}`,
+ );
+ }
+ return ` ${text} `;
+ },
+ },
+ methods: {
+ addNewEntity() {
+ this.$emit('add');
+ },
+ searchSite() {
+ if (this.siteIsBeingEdited) {
+ return;
+ }
+
+ this.$emit('search');
+ },
+ previousPage() {
+ this.$emit('prev');
+ },
+ nextPage() {
+ this.$emit('next');
+ },
+ onKeydown(event: KeyboardEvent) {
+ setTimeout(() => {
+ if (event.key === 'Enter') {
+ this.searchSiteOnEnter(event);
+ return;
+ }
+
+ this.$emit('update:searchTerm', (event.target as HTMLInputElement).value);
+ });
+ },
+ searchSiteOnEnter(event: KeyboardEvent) {
+ event.preventDefault();
+ this.searchSite();
+ },
+ },
+});
+</script>
diff --git a/plugins/SitesManager/vue/src/SitesManagement/SitesManagement.adapter.ts b/plugins/SitesManager/vue/src/SitesManagement/SitesManagement.adapter.ts
new file mode 100644
index 0000000000..bf8c8fe313
--- /dev/null
+++ b/plugins/SitesManager/vue/src/SitesManagement/SitesManagement.adapter.ts
@@ -0,0 +1,15 @@
+/*!
+ * Matomo - free/libre analytics platform
+ *
+ * @link https://matomo.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+import { createAngularJsAdapter } from 'CoreHome';
+import SitesManagement from './SitesManagement.vue';
+
+export default createAngularJsAdapter({
+ component: SitesManagement,
+ scope: {},
+ directiveName: 'matomoSitesManagement',
+});
diff --git a/plugins/SitesManager/vue/src/SitesManagement/SitesManagement.vue b/plugins/SitesManager/vue/src/SitesManagement/SitesManagement.vue
new file mode 100644
index 0000000000..da17d103a5
--- /dev/null
+++ b/plugins/SitesManager/vue/src/SitesManagement/SitesManagement.vue
@@ -0,0 +1,453 @@
+<!--
+ Matomo - free/libre analytics platform
+ @link https://matomo.org
+ @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+-->
+
+<template>
+ <div class="SitesManager" ref="root">
+ <div class="sites-manager-header">
+ <div v-content-intro>
+ <h2
+ v-show="availableTypes.length"
+ >
+ <EnrichedHeadline
+ :help-url="'https://matomo.org/docs/manage-websites/'"
+ :feature-name="translate('SitesManager_WebsitesManagement')"
+ >
+ {{ headlineText }}
+ </EnrichedHeadline>
+ </h2>
+
+ <p>
+ {{ translate('SitesManager_MainDescription') }}
+
+ <span v-html="$sanitize(mainDescription)"></span>
+
+ <span v-show="hasSuperUserAccess">
+ <br/>
+ <span v-html="superUserAccessMessage"></span>
+ </span>
+ </p>
+ </div>
+ </div>
+ <div>
+ <div :class="{ hide_only: !isLoading }">
+ <div class="loadingPiwik">
+ <img
+ src="plugins/Morpheus/images/loading-blue.gif"
+ :alt="translate('General_LoadingData')"
+ />
+ {{ translate('General_LoadingData') }}
+ </div>
+ </div>
+ </div>
+
+ <div>
+ <ButtonBar
+ :site-is-being-edited="isSiteBeingEdited"
+ :has-prev="hasPrev"
+ :hasNext="hasNext"
+ :offset-start="offsetStart"
+ :offset-end="offsetEnd"
+ :total-number-of-sites="totalNumberOfSites"
+ :is-loading="isLoading"
+ :search-term="searchTerm"
+ :is-searching="!!activeSearchTerm"
+ @update:search-term="searchTerm = $event"
+ @add="addNewEntity()"
+ @search="searchSites($event)"
+ @prev="previousPage()"
+ @next="nextPage()"
+ />
+ </div>
+
+ <MatomoDialog v-model="showAddSiteDialog">
+ <div class="ui-confirm">
+ <div>
+ <h2>{{ translate('SitesManager_ChooseMeasurableTypeHeadline') }}</h2>
+
+ <div class="center">
+ <p>
+ <button
+ type="button"
+ v-for="type in availableTypes"
+ :key="type.id"
+ :title="type.description"
+ class="modal-close btn"
+ style="margin-left: 20px;"
+ @click="addSite(type.id);"
+ aria-disabled="false"
+ >
+ <span class="ui-button-text">{{ type.name }}</span>
+ </button>
+ </p>
+ </div>
+ </div>
+ </div>
+ </MatomoDialog>
+
+ <div class="sitesManagerList">
+ <p v-if="activeSearchTerm && 0 === sites.length && !isLoading">
+ {{ translate('SitesManager_NotFound') }} <strong>{{ activeSearchTerm }}</strong>
+ </p>
+
+ <div
+ v-for="(site, index) in sites"
+ :key="site.idsite"
+ >
+ <SiteFields
+ :site="site"
+ :timezone-support-enabled="timezoneSupportEnabled"
+ :utc-time="utcTime"
+ :global-settings="globalSettings"
+ @edit-site="this.isSiteBeingEdited = true"
+ @cancel-edit-site="afterCancelEdit($event)"
+ @delete="afterDelete($event)"
+ @save="afterSave($event.site, $event.settingValues, index, $event.isNew)"
+ />
+ </div>
+ </div>
+
+ <div class="bottomButtonBar">
+ <ButtonBar
+ :site-is-being-edited="isSiteBeingEdited"
+ :has-prev="hasPrev"
+ :hasNext="hasNext"
+ :offset-start="offsetStart"
+ :offset-end="offsetEnd"
+ :total-number-of-sites="totalNumberOfSites"
+ :is-loading="isLoading"
+ :search-term="searchTerm"
+ :is-searching="!!activeSearchTerm"
+ @update:search-term="searchTerm = $event"
+ @add="addNewEntity()"
+ @search="searchSites($event)"
+ @prev="previousPage()"
+ @next="nextPage()"
+ />
+ </div>
+ </div>
+
+</template>
+
+<script lang="ts">
+import { defineComponent, watch } from 'vue';
+import {
+ Matomo,
+ MatomoDialog,
+ Site,
+ ContentIntro,
+ EnrichedHeadline,
+ AjaxHelper,
+ MatomoUrl,
+ translate,
+} from 'CoreHome';
+import { Setting } from 'CorePluginsAdmin';
+import ButtonBar from './ButtonBar.vue';
+import SiteFields from '../SiteFields/SiteFields.vue';
+import SiteTypesStore from '../SiteTypesStore/SiteTypesStore';
+import TimezoneStore from '../TimezoneStore/TimezoneStore';
+import GlobalSettingsStore from '../GlobalSettingsStore/GlobalSettingsStore';
+
+interface SitesManagementState {
+ pageSize: number;
+ currentPage: number;
+ showAddSiteDialog: boolean;
+ searchTerm: string;
+ activeSearchTerm: string;
+ fetchedSites: Site[];
+ utcTime: Date;
+ totalNumberOfSites: number|null;
+ isLoadingInitialEntities: boolean;
+ isSiteBeingEdited: boolean;
+ fetchLimitedSitesAbortController: null|AbortController,
+}
+
+export default defineComponent({
+ props: {
+ // TypeScript can't add state types if there are no properties (probably a bug in Vue)
+ // so we add one dummy property to get the compile to work
+ dummy: String,
+ },
+ components: {
+ MatomoDialog,
+ ButtonBar,
+ SiteFields,
+ EnrichedHeadline,
+ },
+ directives: {
+ ContentIntro,
+ },
+ data(): SitesManagementState {
+ const currentDate = new Date();
+ const utcTime = new Date(
+ currentDate.getUTCFullYear(),
+ currentDate.getUTCMonth(),
+ currentDate.getUTCDate(),
+ currentDate.getUTCHours(),
+ currentDate.getUTCMinutes(),
+ currentDate.getUTCSeconds(),
+ );
+
+ return {
+ pageSize: 10,
+ currentPage: 0,
+ showAddSiteDialog: false,
+ searchTerm: '',
+ activeSearchTerm: '',
+ fetchedSites: [],
+ isLoadingInitialEntities: false,
+ utcTime,
+ totalNumberOfSites: null,
+ isSiteBeingEdited: false,
+ fetchLimitedSitesAbortController: null,
+ };
+ },
+ created() {
+ this.isLoadingInitialEntities = true;
+ Promise.all([
+ SiteTypesStore.fetchAvailableTypes(),
+ this.fetchLimitedSitesWithAdminAccess(),
+ this.getTotalNumberOfSites(),
+ ]).then(() => {
+ this.triggerAddSiteIfRequested();
+ }).finally(() => {
+ this.isLoadingInitialEntities = false;
+ });
+
+ // if hash is #globalSettings, redirect to globalSettings action (we don't do it on
+ // page load so the back button still works)
+ watch(() => MatomoUrl.hashQuery.value, () => {
+ this.checkGlobalSettingsHash();
+ });
+ },
+ computed: {
+ sites() {
+ const emptyIdSiteRows = this.fetchedSites.filter((s) => !s.idsite).length;
+ return this.fetchedSites.slice(0, this.pageSize + emptyIdSiteRows);
+ },
+ isLoading() {
+ return !!this.fetchLimitedSitesAbortController
+ || this.isLoadingInitialEntities
+ || this.totalNumberOfSites === null
+ || SiteTypesStore.isLoading.value
+ || TimezoneStore.isLoading.value
+ || GlobalSettingsStore.isLoading.value;
+ },
+ availableTypes() {
+ return SiteTypesStore.types.value;
+ },
+ timezoneSupportEnabled() {
+ return TimezoneStore.timezoneSupportEnabled.value;
+ },
+ globalSettings() {
+ return GlobalSettingsStore.globalSettings.value;
+ },
+ headlineText() {
+ return translate(
+ 'SitesManager_XManagement',
+ this.availableTypes.length > 1
+ ? translate('General_Measurables')
+ : translate('SitesManager_Sites'),
+ );
+ },
+ mainDescription() {
+ return translate(
+ 'SitesManager_YouCurrentlyHaveAccessToNWebsites',
+ `<strong>${this.totalNumberOfSites}</strong>`,
+ );
+ },
+ hasSuperUserAccess() {
+ return Matomo.hasSuperUserAccess;
+ },
+ superUserAccessMessage() {
+ return translate('SitesManager_SuperUserAccessCan', '<a href=\'#globalSettings\'>', '</a>');
+ },
+ hasPrev() {
+ return this.currentPage >= 1;
+ },
+ hasNext() {
+ return this.fetchedSites.filter((s) => !!s.idsite).length >= this.pageSize + 1;
+ },
+ offsetStart() {
+ return this.currentPage * this.pageSize + 1;
+ },
+ offsetEnd() {
+ return this.offsetStart + this.sites.filter((s) => !!s.idsite).length - 1;
+ },
+ },
+ methods: {
+ checkGlobalSettingsHash() {
+ const newHash = MatomoUrl.hashQuery.value;
+ if (Matomo.hasSuperUserAccess
+ && (
+ newHash === 'globalSettings'
+ || newHash === '/globalSettings'
+ )
+ ) {
+ MatomoUrl.updateLocation({
+ ...MatomoUrl.urlParsed.value,
+ action: 'globalSettings',
+ });
+ }
+ },
+ addNewEntity() {
+ if (this.availableTypes.length > 1) {
+ this.showAddSiteDialog = true;
+ } else if (this.availableTypes.length === 1) {
+ this.addSite(this.availableTypes[0].id);
+ }
+ },
+ addSite(typeId?: string) {
+ let type: string|undefined = typeId;
+
+ const parameters = {
+ isAllowed: true,
+ measurableType: type,
+ };
+
+ Matomo.postEvent('SitesManager.initAddSite', parameters); // TODO: test this
+
+ if (parameters && !parameters.isAllowed) {
+ return;
+ }
+
+ if (!type) {
+ type = 'website'; // todo shall we really hard code this or trigger an exception or so?
+ }
+
+ this.fetchedSites.unshift({
+ type,
+ } as unknown as Site);
+
+ this.isSiteBeingEdited = true;
+ },
+ afterCancelEdit({ site, element }: { site: Site, element: HTMLElement }) {
+ this.isSiteBeingEdited = false;
+
+ if (!site.idsite) {
+ this.fetchedSites = this.fetchedSites.filter((s) => !!s.idsite);
+ return;
+ }
+
+ element.scrollIntoView();
+ },
+ fetchLimitedSitesWithAdminAccess(searchTerm = '') {
+ if (this.fetchLimitedSitesAbortController) {
+ this.fetchLimitedSitesAbortController.abort();
+ }
+
+ this.fetchLimitedSitesAbortController = new AbortController();
+
+ const limit = this.pageSize + 1;
+ const offset = this.currentPage * this.pageSize;
+
+ const params: QueryParameters = {
+ method: 'SitesManager.getSitesWithAdminAccess',
+ fetchAliasUrls: 1,
+ limit: limit + offset, // this is applied in SitesManager.getSitesWithAdminAccess API
+ filter_offset: offset, // filter_offset and filter_limit is applied in response builder
+ filter_limit: limit,
+ };
+
+ if (searchTerm) {
+ params.pattern = searchTerm;
+ }
+
+ return AjaxHelper.fetch<Site[]>(params).then((sites) => {
+ this.fetchedSites = sites || [];
+ }).then((sites) => {
+ this.activeSearchTerm = searchTerm;
+ return sites;
+ }).finally(() => {
+ this.fetchLimitedSitesAbortController = null;
+ });
+ },
+ getTotalNumberOfSites() {
+ return AjaxHelper.fetch<string[]>({
+ method: 'SitesManager.getSitesIdWithAdminAccess',
+ filter_limit: '-1',
+ }).then((sites) => {
+ this.totalNumberOfSites = sites.length;
+ });
+ },
+ triggerAddSiteIfRequested() {
+ const forcedEditSiteId = SiteTypesStore.getEditSiteIdParameter();
+ const showaddsite = MatomoUrl.urlParsed.value.showaddsite as string;
+
+ if (showaddsite === '1') {
+ this.addNewEntity();
+ } else if (forcedEditSiteId) {
+ this.searchTerm = forcedEditSiteId;
+ this.fetchLimitedSitesWithAdminAccess(this.searchTerm);
+ }
+ },
+ previousPage() {
+ this.currentPage = Math.max(0, this.currentPage - 1);
+ this.fetchLimitedSitesWithAdminAccess(this.activeSearchTerm);
+ },
+ nextPage() {
+ this.currentPage = Math.max(0, this.currentPage + 1);
+ this.fetchLimitedSitesWithAdminAccess(this.activeSearchTerm);
+ },
+ searchSites() {
+ this.currentPage = 0;
+ this.fetchLimitedSitesWithAdminAccess(this.searchTerm);
+ },
+ afterDelete(site: Site) {
+ let redirectParams: QueryParameters = {
+ showaddsite: 0,
+ };
+
+ // if the current idSite in the URL is the site we're deleting, then we have to make to
+ // change it. otherwise, if a user goes to another page, the invalid idSite may cause
+ // a fatal error.
+ if (MatomoUrl.urlParsed.value.idSite === `${site.idsite}`) {
+ const otherSite = this.sites.find((s) => s.idsite !== site.idsite);
+
+ if (otherSite) {
+ redirectParams = { ...redirectParams, idSite: otherSite.idsite };
+ }
+ }
+
+ Matomo.helper.redirect(redirectParams);
+ },
+ afterSave(site: Site, settingValues: Record<string, Setting[]>, index: number, isNew: boolean) {
+ const texttareaArrayParams = [
+ 'excluded_ips',
+ 'excluded_parameters',
+ 'excluded_user_agents',
+ 'sitesearch_keyword_parameters',
+ 'sitesearch_category_parameters',
+ ];
+
+ const newSite: Site = { ...site };
+
+ Object.values(settingValues).forEach((settings) => {
+ settings.forEach((setting) => {
+ if (setting.name === 'urls') {
+ newSite.alias_urls = setting.value as string[];
+ } else if (texttareaArrayParams.indexOf(setting.name) !== -1) {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ (newSite as any)[setting.name] = (setting.value as string[]).join(', ');
+ } else {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ (newSite as any)[setting.name] = setting.value;
+ }
+ });
+ });
+
+ this.fetchedSites[index] = newSite;
+
+ if (isNew && this.totalNumberOfSites !== null) {
+ this.totalNumberOfSites += 1;
+ }
+
+ console.log('here?');
+
+ this.isSiteBeingEdited = false;
+ },
+ },
+});
+</script>
diff --git a/plugins/SitesManager/vue/src/TimezoneStore/TimezoneStore.ts b/plugins/SitesManager/vue/src/TimezoneStore/TimezoneStore.ts
index f13da0bc8d..d3c2f2fb3c 100644
--- a/plugins/SitesManager/vue/src/TimezoneStore/TimezoneStore.ts
+++ b/plugins/SitesManager/vue/src/TimezoneStore/TimezoneStore.ts
@@ -15,24 +15,44 @@ interface Timezone {
}
interface TimezoneStoreState {
+ isLoading: boolean;
timezones: Timezone[];
+ timezoneSupportEnabled: boolean;
}
type GetTimezoneListResponse = Record<string, Record<string, string>>;
+interface IsTimezoneSupportedResponse {
+ value: boolean;
+}
+
class TimezoneStore {
private privateState = reactive<TimezoneStoreState>({
+ isLoading: false,
timezones: [],
+ timezoneSupportEnabled: false,
});
- readonly timezones = computed(() => readonly(this.privateState).timezones);
+ private readonly state = computed(() => readonly(this.privateState));
+
+ readonly timezones = computed(() => this.state.value.timezones);
+
+ readonly timezoneSupportEnabled = computed(() => this.state.value.timezoneSupportEnabled);
+
+ readonly isLoading = computed(() => this.state.value.isLoading);
constructor() {
- this.fetchTimezones();
+ this.privateState.isLoading = true;
+ Promise.all([
+ this.checkTimezoneSupportEnabled(),
+ this.fetchTimezones(),
+ ]).finally(() => {
+ this.privateState.isLoading = false;
+ });
}
private fetchTimezones() {
- AjaxHelper.fetch<GetTimezoneListResponse>({
+ return AjaxHelper.fetch<GetTimezoneListResponse>({
method: 'SitesManager.getTimezonesList',
}).then((grouped) => {
const flattened: Timezone[] = [];
@@ -48,6 +68,14 @@ class TimezoneStore {
this.privateState.timezones = flattened;
});
}
+
+ private checkTimezoneSupportEnabled() {
+ return AjaxHelper.fetch<IsTimezoneSupportedResponse>({
+ method: 'SitesManager.isTimezoneSupportEnabled',
+ }).then((response) => {
+ this.privateState.timezoneSupportEnabled = response.value;
+ });
+ }
}
-export default lazyInitSingleton(TimezoneStore);
+export default lazyInitSingleton(TimezoneStore) as TimezoneStore;
diff --git a/plugins/SitesManager/vue/src/index.ts b/plugins/SitesManager/vue/src/index.ts
index b14d6d93a2..a103620feb 100644
--- a/plugins/SitesManager/vue/src/index.ts
+++ b/plugins/SitesManager/vue/src/index.ts
@@ -6,10 +6,12 @@
*/
import './SiteTypesStore/SiteTypesStore.adapter';
-import './SiteFields/SiteFields.adapter';
+import './SitesManagement/SitesManagement.adapter';
+import './ManageGlobalSettings/ManageGlobalSettings.adapter';
export { default as SiteType } from './SiteTypesStore/SiteType';
export { default as SiteTypesStore } from './SiteTypesStore/SiteTypesStore';
-export { default as SiteFields } from './SiteFields/SiteFields.vue';
export { default as CurrencyStore } from './CurrencyStore/CurrencyStore';
export { default as TimezoneStore } from './TimezoneStore/TimezoneStore';
+export { default as SitesManagement } from './SitesManagement/SitesManagement.vue';
+export { default as ManageGlobalSettings } from './ManageGlobalSettings/ManageGlobalSettings.vue';