mirror of
https://github.com/dfpc-coe/CloudTAK.git
synced 2025-12-22 13:47:22 +00:00
Add MissionTemplate Selection
This commit is contained in:
@@ -82,19 +82,9 @@
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Keywords :keywords='missionKeywords(mission)' />
|
||||
<div
|
||||
v-if='missionKeywords(mission).length'
|
||||
class='d-flex flex-wrap align-items-center gap-2'
|
||||
>
|
||||
<span
|
||||
v-for='keyword in missionKeywords(mission)'
|
||||
:key='`${mission.guid}-${keyword}`'
|
||||
class='badge rounded-pill text-bg-info text-uppercase small fw-semibold'
|
||||
v-text='keyword'
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
v-else
|
||||
v-if='!missionKeywords(mission).length'
|
||||
class='text-secondary small'
|
||||
>
|
||||
No keywords
|
||||
@@ -175,6 +165,7 @@
|
||||
import { ref, onMounted, watch } from 'vue';
|
||||
import MissionCreate from './Mission/MissionCreate.vue';
|
||||
import MenuTemplate from '../util/MenuTemplate.vue';
|
||||
import Keywords from '../util/Keywords.vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import {
|
||||
TablerIconButton,
|
||||
|
||||
@@ -109,19 +109,9 @@
|
||||
</div>
|
||||
<div class='col-12'>
|
||||
<small class='text-uppercase text-white-50 d-block mb-2'>Hashtags</small>
|
||||
<div
|
||||
v-if='(pkg.keywords || []).length'
|
||||
class='d-flex flex-wrap gap-2'
|
||||
>
|
||||
<span
|
||||
v-for='keyword in pkg.keywords'
|
||||
:key='keyword'
|
||||
class='badge rounded-pill text-bg-primary text-uppercase fw-semibold'
|
||||
v-text='keyword'
|
||||
/>
|
||||
</div>
|
||||
<Keywords :keywords='pkg.keywords' />
|
||||
<p
|
||||
v-else
|
||||
v-if='!pkg.keywords || !pkg.keywords.length'
|
||||
class='text-white-50 mb-0'
|
||||
>
|
||||
No hashtags provided
|
||||
@@ -174,6 +164,7 @@ import { useRouter, useRoute } from 'vue-router';
|
||||
import type { Profile, Server, Package, Feature } from '../../../../src/types.ts';
|
||||
import { server, stdurl, std } from '../../../std.ts';
|
||||
import Share from '../util/Share.vue';
|
||||
import Keywords from '../util/Keywords.vue';
|
||||
import timeDiff from '../../../timediff.ts';
|
||||
import {
|
||||
TablerAlert,
|
||||
|
||||
@@ -82,25 +82,11 @@
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Keywords
|
||||
:keywords='pkg.keywords.filter((k) => k && k.trim() !== "missionpackage")'
|
||||
/>
|
||||
<div
|
||||
v-if='
|
||||
pkg.keywords
|
||||
.filter((k) => k && k.trim() !== "missionpackage")
|
||||
.length > 0'
|
||||
class='d-flex flex-wrap align-items-center gap-2'
|
||||
>
|
||||
<template
|
||||
v-for='keyword in pkg.keywords'
|
||||
:key='keyword'
|
||||
>
|
||||
<span
|
||||
class='badge rounded-pill text-bg-info text-uppercase small fw-semibold'
|
||||
v-text='keyword'
|
||||
/>
|
||||
</template>
|
||||
</div>
|
||||
<div
|
||||
v-else
|
||||
v-if='!pkg.keywords.filter((k) => k && k.trim() !== "missionpackage").length'
|
||||
class='text-secondary small'
|
||||
>
|
||||
No keywords
|
||||
@@ -124,6 +110,7 @@ import type { PackageList } from '../../../../src/types.ts';
|
||||
import { ref, watch, onMounted } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import MenuTemplate from '../util/MenuTemplate.vue';
|
||||
import Keywords from '../util/Keywords.vue';
|
||||
import { server } from '../../../std.ts';
|
||||
|
||||
import {
|
||||
|
||||
@@ -77,19 +77,9 @@
|
||||
</div>
|
||||
<div class='col-12'>
|
||||
<small class='text-uppercase text-white-50 d-block mb-2'>Keywords</small>
|
||||
<div
|
||||
v-if='props.subscription.meta.keywords.length'
|
||||
class='d-flex flex-wrap gap-2'
|
||||
>
|
||||
<span
|
||||
v-for='keyword of props.subscription.meta.keywords'
|
||||
:key='String(keyword)'
|
||||
class='badge rounded-pill text-bg-primary text-uppercase fw-semibold'
|
||||
v-text='keyword'
|
||||
/>
|
||||
</div>
|
||||
<Keywords :keywords='props.subscription.meta.keywords' />
|
||||
<p
|
||||
v-else
|
||||
v-if='!props.subscription.meta.keywords.length'
|
||||
class='text-white-50 mb-0'
|
||||
>
|
||||
None
|
||||
@@ -228,6 +218,7 @@ import { ref, onMounted, computed } from 'vue';
|
||||
import type { MissionSubscriptions } from '../../../../types.ts';
|
||||
import { stdurl } from '../../../../std.ts'
|
||||
import Subscription from '../../../../base/subscription.ts';
|
||||
import Keywords from '../../util/Keywords.vue';
|
||||
import {
|
||||
IconQrcode,
|
||||
IconBroadcast,
|
||||
|
||||
@@ -67,17 +67,7 @@
|
||||
@delete='deleteLog()'
|
||||
/>
|
||||
|
||||
<div
|
||||
v-if='log.keywords.length'
|
||||
class='d-flex flex-wrap gap-2 mt-1'
|
||||
>
|
||||
<span
|
||||
v-for='keyword in log.keywords'
|
||||
:key='keyword'
|
||||
class='badge text-bg-secondary text-uppercase rounded-pill px-3 py-1 small'
|
||||
v-text='keyword'
|
||||
/>
|
||||
</div>
|
||||
<Keywords :keywords='log.keywords' />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -89,6 +79,7 @@ import { ref, computed } from 'vue';
|
||||
import type { MissionLog } from '../../../../types.ts';
|
||||
import Subscription from '../../../../base/subscription.ts';
|
||||
import CopyField from '../../util/CopyField.vue';
|
||||
import Keywords from '../../util/Keywords.vue';
|
||||
import {
|
||||
TablerLoading,
|
||||
TablerDropdown,
|
||||
|
||||
31
api/web/src/components/CloudTAK/util/Keywords.vue
Normal file
31
api/web/src/components/CloudTAK/util/Keywords.vue
Normal file
@@ -0,0 +1,31 @@
|
||||
<template>
|
||||
<div
|
||||
v-if='keywords && keywords.length'
|
||||
class='d-flex flex-wrap gap-2 mt-1'
|
||||
>
|
||||
<span
|
||||
v-for='keyword in filteredKeywords'
|
||||
:key='keyword'
|
||||
class='badge text-bg-secondary text-uppercase rounded-pill px-3 py-1 small'
|
||||
v-text='keyword'
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
|
||||
const filtered = [
|
||||
'template:'
|
||||
]
|
||||
|
||||
const filteredKeywords = computed(() => {
|
||||
return props.keywords.filter((keyword) => {
|
||||
return filtered.some((filter) => keyword.startsWith(filter)) === false
|
||||
});
|
||||
});
|
||||
|
||||
const props = defineProps<{
|
||||
keywords: string[];
|
||||
}>();
|
||||
</script>
|
||||
Reference in New Issue
Block a user