generated from EVerest/everest-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
closes #96 Signed-off-by: Lukas Mertens <git@lukas-mertens.de> commit-id:a96808ef
- Loading branch information
1 parent
aea257a
commit d7c3a1b
Showing
5 changed files
with
118 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<template> | ||
<v-dialog> | ||
<template v-slot:activator="{ props: activatorProps }"> | ||
<slot name="activator" :activatorProps="activatorProps"></slot> | ||
</template> | ||
<template v-slot:default="{ isActive }"> | ||
<v-card title="Config Preview"> | ||
<v-card-text> | ||
<v-tabs v-model="tab"> | ||
<v-tab value="yaml"> | ||
YAML | ||
</v-tab> | ||
<v-tab value="json"> | ||
JSON | ||
</v-tab> | ||
</v-tabs> | ||
<v-window v-model="tab"> | ||
<v-window-item value="yaml"> | ||
<highlightjs language="yaml" :code="yamlCode"></highlightjs> | ||
</v-window-item> | ||
<v-window-item value="json"> | ||
<highlightjs language="json" :code="jsonCode"></highlightjs> | ||
</v-window-item> | ||
</v-window> | ||
</v-card-text> | ||
</v-card> | ||
</template> | ||
</v-dialog> | ||
</template> | ||
|
||
<style scoped lang="scss"> | ||
</style> | ||
|
||
<script lang="ts"> | ||
import hljsVuePlugin from "@highlightjs/vue-plugin"; | ||
export default { | ||
components: { | ||
highlightjs: hljsVuePlugin.component, | ||
} | ||
} | ||
</script> | ||
<script setup lang="ts"> | ||
import EVConfigModel from "@/modules/evbc/config_model"; | ||
import {computed, ref} from "vue"; | ||
import yaml from 'js-yaml'; | ||
const props = defineProps<{ | ||
config: EVConfigModel, | ||
}>(); | ||
const tab = ref('yaml'); | ||
const jsonCode = computed(() => JSON.stringify(props.config.serialize(), null, 2)); | ||
const yamlCode = computed(() => yaml.dump(props.config.serialize())); | ||
</script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters