Skip to content

Commit

Permalink
Add Mission Changes API
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Mar 6, 2024
1 parent 42d98a5 commit 1e4c645
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 12 deletions.
1 change: 0 additions & 1 deletion api/lib/api/mission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ export default class {
}, opts?: Static<typeof MissionOptions>): Promise<Static<typeof Mission>> {
name = name.trim();
const url = new URL(`/Marti/api/missions/${this.#encodeName(name)}`, this.api.url);
console.error(url)

for (const q in query) url.searchParams.append(q, String(query[q]));

Expand Down
25 changes: 15 additions & 10 deletions api/test/fixtures/get_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,16 @@
"query": true,
"res": true
},
"POST /login": {
"body": true,
"query": false,
"res": true
},
"GET /login": {
"body": false,
"query": false,
"res": true
},
"GET /iconset": {
"body": false,
"query": true,
Expand Down Expand Up @@ -429,16 +439,6 @@
"query": true,
"res": false
},
"POST /login": {
"body": true,
"query": false,
"res": true
},
"GET /login": {
"body": false,
"query": false,
"res": true
},
"DELETE /marti/api/files/:hash": {
"body": false,
"query": true,
Expand Down Expand Up @@ -624,6 +624,11 @@
"query": false,
"res": true
},
"DELETE /task/:task/version/:version": {
"body": false,
"query": false,
"res": true
},
"GET /layer/:layerid/task": {
"body": false,
"query": false,
Expand Down
42 changes: 41 additions & 1 deletion api/web/src/components/CloudTAK/Mission/Mission.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
"bg-blue-lt": mode === "users",
"cursor-pointer": mode !== "users"
}'><IconUsers v-tooltip='"Users"'/></div>
<div @click='mode = "timeline"' class='px-2 py-2' :class='{
"bg-blue-lt": mode === "timeline",
"cursor-pointer": mode !== "timeline"
}'><IconTimeline v-tooltip='"Timeline"'/></div>
<div @click='mode = "logs"' class='px-2 py-2' :class='{
"bg-blue-lt": mode === "logs",
"cursor-pointer": mode !== "logs"
Expand Down Expand Up @@ -151,6 +155,32 @@
</div>
</template>
</template>
<template v-else-if='mode === "timeline"'>
<TablerNone v-if='!mission.missionChanges.length' :create='false'/>
<div v-else class='rows overflow-auto' style='height: 50vh;'>
<div :key='change' v-for='change in mission.missionChanges' class='col-12 hover-dark px-2 py-1'>
<template v-if='change.type === "CREATE_MISSION"'>
<IconVolcano/><span class='mx-2' v-text='`Mission Created: ${change.missionName}`'/>
</template>
<template v-else-if='change.type === "ADD_CONTENT" && change.contentResource'>
<IconFile/><span class='mx-2' v-text='change.contentResource.name'/>
</template>
<template v-else-if='change.type === "ADD_CONTENT" && change.details'>
<IconPolygon/><span class='mx-2' v-text='`${change.details.callsign} (${change.details.type})`'/>
</template>
<template v-else-if='change.type === "REMOVE_CONTENT" && change.contentResource'>
<IconFileX/><span class='mx-2' v-text='change.contentResource.name'/>
</template>
<template v-else>
<span v-text='change'/>
</template>
<div class='col-12 d-flex'>
<label class='subheader' v-text='change.type'/>
<label class='subheader ms-auto' v-text='change.timestamp'/>
</div>
</div>
</div>
</template>
<template v-else-if='mode === "logs"'>
<TablerLoading v-if='loading.logs'/>
<template v-else-if='createLog !== false'>
Expand Down Expand Up @@ -189,9 +219,14 @@
<script>
import {
IconPlus,
IconVolcano,
IconFileX,
IconArticle,
IconTimeline,
IconDownload,
IconFiles,
IconFile,
IconPolygon,
IconLock,
IconInfoSquare,
IconUser,
Expand Down Expand Up @@ -391,18 +426,23 @@ export default {
TablerDelete,
TablerToggle,
TablerInput,
IconVolcano,
IconPlus,
IconArticle,
IconDownload,
IconFiles,
IconFile,
IconPolygon,
IconInfoSquare,
IconUser,
IconUsers,
IconPencil,
IconTrash,
IconRefresh,
IconLock,
IconLockOpen
IconFileX,
IconLockOpen,
IconTimeline
}
}
</script>

0 comments on commit 1e4c645

Please sign in to comment.