-
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.
Merge pull request #95 from SpeciesFileGroup/development
Add cached map data and css vars
- Loading branch information
Showing
10 changed files
with
157 additions
and
4 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,15 @@ | ||
| <template> | ||
| <svg | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| fill="none" | ||
| viewBox="0 0 24 24" | ||
| stroke-width="1.5" | ||
| stroke="currentColor" | ||
| > | ||
| <path | ||
| stroke-linecap="round" | ||
| stroke-linejoin="round" | ||
| d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" | ||
| /> | ||
| </svg> | ||
| </template> |
101 changes: 101 additions & 0 deletions
101
src/modules/otus/components/Panel/PanelMap/CachedMap.vue
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,101 @@ | ||
| <template> | ||
| <VButton | ||
| class="left-2 bottom-2 !px-2 py-2 rounded-full absolute z-[1500]" | ||
| primary | ||
| > | ||
| <IconCheck | ||
| v-if="cachedMap.synced" | ||
| class="w-4 h-4" | ||
| @click="isModalVisible = true" | ||
| /> | ||
| <IconWarning | ||
| v-else | ||
| class="w-4 h-4" | ||
| @click="isModalVisible = true" | ||
| /> | ||
| </VButton> | ||
| <VModal | ||
| v-if="isModalVisible" | ||
| @close="() => (isModalVisible = false)" | ||
| > | ||
| <template #header> | ||
| <h3>Cached map</h3> | ||
| </template> | ||
| <div class="p-4 pt-0"> | ||
| <VTable> | ||
| <VTableHeader> | ||
| <VTableHeaderRow> | ||
| <VTableHeaderCell>Data</VTableHeaderCell> | ||
| <VTableHeaderCell></VTableHeaderCell> | ||
| </VTableHeaderRow> | ||
| </VTableHeader> | ||
| <VTableBody> | ||
| <VTableBodyRow> | ||
| <VTableBodyCell> Is synced </VTableBodyCell> | ||
| <VTableBodyCell> | ||
| <p | ||
| class="text-success flex text-sm items-center" | ||
| v-if="cachedMap.synced" | ||
| > | ||
| <IconCheck class="w-4 h-4" /> | ||
| <span class="ml-1">Map is synchronized</span> | ||
| </p> | ||
| <p | ||
| class="text-warning flex text-sm items-center" | ||
| v-else | ||
| > | ||
| <IconWarning class="w-4 h-4" /> | ||
| <span class="ml-1">Map is not synchronized</span> | ||
| </p> | ||
| </VTableBodyCell> | ||
| </VTableBodyRow> | ||
| <VTableBodyRow> | ||
| <VTableBodyCell> Last update </VTableBodyCell> | ||
| <VTableBodyCell> | ||
| {{ new Date(cachedMap.updated_at) }} | ||
| </VTableBodyCell> | ||
| </VTableBodyRow> | ||
| </VTableBody> | ||
| <VTableHeader> | ||
| <VTableHeaderRow> | ||
| <VTableHeaderCell>Source</VTableHeaderCell> | ||
| <VTableHeaderCell>Total</VTableHeaderCell> | ||
| </VTableHeaderRow> | ||
| </VTableHeader> | ||
| <VTableBody> | ||
| <VTableBodyRow | ||
| v-for="(value, key) in cachedMap.source_scope" | ||
| :key="key" | ||
| > | ||
| <VTableBodyCell class="capitalize"> | ||
| {{ key.replaceAll('_', ' ') }} | ||
| </VTableBodyCell> | ||
| <VTableBodyCell> | ||
| {{ value }} | ||
| </VTableBodyCell> | ||
| </VTableBodyRow> | ||
| </VTableBody> | ||
| </VTable> | ||
| </div> | ||
| </VModal> | ||
| </template> | ||
| <script setup> | ||
| import { ref } from 'vue' | ||
| defineProps({ | ||
| cachedMap: { | ||
| type: Object, | ||
| required: true | ||
| } | ||
| }) | ||
| const isModalVisible = ref(false) | ||
| </script> | ||
|
|
||
| <style> | ||
| .cached-map-icon { | ||
| right: 20px; | ||
| top: 20px; | ||
| z-index: 1098; | ||
| } | ||
| </style> |
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 |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| export * from './loadCatalog' | ||
| export * from './loadDistribution' | ||
| export * from './loadTaxonomy' | ||
| export * from './loadCachedMap' |
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,9 @@ | ||
| import TaxonWorks from '../../services/TaxonWorks' | ||
|
|
||
| export const actionLoadCachedMap = { | ||
| loadCachedMap(mapId) { | ||
| TaxonWorks.getCachedMap(mapId).then((response) => { | ||
| this.distribution.cachedMap = response.data | ||
| }) | ||
| } | ||
| } |
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