-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jlpereira
committed
Jun 12, 2023
1 parent
7bf5121
commit 7f67b6f
Showing
18 changed files
with
320 additions
and
77 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
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,13 @@ | ||
| <template> | ||
| <svg | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| width="32" | ||
| height="32" | ||
| viewBox="0 0 24 24" | ||
| > | ||
| <path | ||
| fill="currentColor" | ||
| d="M5 3h2v2H5v5a2 2 0 0 1-2 2a2 2 0 0 1 2 2v5h2v2H5c-1.07-.27-2-.9-2-2v-4a2 2 0 0 0-2-2H0v-2h1a2 2 0 0 0 2-2V5a2 2 0 0 1 2-2m14 0a2 2 0 0 1 2 2v4a2 2 0 0 0 2 2h1v2h-1a2 2 0 0 0-2 2v4a2 2 0 0 1-2 2h-2v-2h2v-5a2 2 0 0 1 2-2a2 2 0 0 1-2-2V5h-2V3h2m-7 12a1 1 0 0 1 1 1a1 1 0 0 1-1 1a1 1 0 0 1-1-1a1 1 0 0 1 1-1m-4 0a1 1 0 0 1 1 1a1 1 0 0 1-1 1a1 1 0 0 1-1-1a1 1 0 0 1 1-1m8 0a1 1 0 0 1 1 1a1 1 0 0 1-1 1a1 1 0 0 1-1-1a1 1 0 0 1 1-1Z" | ||
| /> | ||
| </svg> | ||
| </template> |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| <template> | ||
| <div | ||
| class="fixed top-0 left-0 w-full h-screen max-h-screen flex flex-col justify-center bg-black bg-opacity-50 z-[2000]" | ||
| @click="emit('close')" | ||
| @key.esc.stop="emit('close')" | ||
| > | ||
| <div | ||
| class="h-full md:h-auto mx-auto md:max-h-[70vh] bg-base-foreground container" | ||
| > | ||
| <div | ||
| class="w-full p-4 md:p-4 flex flex-row box-border justify-between items-center" | ||
| > | ||
| <slot name="header"> | ||
| <span /> | ||
| </slot> | ||
| <IconClose | ||
| class="w-6 h-6 cursor-pointer opacity-50" | ||
| @click="() => emit('close')" | ||
| /> | ||
| </div> | ||
| <div | ||
| class="bg-base-foreground overflow-x-auto h-full md:h-auto max-h-full" | ||
| > | ||
| <slot /> | ||
| </div> | ||
| <div> | ||
| <slot name="footer" /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script setup> | ||
| import { onMounted, onUnmounted } from 'vue' | ||
| const emit = defineEmits(['close']) | ||
| const handleKeys = (e) => { | ||
| if (e.key === 'Escape') { | ||
| e.stopPropagation() | ||
| emit('close') | ||
| } | ||
| } | ||
| onMounted(() => { | ||
| document.addEventListener('keydown', handleKeys) | ||
| document.body.classList.add('overflow-hidden') | ||
| }) | ||
| onUnmounted(() => { | ||
| document.removeEventListener('keydown', handleKeys) | ||
| document.body.classList.remove('overflow-hidden') | ||
| }) | ||
| </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
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,57 @@ | ||
| <template> | ||
| <Dropdown :items="menuOptions"> | ||
| <template #button> | ||
| <IconHamburger class="text-base-soft h-4" /> | ||
| </template> | ||
| </Dropdown> | ||
| <VModal | ||
| v-if="isModalVisible" | ||
| @close="isModalVisible = false" | ||
| > | ||
| <template #header> | ||
| <h3>JSON Data</h3> | ||
| </template> | ||
| <div | ||
| class="p-4 font-normal" | ||
| v-if="request" | ||
| > | ||
| <h3 class="pb-2 text-sm"> | ||
| URL: <a :href="request.url">{{ request.url }}</a> | ||
| </h3> | ||
| <p | ||
| class="bg-base-background p-2 text-sm font-normal whitespace-pre-wrap" | ||
| v-html="JSON.stringify(request.data, null, 4)" | ||
| /> | ||
| </div> | ||
| </VModal> | ||
| </template> | ||
|
|
||
| <script setup> | ||
| import { ref, computed } from 'vue' | ||
| import { useOtuPageRequestStore } from '../../store/request' | ||
| const props = defineProps({ | ||
| panelKey: { | ||
| type: String, | ||
| required: true | ||
| }, | ||
| menuOptions: { | ||
| type: Array, | ||
| default: () => [] | ||
| } | ||
| }) | ||
| const request = computed(() => store.getRequest(props.panelKey)) | ||
| const store = useOtuPageRequestStore() | ||
| const isModalVisible = ref(false) | ||
| const menuOptions = computed(() => [ | ||
| ...props.menuOptions, | ||
| { | ||
| label: 'JSON Data', | ||
| action: () => (isModalVisible.value = true) | ||
| } | ||
| ]) | ||
| </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
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
Oops, something went wrong.