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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nextline-web",
"version": "0.11.2",
"version": "0.11.3",
"private": false,
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/rdb/AsyncEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<template #fallback>
<div style="height: 100%">
<VProgressLinear indeterminate></VProgressLinear>
<!-- <pre class="overflow-auto" style="height: 100%">{{ source }}</pre> -->
<pre class="pl-5">{{ source }}</pre>
</div>
</template>
</Suspense>
Expand Down
13 changes: 11 additions & 2 deletions src/components/rdb/Editor.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<template>
<div ref="element" style="height: 100%"></div>
<div ref="element" :style="{ height: editorHeight }" @wheel.stop.capture></div>
</template>

<script setup lang="ts">
import { ref, toRefs } from "vue";
import { computed, ref, toRefs } from "vue";

import { useMonacoEditor } from "@/utils/monaco-editor";

Expand All @@ -13,6 +13,15 @@ interface Props {
const props = defineProps<Props>();
const { source } = toRefs(props);
const element = ref<HTMLElement>();

const nLines = computed(() => source.value.split("\n").length);
const lineHeight = 24; // From monaco-editor
const padding = 10; // TODO: Check if this is correct
const editorHeight = computed(() => {
const height = nLines.value * lineHeight + padding;
return `${height}px`;
});

// await new Promise((resolve) => setTimeout(resolve, 2000));
await useMonacoEditor({ element, source });
</script>
5 changes: 3 additions & 2 deletions src/components/rdb/RunCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</div>
<div class="g-script">
<VCardSubtitle class="font-weight-bold"> Script </VCardSubtitle>
<VCardText style="height: 100%">
<VCardText>
<AsyncEditor v-if="run?.script" :source="run?.script"></AsyncEditor>
</VCardText>
</div>
Expand Down Expand Up @@ -104,7 +104,8 @@ function formatDateTime(dateTime: string) {
grid-area: script;
display: grid;
grid-template-columns: minmax(100px, 1fr);
grid-template-rows: min-content minmax(200px, 1fr);
/* grid-template-rows: min-content minmax(200px, 1fr); */
grid-template-rows: min-content min-content;
}

.g-stdout {
Expand Down
44 changes: 22 additions & 22 deletions src/components/rdb/RunView.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
<script setup lang="ts">
import { computed, ref } from "vue";
import { useRoute } from "vue-router";

import { useRdbRunQuery } from "@/graphql/codegen/generated";

import RunCard from "./RunCard.vue";

const route = useRoute();
const runNo = Number(route.params.runNo);

const breadcrumb = computed(() => [
{ title: "Runs", to: { name: "runs" }, exact: true },
{ title: `Run ${runNo}`, to: { name: "run", params: { runNo } } },
]);

const queryResponse = useRdbRunQuery({ variables: { runNo } });

const run = computed(() => queryResponse.data.value?.rdb.run);
</script>

<template>
<div class="g-container">
<div class="g-navi">
Expand All @@ -39,13 +18,34 @@ const run = computed(() => queryResponse.data.value?.rdb.run);
</div>
</template>

<script setup lang="ts">
import { computed } from "vue";
import { useRoute } from "vue-router";

import { useRdbRunQuery } from "@/graphql/codegen/generated";

import RunCard from "./RunCard.vue";

const route = useRoute();
const runNo = Number(route.params.runNo);

const breadcrumb = computed(() => [
{ title: "Runs", to: { name: "runs" }, exact: true },
{ title: `Run ${runNo}`, to: { name: "run", params: { runNo } } },
]);

const queryResponse = useRdbRunQuery({ variables: { runNo } });

const run = computed(() => queryResponse.data.value?.rdb.run);
</script>

<style scoped>
.g-container {
display: grid;
padding: 12px;
justify-content: center;
grid-template-columns: minmax(min-content, 960px);
grid-template-rows: min-content min-content 1fr;
grid-template-rows: min-content min-content min-content;
grid-template-areas: "navi" "button" "card";
}

Expand Down