Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dev/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ monolog:
error:
type: stream
path: "%kernel.logs_dir%/error.log"
include_stacktraces: true
level: error
channels: [ "!event", "!deprecation" ]
deprecation:
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/components/LogRecord.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script setup lang="ts">
import JsonData from '@/components/json/JsonData.vue';
import {nl2br, escapeHtml} from '@/services/Strings.ts';
import type LogRecord from '@/models/LogRecord';
import {isEmptyJson, prettyFormatJson} from '@/services/JsonFormatter';
import {ref} from 'vue';
Expand All @@ -23,7 +24,10 @@ function click(value: string) {
<span class="pe-2 text-secondary">{{ logRecord.datetime }}</span>
<span class="text-primary pe-2" v-if="logRecord.channel.length > 0">{{ logRecord.channel }}</span>
<span :class="['pe-2', logRecord.level_class ]">{{ logRecord.level_name }}</span>
<span>{{ logRecord.text }}</span>

<!-- log message -->
<span v-if="!expanded" v-text="logRecord.text.substring(0, 500)"></span>
<span v-if="expanded" v-html="nl2br(escapeHtml(logRecord.text))"></span>
</div>
<div class="border-top pt-2 ps-2 mb-2 position-relative" v-bind:class="{'d-block': expanded, 'd-none': !expanded}" v-if="expanded">
<button class="btn btn-outline-secondary slv-btn-raw" @click="styled = !styled">{{ styled ? 'raw' : 'styled' }}</button>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/json/JsonScalarValue.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script setup lang="ts">
import Numbers from '@/services/Numbers.ts';
import Strings from '@/services/Strings.ts';
import {trim} from '@/services/Strings.ts';

const props = defineProps<{ path: string, data: unknown }>();
const emit = defineEmits(['click']);

function click(value: unknown) {
emit('click', `${Strings.trim(props.path, '.')}="${value}"`);
emit('click', `${trim(props.path, '.')}="${value}"`);
}
</script>

Expand Down
28 changes: 18 additions & 10 deletions frontend/src/services/Strings.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
export default class Strings {
export function trim(str: string, toRemove: string): string {
while (str.startsWith(toRemove)) {
str = str.substring(toRemove.length);
}
while (str.endsWith(toRemove)) {
str = str.substring(0, str.length - toRemove.length);
}

return str;
}

public static trim(str: string, toRemove: string): string {
while (str.startsWith(toRemove)) {
str = str.substring(toRemove.length);
}
while (str.endsWith(toRemove)) {
str = str.substring(0, str.length - toRemove.length);
}
export function nl2br(str: string): string {
return str.replace(/\n/g, '<br/>');
}

return str;
}
export function escapeHtml(str: string): string {
return str
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
}
4 changes: 2 additions & 2 deletions src/Resources/public/.vite/manifest.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"src/main.ts": {
"file": "assets/main-CF_yt7iQ.js",
"file": "assets/main-C_BrajeJ.js",
"name": "main",
"src": "src/main.ts",
"isEntry": true
},
"style.css": {
"file": "assets/style-CcMiSAP_.css",
"file": "assets/style-J8MU6gDa.css",
"src": "style.css"
}
}

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.