Skip to content

Commit

Permalink
Files Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Aug 29, 2024
1 parent 9b36c57 commit 0dc5d99
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 165 deletions.
151 changes: 0 additions & 151 deletions api/web/src/components/CloudTAK/Menu/DataUser.vue

This file was deleted.

4 changes: 2 additions & 2 deletions api/web/src/components/CloudTAK/Menu/Datas.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<div class='col-12 px-2'>
<button
class='btn btn-primary w-100'
@click='$router.push("/menu/datas/user")'
@click='$router.push("/menu/files")'
>
<IconUser
:size='32'
:stroke='1'
/>User Overlays
/>Your Files
</button>
</div>
</div>
Expand Down
51 changes: 43 additions & 8 deletions api/web/src/components/CloudTAK/Menu/Files.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
>
<div class='col-12 py-2 px-3 d-flex align-items-center hover-dark'>
<div class='col-auto'>
<IconMap
<IconMapPlus
v-if='asset.visualized'
v-tooltip='"Visualizable"'
v-tooltip='"Add to Map"'
class='cursor-pointer'
:size='32'
:stroke='1'
@click='createOverlay(asset)'
/>
<IconMapOff
v-else
Expand All @@ -38,12 +40,11 @@
/>
</div>
<div class='col-auto'>
<div class='col-12'>
<span
class='mx-2'
v-text='asset.name'
/>
</div>
<div
class='col-12 text-truncate px-2'
style='max-width: 250px;'
v-text='asset.name'
/>
<div class='col-12 subheader'>
<span class='mx-2'>
<TablerBytes :bytes='asset.size' /> - <TablerEpoch :date='asset.updated' />
Expand Down Expand Up @@ -104,12 +105,16 @@ import {
import {
IconMap,
IconMapOff,
IconMapPlus,
IconTransform,
IconDownload,
IconRefresh,
} from '@tabler/icons-vue';
import MenuTemplate from '../util/MenuTemplate.vue';
import timeDiff from '../../../timediff.js';
import { useMapStore } from '/src/stores/map.ts';
import Overlay from '/src/stores/overlays/base.ts';
const mapStore = useMapStore();
export default {
name: 'CloudTAKImports',
Expand All @@ -121,6 +126,7 @@ export default {
TablerEpoch,
TablerDelete,
IconMap,
IconMapPlus,
IconMapOff,
IconTransform,
IconDownload,
Expand Down Expand Up @@ -155,6 +161,35 @@ export default {
timeDiff(update) {
return timeDiff(update)
},
createOverlay: async function(asset) {
const url = stdurl(`/api/profile/asset/${encodeURIComponent(asset.visualized)}/tile`);
this.loading = true;
const res = await std(url);
if (new URL(res.tiles[0]).pathname.endsWith('.mvt')) {
await mapStore.overlays.push(await Overlay.create(mapStore.map, {
url,
name: asset.name,
mode: 'profile',
mode_id: asset.name,
type: 'vector',
}));
} else {
await mapStore.overlays.push(await Overlay.create(mapStore.map, {
url: url,
name: asset.name,
mode: 'profile',
mode_id: asset.name,
type: 'raster',
}));
}
this.loading = false;
this.$emit('mode', 'overlays');
this.$router.push('/menu/overlays');
},
downloadAsset: async function(asset) {
const url = stdurl(`/api/profile/asset/${asset.name}`);
url.searchParams.append('token', localStorage.token);
Expand Down
4 changes: 0 additions & 4 deletions api/web/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@ const router = new VueRouter.createRouter({
path: 'datas',
name: 'home-menu-datas',
component: () => import('./components/CloudTAK/Menu/Datas.vue')
},{
path: 'datas/user',
name: 'home-menu-datas-user',
component: () => import('./components/CloudTAK/Menu/DataUser.vue')
},{
path: 'contacts',
name: 'home-menu-contacts',
Expand Down

0 comments on commit 0dc5d99

Please sign in to comment.