Skip to content

Commit 8e1756e

Browse files
committed
feat: enhance table row expansion styles and Monaco editor options
1 parent 01e99b9 commit 8e1756e

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

src/pages/jobs/table.vue

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</q-tr>
1616
</template>
1717
<template v-slot:body="props">
18-
<q-tr :props="props" :class="{ 'bg-primary': props.expand }">
18+
<q-tr :props="props" :class="{ 'bg-primary': props.expand, 'text-white': props.expand }">
1919
<q-td v-for="col in props.cols" :key="col.name" :props="props">
2020
{{ col.name === 'state' ? getStatusText(col.value) : col.value }}
2121
</q-td>
@@ -25,14 +25,17 @@
2525
</q-tr>
2626
<q-tr v-show="props.expand" :props="props">
2727
<q-td colspan="100%" style="padding: 0">
28-
<MonacoEditor :model-value="JSON.stringify(props.row?.result, null, 2)" :options="monacoOptions" lang="json" style="height: 50vh" />
28+
<MonacoEditor style="height: 35vh; width: 100%" :model-value="JSON.stringify(props.row?.result, null, 2)" :options="monacoOptions" lang="json" />
29+
<q-separator class="q-my-none" size="8px" color="primary" />
2930
</q-td>
3031
</q-tr>
3132
</template>
3233
</q-table>
3334
</q-page>
3435
</template>
35-
<script setup>
36+
<script lang="ts" setup>
37+
import * as Monaco from 'monaco-editor'
38+
3639
const $dayjs = useDayjs()
3740
const $route = useRoute()
3841
const router = useRouter()
@@ -134,12 +137,14 @@ const isDark = computed(() => {
134137
})
135138
136139
const monacoOptions = computed(() => {
137-
return {
140+
return <Monaco.editor.IStandaloneEditorConstructionOptions>{
138141
theme: isDark.value ? 'vs-dark' : 'vs-light',
139142
readOnly: true,
140143
minimap: {
141144
enabled: true,
142145
},
146+
scrollBeyondLastColumn: 0,
147+
scrollBeyondLastLine: false,
143148
}
144149
})
145150
</script>

src/pages/lifecycles/table.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
) {{ col.label }}
2424
q-th
2525
template(#body="props")
26-
q-tr(:props="props" :class="{ 'bg-primary': props.expand }")
26+
q-tr(:props="props" :class="{ 'bg-primary': props.expand, 'text-white': props.expand }")
2727
q-td(
2828
v-for="col in props.cols.filter(c => c.name !== 'expand')"
2929
:key="col.name"
@@ -34,7 +34,7 @@
3434
@click="expandRow(props)"
3535
:icon="props.expand ? 'mdi-minus' : 'mdi-plus'"
3636
:disable="!props.row"
37-
size="sm" color="primary"
37+
size="sm" color="secondary"
3838
round dense elevation="0"
3939
)
4040
q-tr(v-if="props.expand" :props="props")
@@ -43,8 +43,9 @@
4343
:model-value="JSON.stringify(props.row, null, 2)"
4444
lang="json"
4545
:options="monacoOptions"
46-
style="height: 400px; width: 100%;"
46+
style="height: 35vh; width: 100%"
4747
)
48+
q-separator(class="q-my-none" size="8px" color="primary")
4849
</template>
4950

5051
<script lang="ts">
@@ -121,6 +122,8 @@ export default {
121122
minimap: {
122123
enabled: true,
123124
},
125+
scrollBeyondLastColumn: 0,
126+
scrollBeyondLastLine: false,
124127
}
125128
},
126129
},

0 commit comments

Comments
 (0)