diff options
author | dizzy <diosmosis@users.noreply.github.com> | 2022-01-18 15:09:31 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-18 15:09:31 +0300 |
commit | 0e730b7042fb784a91dd678a3d028b2beebd0e74 (patch) | |
tree | c2554b50956eee488da23386e2bd5e47f76761af /plugins/CoreAdminHome | |
parent | 1a53cf357c1ef5ca4d0d8e4e68c1fc40665296e0 (diff) |
[Vue] migrate trackingfailures directive to Vue (#18553)
* 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
* migrate sparkline component
* migrate progressbar component
* migrate content intro & content table directives
* rebuild vue
* migrate piwik-ajax-form component to vue
* migrate popover handler directive to service class
* migrate dropdownbutton directive though it does not seem to be in use
* migrate show sensitive data directive
* build vue
* 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
* 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 reference nonexistant files
* fix bug and rebuild
* fix bug and rebuild
* fix issue
* fix issues and rebuild
* fix ui test
* fix UI test failure
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/CoreAdminHome')
-rw-r--r-- | plugins/CoreAdminHome/CoreAdminHome.php | 2 | ||||
-rw-r--r-- | plugins/CoreAdminHome/angularjs/trackingfailures/trackingfailures.controller.js | 59 | ||||
-rw-r--r-- | plugins/CoreAdminHome/angularjs/trackingfailures/trackingfailures.directive.html | 59 | ||||
-rw-r--r-- | plugins/CoreAdminHome/angularjs/trackingfailures/trackingfailures.directive.js | 25 | ||||
-rw-r--r-- | plugins/CoreAdminHome/tests/UI/TrackingFailures_spec.js | 2 | ||||
-rw-r--r-- | plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.js | 326 | ||||
-rw-r--r-- | plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.min.js | 18 | ||||
-rw-r--r-- | plugins/CoreAdminHome/vue/src/TrackingFailures/FailureRow.vue | 67 | ||||
-rw-r--r-- | plugins/CoreAdminHome/vue/src/TrackingFailures/TrackingFailures.adapter.ts | 14 | ||||
-rw-r--r-- | plugins/CoreAdminHome/vue/src/TrackingFailures/TrackingFailures.less (renamed from plugins/CoreAdminHome/angularjs/trackingfailures/trackingfailures.directive.less) | 0 | ||||
-rw-r--r-- | plugins/CoreAdminHome/vue/src/TrackingFailures/TrackingFailures.vue | 220 | ||||
-rw-r--r-- | plugins/CoreAdminHome/vue/src/index.ts | 2 |
12 files changed, 643 insertions, 151 deletions
diff --git a/plugins/CoreAdminHome/CoreAdminHome.php b/plugins/CoreAdminHome/CoreAdminHome.php index f542798d6e..4c45a22459 100644 --- a/plugins/CoreAdminHome/CoreAdminHome.php +++ b/plugins/CoreAdminHome/CoreAdminHome.php @@ -59,7 +59,7 @@ class CoreAdminHome extends \Piwik\Plugin $stylesheets[] = "plugins/Morpheus/stylesheets/base.less"; $stylesheets[] = "plugins/Morpheus/stylesheets/main.less"; $stylesheets[] = "plugins/CoreAdminHome/stylesheets/generalSettings.less"; - $stylesheets[] = "plugins/CoreAdminHome/angularjs/trackingfailures/trackingfailures.directive.less"; + $stylesheets[] = "plugins/CoreAdminHome/vue/src/TrackingFailures/TrackingFailures.less"; $stylesheets[] = "plugins/CoreAdminHome/stylesheets/whatIsNew.less"; } diff --git a/plugins/CoreAdminHome/angularjs/trackingfailures/trackingfailures.controller.js b/plugins/CoreAdminHome/angularjs/trackingfailures/trackingfailures.controller.js deleted file mode 100644 index e007fae6c3..0000000000 --- a/plugins/CoreAdminHome/angularjs/trackingfailures/trackingfailures.controller.js +++ /dev/null @@ -1,59 +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('TrackingFailuresController', TrackingFailuresController); - - TrackingFailuresController.$inject = ['piwikApi', 'piwik']; - - function TrackingFailuresController(piwikApi, piwik){ - var self = this; - this.failures = []; - this.sortColumn = 'idsite'; - this.sortReverse = false; - this.isLoading = false; - - this.changeSortOrder = function (columnToSort) { - if (this.sortColumn === columnToSort) { - this.sortReverse = !this.sortReverse; - } else { - this.sortColumn = columnToSort; - } - }; - - this.fetchAll = function () { - this.failures = []; - this.isLoading = true; - piwikApi.fetch({method: 'CoreAdminHome.getTrackingFailures', filter_limit: '-1'}).then(function (failures) { - self.failures = failures; - self.isLoading = false; - }, function () { - self.isLoading = false; - }); - }; - - this.deleteAll = function () { - piwik.helper.modalConfirm('#confirmDeleteAllTrackingFailures', {yes: function () { - self.failures = []; - piwikApi.fetch({method: 'CoreAdminHome.deleteAllTrackingFailures'}).then(function () { - self.fetchAll(); - }); - }}); - }; - - this.deleteFailure = function (idSite, idFailure) { - piwik.helper.modalConfirm('#confirmDeleteThisTrackingFailure', {yes: function () { - self.failures = []; - piwikApi.fetch({method: 'CoreAdminHome.deleteTrackingFailure', idSite: idSite, idFailure: idFailure}).then(function () { - self.fetchAll(); - }); - }}); - }; - - this.fetchAll(); - } - -})(); diff --git a/plugins/CoreAdminHome/angularjs/trackingfailures/trackingfailures.directive.html b/plugins/CoreAdminHome/angularjs/trackingfailures/trackingfailures.directive.html deleted file mode 100644 index 07e4baa895..0000000000 --- a/plugins/CoreAdminHome/angularjs/trackingfailures/trackingfailures.directive.html +++ /dev/null @@ -1,59 +0,0 @@ -<div piwik-content-block - content-title="{{ 'CoreAdminHome_TrackingFailures'|translate }}" - class="matomoTrackingFailures"> - <p> - {{ 'CoreAdminHome_TrackingFailuresIntroduction'|translate:2 }} - <br /><br /> - <input class="btn deleteAllFailures" - ng-show="!trackingFailures.isLoading && trackingFailures.failures.length > 0" - type="button" ng-click="trackingFailures.deleteAll();" - value="{{'CoreAdminHome_DeleteAllFailures'|translate}}"> - </p> - - <div piwik-activity-indicator loading="trackingFailures.isLoading"></div> - - <table piwik-content-table> - <thead> - <tr> - <th ng-click="trackingFailures.changeSortOrder('idsite')">{{ 'General_Measurable'|translate }}</th> - <th ng-click="trackingFailures.changeSortOrder('problem')">{{ 'CoreAdminHome_Problem'|translate }}</th> - <th ng-click="trackingFailures.changeSortOrder('solution')">{{ 'CoreAdminHome_Solution'|translate }}</th> - <th ng-click="trackingFailures.changeSortOrder('date_first_occurred')">{{ 'General_Date'|translate }}</th> - <th ng-click="trackingFailures.changeSortOrder('url')">{{ 'Actions_ColumnPageURL'|translate }}</th> - <th ng-click="trackingFailures.changeSortOrder('request_url')">{{ 'CoreAdminHome_TrackingURL'|translate }}</th> - <th class="action">{{ 'General_Action'|translate }}</th> - </tr> - </thead> - <tbody> - <tr><td colspan="7" ng-show="!trackingFailures.isLoading && trackingFailures.failures.length == 0">{{'CoreAdminHome_NoKnownFailures'|translate}} <span class="icon-ok"></span></td></tr> - <tr ng-repeat="failure in trackingFailures.failures | orderBy:trackingFailures.sortColumn:trackingFailures.sortReverse"> - <td>{{ failure.site_name }} ({{'General_Id'|translate}} {{ failure.idsite }})</td> - <td>{{ failure.problem }}</td> - <td>{{ failure.solution }} <a ng-show="failure.solution_url" rel="noopener noreferrer" ng-href="{{ failure.solution_url }}">{{'CoreAdminHome_LearnMore'|translate }}</a></td> - <td class="datetime">{{ failure.pretty_date_first_occurred }}</td> - <td>{{ failure.url }}</td> - <td><span ng-show="!failure.showFullRequestUrl" title="{{'CoreHome_ClickToSeeFullInformation'|translate}}" - ng-click="failure.showFullRequestUrl = true">{{ failure.request_url|limitTo:100 }}...</span> - <span ng-show="failure.showFullRequestUrl">{{ failure.request_url }}</span></td> - <td><span class="table-action icon-delete" - title="{{'General_Delete'|translate}}" - ng-click="trackingFailures.deleteFailure(failure.idsite, failure.idfailure)"></span></td> - </tr> - </tbody> - </table> - - <div class="ui-confirm" id="confirmDeleteAllTrackingFailures"> - <h2>{{ 'CoreAdminHome_ConfirmDeleteAllTrackingFailures'|translate }}</h2> - - <input type="button" value="{{ 'General_Yes'|translate }}" role="yes"/> - <input type="button" value="{{ 'General_No'|translate }}" role="no" /> - </div> - - <div class="ui-confirm" id="confirmDeleteThisTrackingFailure"> - <h2>{{ 'CoreAdminHome_ConfirmDeleteThisTrackingFailure'|translate }}</h2> - - <input type="button" value="{{ 'General_Yes'|translate }}" role="yes"/> - <input type="button" value="{{ 'General_No'|translate }}" role="no" /> - </div> - -</div>
\ No newline at end of file diff --git a/plugins/CoreAdminHome/angularjs/trackingfailures/trackingfailures.directive.js b/plugins/CoreAdminHome/angularjs/trackingfailures/trackingfailures.directive.js deleted file mode 100644 index 910e5278d7..0000000000 --- a/plugins/CoreAdminHome/angularjs/trackingfailures/trackingfailures.directive.js +++ /dev/null @@ -1,25 +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 - */ - -/** - * Usage: - * <div matomo-tracking-failures> - */ -(function () { - angular.module('piwikApp').directive('matomoTrackingFailures', matomoTrackingFailures); - - matomoTrackingFailures.$inject = ['piwik']; - - function matomoTrackingFailures(piwik){ - return { - restrict: 'A', - templateUrl: 'plugins/CoreAdminHome/angularjs/trackingfailures/trackingfailures.directive.html?cb=' + piwik.cacheBuster, - controller: 'TrackingFailuresController', - controllerAs: 'trackingFailures' - }; - } -})();
\ No newline at end of file diff --git a/plugins/CoreAdminHome/tests/UI/TrackingFailures_spec.js b/plugins/CoreAdminHome/tests/UI/TrackingFailures_spec.js index d5e66f101a..faac886d16 100644 --- a/plugins/CoreAdminHome/tests/UI/TrackingFailures_spec.js +++ b/plugins/CoreAdminHome/tests/UI/TrackingFailures_spec.js @@ -93,4 +93,4 @@ describe("TrackingFailures", function () { expect(await frame.screenshot()).to.matchImage('manage_with_failures_delete_all_confirmed'); }); -});
\ No newline at end of file +}); diff --git a/plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.js b/plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.js index c1acc43395..e10c6076ba 100644 --- a/plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.js +++ b/plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.js @@ -130,6 +130,7 @@ __webpack_require__.d(__webpack_exports__, "BrandingSettings", function() { retu __webpack_require__.d(__webpack_exports__, "SmtpSettings", function() { return /* reexport */ SmtpSettings; }); __webpack_require__.d(__webpack_exports__, "JsTrackingCodeGenerator", function() { return /* reexport */ JsTrackingCodeGenerator; }); __webpack_require__.d(__webpack_exports__, "ImageTrackingCodeGenerator", function() { return /* reexport */ ImageTrackingCodeGenerator; }); +__webpack_require__.d(__webpack_exports__, "TrackingFailures", function() { return /* reexport */ TrackingFailures; }); // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js // This file is imported into lib/wc client bundles. @@ -2053,6 +2054,329 @@ ImageTrackingCodeGeneratorvue_type_script_lang_ts.render = ImageTrackingCodeGene }, directiveName: 'matomoImageTrackingCodeGenerator' })); +// 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/CoreAdminHome/vue/src/TrackingFailures/TrackingFailures.vue?vue&type=template&id=209e7186 + + +var TrackingFailuresvue_type_template_id_209e7186_hoisted_1 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); + +var TrackingFailuresvue_type_template_id_209e7186_hoisted_2 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); + +var TrackingFailuresvue_type_template_id_209e7186_hoisted_3 = ["value"]; +var TrackingFailuresvue_type_template_id_209e7186_hoisted_4 = { + class: "action" +}; +var TrackingFailuresvue_type_template_id_209e7186_hoisted_5 = { + colspan: "7" +}; + +var TrackingFailuresvue_type_template_id_209e7186_hoisted_6 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + class: "icon-ok" +}, null, -1); + +var TrackingFailuresvue_type_template_id_209e7186_hoisted_7 = { + class: "ui-confirm", + id: "confirmDeleteAllTrackingFailures" +}; +var TrackingFailuresvue_type_template_id_209e7186_hoisted_8 = ["value"]; +var TrackingFailuresvue_type_template_id_209e7186_hoisted_9 = ["value"]; +var TrackingFailuresvue_type_template_id_209e7186_hoisted_10 = { + class: "ui-confirm", + id: "confirmDeleteThisTrackingFailure" +}; +var TrackingFailuresvue_type_template_id_209e7186_hoisted_11 = ["value"]; +var TrackingFailuresvue_type_template_id_209e7186_hoisted_12 = ["value"]; +function TrackingFailuresvue_type_template_id_209e7186_render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_ActivityIndicator = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ActivityIndicator"); + + var _component_FailureRow = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("FailureRow"); + + var _component_ContentBlock = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ContentBlock"); + + var _directive_content_table = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("content-table"); + + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_ContentBlock, { + class: "matomoTrackingFailures", + "content-title": _ctx.translate('CoreAdminHome_TrackingFailures') + }, { + default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { + return [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('CoreAdminHome_TrackingFailuresIntroduction', '2')) + " ", 1), TrackingFailuresvue_type_template_id_209e7186_hoisted_1, TrackingFailuresvue_type_template_id_209e7186_hoisted_2, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + class: "btn deleteAllFailures", + type: "button", + onClick: _cache[0] || (_cache[0] = function ($event) { + return _ctx.deleteAll(); + }), + value: _ctx.translate('CoreAdminHome_DeleteAllFailures') + }, null, 8, TrackingFailuresvue_type_template_id_209e7186_hoisted_3), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.isLoading && _ctx.failures.length > 0]])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_ActivityIndicator, { + loading: _ctx.isLoading + }, null, 8, ["loading"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("table", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("thead", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("tr", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("th", { + onClick: _cache[1] || (_cache[1] = function ($event) { + return _ctx.changeSortOrder('idsite'); + }) + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Measurable')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("th", { + onClick: _cache[2] || (_cache[2] = function ($event) { + return _ctx.changeSortOrder('problem'); + }) + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CoreAdminHome_Problem')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("th", { + onClick: _cache[3] || (_cache[3] = function ($event) { + return _ctx.changeSortOrder('solution'); + }) + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CoreAdminHome_Solution')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("th", { + onClick: _cache[4] || (_cache[4] = function ($event) { + return _ctx.changeSortOrder('date_first_occurred'); + }) + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Date')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("th", { + onClick: _cache[5] || (_cache[5] = function ($event) { + return _ctx.changeSortOrder('url'); + }) + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('Actions_ColumnPageURL')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("th", { + onClick: _cache[6] || (_cache[6] = function ($event) { + return _ctx.changeSortOrder('request_url'); + }) + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CoreAdminHome_TrackingURL')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("th", TrackingFailuresvue_type_template_id_209e7186_hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Action')), 1)])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("tbody", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("tr", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", TrackingFailuresvue_type_template_id_209e7186_hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CoreAdminHome_NoKnownFailures')) + " ", 1), TrackingFailuresvue_type_template_id_209e7186_hoisted_6], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.isLoading && _ctx.failures.length === 0]])]), (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.sortedFailures, function (failure, index) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("tr", { + key: index + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_FailureRow, { + failure: failure, + onDelete: _cache[7] || (_cache[7] = function ($event) { + return _ctx.deleteFailure($event.idSite, $event.idFailure); + }) + }, null, 8, ["failure"])]); + }), 128))])], 512), [[_directive_content_table]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", TrackingFailuresvue_type_template_id_209e7186_hoisted_7, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CoreAdminHome_ConfirmDeleteAllTrackingFailures')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + type: "button", + role: "yes", + value: _ctx.translate('General_Yes') + }, null, 8, TrackingFailuresvue_type_template_id_209e7186_hoisted_8), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + type: "button", + role: "no", + value: _ctx.translate('General_No') + }, null, 8, TrackingFailuresvue_type_template_id_209e7186_hoisted_9)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", TrackingFailuresvue_type_template_id_209e7186_hoisted_10, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CoreAdminHome_ConfirmDeleteThisTrackingFailure')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + type: "button", + role: "yes", + value: _ctx.translate('General_Yes') + }, null, 8, TrackingFailuresvue_type_template_id_209e7186_hoisted_11), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + type: "button", + role: "no", + value: _ctx.translate('General_No') + }, null, 8, TrackingFailuresvue_type_template_id_209e7186_hoisted_12)])]; + }), + _: 1 + }, 8, ["content-title"]); +} +// CONCATENATED MODULE: ./plugins/CoreAdminHome/vue/src/TrackingFailures/TrackingFailures.vue?vue&type=template&id=209e7186 + +// 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/CoreAdminHome/vue/src/TrackingFailures/FailureRow.vue?vue&type=template&id=3a6b4c01 + +var FailureRowvue_type_template_id_3a6b4c01_hoisted_1 = [":href"]; +var FailureRowvue_type_template_id_3a6b4c01_hoisted_2 = { + class: "datetime" +}; +var FailureRowvue_type_template_id_3a6b4c01_hoisted_3 = ["title"]; +var FailureRowvue_type_template_id_3a6b4c01_hoisted_4 = ["title"]; +function FailureRowvue_type_template_id_3a6b4c01_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"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.failure.site_name) + " (" + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Id')) + " " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.failure.idsite) + ")", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.failure.problem), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.failure.solution) + " ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + rel: "noopener noreferrer", + ":href": _ctx.failure.solution_url + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CoreAdminHome_LearnMore')), 9, FailureRowvue_type_template_id_3a6b4c01_hoisted_1), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.failure.solution_url]])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", FailureRowvue_type_template_id_3a6b4c01_hoisted_2, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.failure.pretty_date_first_occurred), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.failure.url), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + onClick: _cache[0] || (_cache[0] = function ($event) { + return _ctx.showFullRequestUrl = true; + }), + title: _ctx.translate('CoreHome_ClickToSeeFullInformation') + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.limtedRequestUrl) + "...", 9, FailureRowvue_type_template_id_3a6b4c01_hoisted_3), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.showFullRequestUrl]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.failure.request_url), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.failure.showFullRequestUrl]])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + class: "table-action icon-delete", + onClick: _cache[1] || (_cache[1] = function ($event) { + return _ctx.deleteFailure(_ctx.failure.idsite, _ctx.failure.idfailure); + }), + title: _ctx.translate('General_Delete') + }, null, 8, FailureRowvue_type_template_id_3a6b4c01_hoisted_4)])], 64); +} +// CONCATENATED MODULE: ./plugins/CoreAdminHome/vue/src/TrackingFailures/FailureRow.vue?vue&type=template&id=3a6b4c01 + +// 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/CoreAdminHome/vue/src/TrackingFailures/FailureRow.vue?vue&type=script&lang=ts + +/* harmony default export */ var FailureRowvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + failure: { + type: Object, + required: true + } + }, + emits: ['delete'], + data: function data() { + return { + showFullRequestUrl: false + }; + }, + computed: { + limtedRequestUrl: function limtedRequestUrl() { + return this.failure.request_url.substring(0, 100); + } + }, + methods: { + deleteFailure: function deleteFailure(idSite, idFailure) { + this.$emit('delete', { + idSite: idSite, + idFailure: idFailure + }); + } + } +})); +// CONCATENATED MODULE: ./plugins/CoreAdminHome/vue/src/TrackingFailures/FailureRow.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CoreAdminHome/vue/src/TrackingFailures/FailureRow.vue + + + +FailureRowvue_type_script_lang_ts.render = FailureRowvue_type_template_id_3a6b4c01_render + +/* harmony default export */ var FailureRow = (FailureRowvue_type_script_lang_ts); +// 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/CoreAdminHome/vue/src/TrackingFailures/TrackingFailures.vue?vue&type=script&lang=ts +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || TrackingFailuresvue_type_script_lang_ts_unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function TrackingFailuresvue_type_script_lang_ts_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return TrackingFailuresvue_type_script_lang_ts_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return TrackingFailuresvue_type_script_lang_ts_arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return TrackingFailuresvue_type_script_lang_ts_arrayLikeToArray(arr); } + +function TrackingFailuresvue_type_script_lang_ts_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + + + + +/* harmony default export */ var TrackingFailuresvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + components: { + ContentBlock: external_CoreHome_["ContentBlock"], + ActivityIndicator: external_CoreHome_["ActivityIndicator"], + FailureRow: FailureRow + }, + directives: { + ContentTable: external_CoreHome_["ContentTable"] + }, + data: function data() { + return { + failures: [], + sortColumn: 'idsite', + sortReverse: false, + isLoading: false + }; + }, + created: function created() { + this.fetchAll(); + }, + methods: { + changeSortOrder: function changeSortOrder(columnToSort) { + if (this.sortColumn === columnToSort) { + this.sortReverse = !this.sortReverse; + } else { + this.sortColumn = columnToSort; + } + }, + fetchAll: function fetchAll() { + var _this = this; + + this.failures = []; + this.isLoading = true; + external_CoreHome_["AjaxHelper"].fetch({ + method: 'CoreAdminHome.getTrackingFailures', + filter_limit: '-1' + }).then(function (failures) { + _this.failures = failures; + _this.isLoading = false; + }).finally(function () { + _this.isLoading = false; + }); + }, + deleteAll: function deleteAll() { + var _this2 = this; + + external_CoreHome_["Matomo"].helper.modalConfirm('#confirmDeleteAllTrackingFailures', { + yes: function yes() { + _this2.failures = []; + external_CoreHome_["AjaxHelper"].fetch({ + method: 'CoreAdminHome.deleteAllTrackingFailures' + }).then(function () { + _this2.fetchAll(); + }); + } + }); + }, + deleteFailure: function deleteFailure(idSite, idFailure) { + var _this3 = this; + + external_CoreHome_["Matomo"].helper.modalConfirm('#confirmDeleteThisTrackingFailure', { + yes: function yes() { + _this3.failures = []; + external_CoreHome_["AjaxHelper"].fetch({ + method: 'CoreAdminHome.deleteTrackingFailure', + idSite: idSite, + idFailure: idFailure + }).then(function () { + _this3.fetchAll(); + }); + } + }); + } + }, + computed: { + sortedFailures: function sortedFailures() { + var sortColumn = this.sortColumn; + + var sorted = _toConsumableArray(this.failures); + + if (this.sortReverse) { + sorted.sort(function (lhs, rhs) { + if (lhs[sortColumn] > rhs[sortColumn]) { + return -1; + } + + if (lhs[sortColumn] < rhs[sortColumn]) { + return 1; + } + + return 0; + }); + } else { + sorted.sort(function (lhs, rhs) { + if (lhs[sortColumn] < rhs[sortColumn]) { + return -1; + } + + if (lhs[sortColumn] > rhs[sortColumn]) { + return 1; + } + + return 0; + }); + } + + return sorted; + } + } +})); +// CONCATENATED MODULE: ./plugins/CoreAdminHome/vue/src/TrackingFailures/TrackingFailures.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CoreAdminHome/vue/src/TrackingFailures/TrackingFailures.vue + + + +TrackingFailuresvue_type_script_lang_ts.render = TrackingFailuresvue_type_template_id_209e7186_render + +/* harmony default export */ var TrackingFailures = (TrackingFailuresvue_type_script_lang_ts); +// CONCATENATED MODULE: ./plugins/CoreAdminHome/vue/src/TrackingFailures/TrackingFailures.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 TrackingFailures_adapter = (Object(external_CoreHome_["createAngularJsAdapter"])({ + component: TrackingFailures, + directiveName: 'matomoTrackingFailures' +})); // CONCATENATED MODULE: ./plugins/CoreAdminHome/vue/src/index.ts /*! * Matomo - free/libre analytics platform @@ -2070,6 +2394,8 @@ ImageTrackingCodeGeneratorvue_type_script_lang_ts.render = ImageTrackingCodeGene + + // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js diff --git a/plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.min.js b/plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.min.js index b9a9370c9a..a5949ce039 100644 --- a/plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.min.js +++ b/plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.min.js @@ -1,32 +1,38 @@ -(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["CoreAdminHome"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["CoreAdminHome"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,n){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var a=t[o]={i:o,l:!1,exports:{}};return e[o].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},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 o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(o,a,function(t){return e[t]}.bind(null,a));return o},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/CoreAdminHome/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,"ArchivingSettings",(function(){return w})),n.d(t,"BrandingSettings",(function(){return z})),n.d(t,"SmtpSettings",(function(){return te})),n.d(t,"JsTrackingCodeGenerator",(function(){return bt})),n.d(t,"ImageTrackingCodeGenerator",(function(){return Gt})),"undefined"!==typeof window){var o=window.document.currentScript,a=o&&o.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);a&&(n.p=a[1])}var r=n("19dc"),i=n("8bbf"),l={class:"form-group row"},c={class:"col s12"},s={class:"col s12 m6"},d={class:"form-description",style:{"margin-left":"4px"}},m={for:"enableBrowserTriggerArchiving2"},u=["innerHTML"],g={class:"col s12 m6"},p=["innerHTML"],b={class:"form-group row"},h={class:"col s12"},v={class:"input-field col s12 m6"},j=["disabled"],f={class:"form-description"},O={class:"col s12 m6"},C={key:0,class:"form-help"},k={key:0},V=Object(i["createElementVNode"])("br",null,null,-1),S=Object(i["createElementVNode"])("br",null,null,-1),T=Object(i["createElementVNode"])("br",null,null,-1);function N(e,t,n,o,a,r){var N=Object(i["resolveComponent"])("SaveButton"),y=Object(i["resolveComponent"])("ContentBlock");return Object(i["openBlock"])(),Object(i["createBlock"])(y,{"content-title":e.translate("CoreAdminHome_ArchivingSettings"),anchor:"archivingSettings",class:"matomo-archiving-settings"},{default:Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("div",l,[Object(i["createElementVNode"])("h3",c,Object(i["toDisplayString"])(e.translate("General_AllowPiwikArchivingToTriggerBrowser")),1),Object(i["createElementVNode"])("div",s,[Object(i["createElementVNode"])("p",null,[Object(i["createElementVNode"])("label",null,[Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{type:"radio",id:"enableBrowserTriggerArchiving1",name:"enableBrowserTriggerArchiving",value:"1","onUpdate:modelValue":t[0]||(t[0]=function(t){return e.enableBrowserTriggerArchivingValue=t})},null,512),[[i["vModelRadio"],e.enableBrowserTriggerArchivingValue]]),Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.translate("General_Yes")),1),Object(i["createElementVNode"])("span",d,Object(i["toDisplayString"])(e.translate("General_Default")),1)])]),Object(i["createElementVNode"])("p",null,[Object(i["createElementVNode"])("label",m,[Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{type:"radio",id:"enableBrowserTriggerArchiving2",name:"enableBrowserTriggerArchiving",value:"0","onUpdate:modelValue":t[1]||(t[1]=function(t){return e.enableBrowserTriggerArchivingValue=t})},null,512),[[i["vModelRadio"],e.enableBrowserTriggerArchivingValue]]),Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.translate("General_No")),1),Object(i["createElementVNode"])("span",{class:"form-description",innerHTML:e.archivingTriggerDesc,style:{"margin-left":"4px"}},null,8,u)])])]),Object(i["createElementVNode"])("div",g,[Object(i["createElementVNode"])("div",{class:"form-help",innerHTML:e.archivingInlineHelp},null,8,p)])]),Object(i["createElementVNode"])("div",b,[Object(i["createElementVNode"])("h3",h,Object(i["toDisplayString"])(e.translate("General_ReportsContainingTodayWillBeProcessedAtMostEvery")),1),Object(i["createElementVNode"])("div",v,[Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{type:"text","onUpdate:modelValue":t[2]||(t[2]=function(t){return e.todayArchiveTimeToLiveValue=t}),id:"todayArchiveTimeToLive",disabled:!e.isGeneralSettingsAdminEnabled},null,8,j),[[i["vModelText"],e.todayArchiveTimeToLiveValue]]),Object(i["createElementVNode"])("span",f,Object(i["toDisplayString"])(e.translate("General_RearchiveTimeIntervalOnlyForTodayReports")),1)]),Object(i["createElementVNode"])("div",O,[e.isGeneralSettingsAdminEnabled?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",C,[e.showWarningCron?(Object(i["openBlock"])(),Object(i["createElementBlock"])("strong",k,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("General_NewReportsWillBeProcessedByCron")),1),V,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("General_ReportsWillBeProcessedAtMostEveryHour"))+" "+Object(i["toDisplayString"])(e.translate("General_IfArchivingIsFastYouCanSetupCronRunMoreOften")),1),S])):Object(i["createCommentVNode"])("",!0),Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("General_SmallTrafficYouCanLeaveDefault",e.todayArchiveTimeToLiveDefault))+" ",1),T,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("General_MediumToHighTrafficItIsRecommendedTo",1800,3600)),1)])):Object(i["createCommentVNode"])("",!0)])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(N,{saving:e.isLoading,onConfirm:t[3]||(t[3]=function(t){return e.save()})},null,8,["saving"])])])]})),_:1},8,["content-title"])}var y=n("a5a2"),A=Object(i["defineComponent"])({props:{enableBrowserTriggerArchiving:Boolean,showSegmentArchiveTriggerInfo:Boolean,isGeneralSettingsAdminEnabled:Boolean,showWarningCron:Boolean,todayArchiveTimeToLive:Number,todayArchiveTimeToLiveDefault:Number},components:{ContentBlock:r["ContentBlock"],SaveButton:y["SaveButton"]},data:function(){return{isLoading:!1,enableBrowserTriggerArchivingValue:this.enableBrowserTriggerArchiving?1:0,todayArchiveTimeToLiveValue:this.todayArchiveTimeToLive}},watch:{enableBrowserTriggerArchiving:function(e){this.enableBrowserTriggerArchivingValue=e?1:0},todayArchiveTimeToLive:function(e){this.todayArchiveTimeToLiveValue=e}},computed:{archivingTriggerDesc:function(){var e="";return e+=Object(r["translate"])("General_ArchivingTriggerDescription",'<a target="_blank" rel="noreferrer noopener" href="https://matomo.org/docs/setup-auto-archiving/">',"</a>"),this.showSegmentArchiveTriggerInfo&&(e+=Object(r["translate"])("General_ArchivingTriggerSegment")),e},archivingInlineHelp:function(){var e=Object(r["translate"])("General_ArchivingInlineHelp");return e+="<br/>",e+=Object(r["translate"])("General_SeeTheOfficialDocumentationForMoreInformation",'<a target="_blank" rel="noreferrer noopener" href="https://matomo.org/docs/setup-auto-archiving/">',"</a>"),e}},methods:{save:function(){var e=this;this.isLoading=!0,r["AjaxHelper"].post({module:"API",method:"CoreAdminHome.setArchiveSettings"},{enableBrowserTriggerArchiving:this.enableBrowserTriggerArchivingValue,todayArchiveTimeToLive:this.todayArchiveTimeToLiveValue}).then((function(){e.isLoading=!1;var t=r["NotificationsStore"].show({message:Object(r["translate"])("CoreAdminHome_SettingsSaveSuccess"),type:"transient",id:"generalSettings",context:"success"});r["NotificationsStore"].scrollToNotification(t)})).finally((function(){e.isLoading=!1}))}}});A.render=N;var w=A,E=(Object(r["createAngularJsAdapter"])({component:w,scope:{enableBrowserTriggerArchiving:{angularJsBind:"<"},showSegmentArchiveTriggerInfo:{angularJsBind:"<"},isGeneralSettingsAdminEnabled:{angularJsBind:"<"},showWarningCron:{angularJsBind:"<"},todayArchiveTimeToLive:{angularJsBind:"<"},todayArchiveTimeToLiveDefault:{angularJsBind:"<"}},directiveName:"matomoArchivingSettings"}),{id:"logoSettings"}),_={id:"logoUploadForm",ref:"logoUploadForm",method:"post",enctype:"multipart/form-data",action:"index.php?module=CoreAdminHome&format=json&action=uploadCustomLogo"},H={key:0},B=["value"],L=Object(i["createElementVNode"])("input",{type:"hidden",name:"force_api_session",value:"1"},null,-1),U={key:0},D={key:0,class:"alert alert-warning uploaderror"},x={class:"row"},I={class:"col s12"},P=["src"],G={class:"row"},F={class:"col s12"},M=["src"],J={key:1},q=["innerHTML"],W={key:1},K={class:"alert alert-warning"}; +(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["CoreAdminHome"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["CoreAdminHome"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,n){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var a=t[o]={i:o,l:!1,exports:{}};return e[o].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},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 o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(o,a,function(t){return e[t]}.bind(null,a));return o},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/CoreAdminHome/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,"ArchivingSettings",(function(){return E})),n.d(t,"BrandingSettings",(function(){return z})),n.d(t,"SmtpSettings",(function(){return te})),n.d(t,"JsTrackingCodeGenerator",(function(){return bt})),n.d(t,"ImageTrackingCodeGenerator",(function(){return Gt})),n.d(t,"TrackingFailures",(function(){return bn})),"undefined"!==typeof window){var o=window.document.currentScript,a=o&&o.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);a&&(n.p=a[1])}var r=n("19dc"),i=n("8bbf"),l={class:"form-group row"},c={class:"col s12"},s={class:"col s12 m6"},d={class:"form-description",style:{"margin-left":"4px"}},u={for:"enableBrowserTriggerArchiving2"},m=["innerHTML"],g={class:"col s12 m6"},p=["innerHTML"],b={class:"form-group row"},h={class:"col s12"},j={class:"input-field col s12 m6"},v=["disabled"],f={class:"form-description"},O={class:"col s12 m6"},C={key:0,class:"form-help"},k={key:0},V=Object(i["createElementVNode"])("br",null,null,-1),S=Object(i["createElementVNode"])("br",null,null,-1),N=Object(i["createElementVNode"])("br",null,null,-1);function y(e,t,n,o,a,r){var y=Object(i["resolveComponent"])("SaveButton"),T=Object(i["resolveComponent"])("ContentBlock");return Object(i["openBlock"])(),Object(i["createBlock"])(T,{"content-title":e.translate("CoreAdminHome_ArchivingSettings"),anchor:"archivingSettings",class:"matomo-archiving-settings"},{default:Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("div",l,[Object(i["createElementVNode"])("h3",c,Object(i["toDisplayString"])(e.translate("General_AllowPiwikArchivingToTriggerBrowser")),1),Object(i["createElementVNode"])("div",s,[Object(i["createElementVNode"])("p",null,[Object(i["createElementVNode"])("label",null,[Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{type:"radio",id:"enableBrowserTriggerArchiving1",name:"enableBrowserTriggerArchiving",value:"1","onUpdate:modelValue":t[0]||(t[0]=function(t){return e.enableBrowserTriggerArchivingValue=t})},null,512),[[i["vModelRadio"],e.enableBrowserTriggerArchivingValue]]),Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.translate("General_Yes")),1),Object(i["createElementVNode"])("span",d,Object(i["toDisplayString"])(e.translate("General_Default")),1)])]),Object(i["createElementVNode"])("p",null,[Object(i["createElementVNode"])("label",u,[Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{type:"radio",id:"enableBrowserTriggerArchiving2",name:"enableBrowserTriggerArchiving",value:"0","onUpdate:modelValue":t[1]||(t[1]=function(t){return e.enableBrowserTriggerArchivingValue=t})},null,512),[[i["vModelRadio"],e.enableBrowserTriggerArchivingValue]]),Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.translate("General_No")),1),Object(i["createElementVNode"])("span",{class:"form-description",innerHTML:e.archivingTriggerDesc,style:{"margin-left":"4px"}},null,8,m)])])]),Object(i["createElementVNode"])("div",g,[Object(i["createElementVNode"])("div",{class:"form-help",innerHTML:e.archivingInlineHelp},null,8,p)])]),Object(i["createElementVNode"])("div",b,[Object(i["createElementVNode"])("h3",h,Object(i["toDisplayString"])(e.translate("General_ReportsContainingTodayWillBeProcessedAtMostEvery")),1),Object(i["createElementVNode"])("div",j,[Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{type:"text","onUpdate:modelValue":t[2]||(t[2]=function(t){return e.todayArchiveTimeToLiveValue=t}),id:"todayArchiveTimeToLive",disabled:!e.isGeneralSettingsAdminEnabled},null,8,v),[[i["vModelText"],e.todayArchiveTimeToLiveValue]]),Object(i["createElementVNode"])("span",f,Object(i["toDisplayString"])(e.translate("General_RearchiveTimeIntervalOnlyForTodayReports")),1)]),Object(i["createElementVNode"])("div",O,[e.isGeneralSettingsAdminEnabled?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",C,[e.showWarningCron?(Object(i["openBlock"])(),Object(i["createElementBlock"])("strong",k,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("General_NewReportsWillBeProcessedByCron")),1),V,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("General_ReportsWillBeProcessedAtMostEveryHour"))+" "+Object(i["toDisplayString"])(e.translate("General_IfArchivingIsFastYouCanSetupCronRunMoreOften")),1),S])):Object(i["createCommentVNode"])("",!0),Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("General_SmallTrafficYouCanLeaveDefault",e.todayArchiveTimeToLiveDefault))+" ",1),N,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("General_MediumToHighTrafficItIsRecommendedTo",1800,3600)),1)])):Object(i["createCommentVNode"])("",!0)])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(y,{saving:e.isLoading,onConfirm:t[3]||(t[3]=function(t){return e.save()})},null,8,["saving"])])])]})),_:1},8,["content-title"])}var T=n("a5a2"),A=Object(i["defineComponent"])({props:{enableBrowserTriggerArchiving:Boolean,showSegmentArchiveTriggerInfo:Boolean,isGeneralSettingsAdminEnabled:Boolean,showWarningCron:Boolean,todayArchiveTimeToLive:Number,todayArchiveTimeToLiveDefault:Number},components:{ContentBlock:r["ContentBlock"],SaveButton:T["SaveButton"]},data:function(){return{isLoading:!1,enableBrowserTriggerArchivingValue:this.enableBrowserTriggerArchiving?1:0,todayArchiveTimeToLiveValue:this.todayArchiveTimeToLive}},watch:{enableBrowserTriggerArchiving:function(e){this.enableBrowserTriggerArchivingValue=e?1:0},todayArchiveTimeToLive:function(e){this.todayArchiveTimeToLiveValue=e}},computed:{archivingTriggerDesc:function(){var e="";return e+=Object(r["translate"])("General_ArchivingTriggerDescription",'<a target="_blank" rel="noreferrer noopener" href="https://matomo.org/docs/setup-auto-archiving/">',"</a>"),this.showSegmentArchiveTriggerInfo&&(e+=Object(r["translate"])("General_ArchivingTriggerSegment")),e},archivingInlineHelp:function(){var e=Object(r["translate"])("General_ArchivingInlineHelp");return e+="<br/>",e+=Object(r["translate"])("General_SeeTheOfficialDocumentationForMoreInformation",'<a target="_blank" rel="noreferrer noopener" href="https://matomo.org/docs/setup-auto-archiving/">',"</a>"),e}},methods:{save:function(){var e=this;this.isLoading=!0,r["AjaxHelper"].post({module:"API",method:"CoreAdminHome.setArchiveSettings"},{enableBrowserTriggerArchiving:this.enableBrowserTriggerArchivingValue,todayArchiveTimeToLive:this.todayArchiveTimeToLiveValue}).then((function(){e.isLoading=!1;var t=r["NotificationsStore"].show({message:Object(r["translate"])("CoreAdminHome_SettingsSaveSuccess"),type:"transient",id:"generalSettings",context:"success"});r["NotificationsStore"].scrollToNotification(t)})).finally((function(){e.isLoading=!1}))}}});A.render=y;var E=A,w=(Object(r["createAngularJsAdapter"])({component:E,scope:{enableBrowserTriggerArchiving:{angularJsBind:"<"},showSegmentArchiveTriggerInfo:{angularJsBind:"<"},isGeneralSettingsAdminEnabled:{angularJsBind:"<"},showWarningCron:{angularJsBind:"<"},todayArchiveTimeToLive:{angularJsBind:"<"},todayArchiveTimeToLiveDefault:{angularJsBind:"<"}},directiveName:"matomoArchivingSettings"}),{id:"logoSettings"}),_={id:"logoUploadForm",ref:"logoUploadForm",method:"post",enctype:"multipart/form-data",action:"index.php?module=CoreAdminHome&format=json&action=uploadCustomLogo"},H={key:0},D=["value"],B=Object(i["createElementVNode"])("input",{type:"hidden",name:"force_api_session",value:"1"},null,-1),L={key:0},U={key:0,class:"alert alert-warning uploaderror"},x={class:"row"},F={class:"col s12"},I=["src"],G={class:"row"},P={class:"col s12"},M=["src"],J={key:1},q=["innerHTML"],R={key:1},W={class:"alert alert-warning"}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function R(e,t,n,o,a,r){var l=Object(i["resolveComponent"])("Field"),c=Object(i["resolveComponent"])("SaveButton"),s=Object(i["resolveComponent"])("ContentBlock"),d=Object(i["resolveDirective"])("form");return Object(i["openBlock"])(),Object(i["createBlock"])(s,{"content-title":e.translate("CoreAdminHome_BrandingSettings"),anchor:"brandingSettings"},{default:Object(i["withCtx"])((function(){return[Object(i["withDirectives"])(Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("p",null,Object(i["toDisplayString"])(e.translate("CoreAdminHome_CustomLogoHelpText")),1),Object(i["createVNode"])(l,{name:"useCustomLogo",uicontrol:"checkbox","model-value":e.enabled,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onUseCustomLogoChange(t)}),title:e.translate("CoreAdminHome_UseCustomLogo"),"inline-help":e.help},null,8,["model-value","title","inline-help"]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",E,[Object(i["createElementVNode"])("form",_,[e.fileUploadEnabled?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",H,[Object(i["createElementVNode"])("input",{type:"hidden",name:"token_auth",value:e.tokenAuth},null,8,B),L,e.logosWriteable?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",U,[Object(i["createVNode"])(i["Transition"],{name:"fade-out"},{default:Object(i["withCtx"])((function(){return[e.showUploadError?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",D,Object(i["toDisplayString"])(e.translate("CoreAdminHome_LogoUploadFailed")),1)):Object(i["createCommentVNode"])("",!0)]})),_:1}),Object(i["createVNode"])(l,{uicontrol:"file",name:"customLogo","model-value":e.customLogo,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.onCustomLogoChange(t)}),title:e.translate("CoreAdminHome_LogoUpload"),"inline-help":e.translate("CoreAdminHome_LogoUploadHelp","JPG / PNG / GIF","110")},null,8,["model-value","title","inline-help"]),Object(i["createElementVNode"])("div",x,[Object(i["createElementVNode"])("div",I,[Object(i["createElementVNode"])("img",{src:e.pathUserLogoWithBuster,id:"currentLogo",style:{"max-height":"150px"},ref:"currentLogo"},null,8,P)])]),Object(i["createVNode"])(l,{uicontrol:"file",name:"customFavicon","model-value":e.customFavicon,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.onFaviconChange(t)}),title:e.translate("CoreAdminHome_FaviconUpload"),"inline-help":e.translate("CoreAdminHome_LogoUploadHelp","JPG / PNG / GIF","16")},null,8,["model-value","title","inline-help"]),Object(i["createElementVNode"])("div",G,[Object(i["createElementVNode"])("div",F,[Object(i["createElementVNode"])("img",{src:e.pathUserFaviconWithBuster,id:"currentFavicon",width:"16",height:"16",ref:"currentFavicon"},null,8,M)])])])):Object(i["createCommentVNode"])("",!0),e.logosWriteable?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",J,[Object(i["createElementVNode"])("div",{class:"alert alert-warning",innerHTML:e.logosNotWriteableWarning},null,8,q)]))])):Object(i["createCommentVNode"])("",!0),e.fileUploadEnabled?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",W,[Object(i["createElementVNode"])("div",K,Object(i["toDisplayString"])(e.translate("CoreAdminHome_FileUploadDisabled","file_uploads=1")),1)]))],512)],512),[[i["vShow"],e.enabled]]),Object(i["createVNode"])(c,{onConfirm:t[3]||(t[3]=function(t){return e.save()}),saving:e.isLoading},null,8,["saving"])],512),[[d]])]})),_:1},8,["content-title"])}var Q=window,$=Q.$,Y=Object(i["defineComponent"])({props:{fileUploadEnabled:{type:Boolean,required:!0},logosWriteable:{type:Boolean,required:!0},useCustomLogo:{type:Boolean,required:!0},pathUserLogoDirectory:{type:String,required:!0},pathUserLogo:{type:String,required:!0},pathUserLogoSmall:{type:String,required:!0},pathUserLogoSvg:{type:String,required:!0},hasUserLogo:{type:Boolean,required:!0},pathUserFavicon:{type:String,required:!0},hasUserFavicon:{type:Boolean,required:!0},isPluginsAdminEnabled:{type:Boolean,required:!0}},components:{Field:y["Field"],ContentBlock:r["ContentBlock"],SaveButton:y["SaveButton"]},directives:{Form:y["Form"]},data:function(){return{isLoading:!1,enabled:this.useCustomLogo,customLogo:this.pathUserLogo,customFavicon:this.pathUserFavicon,showUploadError:!1,currentLogoSrcExists:this.hasUserLogo,currentFaviconSrcExists:this.hasUserFavicon,currentLogoCacheBuster:(new Date).getTime(),currentFaviconCacheBuster:(new Date).getTime()}},computed:{tokenAuth:function(){return r["Matomo"].token_auth},logosNotWriteableWarning:function(){return Object(r["translate"])("CoreAdminHome_LogoNotWriteableInstruction","<code>".concat(this.pathUserLogoDirectory,"</code><br/>"),"".concat(this.pathUserLogo,", ").concat(this.pathUserLogoSmall,", ").concat(this.pathUserLogoSvg))},help:function(){if(this.isPluginsAdminEnabled){var e='"'.concat(Object(r["translate"])("General_GiveUsYourFeedback"),'"'),t='<a href="?module=CorePluginsAdmin&action=plugins" rel="noreferrer noopener" target="_blank">';return Object(r["translate"])("CoreAdminHome_CustomLogoFeedbackInfo",e,t,"</a>")}},pathUserLogoWithBuster:function(){return this.currentLogoSrcExists&&this.pathUserLogo?"".concat(this.pathUserLogo,"?").concat(this.currentLogoCacheBuster):""},pathUserFaviconWithBuster:function(){return this.currentFaviconSrcExists&&this.pathUserFavicon?"".concat(this.pathUserFavicon,"?").concat(this.currentFaviconCacheBuster):""}},methods:{onUseCustomLogoChange:function(e){this.enabled=e},onCustomLogoChange:function(e){this.customLogo=e,this.updateLogo()},onFaviconChange:function(e){this.customFavicon=e,this.updateLogo()},save:function(){var e=this;this.isLoading=!0,r["AjaxHelper"].post({module:"API",method:"CoreAdminHome.setBrandingSettings"},{useCustomLogo:this.enabled?"1":"0"}).then((function(){var e=r["NotificationsStore"].show({message:Object(r["translate"])("CoreAdminHome_SettingsSaveSuccess"),type:"transient",id:"generalSettings",context:"success"});r["NotificationsStore"].scrollToNotification(e)})).finally((function(){e.isLoading=!1}))},updateLogo:function(){var e=this,t=!!this.customLogo,n=!!this.customFavicon;if(t||n){this.showUploadError=!1;var o="upload".concat((new Date).getTime()),a=$('<iframe name="'.concat(o,'" />'));a.css("display","none"),a.on("load",(function(){setTimeout((function(){var o=($(a.contents()).find("body").html()||"").trim();"0"===o?e.showUploadError=!0:(t&&(e.currentLogoSrcExists=!0,e.currentLogoCacheBuster=(new Date).getTime()),n&&(e.currentFaviconSrcExists=!0,e.currentFaviconCacheBuster=(new Date).getTime())),"1"!==o&&"0"!==o||a.remove()}),1e3)})),$("body:first").append(a);var r=$(this.$refs.logoUploadForm);r.attr("target",o),r.submit(),this.customLogo="",this.customFavicon=""}}}});Y.render=R;var z=Y,X=(Object(r["createAngularJsAdapter"])({component:z,scope:{fileUploadEnabled:{angularJsBind:"<"},logosWriteable:{angularJsBind:"<"},useCustomLogo:{angularJsBind:"<"},pathUserLogoDirectory:{angularJsBind:"<"},pathUserLogo:{angularJsBind:"<"},pathUserLogoSmall:{angularJsBind:"<"},pathUserLogoSvg:{angularJsBind:"<"},hasUserLogo:{angularJsBind:"<"},pathUserFavicon:{angularJsBind:"<"},hasUserFavicon:{angularJsBind:"<"},isPluginsAdminEnabled:{angularJsBind:"<"}},directiveName:"matomoBrandingSettings"}),{id:"smtpSettings"}); + */function K(e,t,n,o,a,r){var l=Object(i["resolveComponent"])("Field"),c=Object(i["resolveComponent"])("SaveButton"),s=Object(i["resolveComponent"])("ContentBlock"),d=Object(i["resolveDirective"])("form");return Object(i["openBlock"])(),Object(i["createBlock"])(s,{"content-title":e.translate("CoreAdminHome_BrandingSettings"),anchor:"brandingSettings"},{default:Object(i["withCtx"])((function(){return[Object(i["withDirectives"])(Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("p",null,Object(i["toDisplayString"])(e.translate("CoreAdminHome_CustomLogoHelpText")),1),Object(i["createVNode"])(l,{name:"useCustomLogo",uicontrol:"checkbox","model-value":e.enabled,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onUseCustomLogoChange(t)}),title:e.translate("CoreAdminHome_UseCustomLogo"),"inline-help":e.help},null,8,["model-value","title","inline-help"]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",w,[Object(i["createElementVNode"])("form",_,[e.fileUploadEnabled?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",H,[Object(i["createElementVNode"])("input",{type:"hidden",name:"token_auth",value:e.tokenAuth},null,8,D),B,e.logosWriteable?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",L,[Object(i["createVNode"])(i["Transition"],{name:"fade-out"},{default:Object(i["withCtx"])((function(){return[e.showUploadError?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",U,Object(i["toDisplayString"])(e.translate("CoreAdminHome_LogoUploadFailed")),1)):Object(i["createCommentVNode"])("",!0)]})),_:1}),Object(i["createVNode"])(l,{uicontrol:"file",name:"customLogo","model-value":e.customLogo,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.onCustomLogoChange(t)}),title:e.translate("CoreAdminHome_LogoUpload"),"inline-help":e.translate("CoreAdminHome_LogoUploadHelp","JPG / PNG / GIF","110")},null,8,["model-value","title","inline-help"]),Object(i["createElementVNode"])("div",x,[Object(i["createElementVNode"])("div",F,[Object(i["createElementVNode"])("img",{src:e.pathUserLogoWithBuster,id:"currentLogo",style:{"max-height":"150px"},ref:"currentLogo"},null,8,I)])]),Object(i["createVNode"])(l,{uicontrol:"file",name:"customFavicon","model-value":e.customFavicon,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.onFaviconChange(t)}),title:e.translate("CoreAdminHome_FaviconUpload"),"inline-help":e.translate("CoreAdminHome_LogoUploadHelp","JPG / PNG / GIF","16")},null,8,["model-value","title","inline-help"]),Object(i["createElementVNode"])("div",G,[Object(i["createElementVNode"])("div",P,[Object(i["createElementVNode"])("img",{src:e.pathUserFaviconWithBuster,id:"currentFavicon",width:"16",height:"16",ref:"currentFavicon"},null,8,M)])])])):Object(i["createCommentVNode"])("",!0),e.logosWriteable?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",J,[Object(i["createElementVNode"])("div",{class:"alert alert-warning",innerHTML:e.logosNotWriteableWarning},null,8,q)]))])):Object(i["createCommentVNode"])("",!0),e.fileUploadEnabled?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",R,[Object(i["createElementVNode"])("div",W,Object(i["toDisplayString"])(e.translate("CoreAdminHome_FileUploadDisabled","file_uploads=1")),1)]))],512)],512),[[i["vShow"],e.enabled]]),Object(i["createVNode"])(c,{onConfirm:t[3]||(t[3]=function(t){return e.save()}),saving:e.isLoading},null,8,["saving"])],512),[[d]])]})),_:1},8,["content-title"])}var Q=window,$=Q.$,Y=Object(i["defineComponent"])({props:{fileUploadEnabled:{type:Boolean,required:!0},logosWriteable:{type:Boolean,required:!0},useCustomLogo:{type:Boolean,required:!0},pathUserLogoDirectory:{type:String,required:!0},pathUserLogo:{type:String,required:!0},pathUserLogoSmall:{type:String,required:!0},pathUserLogoSvg:{type:String,required:!0},hasUserLogo:{type:Boolean,required:!0},pathUserFavicon:{type:String,required:!0},hasUserFavicon:{type:Boolean,required:!0},isPluginsAdminEnabled:{type:Boolean,required:!0}},components:{Field:T["Field"],ContentBlock:r["ContentBlock"],SaveButton:T["SaveButton"]},directives:{Form:T["Form"]},data:function(){return{isLoading:!1,enabled:this.useCustomLogo,customLogo:this.pathUserLogo,customFavicon:this.pathUserFavicon,showUploadError:!1,currentLogoSrcExists:this.hasUserLogo,currentFaviconSrcExists:this.hasUserFavicon,currentLogoCacheBuster:(new Date).getTime(),currentFaviconCacheBuster:(new Date).getTime()}},computed:{tokenAuth:function(){return r["Matomo"].token_auth},logosNotWriteableWarning:function(){return Object(r["translate"])("CoreAdminHome_LogoNotWriteableInstruction","<code>".concat(this.pathUserLogoDirectory,"</code><br/>"),"".concat(this.pathUserLogo,", ").concat(this.pathUserLogoSmall,", ").concat(this.pathUserLogoSvg))},help:function(){if(this.isPluginsAdminEnabled){var e='"'.concat(Object(r["translate"])("General_GiveUsYourFeedback"),'"'),t='<a href="?module=CorePluginsAdmin&action=plugins" rel="noreferrer noopener" target="_blank">';return Object(r["translate"])("CoreAdminHome_CustomLogoFeedbackInfo",e,t,"</a>")}},pathUserLogoWithBuster:function(){return this.currentLogoSrcExists&&this.pathUserLogo?"".concat(this.pathUserLogo,"?").concat(this.currentLogoCacheBuster):""},pathUserFaviconWithBuster:function(){return this.currentFaviconSrcExists&&this.pathUserFavicon?"".concat(this.pathUserFavicon,"?").concat(this.currentFaviconCacheBuster):""}},methods:{onUseCustomLogoChange:function(e){this.enabled=e},onCustomLogoChange:function(e){this.customLogo=e,this.updateLogo()},onFaviconChange:function(e){this.customFavicon=e,this.updateLogo()},save:function(){var e=this;this.isLoading=!0,r["AjaxHelper"].post({module:"API",method:"CoreAdminHome.setBrandingSettings"},{useCustomLogo:this.enabled?"1":"0"}).then((function(){var e=r["NotificationsStore"].show({message:Object(r["translate"])("CoreAdminHome_SettingsSaveSuccess"),type:"transient",id:"generalSettings",context:"success"});r["NotificationsStore"].scrollToNotification(e)})).finally((function(){e.isLoading=!1}))},updateLogo:function(){var e=this,t=!!this.customLogo,n=!!this.customFavicon;if(t||n){this.showUploadError=!1;var o="upload".concat((new Date).getTime()),a=$('<iframe name="'.concat(o,'" />'));a.css("display","none"),a.on("load",(function(){setTimeout((function(){var o=($(a.contents()).find("body").html()||"").trim();"0"===o?e.showUploadError=!0:(t&&(e.currentLogoSrcExists=!0,e.currentLogoCacheBuster=(new Date).getTime()),n&&(e.currentFaviconSrcExists=!0,e.currentFaviconCacheBuster=(new Date).getTime())),"1"!==o&&"0"!==o||a.remove()}),1e3)})),$("body:first").append(a);var r=$(this.$refs.logoUploadForm);r.attr("target",o),r.submit(),this.customLogo="",this.customFavicon=""}}}});Y.render=K;var z=Y,X=(Object(r["createAngularJsAdapter"])({component:z,scope:{fileUploadEnabled:{angularJsBind:"<"},logosWriteable:{angularJsBind:"<"},useCustomLogo:{angularJsBind:"<"},pathUserLogoDirectory:{angularJsBind:"<"},pathUserLogo:{angularJsBind:"<"},pathUserLogoSmall:{angularJsBind:"<"},pathUserLogoSvg:{angularJsBind:"<"},hasUserLogo:{angularJsBind:"<"},pathUserFavicon:{angularJsBind:"<"},hasUserFavicon:{angularJsBind:"<"},isPluginsAdminEnabled:{angularJsBind:"<"}},directiveName:"matomoBrandingSettings"}),{id:"smtpSettings"}); /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Z(e,t,n,o,a,r){var l=Object(i["resolveComponent"])("Field"),c=Object(i["resolveComponent"])("SaveButton"),s=Object(i["resolveComponent"])("ContentBlock"),d=Object(i["resolveDirective"])("form");return Object(i["openBlock"])(),Object(i["createBlock"])(s,{"content-title":e.translate("CoreAdminHome_EmailServerSettings"),anchor:"mailSettings"},{default:Object(i["withCtx"])((function(){return[Object(i["withDirectives"])(Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(l,{uicontrol:"checkbox",name:"mailUseSmtp",modelValue:e.enabled,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.enabled=t}),title:e.translate("General_UseSMTPServerForEmail"),"inline-help":e.translate("General_SelectYesIfYouWantToSendEmailsViaServer")},null,8,["modelValue","title","inline-help"]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",X,[Object(i["createVNode"])(l,{uicontrol:"text",name:"mailHost","model-value":e.mailHost,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.onUpdateMailHost(t)}),title:e.translate("General_SmtpServerAddress")},null,8,["model-value","title"]),Object(i["createVNode"])(l,{uicontrol:"text",name:"mailPort",modelValue:e.mailPort,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.mailPort=t}),title:e.translate("General_SmtpPort"),"inline-help":e.translate("General_OptionalSmtpPort")},null,8,["modelValue","title","inline-help"]),Object(i["createVNode"])(l,{uicontrol:"select",name:"mailType",modelValue:e.mailType,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.mailType=t}),title:e.translate("General_AuthenticationMethodSmtp"),options:e.mailTypes,"inline-help":e.translate("General_OnlyUsedIfUserPwdIsSet")},null,8,["modelValue","title","options","inline-help"]),Object(i["createVNode"])(l,{uicontrol:"text",name:"mailUsername",modelValue:e.mailUsername,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.mailUsername=t}),title:e.translate("General_SmtpUsername"),"inline-help":e.translate("General_OnlyEnterIfRequired"),autocomplete:!1},null,8,["modelValue","title","inline-help"]),Object(i["createVNode"])(l,{uicontrol:"password",name:"mailPassword","model-value":e.mailPassword,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.onMailPasswordChange(t)}),onClick:t[6]||(t[6]=function(t){!e.passwordChanged&&t.target.select()}),title:e.translate("General_SmtpPassword"),"inline-help":e.passwordHelp,autocomplete:!1},null,8,["model-value","title","inline-help"]),Object(i["createVNode"])(l,{uicontrol:"text",name:"mailFromAddress",modelValue:e.mailFromAddress,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.mailFromAddress=t}),title:e.translate("General_SmtpFromAddress"),"inline-help":e.translate("General_SmtpFromEmailHelp",e.mailHost),autocomplete:!1},null,8,["modelValue","title","inline-help"]),Object(i["createVNode"])(l,{uicontrol:"text",name:"mailFromName",modelValue:e.mailFromName,"onUpdate:modelValue":t[8]||(t[8]=function(t){return e.mailFromName=t}),title:e.translate("General_SmtpFromName"),"inline-help":e.translate("General_NameShownInTheSenderColumn"),autocomplete:!1},null,8,["modelValue","title","inline-help"]),Object(i["createVNode"])(l,{uicontrol:"select",name:"mailEncryption",modelValue:e.mailEncryption,"onUpdate:modelValue":t[9]||(t[9]=function(t){return e.mailEncryption=t}),title:e.translate("General_SmtpEncryption"),options:e.mailEncryptions,"inline-help":e.translate("General_EncryptedSmtpTransport")},null,8,["modelValue","title","options","inline-help"])],512),[[i["vShow"],e.enabled]]),Object(i["createVNode"])(c,{onConfirm:t[10]||(t[10]=function(t){return e.save()}),saving:e.isLoading},null,8,["saving"])],512),[[d]])]})),_:1},8,["content-title"])}var ee=Object(i["defineComponent"])({props:{mail:{type:Object,required:!0},mailTypes:{type:Object,required:!0},mailEncryptions:{type:Object,required:!0}},data:function(){var e=this.mail;return{isLoading:!1,enabled:"smtp"===e.transport,mailHost:e.host,passwordChanged:!1,mailPort:e.port,mailType:e.type,mailUsername:e.username,mailPassword:e.password?"******":"",mailFromAddress:e.noreply_email_address,mailFromName:e.noreply_email_name,mailEncryption:e.encryption}},components:{ContentBlock:r["ContentBlock"],Field:y["Field"],SaveButton:y["SaveButton"]},directives:{Form:y["Form"]},computed:{passwordHelp:function(){var e="".concat(Object(r["translate"])("General_OnlyEnterIfRequiredPassword"),"<br/>"),t="".concat(Object(r["translate"])("General_WarningPasswordStored","<strong>","</strong>"),"<br/>");return"".concat(e,"\n").concat(t)}},methods:{onUpdateMailHost:function(e){this.mailHost=e,this.passwordChanged||(this.mailPassword="",this.passwordChanged=!0)},onMailPasswordChange:function(e){this.mailPassword=e,this.passwordChanged=!0},save:function(){var e=this;this.isLoading=!0;var t={mailUseSmtp:this.enabled?"1":"0",mailPort:this.mailPort,mailHost:this.mailHost,mailType:this.mailType,mailUsername:this.mailUsername,mailFromAddress:this.mailFromAddress,mailFromName:this.mailFromName,mailEncryption:this.mailEncryption};this.passwordChanged&&(t.mailPassword=this.mailPassword),r["AjaxHelper"].post({module:"CoreAdminHome",action:"setMailSettings"},t,{withTokenInUrl:!0}).then((function(){var e=r["NotificationsStore"].show({message:Object(r["translate"])("CoreAdminHome_SettingsSaveSuccess"),type:"transient",id:"generalSettings",context:"success"});r["NotificationsStore"].scrollToNotification(e)})).finally((function(){e.isLoading=!1}))}}});ee.render=Z;var te=ee,ne=(Object(r["createAngularJsAdapter"])({component:te,scope:{mail:{angularJsBind:"<"},mailTypes:{angularJsBind:"<"},mailEncryptions:{angularJsBind:"<"}},directiveName:"matomoSmtpSettings"}),{id:"js-code-options"}),oe=Object(i["createElementVNode"])("br",null,null,-1),ae=Object(i["createElementVNode"])("br",null,null,-1),re=["innerHTML"],ie=["innerHTML"],le=Object(i["createElementVNode"])("br",null,null,-1),ce=Object(i["createElementVNode"])("br",null,null,-1),se=["innerHTML"],de=Object(i["createElementVNode"])("br",null,null,-1),me=Object(i["createElementVNode"])("br",null,null,-1),ue=["innerHTML"],ge=Object(i["createElementVNode"])("br",null,null,-1),pe=Object(i["createElementVNode"])("br",null,null,-1),be=Object(i["createElementVNode"])("a",{href:"https://matomo.org/faq/new-to-piwik/how-do-i-install-the-matomo-tracking-code-on-wordpress/",target:"_blank",rel:"noopener"},"WordPress",-1),he=Object(i["createTextVNode"])(" | "),ve=Object(i["createElementVNode"])("a",{href:"https://matomo.org/faq/new-to-piwik/how-do-i-integrate-matomo-with-squarespace-website/",target:"_blank",rel:"noopener"},"Squarespace",-1),je=Object(i["createTextVNode"])(" | "),fe=Object(i["createElementVNode"])("a",{href:"https://matomo.org/faq/new-to-piwik/how-do-i-install-the-matomo-analytics-tracking-code-on-wix/",target:"_blank",rel:"noopener"},"Wix",-1),Oe=Object(i["createTextVNode"])(" | "),Ce=Object(i["createElementVNode"])("a",{href:"https://matomo.org/faq/how-to-install/faq_19424/",target:"_blank",rel:"noopener"},"SharePoint",-1),ke=Object(i["createTextVNode"])(" | "),Ve=Object(i["createElementVNode"])("a",{href:"https://matomo.org/faq/new-to-piwik/how-do-i-install-the-matomo-analytics-tracking-code-on-joomla/",target:"_blank",rel:"noopener"},"Joomla",-1),Se=Object(i["createTextVNode"])(" | "),Te=Object(i["createElementVNode"])("a",{href:"https://matomo.org/faq/new-to-piwik/how-do-i-install-the-matomo-tracking-code-on-my-shopify-store/",target:"_blank",rel:"noopener"},"Shopify",-1),Ne=Object(i["createTextVNode"])(" | "),ye=Object(i["createElementVNode"])("a",{href:"https://matomo.org/faq/new-to-piwik/how-do-i-use-matomo-analytics-within-gtm-google-tag-manager/",target:"_blank",rel:"noopener"},"Google Tag Manager",-1),Ae={id:"javascript-output-section"},we={class:"valign-wrapper trackingHelpHeader matchWidth"},Ee={id:"javascript-text"},_e=["textContent"],He={id:"optional-js-tracking-options"},Be={id:"jsTrackAllSubdomainsInlineHelp",class:"inline-help-node"},Le=["innerHTML"],Ue=["innerHTML"],De={id:"jsTrackGroupByDomainInlineHelp",class:"inline-help-node"},xe={id:"jsTrackAllAliasesInlineHelp",class:"inline-help-node"},Ie={id:"javascript-advanced-options"},Pe={id:"javascript-tracking-visitor-cv"},Ge={class:"row"},Fe={class:"col s12 m3"},Me={class:"col s12 m3"},Je={class:"col s12 m6 l3"},qe=["onKeydown"],We={class:"col s12 m6 l3"},Ke=["onKeydown"],Re={class:"row"},Qe={class:"col s12"},$e=Object(i["createElementVNode"])("span",{class:"icon-add"},null,-1),Ye={id:"jsCrossDomain",class:"inline-help-node"},ze=Object(i["createElementVNode"])("br",null,null,-1),Xe={id:"jsDoNotTrackInlineHelp",class:"inline-help-node"},Ze={key:0},et=Object(i["createElementVNode"])("br",null,null,-1),tt=["innerHTML"],nt={id:"js-campaign-query-param-extra"},ot={class:"row"},at={class:"col s12"},rt={class:"row"},it={class:"col s12"}; + */function Z(e,t,n,o,a,r){var l=Object(i["resolveComponent"])("Field"),c=Object(i["resolveComponent"])("SaveButton"),s=Object(i["resolveComponent"])("ContentBlock"),d=Object(i["resolveDirective"])("form");return Object(i["openBlock"])(),Object(i["createBlock"])(s,{"content-title":e.translate("CoreAdminHome_EmailServerSettings"),anchor:"mailSettings"},{default:Object(i["withCtx"])((function(){return[Object(i["withDirectives"])(Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(l,{uicontrol:"checkbox",name:"mailUseSmtp",modelValue:e.enabled,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.enabled=t}),title:e.translate("General_UseSMTPServerForEmail"),"inline-help":e.translate("General_SelectYesIfYouWantToSendEmailsViaServer")},null,8,["modelValue","title","inline-help"]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",X,[Object(i["createVNode"])(l,{uicontrol:"text",name:"mailHost","model-value":e.mailHost,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.onUpdateMailHost(t)}),title:e.translate("General_SmtpServerAddress")},null,8,["model-value","title"]),Object(i["createVNode"])(l,{uicontrol:"text",name:"mailPort",modelValue:e.mailPort,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.mailPort=t}),title:e.translate("General_SmtpPort"),"inline-help":e.translate("General_OptionalSmtpPort")},null,8,["modelValue","title","inline-help"]),Object(i["createVNode"])(l,{uicontrol:"select",name:"mailType",modelValue:e.mailType,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.mailType=t}),title:e.translate("General_AuthenticationMethodSmtp"),options:e.mailTypes,"inline-help":e.translate("General_OnlyUsedIfUserPwdIsSet")},null,8,["modelValue","title","options","inline-help"]),Object(i["createVNode"])(l,{uicontrol:"text",name:"mailUsername",modelValue:e.mailUsername,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.mailUsername=t}),title:e.translate("General_SmtpUsername"),"inline-help":e.translate("General_OnlyEnterIfRequired"),autocomplete:!1},null,8,["modelValue","title","inline-help"]),Object(i["createVNode"])(l,{uicontrol:"password",name:"mailPassword","model-value":e.mailPassword,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.onMailPasswordChange(t)}),onClick:t[6]||(t[6]=function(t){!e.passwordChanged&&t.target.select()}),title:e.translate("General_SmtpPassword"),"inline-help":e.passwordHelp,autocomplete:!1},null,8,["model-value","title","inline-help"]),Object(i["createVNode"])(l,{uicontrol:"text",name:"mailFromAddress",modelValue:e.mailFromAddress,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.mailFromAddress=t}),title:e.translate("General_SmtpFromAddress"),"inline-help":e.translate("General_SmtpFromEmailHelp",e.mailHost),autocomplete:!1},null,8,["modelValue","title","inline-help"]),Object(i["createVNode"])(l,{uicontrol:"text",name:"mailFromName",modelValue:e.mailFromName,"onUpdate:modelValue":t[8]||(t[8]=function(t){return e.mailFromName=t}),title:e.translate("General_SmtpFromName"),"inline-help":e.translate("General_NameShownInTheSenderColumn"),autocomplete:!1},null,8,["modelValue","title","inline-help"]),Object(i["createVNode"])(l,{uicontrol:"select",name:"mailEncryption",modelValue:e.mailEncryption,"onUpdate:modelValue":t[9]||(t[9]=function(t){return e.mailEncryption=t}),title:e.translate("General_SmtpEncryption"),options:e.mailEncryptions,"inline-help":e.translate("General_EncryptedSmtpTransport")},null,8,["modelValue","title","options","inline-help"])],512),[[i["vShow"],e.enabled]]),Object(i["createVNode"])(c,{onConfirm:t[10]||(t[10]=function(t){return e.save()}),saving:e.isLoading},null,8,["saving"])],512),[[d]])]})),_:1},8,["content-title"])}var ee=Object(i["defineComponent"])({props:{mail:{type:Object,required:!0},mailTypes:{type:Object,required:!0},mailEncryptions:{type:Object,required:!0}},data:function(){var e=this.mail;return{isLoading:!1,enabled:"smtp"===e.transport,mailHost:e.host,passwordChanged:!1,mailPort:e.port,mailType:e.type,mailUsername:e.username,mailPassword:e.password?"******":"",mailFromAddress:e.noreply_email_address,mailFromName:e.noreply_email_name,mailEncryption:e.encryption}},components:{ContentBlock:r["ContentBlock"],Field:T["Field"],SaveButton:T["SaveButton"]},directives:{Form:T["Form"]},computed:{passwordHelp:function(){var e="".concat(Object(r["translate"])("General_OnlyEnterIfRequiredPassword"),"<br/>"),t="".concat(Object(r["translate"])("General_WarningPasswordStored","<strong>","</strong>"),"<br/>");return"".concat(e,"\n").concat(t)}},methods:{onUpdateMailHost:function(e){this.mailHost=e,this.passwordChanged||(this.mailPassword="",this.passwordChanged=!0)},onMailPasswordChange:function(e){this.mailPassword=e,this.passwordChanged=!0},save:function(){var e=this;this.isLoading=!0;var t={mailUseSmtp:this.enabled?"1":"0",mailPort:this.mailPort,mailHost:this.mailHost,mailType:this.mailType,mailUsername:this.mailUsername,mailFromAddress:this.mailFromAddress,mailFromName:this.mailFromName,mailEncryption:this.mailEncryption};this.passwordChanged&&(t.mailPassword=this.mailPassword),r["AjaxHelper"].post({module:"CoreAdminHome",action:"setMailSettings"},t,{withTokenInUrl:!0}).then((function(){var e=r["NotificationsStore"].show({message:Object(r["translate"])("CoreAdminHome_SettingsSaveSuccess"),type:"transient",id:"generalSettings",context:"success"});r["NotificationsStore"].scrollToNotification(e)})).finally((function(){e.isLoading=!1}))}}});ee.render=Z;var te=ee,ne=(Object(r["createAngularJsAdapter"])({component:te,scope:{mail:{angularJsBind:"<"},mailTypes:{angularJsBind:"<"},mailEncryptions:{angularJsBind:"<"}},directiveName:"matomoSmtpSettings"}),{id:"js-code-options"}),oe=Object(i["createElementVNode"])("br",null,null,-1),ae=Object(i["createElementVNode"])("br",null,null,-1),re=["innerHTML"],ie=["innerHTML"],le=Object(i["createElementVNode"])("br",null,null,-1),ce=Object(i["createElementVNode"])("br",null,null,-1),se=["innerHTML"],de=Object(i["createElementVNode"])("br",null,null,-1),ue=Object(i["createElementVNode"])("br",null,null,-1),me=["innerHTML"],ge=Object(i["createElementVNode"])("br",null,null,-1),pe=Object(i["createElementVNode"])("br",null,null,-1),be=Object(i["createElementVNode"])("a",{href:"https://matomo.org/faq/new-to-piwik/how-do-i-install-the-matomo-tracking-code-on-wordpress/",target:"_blank",rel:"noopener"},"WordPress",-1),he=Object(i["createTextVNode"])(" | "),je=Object(i["createElementVNode"])("a",{href:"https://matomo.org/faq/new-to-piwik/how-do-i-integrate-matomo-with-squarespace-website/",target:"_blank",rel:"noopener"},"Squarespace",-1),ve=Object(i["createTextVNode"])(" | "),fe=Object(i["createElementVNode"])("a",{href:"https://matomo.org/faq/new-to-piwik/how-do-i-install-the-matomo-analytics-tracking-code-on-wix/",target:"_blank",rel:"noopener"},"Wix",-1),Oe=Object(i["createTextVNode"])(" | "),Ce=Object(i["createElementVNode"])("a",{href:"https://matomo.org/faq/how-to-install/faq_19424/",target:"_blank",rel:"noopener"},"SharePoint",-1),ke=Object(i["createTextVNode"])(" | "),Ve=Object(i["createElementVNode"])("a",{href:"https://matomo.org/faq/new-to-piwik/how-do-i-install-the-matomo-analytics-tracking-code-on-joomla/",target:"_blank",rel:"noopener"},"Joomla",-1),Se=Object(i["createTextVNode"])(" | "),Ne=Object(i["createElementVNode"])("a",{href:"https://matomo.org/faq/new-to-piwik/how-do-i-install-the-matomo-tracking-code-on-my-shopify-store/",target:"_blank",rel:"noopener"},"Shopify",-1),ye=Object(i["createTextVNode"])(" | "),Te=Object(i["createElementVNode"])("a",{href:"https://matomo.org/faq/new-to-piwik/how-do-i-use-matomo-analytics-within-gtm-google-tag-manager/",target:"_blank",rel:"noopener"},"Google Tag Manager",-1),Ae={id:"javascript-output-section"},Ee={class:"valign-wrapper trackingHelpHeader matchWidth"},we={id:"javascript-text"},_e=["textContent"],He={id:"optional-js-tracking-options"},De={id:"jsTrackAllSubdomainsInlineHelp",class:"inline-help-node"},Be=["innerHTML"],Le=["innerHTML"],Ue={id:"jsTrackGroupByDomainInlineHelp",class:"inline-help-node"},xe={id:"jsTrackAllAliasesInlineHelp",class:"inline-help-node"},Fe={id:"javascript-advanced-options"},Ie={id:"javascript-tracking-visitor-cv"},Ge={class:"row"},Pe={class:"col s12 m3"},Me={class:"col s12 m3"},Je={class:"col s12 m6 l3"},qe=["onKeydown"],Re={class:"col s12 m6 l3"},We=["onKeydown"],Ke={class:"row"},Qe={class:"col s12"},$e=Object(i["createElementVNode"])("span",{class:"icon-add"},null,-1),Ye={id:"jsCrossDomain",class:"inline-help-node"},ze=Object(i["createElementVNode"])("br",null,null,-1),Xe={id:"jsDoNotTrackInlineHelp",class:"inline-help-node"},Ze={key:0},et=Object(i["createElementVNode"])("br",null,null,-1),tt=["innerHTML"],nt={id:"js-campaign-query-param-extra"},ot={class:"row"},at={class:"col s12"},rt={class:"row"},it={class:"col s12"}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function lt(e,t,n,o,a,r){var l=Object(i["resolveComponent"])("Field"),c=Object(i["resolveComponent"])("ContentBlock"),s=Object(i["resolveDirective"])("select-on-focus");return Object(i["openBlock"])(),Object(i["createBlock"])(c,{anchor:"javaScriptTracking","content-title":e.translate("CoreAdminHome_JavaScriptTracking")},{default:Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("div",ne,[Object(i["createElementVNode"])("p",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("CoreAdminHome_JSTrackingIntro1"))+" ",1),oe,ae,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("CoreAdminHome_JSTrackingIntro2"))+" ",1),Object(i["createElementVNode"])("span",{innerHTML:e.jsTrackingIntro3a},null,8,re),Object(i["createElementVNode"])("span",{innerHTML:" "+e.jsTrackingIntro3b},null,8,ie),le,ce,Object(i["createElementVNode"])("span",{innerHTML:e.jsTrackingIntro4a},null,8,se),de,me,Object(i["createElementVNode"])("span",{innerHTML:e.jsTrackingIntro5},null,8,ue),ge,pe,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("SitesManager_InstallationGuides"))+" : ",1),be,he,ve,je,fe,Oe,Ce,ke,Ve,Se,Te,Ne,ye]),Object(i["createVNode"])(l,{uicontrol:"site",name:"js-tracker-website",class:"jsTrackingCodeWebsite",modelValue:e.site,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.site=t}),introduction:e.translate("General_Website")},null,8,["modelValue","introduction"]),Object(i["createElementVNode"])("div",Ae,[Object(i["createElementVNode"])("div",we,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(e.translate("General_JsTrackingTag")),1),Object(i["createElementVNode"])("p",null,Object(i["toDisplayString"])(e.translate("CoreAdminHome_JSTracking_CodeNoteBeforeClosingHead","</head>")),1)]),Object(i["createElementVNode"])("button",{class:"btn",id:"emailJsBtn",onClick:t[1]||(t[1]=function(t){return e.sendEmail()})},Object(i["toDisplayString"])(e.translate("SitesManager_EmailInstructionsButton")),1)]),Object(i["createElementVNode"])("div",Ee,[Object(i["withDirectives"])(Object(i["createElementVNode"])("pre",{class:"codeblock",textContent:Object(i["toDisplayString"])(e.trackingCode),ref:"trackingCode"},null,8,_e),[[s,{}]])])]),Object(i["createElementVNode"])("div",He,[Object(i["createElementVNode"])("div",Be,[Object(i["createElementVNode"])("span",{innerHTML:e.mergeSubdomainsDesc},null,8,Le),Object(i["createElementVNode"])("span",{innerHTML:e.learnMoreText},null,8,Ue)]),Object(i["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-all-subdomains","model-value":e.trackAllSubdomains,"onUpdate:modelValue":t[2]||(t[2]=function(t){e.trackAllSubdomains=t,e.updateTrackingCode()}),disabled:e.isLoading,introduction:e.translate("General_Options"),title:"".concat(e.translate("CoreAdminHome_JSTracking_MergeSubdomains")," ").concat(e.currentSiteName),"inline-help":"#jsTrackAllSubdomainsInlineHelp"},null,8,["model-value","disabled","introduction","title"])]),Object(i["createElementVNode"])("div",De,Object(i["toDisplayString"])(e.translate("CoreAdminHome_JSTracking_GroupPageTitlesByDomainDesc1",e.currentSiteHost)),1),Object(i["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-group-by-domain","model-value":e.groupByDomain,"onUpdate:modelValue":t[3]||(t[3]=function(t){e.groupByDomain=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_GroupPageTitlesByDomain"),"inline-help":"#jsTrackGroupByDomainInlineHelp"},null,8,["model-value","disabled","title"]),Object(i["createElementVNode"])("div",xe,Object(i["toDisplayString"])(e.translate("CoreAdminHome_JSTracking_MergeAliasesDesc",e.currentSiteAlias)),1),Object(i["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-all-aliases","model-value":e.trackAllAliases,"onUpdate:modelValue":t[4]||(t[4]=function(t){e.trackAllAliases=t,e.updateTrackingCode()}),disabled:e.isLoading,title:"".concat(e.translate("CoreAdminHome_JSTracking_MergeAliases")," ").concat(e.currentSiteName),"inline-help":"#jsTrackAllAliasesInlineHelp"},null,8,["model-value","disabled","title"])]),Object(i["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-noscript","model-value":e.trackNoScript,"onUpdate:modelValue":t[5]||(t[5]=function(t){e.trackNoScript=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_TrackNoScript")},null,8,["model-value","disabled","title"]),Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(e.translate("Mobile_Advanced")),1),Object(i["createElementVNode"])("p",null,[Object(i["withDirectives"])(Object(i["createElementVNode"])("a",{href:"javascript:;",onClick:t[6]||(t[6]=Object(i["withModifiers"])((function(t){return e.showAdvanced=!0}),["prevent"]))},Object(i["toDisplayString"])(e.translate("General_Show")),513),[[i["vShow"],!e.showAdvanced]]),Object(i["withDirectives"])(Object(i["createElementVNode"])("a",{href:"javascript:;",onClick:t[7]||(t[7]=Object(i["withModifiers"])((function(t){return e.showAdvanced=!1}),["prevent"]))},Object(i["toDisplayString"])(e.translate("General_Hide")),513),[[i["vShow"],e.showAdvanced]])]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",Ie,[Object(i["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-visitor-cv-check","model-value":e.trackCustomVars,"onUpdate:modelValue":t[8]||(t[8]=function(t){e.trackCustomVars=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_VisitorCustomVars"),"inline-help":e.translate("CoreAdminHome_JSTracking_VisitorCustomVarsDesc")},null,8,["model-value","disabled","title","inline-help"]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",Pe,[Object(i["createElementVNode"])("div",Ge,[Object(i["createElementVNode"])("div",Fe,Object(i["toDisplayString"])(e.translate("General_Name")),1),Object(i["createElementVNode"])("div",Me,Object(i["toDisplayString"])(e.translate("General_Value")),1)]),(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.customVars,(function(t,n){return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{class:"row",key:n},[Object(i["createElementVNode"])("div",Je,[Object(i["createElementVNode"])("input",{type:"text",class:"custom-variable-name",onKeydown:function(t){return e.onCustomVarNameKeydown(t,n)},placeholder:"e.g. Type"},null,40,qe)]),Object(i["createElementVNode"])("div",We,[Object(i["createElementVNode"])("input",{type:"text",class:"custom-variable-value",onKeydown:function(t){return e.onCustomVarValueKeydown(t,n)},placeholder:"e.g. Customer"},null,40,Ke)])])})),128)),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",Re,[Object(i["createElementVNode"])("div",Qe,[Object(i["createElementVNode"])("a",{href:"javascript:;",onClick:t[9]||(t[9]=function(t){return e.addCustomVar()}),class:"add-custom-variable"},[$e,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("General_Add")),1)])])],512),[[i["vShow"],e.canAddMoreCustomVariables]])],512),[[i["vShow"],e.trackCustomVars]]),Object(i["createElementVNode"])("div",Ye,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("CoreAdminHome_JSTracking_CrossDomain"))+" ",1),ze,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("CoreAdminHome_JSTracking_CrossDomain_NeedsMultipleDomains")),1)]),Object(i["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-cross-domain","model-value":e.crossDomain,"onUpdate:modelValue":t[10]||(t[10]=function(t){e.crossDomain=t,e.updateTrackingCode(),e.onCrossDomainToggle()}),disabled:e.isLoading||!e.hasManySiteUrls,title:e.translate("CoreAdminHome_JSTracking_EnableCrossDomainLinking"),"inline-help":"#jsCrossDomain"},null,8,["model-value","disabled","title"]),Object(i["createElementVNode"])("div",Xe,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("CoreAdminHome_JSTracking_EnableDoNotTrackDesc"))+" ",1),e.serverSideDoNotTrackEnabled?(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",Ze,[et,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("CoreAdminHome_JSTracking_EnableDoNotTrack_AlreadyEnabled")),1)])):Object(i["createCommentVNode"])("",!0)]),Object(i["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-do-not-track","model-value":e.doNotTrack,"onUpdate:modelValue":t[11]||(t[11]=function(t){e.doNotTrack=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_EnableDoNotTrack"),"inline-help":"#jsDoNotTrackInlineHelp"},null,8,["model-value","disabled","title"]),Object(i["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-disable-cookies","model-value":e.disableCookies,"onUpdate:modelValue":t[12]||(t[12]=function(t){e.disableCookies=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_DisableCookies"),"inline-help":e.translate("CoreAdminHome_JSTracking_DisableCookiesDesc")},null,8,["model-value","disabled","title","inline-help"]),Object(i["createElementVNode"])("div",{id:"jsTrackCampaignParamsInlineHelp",class:"inline-help-node",innerHTML:e.jsTrackCampaignParamsInlineHelp},null,8,tt),Object(i["createVNode"])(l,{uicontrol:"checkbox",name:"custom-campaign-query-params-check","model-value":e.useCustomCampaignParams,"onUpdate:modelValue":t[13]||(t[13]=function(t){e.useCustomCampaignParams=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_CustomCampaignQueryParam"),"inline-help":"#jsTrackCampaignParamsInlineHelp"},null,8,["model-value","disabled","title"]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",nt,[Object(i["createElementVNode"])("div",ot,[Object(i["createElementVNode"])("div",at,[Object(i["createVNode"])(l,{uicontrol:"text",name:"custom-campaign-name-query-param","model-value":e.customCampaignName,"onUpdate:modelValue":t[14]||(t[14]=function(t){e.customCampaignName=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_CampaignNameParam")},null,8,["model-value","disabled","title"])])]),Object(i["createElementVNode"])("div",rt,[Object(i["createElementVNode"])("div",it,[Object(i["createVNode"])(l,{uicontrol:"text",name:"custom-campaign-keyword-query-param","model-value":e.customCampaignKeyword,"onUpdate:modelValue":t[15]||(t[15]=function(t){e.customCampaignKeyword=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_CampaignKwdParam")},null,8,["model-value","disabled","title"])])])],512),[[i["vShow"],e.useCustomCampaignParams]])],512),[[i["vShow"],e.showAdvanced]])]})),_:1},8,["content-title"])}function ct(e){var t=new URL(e);return t.hostname}function st(e){return e.map((function(e){return[e.name,e.value]}))}var dt=window,mt=dt.$,ut=window.location.host,gt=window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/")),pt=Object(i["defineComponent"])({props:{defaultSite:{type:Object,required:!0},maxCustomVariables:Number,serverSideDoNotTrackEnabled:Boolean},data:function(){return{showAdvanced:!1,site:this.defaultSite,trackingCode:"",trackAllSubdomains:!1,isLoading:!1,siteUrls:{},siteExcludedQueryParams:{},crossDomain:!1,groupByDomain:!1,trackAllAliases:!1,trackNoScript:!1,trackCustomVars:!1,customVars:[],canAddMoreCustomVariables:!!this.maxCustomVariables&&this.maxCustomVariables>0,doNotTrack:!1,disableCookies:!1,useCustomCampaignParams:!1,customCampaignName:"",customCampaignKeyword:"",trackingCodeAbortController:null,isHighlighting:!1}},components:{ContentBlock:r["ContentBlock"],Field:y["Field"]},directives:{SelectOnFocus:r["SelectOnFocus"]},created:function(){this.onCustomVarNameKeydown=Object(r["debounce"])(this.onCustomVarNameKeydown,100),this.onCustomVarValueKeydown=Object(r["debounce"])(this.onCustomVarValueKeydown,100),this.addCustomVar(),this.site&&this.site.id&&this.onSiteChanged(this.site)},watch:{site:function(e){this.onSiteChanged(e)}},methods:{onSiteChanged:function(e){var t=this,n=e.id,o=[];this.siteUrls[n]||(this.isLoading=!0,o.push(r["AjaxHelper"].fetch({module:"API",method:"SitesManager.getSiteUrlsFromId",idSite:n,filter_limit:"-1"}).then((function(e){t.siteUrls[n]=e||[]})))),this.siteExcludedQueryParams[n]||(this.isLoading=!0,o.push(r["AjaxHelper"].fetch({module:"API",method:"Overlay.getExcludedQueryParameters",idSite:n,filter_limit:"-1"}).then((function(e){t.siteExcludedQueryParams[n]=e||[]})))),Promise.all(o).then((function(){t.isLoading=!1,t.updateCurrentSiteInfo(),t.updateTrackingCode()}))},sendEmail:function(){var e=Object(r["translate"])("SitesManager_EmailInstructionsSubject");e=encodeURIComponent(e);var t=this.trackingCode;t=t.replace(/<[^>]+>/g,"");var n="".concat(Object(r["translate"])("SitesManager_JsTrackingTagHelp"),". ").concat(Object(r["translate"])("CoreAdminHome_JSTracking_CodeNoteBeforeClosingHeadEmail","'head"),"\n").concat(t);n=encodeURIComponent(n);var o="mailto:?subject=".concat(e,"&body=").concat(n);window.location.href=o},onCrossDomainToggle:function(){this.crossDomain&&(this.trackAllAliases=!0)},updateTrackingCode:function(){var e=this,t=this.site,n={piwikUrl:"".concat(ut).concat(gt),groupPageTitlesByDomain:this.groupByDomain?1:0,mergeSubdomains:this.trackAllSubdomains?1:0,mergeAliasUrls:this.trackAllAliases?1:0,visitorCustomVariables:this.trackCustomVars?st(this.customVars):0,customCampaignNameQueryParam:null,customCampaignKeywordParam:null,doNotTrack:this.doNotTrack?1:0,disableCookies:this.disableCookies?1:0,crossDomain:this.crossDomain?1:0,trackNoScript:this.trackNoScript?1:0,forceMatomoEndpoint:1};this.siteExcludedQueryParams[t.id]&&(n.excludedQueryParams=this.siteExcludedQueryParams[t.id]),this.useCustomCampaignParams&&(n.customCampaignNameQueryParam=this.customCampaignName,n.customCampaignKeywordParam=this.customCampaignKeyword),this.trackingCodeAbortController&&(this.trackingCodeAbortController.abort(),this.trackingCodeAbortController=null),this.trackingCodeAbortController=new AbortController,r["AjaxHelper"].post({module:"API",format:"json",method:"SitesManager.getJavascriptTag",idSite:t.id},n,{abortController:this.trackingCodeAbortController}).then((function(t){e.trackingCodeAbortController=null,e.trackingCode=t.value;var n=mt(e.$refs.trackingCode);n&&!e.isHighlighting&&(e.isHighlighting=!0,n.effect("highlight",{complete:function(){e.isHighlighting=!1}},1500))}))},updateCurrentSiteInfo:function(){this.hasManySiteUrls||(this.crossDomain=!1)},addCustomVar:function(){this.canAddMoreCustomVariables&&this.customVars.push({name:"",value:""}),this.canAddMoreCustomVariables=!!this.maxCustomVariables&&this.maxCustomVariables>this.customVars.length},onCustomVarNameKeydown:function(e,t){var n=this;setTimeout((function(){n.customVars[t].name=e.target.value,n.updateTrackingCode()}))},onCustomVarValueKeydown:function(e,t){var n=this;setTimeout((function(){n.customVars[t].value=e.target.value,n.updateTrackingCode()}))}},computed:{hasManySiteUrls:function(){var e=this.site;return this.siteUrls[e.id]&&this.siteUrls[e.id].length>1},currentSiteHost:function(){var e,t=null===(e=this.siteUrls[this.site.id])||void 0===e?void 0:e[0];return t?ct(t):""},currentSiteAlias:function(){var e,t="x.".concat(this.currentSiteHost),n=null===(e=this.siteUrls[this.site.id])||void 0===e?void 0:e[1];return n||t},currentSiteName:function(){return r["Matomo"].helper.htmlEntities(this.site.name)},jsTrackingIntro3a:function(){return Object(r["translate"])("CoreAdminHome_JSTrackingIntro3a",'<a href="https://matomo.org/integrate/" rel="noreferrer noopener" target="_blank">',"</a>")},jsTrackingIntro3b:function(){return Object(r["translate"])("CoreAdminHome_JSTrackingIntro3b")},jsTrackingIntro4a:function(){return Object(r["translate"])("CoreAdminHome_JSTrackingIntro4",'<a href="#image-tracking-link">',"</a>")},jsTrackingIntro5:function(){return Object(r["translate"])("CoreAdminHome_JSTrackingIntro5",'<a rel="noreferrer noopener" target="_blank" href="https://developer.matomo.org/guides/tracking-javascript-guide">',"</a>")},mergeSubdomainsDesc:function(){return Object(r["translate"])("CoreAdminHome_JSTracking_MergeSubdomainsDesc","x.".concat(this.currentSiteHost),"y.".concat(this.currentSiteHost))},learnMoreText:function(){var e="https://developer.matomo.org/guides/tracking-javascript-guide#measuring-domains-andor-sub-domains";return Object(r["translate"])("General_LearnMore",' (<a href="'.concat(e,'" rel="noreferrer noopener" target="_blank">'),"</a>)")},jsTrackCampaignParamsInlineHelp:function(){return Object(r["translate"])("CoreAdminHome_JSTracking_CustomCampaignQueryParamDesc",'<a href="https://matomo.org/faq/general/#faq_119" rel="noreferrer noopener" target="_blank">',"</a>")}}});pt.render=lt;var bt=pt,ht=(Object(r["createAngularJsAdapter"])({component:bt,scope:{defaultSite:{angularJsBind:"<"},maxCustomVariables:{angularJsBind:"<"},serverSideDoNotTrackEnabled:{angularJsBind:"<"}},directiveName:"matomoJsTrackingCodeGenerator"}),Object(i["createElementVNode"])("a",{name:"image-tracking-link"},null,-1)),vt={id:"image-tracking-code-options"},jt=["innerHTML"],ft=["innerHTML"],Ot={id:"image-tracking-goal-sub"},Ct={class:"row"},kt={class:"col s12 m6"},Vt={class:"col s12 m6"},St={id:"image-link-output-section"},Tt={id:"image-tracking-text"},Nt=["textContent"]; + */function lt(e,t,n,o,a,r){var l=Object(i["resolveComponent"])("Field"),c=Object(i["resolveComponent"])("ContentBlock"),s=Object(i["resolveDirective"])("select-on-focus");return Object(i["openBlock"])(),Object(i["createBlock"])(c,{anchor:"javaScriptTracking","content-title":e.translate("CoreAdminHome_JavaScriptTracking")},{default:Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("div",ne,[Object(i["createElementVNode"])("p",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("CoreAdminHome_JSTrackingIntro1"))+" ",1),oe,ae,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("CoreAdminHome_JSTrackingIntro2"))+" ",1),Object(i["createElementVNode"])("span",{innerHTML:e.jsTrackingIntro3a},null,8,re),Object(i["createElementVNode"])("span",{innerHTML:" "+e.jsTrackingIntro3b},null,8,ie),le,ce,Object(i["createElementVNode"])("span",{innerHTML:e.jsTrackingIntro4a},null,8,se),de,ue,Object(i["createElementVNode"])("span",{innerHTML:e.jsTrackingIntro5},null,8,me),ge,pe,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("SitesManager_InstallationGuides"))+" : ",1),be,he,je,ve,fe,Oe,Ce,ke,Ve,Se,Ne,ye,Te]),Object(i["createVNode"])(l,{uicontrol:"site",name:"js-tracker-website",class:"jsTrackingCodeWebsite",modelValue:e.site,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.site=t}),introduction:e.translate("General_Website")},null,8,["modelValue","introduction"]),Object(i["createElementVNode"])("div",Ae,[Object(i["createElementVNode"])("div",Ee,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(e.translate("General_JsTrackingTag")),1),Object(i["createElementVNode"])("p",null,Object(i["toDisplayString"])(e.translate("CoreAdminHome_JSTracking_CodeNoteBeforeClosingHead","</head>")),1)]),Object(i["createElementVNode"])("button",{class:"btn",id:"emailJsBtn",onClick:t[1]||(t[1]=function(t){return e.sendEmail()})},Object(i["toDisplayString"])(e.translate("SitesManager_EmailInstructionsButton")),1)]),Object(i["createElementVNode"])("div",we,[Object(i["withDirectives"])(Object(i["createElementVNode"])("pre",{class:"codeblock",textContent:Object(i["toDisplayString"])(e.trackingCode),ref:"trackingCode"},null,8,_e),[[s,{}]])])]),Object(i["createElementVNode"])("div",He,[Object(i["createElementVNode"])("div",De,[Object(i["createElementVNode"])("span",{innerHTML:e.mergeSubdomainsDesc},null,8,Be),Object(i["createElementVNode"])("span",{innerHTML:e.learnMoreText},null,8,Le)]),Object(i["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-all-subdomains","model-value":e.trackAllSubdomains,"onUpdate:modelValue":t[2]||(t[2]=function(t){e.trackAllSubdomains=t,e.updateTrackingCode()}),disabled:e.isLoading,introduction:e.translate("General_Options"),title:"".concat(e.translate("CoreAdminHome_JSTracking_MergeSubdomains")," ").concat(e.currentSiteName),"inline-help":"#jsTrackAllSubdomainsInlineHelp"},null,8,["model-value","disabled","introduction","title"])]),Object(i["createElementVNode"])("div",Ue,Object(i["toDisplayString"])(e.translate("CoreAdminHome_JSTracking_GroupPageTitlesByDomainDesc1",e.currentSiteHost)),1),Object(i["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-group-by-domain","model-value":e.groupByDomain,"onUpdate:modelValue":t[3]||(t[3]=function(t){e.groupByDomain=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_GroupPageTitlesByDomain"),"inline-help":"#jsTrackGroupByDomainInlineHelp"},null,8,["model-value","disabled","title"]),Object(i["createElementVNode"])("div",xe,Object(i["toDisplayString"])(e.translate("CoreAdminHome_JSTracking_MergeAliasesDesc",e.currentSiteAlias)),1),Object(i["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-all-aliases","model-value":e.trackAllAliases,"onUpdate:modelValue":t[4]||(t[4]=function(t){e.trackAllAliases=t,e.updateTrackingCode()}),disabled:e.isLoading,title:"".concat(e.translate("CoreAdminHome_JSTracking_MergeAliases")," ").concat(e.currentSiteName),"inline-help":"#jsTrackAllAliasesInlineHelp"},null,8,["model-value","disabled","title"])]),Object(i["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-noscript","model-value":e.trackNoScript,"onUpdate:modelValue":t[5]||(t[5]=function(t){e.trackNoScript=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_TrackNoScript")},null,8,["model-value","disabled","title"]),Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(e.translate("Mobile_Advanced")),1),Object(i["createElementVNode"])("p",null,[Object(i["withDirectives"])(Object(i["createElementVNode"])("a",{href:"javascript:;",onClick:t[6]||(t[6]=Object(i["withModifiers"])((function(t){return e.showAdvanced=!0}),["prevent"]))},Object(i["toDisplayString"])(e.translate("General_Show")),513),[[i["vShow"],!e.showAdvanced]]),Object(i["withDirectives"])(Object(i["createElementVNode"])("a",{href:"javascript:;",onClick:t[7]||(t[7]=Object(i["withModifiers"])((function(t){return e.showAdvanced=!1}),["prevent"]))},Object(i["toDisplayString"])(e.translate("General_Hide")),513),[[i["vShow"],e.showAdvanced]])]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",Fe,[Object(i["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-visitor-cv-check","model-value":e.trackCustomVars,"onUpdate:modelValue":t[8]||(t[8]=function(t){e.trackCustomVars=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_VisitorCustomVars"),"inline-help":e.translate("CoreAdminHome_JSTracking_VisitorCustomVarsDesc")},null,8,["model-value","disabled","title","inline-help"]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",Ie,[Object(i["createElementVNode"])("div",Ge,[Object(i["createElementVNode"])("div",Pe,Object(i["toDisplayString"])(e.translate("General_Name")),1),Object(i["createElementVNode"])("div",Me,Object(i["toDisplayString"])(e.translate("General_Value")),1)]),(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.customVars,(function(t,n){return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{class:"row",key:n},[Object(i["createElementVNode"])("div",Je,[Object(i["createElementVNode"])("input",{type:"text",class:"custom-variable-name",onKeydown:function(t){return e.onCustomVarNameKeydown(t,n)},placeholder:"e.g. Type"},null,40,qe)]),Object(i["createElementVNode"])("div",Re,[Object(i["createElementVNode"])("input",{type:"text",class:"custom-variable-value",onKeydown:function(t){return e.onCustomVarValueKeydown(t,n)},placeholder:"e.g. Customer"},null,40,We)])])})),128)),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",Ke,[Object(i["createElementVNode"])("div",Qe,[Object(i["createElementVNode"])("a",{href:"javascript:;",onClick:t[9]||(t[9]=function(t){return e.addCustomVar()}),class:"add-custom-variable"},[$e,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("General_Add")),1)])])],512),[[i["vShow"],e.canAddMoreCustomVariables]])],512),[[i["vShow"],e.trackCustomVars]]),Object(i["createElementVNode"])("div",Ye,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("CoreAdminHome_JSTracking_CrossDomain"))+" ",1),ze,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("CoreAdminHome_JSTracking_CrossDomain_NeedsMultipleDomains")),1)]),Object(i["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-cross-domain","model-value":e.crossDomain,"onUpdate:modelValue":t[10]||(t[10]=function(t){e.crossDomain=t,e.updateTrackingCode(),e.onCrossDomainToggle()}),disabled:e.isLoading||!e.hasManySiteUrls,title:e.translate("CoreAdminHome_JSTracking_EnableCrossDomainLinking"),"inline-help":"#jsCrossDomain"},null,8,["model-value","disabled","title"]),Object(i["createElementVNode"])("div",Xe,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("CoreAdminHome_JSTracking_EnableDoNotTrackDesc"))+" ",1),e.serverSideDoNotTrackEnabled?(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",Ze,[et,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("CoreAdminHome_JSTracking_EnableDoNotTrack_AlreadyEnabled")),1)])):Object(i["createCommentVNode"])("",!0)]),Object(i["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-do-not-track","model-value":e.doNotTrack,"onUpdate:modelValue":t[11]||(t[11]=function(t){e.doNotTrack=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_EnableDoNotTrack"),"inline-help":"#jsDoNotTrackInlineHelp"},null,8,["model-value","disabled","title"]),Object(i["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-disable-cookies","model-value":e.disableCookies,"onUpdate:modelValue":t[12]||(t[12]=function(t){e.disableCookies=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_DisableCookies"),"inline-help":e.translate("CoreAdminHome_JSTracking_DisableCookiesDesc")},null,8,["model-value","disabled","title","inline-help"]),Object(i["createElementVNode"])("div",{id:"jsTrackCampaignParamsInlineHelp",class:"inline-help-node",innerHTML:e.jsTrackCampaignParamsInlineHelp},null,8,tt),Object(i["createVNode"])(l,{uicontrol:"checkbox",name:"custom-campaign-query-params-check","model-value":e.useCustomCampaignParams,"onUpdate:modelValue":t[13]||(t[13]=function(t){e.useCustomCampaignParams=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_CustomCampaignQueryParam"),"inline-help":"#jsTrackCampaignParamsInlineHelp"},null,8,["model-value","disabled","title"]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",nt,[Object(i["createElementVNode"])("div",ot,[Object(i["createElementVNode"])("div",at,[Object(i["createVNode"])(l,{uicontrol:"text",name:"custom-campaign-name-query-param","model-value":e.customCampaignName,"onUpdate:modelValue":t[14]||(t[14]=function(t){e.customCampaignName=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_CampaignNameParam")},null,8,["model-value","disabled","title"])])]),Object(i["createElementVNode"])("div",rt,[Object(i["createElementVNode"])("div",it,[Object(i["createVNode"])(l,{uicontrol:"text",name:"custom-campaign-keyword-query-param","model-value":e.customCampaignKeyword,"onUpdate:modelValue":t[15]||(t[15]=function(t){e.customCampaignKeyword=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_CampaignKwdParam")},null,8,["model-value","disabled","title"])])])],512),[[i["vShow"],e.useCustomCampaignParams]])],512),[[i["vShow"],e.showAdvanced]])]})),_:1},8,["content-title"])}function ct(e){var t=new URL(e);return t.hostname}function st(e){return e.map((function(e){return[e.name,e.value]}))}var dt=window,ut=dt.$,mt=window.location.host,gt=window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/")),pt=Object(i["defineComponent"])({props:{defaultSite:{type:Object,required:!0},maxCustomVariables:Number,serverSideDoNotTrackEnabled:Boolean},data:function(){return{showAdvanced:!1,site:this.defaultSite,trackingCode:"",trackAllSubdomains:!1,isLoading:!1,siteUrls:{},siteExcludedQueryParams:{},crossDomain:!1,groupByDomain:!1,trackAllAliases:!1,trackNoScript:!1,trackCustomVars:!1,customVars:[],canAddMoreCustomVariables:!!this.maxCustomVariables&&this.maxCustomVariables>0,doNotTrack:!1,disableCookies:!1,useCustomCampaignParams:!1,customCampaignName:"",customCampaignKeyword:"",trackingCodeAbortController:null,isHighlighting:!1}},components:{ContentBlock:r["ContentBlock"],Field:T["Field"]},directives:{SelectOnFocus:r["SelectOnFocus"]},created:function(){this.onCustomVarNameKeydown=Object(r["debounce"])(this.onCustomVarNameKeydown,100),this.onCustomVarValueKeydown=Object(r["debounce"])(this.onCustomVarValueKeydown,100),this.addCustomVar(),this.site&&this.site.id&&this.onSiteChanged(this.site)},watch:{site:function(e){this.onSiteChanged(e)}},methods:{onSiteChanged:function(e){var t=this,n=e.id,o=[];this.siteUrls[n]||(this.isLoading=!0,o.push(r["AjaxHelper"].fetch({module:"API",method:"SitesManager.getSiteUrlsFromId",idSite:n,filter_limit:"-1"}).then((function(e){t.siteUrls[n]=e||[]})))),this.siteExcludedQueryParams[n]||(this.isLoading=!0,o.push(r["AjaxHelper"].fetch({module:"API",method:"Overlay.getExcludedQueryParameters",idSite:n,filter_limit:"-1"}).then((function(e){t.siteExcludedQueryParams[n]=e||[]})))),Promise.all(o).then((function(){t.isLoading=!1,t.updateCurrentSiteInfo(),t.updateTrackingCode()}))},sendEmail:function(){var e=Object(r["translate"])("SitesManager_EmailInstructionsSubject");e=encodeURIComponent(e);var t=this.trackingCode;t=t.replace(/<[^>]+>/g,"");var n="".concat(Object(r["translate"])("SitesManager_JsTrackingTagHelp"),". ").concat(Object(r["translate"])("CoreAdminHome_JSTracking_CodeNoteBeforeClosingHeadEmail","'head"),"\n").concat(t);n=encodeURIComponent(n);var o="mailto:?subject=".concat(e,"&body=").concat(n);window.location.href=o},onCrossDomainToggle:function(){this.crossDomain&&(this.trackAllAliases=!0)},updateTrackingCode:function(){var e=this,t=this.site,n={piwikUrl:"".concat(mt).concat(gt),groupPageTitlesByDomain:this.groupByDomain?1:0,mergeSubdomains:this.trackAllSubdomains?1:0,mergeAliasUrls:this.trackAllAliases?1:0,visitorCustomVariables:this.trackCustomVars?st(this.customVars):0,customCampaignNameQueryParam:null,customCampaignKeywordParam:null,doNotTrack:this.doNotTrack?1:0,disableCookies:this.disableCookies?1:0,crossDomain:this.crossDomain?1:0,trackNoScript:this.trackNoScript?1:0,forceMatomoEndpoint:1};this.siteExcludedQueryParams[t.id]&&(n.excludedQueryParams=this.siteExcludedQueryParams[t.id]),this.useCustomCampaignParams&&(n.customCampaignNameQueryParam=this.customCampaignName,n.customCampaignKeywordParam=this.customCampaignKeyword),this.trackingCodeAbortController&&(this.trackingCodeAbortController.abort(),this.trackingCodeAbortController=null),this.trackingCodeAbortController=new AbortController,r["AjaxHelper"].post({module:"API",format:"json",method:"SitesManager.getJavascriptTag",idSite:t.id},n,{abortController:this.trackingCodeAbortController}).then((function(t){e.trackingCodeAbortController=null,e.trackingCode=t.value;var n=ut(e.$refs.trackingCode);n&&!e.isHighlighting&&(e.isHighlighting=!0,n.effect("highlight",{complete:function(){e.isHighlighting=!1}},1500))}))},updateCurrentSiteInfo:function(){this.hasManySiteUrls||(this.crossDomain=!1)},addCustomVar:function(){this.canAddMoreCustomVariables&&this.customVars.push({name:"",value:""}),this.canAddMoreCustomVariables=!!this.maxCustomVariables&&this.maxCustomVariables>this.customVars.length},onCustomVarNameKeydown:function(e,t){var n=this;setTimeout((function(){n.customVars[t].name=e.target.value,n.updateTrackingCode()}))},onCustomVarValueKeydown:function(e,t){var n=this;setTimeout((function(){n.customVars[t].value=e.target.value,n.updateTrackingCode()}))}},computed:{hasManySiteUrls:function(){var e=this.site;return this.siteUrls[e.id]&&this.siteUrls[e.id].length>1},currentSiteHost:function(){var e,t=null===(e=this.siteUrls[this.site.id])||void 0===e?void 0:e[0];return t?ct(t):""},currentSiteAlias:function(){var e,t="x.".concat(this.currentSiteHost),n=null===(e=this.siteUrls[this.site.id])||void 0===e?void 0:e[1];return n||t},currentSiteName:function(){return r["Matomo"].helper.htmlEntities(this.site.name)},jsTrackingIntro3a:function(){return Object(r["translate"])("CoreAdminHome_JSTrackingIntro3a",'<a href="https://matomo.org/integrate/" rel="noreferrer noopener" target="_blank">',"</a>")},jsTrackingIntro3b:function(){return Object(r["translate"])("CoreAdminHome_JSTrackingIntro3b")},jsTrackingIntro4a:function(){return Object(r["translate"])("CoreAdminHome_JSTrackingIntro4",'<a href="#image-tracking-link">',"</a>")},jsTrackingIntro5:function(){return Object(r["translate"])("CoreAdminHome_JSTrackingIntro5",'<a rel="noreferrer noopener" target="_blank" href="https://developer.matomo.org/guides/tracking-javascript-guide">',"</a>")},mergeSubdomainsDesc:function(){return Object(r["translate"])("CoreAdminHome_JSTracking_MergeSubdomainsDesc","x.".concat(this.currentSiteHost),"y.".concat(this.currentSiteHost))},learnMoreText:function(){var e="https://developer.matomo.org/guides/tracking-javascript-guide#measuring-domains-andor-sub-domains";return Object(r["translate"])("General_LearnMore",' (<a href="'.concat(e,'" rel="noreferrer noopener" target="_blank">'),"</a>)")},jsTrackCampaignParamsInlineHelp:function(){return Object(r["translate"])("CoreAdminHome_JSTracking_CustomCampaignQueryParamDesc",'<a href="https://matomo.org/faq/general/#faq_119" rel="noreferrer noopener" target="_blank">',"</a>")}}});pt.render=lt;var bt=pt,ht=(Object(r["createAngularJsAdapter"])({component:bt,scope:{defaultSite:{angularJsBind:"<"},maxCustomVariables:{angularJsBind:"<"},serverSideDoNotTrackEnabled:{angularJsBind:"<"}},directiveName:"matomoJsTrackingCodeGenerator"}),Object(i["createElementVNode"])("a",{name:"image-tracking-link"},null,-1)),jt={id:"image-tracking-code-options"},vt=["innerHTML"],ft=["innerHTML"],Ot={id:"image-tracking-goal-sub"},Ct={class:"row"},kt={class:"col s12 m6"},Vt={class:"col s12 m6"},St={id:"image-link-output-section"},Nt={id:"image-tracking-text"},yt=["textContent"]; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function yt(e,t,n,o,a,r){var l=Object(i["resolveComponent"])("Field"),c=Object(i["resolveComponent"])("ContentBlock"),s=Object(i["resolveDirective"])("select-on-focus");return Object(i["openBlock"])(),Object(i["createBlock"])(c,{"content-title":e.translate("CoreAdminHome_ImageTracking"),anchor:"imageTracking"},{default:Object(i["withCtx"])((function(){return[ht,Object(i["createElementVNode"])("div",vt,[Object(i["createElementVNode"])("p",{innerHTML:e.imageTrackingIntro},null,8,jt),Object(i["createElementVNode"])("p",{innerHTML:e.imageTrackingIntro3},null,8,ft),Object(i["createVNode"])(l,{uicontrol:"site",name:"image-tracker-website",modelValue:e.site,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.site=t}),introduction:e.translate("General_Website")},null,8,["modelValue","introduction"]),Object(i["createVNode"])(l,{uicontrol:"text",name:"image-tracker-action-name","model-value":e.pageName,"onUpdate:modelValue":t[1]||(t[1]=function(t){e.pageName=t,e.updateTrackingCode()}),disabled:e.isLoading,introduction:e.translate("General_Options"),title:e.translate("Actions_ColumnPageName")},null,8,["model-value","disabled","introduction","title"]),Object(i["createVNode"])(l,{uicontrol:"checkbox",name:"image-tracking-goal-check","model-value":e.trackGoal,"onUpdate:modelValue":t[2]||(t[2]=function(t){e.trackGoal=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_TrackAGoal")},null,8,["model-value","disabled","title"]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",Ot,[Object(i["createElementVNode"])("div",Ct,[Object(i["createElementVNode"])("div",kt,[Object(i["createVNode"])(l,{uicontrol:"select",name:"image-tracker-goal",options:e.siteGoals,disabled:e.isLoading,"model-value":e.trackIdGoal,"onUpdate:modelValue":t[3]||(t[3]=function(t){e.trackIdGoal=t,e.updateTrackingCode()})},null,8,["options","disabled","model-value"])]),Object(i["createElementVNode"])("div",Vt,[Object(i["createVNode"])(l,{uicontrol:"text",name:"image-revenue","model-value":e.revenue,"onUpdate:modelValue":t[4]||(t[4]=function(t){e.revenue=t,e.updateTrackingCode()}),disabled:e.isLoading,"full-width":!0,title:"".concat(e.translate("CoreAdminHome_WithOptionalRevenue")," ").concat(e.currentSiteCurrency)},null,8,["model-value","disabled","title"])])])],512),[[i["vShow"],e.trackGoal]]),Object(i["createElementVNode"])("div",St,[Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(e.translate("CoreAdminHome_ImageTrackingLink")),1),Object(i["createElementVNode"])("div",Tt,[Object(i["withDirectives"])(Object(i["createElementVNode"])("pre",{textContent:Object(i["toDisplayString"])(e.trackingCode),ref:"trackingCode"},null,8,Nt),[[s,{}]])])])])]})),_:1},8,["content-title"])}function At(e,t){return Bt(e)||Ht(e,t)||Et(e,t)||wt()}function wt(){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 Et(e,t){if(e){if("string"===typeof e)return _t(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)?_t(e,t):void 0}}function _t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Ht(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,a,r=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(o=n.next()).done);i=!0)if(r.push(o.value),t&&r.length===t)break}catch(c){l=!0,a=c}finally{try{i||null==n["return"]||n["return"]()}finally{if(l)throw a}}return r}}function Bt(e){if(Array.isArray(e))return e}var Lt=null,Ut=window,Dt=Ut.$,xt=window.location.host,It=window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/")),Pt=Object(i["defineComponent"])({props:{defaultSite:{type:Object,required:!0}},components:{ContentBlock:r["ContentBlock"],Field:y["Field"]},directives:{SelectOnFocus:r["SelectOnFocus"]},data:function(){return{isLoading:!1,site:this.defaultSite,pageName:"",trackGoal:!1,trackIdGoal:null,revenue:"",trackingCode:"",sites:{},goals:{},trackingCodeAbortController:null,isHighlighting:!1}},created:function(){this.updateTrackingCode=Object(r["debounce"])(this.updateTrackingCode),this.site&&this.site.id&&this.onSiteChanged(this.site)},watch:{site:function(e){this.onSiteChanged(e)}},methods:{onSiteChanged:function(e){var t,n,o,a=this;return this.trackIdGoal=null,Lt?t=Promise.resolve(Lt):(this.isLoading=!0,t=r["AjaxHelper"].fetch({method:"SitesManager.getCurrencySymbols",filter_limit:"-1"})),this.sites[e.id]?n=Promise.resolve(this.sites[e.id]):(this.isLoading=!0,n=r["AjaxHelper"].fetch({module:"API",method:"SitesManager.getSiteFromId",idSite:e.id})),this.goals[e.id]?o=Promise.resolve(this.goals[e.id]):(this.isLoading=!0,o=r["AjaxHelper"].fetch({module:"API",method:"Goals.getGoals",filter_limit:"-1",idSite:e.id})),Promise.all([t,n,o]).then((function(t){var n=At(t,3),o=n[0],r=n[1],i=n[2];a.isLoading=!1,Lt=o,a.sites[e.id]=r,a.goals[e.id]=i,a.updateTrackingCode()}))},updateTrackingCode:function(){var e=this,t={piwikUrl:"".concat(xt).concat(It),actionName:this.pageName,forceMatomoEndpoint:1};this.trackGoal&&this.trackIdGoal&&(t.idGoal=this.trackIdGoal,t.revenue=this.revenue),this.trackingCodeAbortController&&(this.trackingCodeAbortController.abort(),this.trackingCodeAbortController=null),this.trackingCodeAbortController=new AbortController,r["AjaxHelper"].post({module:"API",format:"json",method:"SitesManager.getImageTrackingCode",idSite:this.site.id},t,{abortController:this.trackingCodeAbortController}).then((function(t){e.trackingCodeAbortController=null,e.trackingCode=t.value;var n=Dt(e.$refs.trackingCode);n&&!e.isHighlighting&&(e.isHighlighting=!0,n.effect("highlight",{complete:function(){e.isHighlighting=!1}},1500))}))}},computed:{currentSiteCurrency:function(){return Lt?Lt[(this.sites[this.site.id].currency||"").toUpperCase()]:""},siteGoals:function(){var e=this.goals[this.site.id];return[{key:"",value:Object(r["translate"])("UserCountryMap_None")}].concat(Object.values(e||[]).map((function(e){return{key:"".concat(e.idgoal),value:e.name}})))},imageTrackingIntro:function(){var e=Object(r["translate"])("CoreAdminHome_ImageTrackingIntro1"),t=Object(r["translate"])("CoreAdminHome_ImageTrackingIntro2","<code><noscript></noscript></code>");return"".concat(e," ").concat(t)},imageTrackingIntro3:function(){var e="https://matomo.org/docs/tracking-api/reference/";return Object(r["translate"])("CoreAdminHome_ImageTrackingIntro3",'<a href="'.concat(e,'" rel="noreferrer noopener" target="_blank">'),"</a>")}}});Pt.render=yt;var Gt=Pt; + */function Tt(e,t,n,o,a,r){var l=Object(i["resolveComponent"])("Field"),c=Object(i["resolveComponent"])("ContentBlock"),s=Object(i["resolveDirective"])("select-on-focus");return Object(i["openBlock"])(),Object(i["createBlock"])(c,{"content-title":e.translate("CoreAdminHome_ImageTracking"),anchor:"imageTracking"},{default:Object(i["withCtx"])((function(){return[ht,Object(i["createElementVNode"])("div",jt,[Object(i["createElementVNode"])("p",{innerHTML:e.imageTrackingIntro},null,8,vt),Object(i["createElementVNode"])("p",{innerHTML:e.imageTrackingIntro3},null,8,ft),Object(i["createVNode"])(l,{uicontrol:"site",name:"image-tracker-website",modelValue:e.site,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.site=t}),introduction:e.translate("General_Website")},null,8,["modelValue","introduction"]),Object(i["createVNode"])(l,{uicontrol:"text",name:"image-tracker-action-name","model-value":e.pageName,"onUpdate:modelValue":t[1]||(t[1]=function(t){e.pageName=t,e.updateTrackingCode()}),disabled:e.isLoading,introduction:e.translate("General_Options"),title:e.translate("Actions_ColumnPageName")},null,8,["model-value","disabled","introduction","title"]),Object(i["createVNode"])(l,{uicontrol:"checkbox",name:"image-tracking-goal-check","model-value":e.trackGoal,"onUpdate:modelValue":t[2]||(t[2]=function(t){e.trackGoal=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_TrackAGoal")},null,8,["model-value","disabled","title"]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",Ot,[Object(i["createElementVNode"])("div",Ct,[Object(i["createElementVNode"])("div",kt,[Object(i["createVNode"])(l,{uicontrol:"select",name:"image-tracker-goal",options:e.siteGoals,disabled:e.isLoading,"model-value":e.trackIdGoal,"onUpdate:modelValue":t[3]||(t[3]=function(t){e.trackIdGoal=t,e.updateTrackingCode()})},null,8,["options","disabled","model-value"])]),Object(i["createElementVNode"])("div",Vt,[Object(i["createVNode"])(l,{uicontrol:"text",name:"image-revenue","model-value":e.revenue,"onUpdate:modelValue":t[4]||(t[4]=function(t){e.revenue=t,e.updateTrackingCode()}),disabled:e.isLoading,"full-width":!0,title:"".concat(e.translate("CoreAdminHome_WithOptionalRevenue")," ").concat(e.currentSiteCurrency)},null,8,["model-value","disabled","title"])])])],512),[[i["vShow"],e.trackGoal]]),Object(i["createElementVNode"])("div",St,[Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(e.translate("CoreAdminHome_ImageTrackingLink")),1),Object(i["createElementVNode"])("div",Nt,[Object(i["withDirectives"])(Object(i["createElementVNode"])("pre",{textContent:Object(i["toDisplayString"])(e.trackingCode),ref:"trackingCode"},null,8,yt),[[s,{}]])])])])]})),_:1},8,["content-title"])}function At(e,t){return Dt(e)||Ht(e,t)||wt(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 wt(e,t){if(e){if("string"===typeof e)return _t(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)?_t(e,t):void 0}}function _t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Ht(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,a,r=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(o=n.next()).done);i=!0)if(r.push(o.value),t&&r.length===t)break}catch(c){l=!0,a=c}finally{try{i||null==n["return"]||n["return"]()}finally{if(l)throw a}}return r}}function Dt(e){if(Array.isArray(e))return e}var Bt=null,Lt=window,Ut=Lt.$,xt=window.location.host,Ft=window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/")),It=Object(i["defineComponent"])({props:{defaultSite:{type:Object,required:!0}},components:{ContentBlock:r["ContentBlock"],Field:T["Field"]},directives:{SelectOnFocus:r["SelectOnFocus"]},data:function(){return{isLoading:!1,site:this.defaultSite,pageName:"",trackGoal:!1,trackIdGoal:null,revenue:"",trackingCode:"",sites:{},goals:{},trackingCodeAbortController:null,isHighlighting:!1}},created:function(){this.updateTrackingCode=Object(r["debounce"])(this.updateTrackingCode),this.site&&this.site.id&&this.onSiteChanged(this.site)},watch:{site:function(e){this.onSiteChanged(e)}},methods:{onSiteChanged:function(e){var t,n,o,a=this;return this.trackIdGoal=null,Bt?t=Promise.resolve(Bt):(this.isLoading=!0,t=r["AjaxHelper"].fetch({method:"SitesManager.getCurrencySymbols",filter_limit:"-1"})),this.sites[e.id]?n=Promise.resolve(this.sites[e.id]):(this.isLoading=!0,n=r["AjaxHelper"].fetch({module:"API",method:"SitesManager.getSiteFromId",idSite:e.id})),this.goals[e.id]?o=Promise.resolve(this.goals[e.id]):(this.isLoading=!0,o=r["AjaxHelper"].fetch({module:"API",method:"Goals.getGoals",filter_limit:"-1",idSite:e.id})),Promise.all([t,n,o]).then((function(t){var n=At(t,3),o=n[0],r=n[1],i=n[2];a.isLoading=!1,Bt=o,a.sites[e.id]=r,a.goals[e.id]=i,a.updateTrackingCode()}))},updateTrackingCode:function(){var e=this,t={piwikUrl:"".concat(xt).concat(Ft),actionName:this.pageName,forceMatomoEndpoint:1};this.trackGoal&&this.trackIdGoal&&(t.idGoal=this.trackIdGoal,t.revenue=this.revenue),this.trackingCodeAbortController&&(this.trackingCodeAbortController.abort(),this.trackingCodeAbortController=null),this.trackingCodeAbortController=new AbortController,r["AjaxHelper"].post({module:"API",format:"json",method:"SitesManager.getImageTrackingCode",idSite:this.site.id},t,{abortController:this.trackingCodeAbortController}).then((function(t){e.trackingCodeAbortController=null,e.trackingCode=t.value;var n=Ut(e.$refs.trackingCode);n&&!e.isHighlighting&&(e.isHighlighting=!0,n.effect("highlight",{complete:function(){e.isHighlighting=!1}},1500))}))}},computed:{currentSiteCurrency:function(){return Bt?Bt[(this.sites[this.site.id].currency||"").toUpperCase()]:""},siteGoals:function(){var e=this.goals[this.site.id];return[{key:"",value:Object(r["translate"])("UserCountryMap_None")}].concat(Object.values(e||[]).map((function(e){return{key:"".concat(e.idgoal),value:e.name}})))},imageTrackingIntro:function(){var e=Object(r["translate"])("CoreAdminHome_ImageTrackingIntro1"),t=Object(r["translate"])("CoreAdminHome_ImageTrackingIntro2","<code><noscript></noscript></code>");return"".concat(e," ").concat(t)},imageTrackingIntro3:function(){var e="https://matomo.org/docs/tracking-api/reference/";return Object(r["translate"])("CoreAdminHome_ImageTrackingIntro3",'<a href="'.concat(e,'" rel="noreferrer noopener" target="_blank">'),"</a>")}}});It.render=Tt;var Gt=It,Pt=(Object(r["createAngularJsAdapter"])({component:Gt,scope:{defaultSite:{angularJsBind:"<"}},directiveName:"matomoImageTrackingCodeGenerator"}),Object(i["createElementVNode"])("br",null,null,-1)),Mt=Object(i["createElementVNode"])("br",null,null,-1),Jt=["value"],qt={class:"action"},Rt={colspan:"7"},Wt=Object(i["createElementVNode"])("span",{class:"icon-ok"},null,-1),Kt={class:"ui-confirm",id:"confirmDeleteAllTrackingFailures"},Qt=["value"],$t=["value"],Yt={class:"ui-confirm",id:"confirmDeleteThisTrackingFailure"},zt=["value"],Xt=["value"]; /*! * 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:Gt,scope:{defaultSite:{angularJsBind:"<"}},directiveName:"matomoImageTrackingCodeGenerator"})}})})); + */function Zt(e,t,n,o,a,r){var l=Object(i["resolveComponent"])("ActivityIndicator"),c=Object(i["resolveComponent"])("FailureRow"),s=Object(i["resolveComponent"])("ContentBlock"),d=Object(i["resolveDirective"])("content-table");return Object(i["openBlock"])(),Object(i["createBlock"])(s,{class:"matomoTrackingFailures","content-title":e.translate("CoreAdminHome_TrackingFailures")},{default:Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("p",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("CoreAdminHome_TrackingFailuresIntroduction","2"))+" ",1),Pt,Mt,Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{class:"btn deleteAllFailures",type:"button",onClick:t[0]||(t[0]=function(t){return e.deleteAll()}),value:e.translate("CoreAdminHome_DeleteAllFailures")},null,8,Jt),[[i["vShow"],!e.isLoading&&e.failures.length>0]])]),Object(i["createVNode"])(l,{loading:e.isLoading},null,8,["loading"]),Object(i["withDirectives"])(Object(i["createElementVNode"])("table",null,[Object(i["createElementVNode"])("thead",null,[Object(i["createElementVNode"])("tr",null,[Object(i["createElementVNode"])("th",{onClick:t[1]||(t[1]=function(t){return e.changeSortOrder("idsite")})},Object(i["toDisplayString"])(e.translate("General_Measurable")),1),Object(i["createElementVNode"])("th",{onClick:t[2]||(t[2]=function(t){return e.changeSortOrder("problem")})},Object(i["toDisplayString"])(e.translate("CoreAdminHome_Problem")),1),Object(i["createElementVNode"])("th",{onClick:t[3]||(t[3]=function(t){return e.changeSortOrder("solution")})},Object(i["toDisplayString"])(e.translate("CoreAdminHome_Solution")),1),Object(i["createElementVNode"])("th",{onClick:t[4]||(t[4]=function(t){return e.changeSortOrder("date_first_occurred")})},Object(i["toDisplayString"])(e.translate("General_Date")),1),Object(i["createElementVNode"])("th",{onClick:t[5]||(t[5]=function(t){return e.changeSortOrder("url")})},Object(i["toDisplayString"])(e.translate("Actions_ColumnPageURL")),1),Object(i["createElementVNode"])("th",{onClick:t[6]||(t[6]=function(t){return e.changeSortOrder("request_url")})},Object(i["toDisplayString"])(e.translate("CoreAdminHome_TrackingURL")),1),Object(i["createElementVNode"])("th",qt,Object(i["toDisplayString"])(e.translate("General_Action")),1)])]),Object(i["createElementVNode"])("tbody",null,[Object(i["createElementVNode"])("tr",null,[Object(i["withDirectives"])(Object(i["createElementVNode"])("td",Rt,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("CoreAdminHome_NoKnownFailures"))+" ",1),Wt],512),[[i["vShow"],!e.isLoading&&0===e.failures.length]])]),(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.sortedFailures,(function(n,o){return Object(i["openBlock"])(),Object(i["createElementBlock"])("tr",{key:o},[Object(i["createVNode"])(c,{failure:n,onDelete:t[7]||(t[7]=function(t){return e.deleteFailure(t.idSite,t.idFailure)})},null,8,["failure"])])})),128))])],512),[[d]]),Object(i["createElementVNode"])("div",Kt,[Object(i["createElementVNode"])("h2",null,Object(i["toDisplayString"])(e.translate("CoreAdminHome_ConfirmDeleteAllTrackingFailures")),1),Object(i["createElementVNode"])("input",{type:"button",role:"yes",value:e.translate("General_Yes")},null,8,Qt),Object(i["createElementVNode"])("input",{type:"button",role:"no",value:e.translate("General_No")},null,8,$t)]),Object(i["createElementVNode"])("div",Yt,[Object(i["createElementVNode"])("h2",null,Object(i["toDisplayString"])(e.translate("CoreAdminHome_ConfirmDeleteThisTrackingFailure")),1),Object(i["createElementVNode"])("input",{type:"button",role:"yes",value:e.translate("General_Yes")},null,8,zt),Object(i["createElementVNode"])("input",{type:"button",role:"no",value:e.translate("General_No")},null,8,Xt)])]})),_:1},8,["content-title"])}var en=[":href"],tn={class:"datetime"},nn=["title"],on=["title"];function an(e,t,n,o,a,r){return Object(i["openBlock"])(),Object(i["createElementBlock"])(i["Fragment"],null,[Object(i["createElementVNode"])("td",null,Object(i["toDisplayString"])(e.failure.site_name)+" ("+Object(i["toDisplayString"])(e.translate("General_Id"))+" "+Object(i["toDisplayString"])(e.failure.idsite)+")",1),Object(i["createElementVNode"])("td",null,Object(i["toDisplayString"])(e.failure.problem),1),Object(i["createElementVNode"])("td",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.failure.solution)+" ",1),Object(i["withDirectives"])(Object(i["createElementVNode"])("a",{rel:"noopener noreferrer",":href":e.failure.solution_url},Object(i["toDisplayString"])(e.translate("CoreAdminHome_LearnMore")),9,en),[[i["vShow"],e.failure.solution_url]])]),Object(i["createElementVNode"])("td",tn,Object(i["toDisplayString"])(e.failure.pretty_date_first_occurred),1),Object(i["createElementVNode"])("td",null,Object(i["toDisplayString"])(e.failure.url),1),Object(i["createElementVNode"])("td",null,[Object(i["withDirectives"])(Object(i["createElementVNode"])("span",{onClick:t[0]||(t[0]=function(t){return e.showFullRequestUrl=!0}),title:e.translate("CoreHome_ClickToSeeFullInformation")},Object(i["toDisplayString"])(e.limtedRequestUrl)+"...",9,nn),[[i["vShow"],!e.showFullRequestUrl]]),Object(i["withDirectives"])(Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.failure.request_url),513),[[i["vShow"],e.failure.showFullRequestUrl]])]),Object(i["createElementVNode"])("td",null,[Object(i["createElementVNode"])("span",{class:"table-action icon-delete",onClick:t[1]||(t[1]=function(t){return e.deleteFailure(e.failure.idsite,e.failure.idfailure)}),title:e.translate("General_Delete")},null,8,on)])],64)}var rn=Object(i["defineComponent"])({props:{failure:{type:Object,required:!0}},emits:["delete"],data:function(){return{showFullRequestUrl:!1}},computed:{limtedRequestUrl:function(){return this.failure.request_url.substring(0,100)}},methods:{deleteFailure:function(e,t){this.$emit("delete",{idSite:e,idFailure:t})}}});rn.render=an;var ln=rn;function cn(e){return mn(e)||un(e)||dn(e)||sn()}function sn(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function dn(e,t){if(e){if("string"===typeof e)return gn(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)?gn(e,t):void 0}}function un(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function mn(e){if(Array.isArray(e))return gn(e)}function gn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var pn=Object(i["defineComponent"])({components:{ContentBlock:r["ContentBlock"],ActivityIndicator:r["ActivityIndicator"],FailureRow:ln},directives:{ContentTable:r["ContentTable"]},data:function(){return{failures:[],sortColumn:"idsite",sortReverse:!1,isLoading:!1}},created:function(){this.fetchAll()},methods:{changeSortOrder:function(e){this.sortColumn===e?this.sortReverse=!this.sortReverse:this.sortColumn=e},fetchAll:function(){var e=this;this.failures=[],this.isLoading=!0,r["AjaxHelper"].fetch({method:"CoreAdminHome.getTrackingFailures",filter_limit:"-1"}).then((function(t){e.failures=t,e.isLoading=!1})).finally((function(){e.isLoading=!1}))},deleteAll:function(){var e=this;r["Matomo"].helper.modalConfirm("#confirmDeleteAllTrackingFailures",{yes:function(){e.failures=[],r["AjaxHelper"].fetch({method:"CoreAdminHome.deleteAllTrackingFailures"}).then((function(){e.fetchAll()}))}})},deleteFailure:function(e,t){var n=this;r["Matomo"].helper.modalConfirm("#confirmDeleteThisTrackingFailure",{yes:function(){n.failures=[],r["AjaxHelper"].fetch({method:"CoreAdminHome.deleteTrackingFailure",idSite:e,idFailure:t}).then((function(){n.fetchAll()}))}})}},computed:{sortedFailures:function(){var e=this.sortColumn,t=cn(this.failures);return this.sortReverse?t.sort((function(t,n){return t[e]>n[e]?-1:t[e]<n[e]?1:0})):t.sort((function(t,n){return t[e]<n[e]?-1:t[e]>n[e]?1:0})),t}}});pn.render=Zt;var bn=pn; +/*! + * 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:bn,directiveName:"matomoTrackingFailures"})}})})); //# sourceMappingURL=CoreAdminHome.umd.min.js.map
\ No newline at end of file diff --git a/plugins/CoreAdminHome/vue/src/TrackingFailures/FailureRow.vue b/plugins/CoreAdminHome/vue/src/TrackingFailures/FailureRow.vue new file mode 100644 index 0000000000..a1b48fb3c4 --- /dev/null +++ b/plugins/CoreAdminHome/vue/src/TrackingFailures/FailureRow.vue @@ -0,0 +1,67 @@ +<template> + <td>{{ failure.site_name }} ({{ translate('General_Id') }} {{ failure.idsite }})</td> + <td>{{ failure.problem }}</td> + <td>{{ failure.solution }} <a + v-show="failure.solution_url" + rel="noopener noreferrer" + ::href="failure.solution_url" + >{{ translate('CoreAdminHome_LearnMore') }}</a></td> + <td class="datetime">{{ failure.pretty_date_first_occurred }}</td> + <td>{{ failure.url }}</td> + <td> + <span + v-show="!showFullRequestUrl" + @click="showFullRequestUrl = true" + :title="translate('CoreHome_ClickToSeeFullInformation')" + >{{ limtedRequestUrl }}...</span> + <span v-show="failure.showFullRequestUrl">{{ failure.request_url }}</span> + </td> + <td><span + class="table-action icon-delete" + @click="deleteFailure(failure.idsite, failure.idfailure)" + :title="translate('General_Delete')" + /></td> +</template> + +<script lang="ts"> +import { defineComponent } from 'vue'; + +export interface TrackingFailure { + [index: string]: string|number|undefined; + + idfailure: string|number; + site_name: string; + idsite: string|number; + problem: string; + solution: string; + solution_url?: string; + url: string; + pretty_date_first_occurred: string; + request_url: string; +} + +export default defineComponent({ + props: { + failure: { + type: Object, + required: true, + }, + }, + emits: ['delete'], + data() { + return { + showFullRequestUrl: false, + }; + }, + computed: { + limtedRequestUrl() { + return (this.failure as TrackingFailure).request_url.substring(0, 100); + }, + }, + methods: { + deleteFailure(idSite: string|number, idFailure: string|number) { + this.$emit('delete', { idSite, idFailure }); + }, + }, +}); +</script> diff --git a/plugins/CoreAdminHome/vue/src/TrackingFailures/TrackingFailures.adapter.ts b/plugins/CoreAdminHome/vue/src/TrackingFailures/TrackingFailures.adapter.ts new file mode 100644 index 0000000000..2b7b6ac042 --- /dev/null +++ b/plugins/CoreAdminHome/vue/src/TrackingFailures/TrackingFailures.adapter.ts @@ -0,0 +1,14 @@ +/*! + * 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 TrackingFailures from './TrackingFailures.vue'; + +export default createAngularJsAdapter({ + component: TrackingFailures, + directiveName: 'matomoTrackingFailures', +}); diff --git a/plugins/CoreAdminHome/angularjs/trackingfailures/trackingfailures.directive.less b/plugins/CoreAdminHome/vue/src/TrackingFailures/TrackingFailures.less index 505b106431..505b106431 100644 --- a/plugins/CoreAdminHome/angularjs/trackingfailures/trackingfailures.directive.less +++ b/plugins/CoreAdminHome/vue/src/TrackingFailures/TrackingFailures.less diff --git a/plugins/CoreAdminHome/vue/src/TrackingFailures/TrackingFailures.vue b/plugins/CoreAdminHome/vue/src/TrackingFailures/TrackingFailures.vue new file mode 100644 index 0000000000..d7cd39358c --- /dev/null +++ b/plugins/CoreAdminHome/vue/src/TrackingFailures/TrackingFailures.vue @@ -0,0 +1,220 @@ +<!-- + Matomo - free/libre analytics platform + @link https://matomo.org + @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later +--> + +<template> + <ContentBlock + class="matomoTrackingFailures" + :content-title="translate('CoreAdminHome_TrackingFailures')" + > + <p> + {{ translate('CoreAdminHome_TrackingFailuresIntroduction', '2') }} + <br /><br /> + <input + class="btn deleteAllFailures" + v-show="!isLoading && failures.length > 0" + type="button" + @click="deleteAll()" + :value="translate('CoreAdminHome_DeleteAllFailures')" + /> + </p> + <ActivityIndicator + :loading="isLoading" + /> + <table v-content-table> + <thead> + <tr> + <th @click="changeSortOrder('idsite')">{{ translate('General_Measurable') }}</th> + <th @click="changeSortOrder('problem')">{{ translate('CoreAdminHome_Problem') }}</th> + <th @click="changeSortOrder('solution')">{{ translate('CoreAdminHome_Solution') }}</th> + <th @click="changeSortOrder('date_first_occurred')">{{ translate('General_Date') }}</th> + <th @click="changeSortOrder('url')">{{ translate('Actions_ColumnPageURL') }}</th> + <th @click="changeSortOrder('request_url')"> + {{ translate('CoreAdminHome_TrackingURL') }} + </th> + <th class="action">{{ translate('General_Action') }}</th> + </tr> + </thead> + <tbody> + <tr> + <td + colspan="7" + v-show="!isLoading && failures.length === 0" + >{{ translate('CoreAdminHome_NoKnownFailures') }} <span class="icon-ok" /></td> + </tr> + <tr v-for="(failure, index) in sortedFailures" :key="index"> + <FailureRow + :failure="failure" + @delete="deleteFailure($event.idSite, $event.idFailure)" + /> + </tr> + </tbody> + </table> + <div + class="ui-confirm" + id="confirmDeleteAllTrackingFailures" + > + <h2>{{ translate('CoreAdminHome_ConfirmDeleteAllTrackingFailures') }}</h2> + <input + type="button" + role="yes" + :value="translate('General_Yes')" + /> + <input + type="button" + role="no" + :value="translate('General_No')" + /> + </div> + <div + class="ui-confirm" + id="confirmDeleteThisTrackingFailure" + > + <h2>{{ translate('CoreAdminHome_ConfirmDeleteThisTrackingFailure') }}</h2> + <input + type="button" + role="yes" + :value="translate('General_Yes')" + /> + <input + type="button" + role="no" + :value="translate('General_No')" + /> + </div> + </ContentBlock> +</template> + +<script lang="ts"> +import { defineComponent } from 'vue'; +import { + AjaxHelper, + ContentBlock, + Matomo, + ActivityIndicator, + ContentTable, +} from 'CoreHome'; +import FailureRow, { TrackingFailure } from './FailureRow.vue'; + +interface TrackingFailuresState { + failures: TrackingFailure[]; + sortColumn: string; + sortReverse: boolean; + isLoading: boolean; +} + +export default defineComponent({ + components: { + ContentBlock, + ActivityIndicator, + FailureRow, + }, + directives: { + ContentTable, + }, + data(): TrackingFailuresState { + return { + failures: [], + sortColumn: 'idsite', + sortReverse: false, + isLoading: false, + }; + }, + created() { + this.fetchAll(); + }, + methods: { + changeSortOrder(columnToSort: string) { + if (this.sortColumn === columnToSort) { + this.sortReverse = !this.sortReverse; + } else { + this.sortColumn = columnToSort; + } + }, + fetchAll() { + this.failures = []; + this.isLoading = true; + + AjaxHelper.fetch<TrackingFailure[]>({ + method: 'CoreAdminHome.getTrackingFailures', + filter_limit: '-1', + }).then((failures) => { + this.failures = failures; + this.isLoading = false; + }).finally(() => { + this.isLoading = false; + }); + }, + deleteAll() { + Matomo.helper.modalConfirm( + '#confirmDeleteAllTrackingFailures', + { + yes: () => { + this.failures = []; + AjaxHelper.fetch({ + method: 'CoreAdminHome.deleteAllTrackingFailures', + }).then(() => { + this.fetchAll(); + }); + }, + }, + ); + }, + deleteFailure(idSite: string|number, idFailure: string|number) { + Matomo.helper.modalConfirm( + '#confirmDeleteThisTrackingFailure', + { + yes: () => { + this.failures = []; + + AjaxHelper.fetch({ + method: 'CoreAdminHome.deleteTrackingFailure', + idSite, + idFailure, + }).then(() => { + this.fetchAll(); + }); + }, + }, + ); + }, + }, + computed: { + sortedFailures() { + const { sortColumn } = this; + + const sorted: TrackingFailure[] = [...this.failures]; + + if (this.sortReverse) { + sorted.sort((lhs: TrackingFailure, rhs: TrackingFailure) => { + if (lhs[sortColumn]! > rhs[sortColumn]!) { + return -1; + } + + if (lhs[sortColumn]! < rhs[sortColumn]!) { + return 1; + } + + return 0; + }); + } else { + sorted.sort((lhs: TrackingFailure, rhs: TrackingFailure) => { + if (lhs[sortColumn]! < rhs[sortColumn]!) { + return -1; + } + + if (lhs[sortColumn]! > rhs[sortColumn]!) { + return 1; + } + + return 0; + }); + } + + return sorted; + }, + }, +}); +</script> diff --git a/plugins/CoreAdminHome/vue/src/index.ts b/plugins/CoreAdminHome/vue/src/index.ts index b0597ead4b..ebe1b72c78 100644 --- a/plugins/CoreAdminHome/vue/src/index.ts +++ b/plugins/CoreAdminHome/vue/src/index.ts @@ -10,6 +10,7 @@ import './BrandingSettings/BrandingSettings.adapter'; import './SmtpSettings/SmtpSettings.adapter'; import './JsTrackingCodeGenerator/JsTrackingCodeGenerator.adapter'; import './ImageTrackingCodeGenerator/ImageTrackingCodeGenerator.adapter'; +import './TrackingFailures/TrackingFailures.adapter'; export { default as ArchivingSettings } from './ArchivingSettings/ArchivingSettings.vue'; export { default as BrandingSettings } from './BrandingSettings/BrandingSettings.vue'; @@ -20,3 +21,4 @@ export { export { default as ImageTrackingCodeGenerator, } from './ImageTrackingCodeGenerator/ImageTrackingCodeGenerator.vue'; +export { default as TrackingFailures } from './TrackingFailures/TrackingFailures.vue'; |