Skip to content

Commit e688bb6

Browse files
authored
Merge pull request #204 from opcodesio/multi-server-access
Multi server access & Accessibility
2 parents 4cd5106 + b1e07ae commit e688bb6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1497
-482
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ Log Viewer helps you quickly and clearly see individual log entries, to **search
3636
- 🔍 **Search** the logs,
3737
- 🎚 **Filter** by log level (error, info, debug, etc.),
3838
- 🔗 **Sharable links** to individual log entries,
39-
- 🌑 **Dark mode**
39+
- 🌑 **Dark mode**,
4040
- 📱 **Mobile-friendly** UI,
41+
- 🖥️ **Multiple host support**,
42+
- ⌨️ **Keyboard accessible**,
4143
- 💾 **Download & delete** log files from the UI,
4244
- ☑️ **Horizon** log support (up to Horizon v9.20),
4345
- ☎️ **API access** for folders, files & log entries,

composer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "opcodesio/log-viewer",
3-
"version": "v2.1.1",
3+
"version": "v2.2.0",
44
"description": "Fast and easy-to-use log viewer for your Laravel application",
55
"keywords": [
66
"arukompas",
@@ -24,6 +24,7 @@
2424
"illuminate/contracts": "^8.0|^9.0|^10.0"
2525
},
2626
"require-dev": {
27+
"guzzlehttp/guzzle": "^7.2",
2728
"itsgoingd/clockwork": "^5.1",
2829
"laravel/pint": "^1.0",
2930
"nunomaduro/collision": "^6.0",
@@ -33,6 +34,9 @@
3334
"phpunit/phpunit": "^9.5",
3435
"spatie/test-time": "^1.3"
3536
},
37+
"suggest": {
38+
"guzzlehttp/guzzle": "Required for multi-host support. ^7.2"
39+
},
3640
"autoload": {
3741
"psr-4": {
3842
"Opcodes\\LogViewer\\": "src"

config/log-viewer.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,42 @@
7777
\Opcodes\LogViewer\Http\Middleware\AuthorizeLogViewer::class,
7878
],
7979

80+
/*
81+
|--------------------------------------------------------------------------
82+
| Log Viewer Remote hosts.
83+
|--------------------------------------------------------------------------
84+
| Log Viewer supports viewing Laravel logs from remote hosts. They must
85+
| be running Log Viewer as well. Below you can define the hosts you
86+
| would like to show in this Log Viewer instance.
87+
|
88+
*/
89+
90+
'hosts' => [
91+
'local' => [
92+
'name' => 'Local',
93+
],
94+
95+
// 'staging' => [
96+
// 'name' => 'Staging',
97+
// 'host' => 'https://staging.example.com/log-viewer',
98+
// 'auth' => [ // Example of HTTP Basic auth
99+
// 'username' => 'username',
100+
// 'password' => 'password',
101+
// ],
102+
// ],
103+
//
104+
// 'production' => [
105+
// 'name' => 'Production',
106+
// 'host' => 'https://example.com/log-viewer',
107+
// 'auth' => [ // Example of Bearer token auth
108+
// 'token' => env('LOG_VIEWER_PRODUCTION_TOKEN'),
109+
// ],
110+
// 'headers' => [
111+
// 'X-Foo' => 'Bar',
112+
// ],
113+
// ],
114+
],
115+
80116
/*
81117
|--------------------------------------------------------------------------
82118
| Include file patterns

public/app.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/app.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/img/bmc-logo.png

-96.8 KB
Binary file not shown.

public/img/bmc.png

-318 KB
Binary file not shown.

public/mix-manifest.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
{
2-
"/app.js": "/app.js?id=b396fb47d3af2fd9fa5e679732a1af56",
3-
"/app.css": "/app.css?id=bb10c6e498a9e0746288332160701561",
4-
"/img/bmc-logo.png": "/img/bmc-logo.png?id=c04e60b1d9e2d6f064e274a80eca2a7d",
5-
"/img/bmc.png": "/img/bmc.png?id=3f4eb0139fa11ab84b70648b7c5b4cf7",
2+
"/app.js": "/app.js?id=c256067349a1c4dcc5f98d1f831c311a",
3+
"/app.css": "/app.css?id=635adfebadcc6643a1986f894f844f14",
64
"/img/log-viewer-128.png": "/img/log-viewer-128.png?id=d576c6d2e16074d3f064e60fe4f35166",
75
"/img/log-viewer-32.png": "/img/log-viewer-32.png?id=f8ec67d10f996aa8baf00df3b61eea6d",
86
"/img/log-viewer-64.png": "/img/log-viewer-64.png?id=8902d596fc883ca9eb8105bb683568c6"

resources/css/app.scss

Lines changed: 93 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,34 @@ html.dark {
5050
@apply text-gray-700 dark:text-gray-400;
5151
}
5252
}
53+
5354
.log-count {
5455
@apply text-gray-500 dark:text-gray-400 ml-8 whitespace-nowrap;
5556
}
57+
58+
button.active {
59+
.log-level {
60+
&.success {
61+
@apply text-emerald-100;
62+
}
63+
&.info {
64+
@apply text-sky-100;
65+
}
66+
&.warning {
67+
@apply text-amber-100;
68+
}
69+
&.danger {
70+
@apply text-rose-100;
71+
}
72+
&.none {
73+
@apply text-gray-100;
74+
}
75+
}
76+
.log-count {
77+
@apply text-gray-200 dark:text-gray-300;
78+
}
79+
}
80+
5681
.no-results {
5782
@apply text-xs text-gray-500 dark:text-gray-400 text-center px-4 py-1;
5883
}
@@ -63,7 +88,7 @@ html.dark {
6388
@apply bg-white dark:bg-gray-800 transition duration-200 cursor-pointer;
6489

6590
&.success {
66-
&:hover > td, &.active > td {
91+
&:hover > td, &.active > td, &:focus-within > td {
6792
@apply bg-emerald-50 dark:bg-emerald-800 dark:bg-opacity-40;
6893
}
6994
.log-level-indicator {
@@ -75,7 +100,7 @@ html.dark {
75100
}
76101

77102
&.info {
78-
&:hover > td, &.active > td {
103+
&:hover > td, &.active > td, &:focus-within > td {
79104
@apply bg-sky-50 dark:bg-sky-800 dark:bg-opacity-40;
80105
}
81106
.log-level-indicator {
@@ -87,7 +112,7 @@ html.dark {
87112
}
88113

89114
&.warning {
90-
&:hover > td, &.active > td {
115+
&:hover > td, &.active > td, &:focus-within > td {
91116
@apply bg-amber-50 dark:bg-amber-800 dark:bg-opacity-40;
92117
}
93118
.log-level-indicator {
@@ -99,7 +124,7 @@ html.dark {
99124
}
100125

101126
&.danger {
102-
&:hover > td, &.active > td {
127+
&:hover > td, &.active > td, &:focus-within > td {
103128
@apply bg-rose-50 dark:bg-rose-800 dark:bg-opacity-40;
104129
}
105130
.log-level-indicator {
@@ -111,7 +136,7 @@ html.dark {
111136
}
112137

113138
&.none {
114-
&:hover > td, &.active > td {
139+
&:hover > td, &.active > td, &:focus-within > td {
115140
@apply bg-gray-50 dark:bg-gray-800 dark:bg-opacity-40;
116141
}
117142
.log-level-indicator {
@@ -121,6 +146,10 @@ html.dark {
121146
@apply text-gray-700 dark:text-gray-400;
122147
}
123148
}
149+
150+
&:hover .log-level-icon {
151+
@apply opacity-100;
152+
}
124153
}
125154

126155
/** Level Badges **/
@@ -301,19 +330,11 @@ html.dark {
301330
@apply bg-white dark:bg-gray-800 dark:text-gray-200 relative;
302331

303332
.log-item > td {
304-
@apply border-t border-gray-200 dark:border-gray-700 px-1 lg:px-2 py-1 lg:py-2 text-xs lg:text-sm;
305-
}
306-
307-
.log-item > td.log-level-icon {
308-
@apply whitespace-nowrap border-t border-gray-200 dark:border-gray-700 py-1 lg:py-2 pl-2 lg:pl-4 lg:pr-2 lg:pl-6 lg:pl-8;
309-
& > svg {
310-
@apply opacity-75 h-5 w-5;
311-
}
333+
@apply border-t border-gray-200 dark:border-gray-700 px-1 lg:px-2 py-1.5 lg:py-2 text-xs lg:text-sm;
312334
}
313335

314336
&.first {
315-
.log-item > td,
316-
.log-item > td.log-level-icon {
337+
.log-item > td {
317338
@apply border-t-transparent;
318339
}
319340
}
@@ -323,15 +344,19 @@ html.dark {
323344
}
324345

325346
.log-link {
326-
@apply flex items-center w-full;
327-
margin-right: 0.5rem;
347+
@apply flex items-center justify-end w-full -my-0.5 py-0.5 pl-1 rounded;
348+
328349
@screen sm {
329-
min-width: 40px;
350+
min-width: 64px;
330351
}
331352

332353
& > svg {
333354
@apply h-4 w-4 ml-1 transition duration-200;
334355
}
356+
357+
&:focus {
358+
@apply outline-none ring-2 ring-brand-500 dark:ring-brand-400;
359+
}
335360
}
336361

337362
code, mark {
@@ -342,17 +367,20 @@ html.dark {
342367
}
343368

344369
.pagination {
345-
@apply md:mt-2 px-4 w-full flex items-center justify-center lg:px-0;
370+
@apply sm:mt-2 sm:px-4 w-full flex items-center justify-center lg:px-0;
346371

347372
.previous {
348373
@apply -mt-px w-0 flex-1 flex justify-start md:justify-end;
349374

350375
button {
351-
@apply border-t-2 border-transparent pt-4 pr-1 inline-flex items-center text-sm font-medium text-gray-500 dark:text-gray-400;
376+
@apply border-t-2 border-transparent pt-3 pr-1 inline-flex items-center text-sm font-medium text-gray-500 dark:text-gray-400;
352377
&:hover {
353378
@apply text-gray-700 border-gray-300
354379
dark:text-gray-300 border-gray-400;
355380
}
381+
&:focus {
382+
@apply rounded-md outline-none ring-2 ring-brand-500 dark:ring-brand-400;
383+
}
356384
svg {
357385
@apply mx-3 h-5 w-5 text-current;
358386
}
@@ -363,11 +391,14 @@ html.dark {
363391
@apply -mt-px w-0 flex-1 flex justify-end md:justify-start;
364392

365393
button {
366-
@apply border-t-2 border-transparent pt-4 pl-1 inline-flex items-center text-sm font-medium text-gray-500 dark:text-gray-400;
394+
@apply border-t-2 border-transparent pt-3 pl-1 inline-flex items-center text-sm font-medium text-gray-500 dark:text-gray-400;
367395
&:hover {
368396
@apply text-gray-700 border-gray-300
369397
dark:text-gray-300 border-gray-400;
370398
}
399+
&:focus {
400+
@apply rounded-md outline-none ring-2 ring-brand-500 dark:ring-brand-400;
401+
}
371402
svg {
372403
@apply mx-3 h-5 w-5 text-current;
373404
}
@@ -378,11 +409,15 @@ html.dark {
378409
@apply hidden sm:-mt-px sm:flex;
379410

380411
span {
381-
@apply border-transparent text-gray-500 dark:text-gray-400 border-t-2 pt-4 px-4 inline-flex items-center text-sm font-medium;
412+
@apply border-transparent text-gray-500 dark:text-gray-400 border-t-2 pt-3 px-4 inline-flex items-center text-sm font-medium;
382413
}
383414

384415
button {
385-
@apply border-t-2 pt-4 px-4 inline-flex items-center text-sm font-medium;
416+
@apply border-t-2 pt-3 px-4 inline-flex items-center text-sm font-medium;
417+
418+
&:focus {
419+
@apply rounded-md outline-none ring-2 ring-brand-500 dark:ring-brand-400;
420+
}
386421
}
387422
}
388423
}
@@ -429,6 +464,10 @@ html.dark {
429464
.dropdown {
430465
@apply absolute top-full z-40 right-1 -mt-1 overflow-hidden text-gray-900 dark:text-gray-200 rounded-md bg-white border-gray-200 dark:bg-gray-800 border dark:border-gray-700 shadow-md;
431466

467+
&:focus {
468+
@apply outline-none ring-1 ring-brand-500 ring-opacity-50 dark:ring-brand-700 dark:ring-opacity-50;
469+
}
470+
432471
transform-origin: top right !important;
433472

434473
&.up {
@@ -448,7 +487,7 @@ html.dark {
448487
}
449488
}
450489

451-
button, a {
490+
button:not(.inline-link), a:not(.inline-link) {
452491
@apply block flex items-center w-full px-4 py-2 text-left text-sm outline-brand-500 dark:outline-brand-800;
453492
& > svg {
454493
@apply w-4 h-4 mr-3 text-gray-400;
@@ -459,8 +498,16 @@ html.dark {
459498
}
460499
}
461500
}
462-
button:hover, a:hover {
463-
@apply bg-gray-50 dark:bg-gray-700;
501+
button:hover, a:hover, button.active, a.active {
502+
@apply text-white bg-brand-600;
503+
504+
& > .checkmark {
505+
@apply bg-brand-600 dark:border-gray-300;
506+
}
507+
508+
& > svg {
509+
@apply text-white;
510+
}
464511
}
465512

466513
.divider {
@@ -476,14 +523,21 @@ html.dark {
476523
// Dark border (hover): border-brand-700
477524

478525
.file-list {
479-
@apply relative h-full overflow-y-auto pl-3 sm:pl-0 pt-2 pb-4 pr-3 sm:pr-4;
526+
@apply relative h-full overflow-y-auto pb-4 px-3 md:pr-0 md:pl-0;
480527

481528
.file-item-container,
482529
.folder-item-container {
483-
@apply relative mt-2 text-gray-800 dark:text-gray-200 rounded-md bg-white dark:bg-gray-800;
530+
@apply relative mt-2 text-gray-800 dark:text-gray-200 rounded-md bg-white dark:bg-gray-800 top-0;
484531

485532
.file-item {
486-
@apply relative flex justify-between items-center pl-4 pr-10 py-2 rounded-md border cursor-pointer border-transparent transition duration-100;
533+
@apply relative flex justify-between items-center rounded-md border cursor-pointer border-transparent transition duration-100;
534+
535+
.file-item-info {
536+
@apply flex-1 text-left flex items-center justify-between pl-4 pr-3 py-2 rounded-l-md outline-brand-500 dark:outline-brand-700 transition duration-200;
537+
&:hover {
538+
@apply bg-brand-50 dark:bg-brand-900;
539+
}
540+
}
487541

488542
.file-icon {
489543
@apply mr-2 text-gray-400 dark:text-gray-500;
@@ -515,13 +569,10 @@ html.dark {
515569
}
516570

517571
.file-dropdown-toggle {
518-
@apply absolute top-0 right-0 bottom-0 w-8 flex rounded-r-md items-center justify-center border-l border-transparent text-gray-500 dark:text-gray-400 outline-brand-500 dark:outline-brand-700 transition duration-200;
572+
@apply self-stretch w-8 flex rounded-r-md items-center justify-center border-l border-transparent text-gray-500 dark:text-gray-400 outline-brand-500 dark:outline-brand-700 transition duration-200;
519573
&:hover {
520574
@apply border-brand-600 bg-brand-50 dark:border-brand-800 dark:bg-brand-900;
521575
}
522-
& > svg {
523-
@apply h-4 w-4;
524-
}
525576
}
526577
}
527578

@@ -531,12 +582,12 @@ html.dark {
531582
position: -webkit-sticky;
532583
position: sticky;
533584
}
534-
535-
& > .file-item {
536-
@apply pr-4;
537-
}
538585
}
539586
}
587+
588+
.folder-container:first-child > .folder-item-container {
589+
@apply mt-0;
590+
}
540591
}
541592

542593
.menu-button {
@@ -567,7 +618,11 @@ button.button:hover, a.button:hover {
567618
}
568619

569620
.select {
570-
@apply bg-gray-50 dark:bg-gray-800 dark:bg-opacity-50 px-3 py-0.5 border dark:border-gray-700 rounded-md font-normal outline-none
621+
@apply bg-gray-100 dark:bg-gray-900 text-gray-700 dark:text-gray-300 rounded font-normal outline-none px-1 -my-0.5 py-0.5;
622+
}
623+
624+
.select:hover {
625+
@apply bg-gray-200 dark:bg-gray-800;
571626
}
572627

573628
.select:focus {

0 commit comments

Comments
 (0)