From c8e0ecd384945ce4949433f70aa0a4e473636ff1 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Tue, 8 Sep 2020 17:17:29 +0200 Subject: [PATCH 001/138] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9ff30ebe..4de3d410b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Release Notes -## [Unreleased](https://github.com/laravel/telescope/compare/v4.0.0...4.x) +## [Unreleased](https://github.com/laravel/telescope/compare/v4.0.0...master) ## [v4.0.0 (2020-09-08)](https://github.com/laravel/telescope/compare/v3.5.1...v4.0.0) From 654aa7d40a27550f5ad299a93e628925d9cd4c68 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Tue, 8 Sep 2020 17:18:04 +0200 Subject: [PATCH 002/138] Update branch alias --- composer.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/composer.json b/composer.json index f87b4b0c0..845493f0a 100644 --- a/composer.json +++ b/composer.json @@ -34,6 +34,9 @@ } }, "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + }, "laravel": { "providers": [ "Laravel\\Telescope\\TelescopeServiceProvider" From 7bfe65fe17905eb2fb4836b0346e09eb04374739 Mon Sep 17 00:00:00 2001 From: Senthil Vel Date: Thu, 17 Sep 2020 15:07:21 +0530 Subject: [PATCH 003/138] Retain exceptions data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Takes —keep-exceptions argument --- src/Console/PruneCommand.php | 4 ++-- src/Contracts/PrunableRepository.php | 2 +- src/Storage/DatabaseEntriesRepository.php | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Console/PruneCommand.php b/src/Console/PruneCommand.php index 8dab58864..55c2f3fc7 100644 --- a/src/Console/PruneCommand.php +++ b/src/Console/PruneCommand.php @@ -12,7 +12,7 @@ class PruneCommand extends Command * * @var string */ - protected $signature = 'telescope:prune {--hours=24 : The number of hours to retain Telescope data}'; + protected $signature = 'telescope:prune {--hours=24 : The number of hours to retain Telescope data} {--keep-exceptions : Retain exceptions data}'; /** * The console command description. @@ -29,6 +29,6 @@ class PruneCommand extends Command */ public function handle(PrunableRepository $repository) { - $this->info($repository->prune(now()->subHours($this->option('hours'))).' entries pruned.'); + $this->info($repository->prune(now()->subHours($this->option('hours')), $this->option('keep-exceptions')).' entries pruned.'); } } diff --git a/src/Contracts/PrunableRepository.php b/src/Contracts/PrunableRepository.php index 543d308a4..350376653 100644 --- a/src/Contracts/PrunableRepository.php +++ b/src/Contracts/PrunableRepository.php @@ -12,5 +12,5 @@ interface PrunableRepository * @param \DateTimeInterface $before * @return void */ - public function prune(DateTimeInterface $before); + public function prune(DateTimeInterface $before, $keepExceptions); } diff --git a/src/Storage/DatabaseEntriesRepository.php b/src/Storage/DatabaseEntriesRepository.php index 4e3ffcf50..a8a5b2492 100644 --- a/src/Storage/DatabaseEntriesRepository.php +++ b/src/Storage/DatabaseEntriesRepository.php @@ -335,11 +335,15 @@ public function stopMonitoring(array $tags) * @param \DateTimeInterface $before * @return int */ - public function prune(DateTimeInterface $before) + public function prune(DateTimeInterface $before, $keepExceptions) { $query = $this->table('telescope_entries') ->where('created_at', '<', $before); + if($keepExceptions) { + $query->where('type', '!=' ,'exception'); + } + $totalDeleted = 0; do { From a857d133ac380cc2fc1c7247bf66988d9e663ba7 Mon Sep 17 00:00:00 2001 From: Senthil Vel Date: Thu, 17 Sep 2020 15:45:30 +0530 Subject: [PATCH 004/138] Update PrunableRepository.php --- src/Contracts/PrunableRepository.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Contracts/PrunableRepository.php b/src/Contracts/PrunableRepository.php index 350376653..430a3639b 100644 --- a/src/Contracts/PrunableRepository.php +++ b/src/Contracts/PrunableRepository.php @@ -10,6 +10,7 @@ interface PrunableRepository * Prune all of the entries older than the given date. * * @param \DateTimeInterface $before + * @param $keepExceptions * @return void */ public function prune(DateTimeInterface $before, $keepExceptions); From d0c95ba9364aeb3bc31bbcbd1a68116f6682e332 Mon Sep 17 00:00:00 2001 From: Senthil Vel Date: Thu, 17 Sep 2020 15:50:48 +0530 Subject: [PATCH 005/138] Updated docblocks --- src/Storage/DatabaseEntriesRepository.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Storage/DatabaseEntriesRepository.php b/src/Storage/DatabaseEntriesRepository.php index a8a5b2492..d1e73a585 100644 --- a/src/Storage/DatabaseEntriesRepository.php +++ b/src/Storage/DatabaseEntriesRepository.php @@ -333,6 +333,7 @@ public function stopMonitoring(array $tags) * Prune all of the entries older than the given date. * * @param \DateTimeInterface $before + * @param $keepExceptions * @return int */ public function prune(DateTimeInterface $before, $keepExceptions) @@ -340,7 +341,7 @@ public function prune(DateTimeInterface $before, $keepExceptions) $query = $this->table('telescope_entries') ->where('created_at', '<', $before); - if($keepExceptions) { + if ($keepExceptions) { $query->where('type', '!=' ,'exception'); } From 91033667a361b108cd4dcdef4711dbce365024da Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 17 Sep 2020 08:15:03 -0500 Subject: [PATCH 006/138] formatting --- src/Console/PruneCommand.php | 2 +- src/Contracts/PrunableRepository.php | 2 +- src/Storage/DatabaseEntriesRepository.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Console/PruneCommand.php b/src/Console/PruneCommand.php index 55c2f3fc7..05ff8c4d5 100644 --- a/src/Console/PruneCommand.php +++ b/src/Console/PruneCommand.php @@ -12,7 +12,7 @@ class PruneCommand extends Command * * @var string */ - protected $signature = 'telescope:prune {--hours=24 : The number of hours to retain Telescope data} {--keep-exceptions : Retain exceptions data}'; + protected $signature = 'telescope:prune {--hours=24 : The number of hours to retain Telescope data} {--keep-exceptions : Retain exception data}'; /** * The console command description. diff --git a/src/Contracts/PrunableRepository.php b/src/Contracts/PrunableRepository.php index 430a3639b..fb3f3f3e4 100644 --- a/src/Contracts/PrunableRepository.php +++ b/src/Contracts/PrunableRepository.php @@ -10,7 +10,7 @@ interface PrunableRepository * Prune all of the entries older than the given date. * * @param \DateTimeInterface $before - * @param $keepExceptions + * @param bool $keepExceptions * @return void */ public function prune(DateTimeInterface $before, $keepExceptions); diff --git a/src/Storage/DatabaseEntriesRepository.php b/src/Storage/DatabaseEntriesRepository.php index d1e73a585..267e618ef 100644 --- a/src/Storage/DatabaseEntriesRepository.php +++ b/src/Storage/DatabaseEntriesRepository.php @@ -333,7 +333,7 @@ public function stopMonitoring(array $tags) * Prune all of the entries older than the given date. * * @param \DateTimeInterface $before - * @param $keepExceptions + * @param bool $keepExceptions * @return int */ public function prune(DateTimeInterface $before, $keepExceptions) From 72af60e7f295018729873784e51ae21aa7b9b364 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 17 Sep 2020 08:15:31 -0500 Subject: [PATCH 007/138] Apply fixes from StyleCI (#951) --- src/Storage/DatabaseEntriesRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Storage/DatabaseEntriesRepository.php b/src/Storage/DatabaseEntriesRepository.php index 267e618ef..6081f4342 100644 --- a/src/Storage/DatabaseEntriesRepository.php +++ b/src/Storage/DatabaseEntriesRepository.php @@ -342,7 +342,7 @@ public function prune(DateTimeInterface $before, $keepExceptions) ->where('created_at', '<', $before); if ($keepExceptions) { - $query->where('type', '!=' ,'exception'); + $query->where('type', '!=', 'exception'); } $totalDeleted = 0; From 5a3b42e5f70db413abe34f3fa9f18c99bd2512ac Mon Sep 17 00:00:00 2001 From: Alexandre Danault Date: Wed, 7 Jul 2021 21:46:34 -0400 Subject: [PATCH 008/138] Add a new "Clear Entries" button at the top of Telescope --- resources/js/app.js | 6 ++++++ resources/js/components/IndexScreen.vue | 11 +++++++++++ resources/views/layout.blade.php | 6 ++++++ src/Http/Controllers/EntriesController.php | 19 +++++++++++++++++++ src/Http/routes.php | 3 +++ 5 files changed, 45 insertions(+) create mode 100644 src/Http/Controllers/EntriesController.php diff --git a/resources/js/app.js b/resources/js/app.js index ab93bf91e..0fe5e65c0 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -82,5 +82,11 @@ new Vue({ window.Telescope.recording = !Telescope.recording; this.recording = !this.recording; }, + + clearEntries() { + axios.post(Telescope.basePath + '/telescope-api/clear-entries'); + + this.$emit('clear-entries'); + }, }, }); diff --git a/resources/js/components/IndexScreen.vue b/resources/js/components/IndexScreen.vue index 4c4a4b7bc..0fc69c313 100644 --- a/resources/js/components/IndexScreen.vue +++ b/resources/js/components/IndexScreen.vue @@ -47,6 +47,17 @@ this.tag = this.$route.query.tag || ''; + this.$root.$on('clear-entries', () => { + this.entries = []; + this.hasMoreEntries = false; + this.hasNewEntries = false; + this.lastEntryIndex = ''; + + this.checkForNewEntries(); + + this.ready = true; + }) + this.loadEntries((entries) => { this.entries = entries; diff --git a/resources/views/layout.blade.php b/resources/views/layout.blade.php index 90c062cfd..fb5a9ab95 100644 --- a/resources/views/layout.blade.php +++ b/resources/views/layout.blade.php @@ -41,6 +41,12 @@ + +