Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ onMounted(() => {
PageTabs

.p-4#router
router-view
router-view(v-slot="{ Component }")
KeepAlive
component(:is="Component")
Comment on lines +31 to +33
</template>

<style scoped>
Expand Down
6 changes: 5 additions & 1 deletion src/views/AbilitiesView.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup>
import { storeToRefs } from "pinia";
import { reactive, ref, inject, onMounted, computed } from "vue";
import { reactive, ref, inject, onMounted, onActivated, computed } from "vue";
import { useRoute } from "vue-router";
import { useAbilityStore } from "@/stores/abilityStore";
import { getAbilityPlatforms } from "@/utils/abilityUtil.js";
Expand Down Expand Up @@ -39,6 +39,10 @@ onMounted(async () => {
filters.plugin = route.query.plugin || "";
});

onActivated(async () => {
await abilityStore.getAbilities($api);
});
Comment on lines +42 to +44

function clearFilters() {
Object.keys(filters).forEach((k) => filters[k] = "");
}
Expand Down
8 changes: 7 additions & 1 deletion src/views/AdversariesView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { inject, reactive, ref, onMounted, computed } from "vue";
import { inject, reactive, ref, onMounted, onActivated, computed } from "vue";
import { storeToRefs } from "pinia";

import { useAdversaryStore } from "@/stores/adversaryStore";
Expand Down Expand Up @@ -31,6 +31,12 @@ onMounted(async () => {
await objectiveStore.getObjectives($api);
});

onActivated(async () => {
await abilityStore.getAbilities($api);
await adversaryStore.getAdversaries($api);
await objectiveStore.getObjectives($api);
});
Comment on lines +34 to +38

function selectAdversary(adversary) {
selectedAdversary.value = adversary;
adversaryStore.updateSelectedAdversaryAbilities();
Expand Down
13 changes: 10 additions & 3 deletions src/views/AgentsView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { inject, onMounted, onBeforeUnmount, ref } from "vue";
import { inject, onMounted, onActivated, onDeactivated, ref } from "vue";
import { storeToRefs } from "pinia";

import { useAgentStore } from '@/stores/agentStore';
Expand All @@ -26,9 +26,16 @@ onMounted(async () => {
}, 3000);
});

onBeforeUnmount(() => {
onActivated(async () => {
await agentStore.getAgents($api);
agentRefreshInterval.value = setInterval(async () => {
await agentStore.getAgents($api);
}, 3000);
Comment on lines +29 to +33
});

onDeactivated(() => {
clearInterval(agentRefreshInterval.value);
})
});
Comment on lines +36 to +38

function removeDeadAgents() {
agents.value.forEach((agent, index) => {
Expand Down
7 changes: 6 additions & 1 deletion src/views/ContactsView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { inject, onMounted } from "vue";
import { inject, onMounted, onActivated } from "vue";
import { useCoreStore } from "../stores/coreStore";
import { storeToRefs } from "pinia";

Expand All @@ -14,6 +14,11 @@ onMounted(async () => {
await coreStore.getAvailableContacts($api);
});

onActivated(async () => {
await coreStore.getContacts($api);
await coreStore.getAvailableContacts($api);
});
Comment on lines +17 to +20

async function downloadReport(contact) {
await coreStore.downloadContactReport($api, contact);
}
Expand Down
7 changes: 6 additions & 1 deletion src/views/ExfilledFilesView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { reactive, ref, inject, onMounted, watch } from "vue";
import { reactive, ref, inject, onMounted, onActivated, watch } from "vue";
import { storeToRefs } from "pinia";
import { useCoreStore } from "@/stores/coreStore";
import { useOperationStore } from "@/stores/operationStore";
Expand Down Expand Up @@ -29,6 +29,11 @@ onMounted(async () => {
});
});

onActivated(async () => {
await operationStore.getOperations($api);
exfilStore.loadFiles($api, selectedOperationId.value);
});
Comment on lines +32 to +35

function toggleAllFiles() {
if (selectedFiles.value.length < numFiles.value) {
Object.keys(files.value).forEach((agentName) => {
Expand Down
6 changes: 5 additions & 1 deletion src/views/FactSourcesView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { ref, inject, onMounted } from "vue";
import { ref, inject, onMounted, onActivated } from "vue";
import { storeToRefs } from "pinia";

import { useSourceStore } from "@/stores/sourceStore.js";
Expand All @@ -19,6 +19,10 @@ onMounted(() => {
sourceStore.getSources($api);
});

onActivated(() => {
sourceStore.getSources($api);
});
Comment on lines +22 to +24

function saveSource() {
selectedSource.value.name = newSourceName.value;
sourceStore.saveSource($api, selectedSource);
Expand Down
10 changes: 9 additions & 1 deletion src/views/HomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import AdversaryChartStatus from "@/components/adversaries/AdversaryChartStatus.
import CodeEditor from "@/components/core/CodeEditor.vue";
import { useCoreStore } from "@/stores/coreStore";
import { storeToRefs } from "pinia";
import { onMounted, inject } from "vue";
import { onMounted, onActivated, inject } from "vue";

const coreStore = useCoreStore();
const $api = inject("$api");
Expand All @@ -17,6 +17,14 @@ onMounted(async () => {
console.error(error);
}
});

onActivated(async () => {
try {
await coreStore.getMainConfig($api);
} catch (error) {
console.error(error);
}
});
Comment on lines +21 to +27
</script>

<template lang="pug">
Expand Down
6 changes: 5 additions & 1 deletion src/views/ObfuscatorsView.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup>
import { storeToRefs } from "pinia";
import { inject, onMounted } from "vue";
import { inject, onMounted, onActivated } from "vue";
import { useCoreStore } from "../stores/coreStore";

const coreStore = useCoreStore();
Expand All @@ -11,6 +11,10 @@ const $api = inject("$api");
onMounted(async () => {
await coreStore.getObfuscators($api);
});

onActivated(async () => {
await coreStore.getObfuscators($api);
});
Comment on lines +15 to +17
</script>

<template lang="pug">
Expand Down
6 changes: 5 additions & 1 deletion src/views/ObjectivesView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { ref, inject, onMounted } from "vue";
import { ref, inject, onMounted, onActivated } from "vue";
import { storeToRefs } from "pinia";

import { useAdversaryStore } from "@/stores/adversaryStore.js";
Expand All @@ -18,6 +18,10 @@ onMounted(async () => {
await adversaryStore.getObjectives($api);
});

onActivated(async () => {
await adversaryStore.getObjectives($api);
});
Comment on lines +21 to +23

function editNameDesc() {
newObjectiveName.value = selectedObjective.value.name;
newObjectiveDescription.value = selectedObjective.value.description;
Expand Down
12 changes: 10 additions & 2 deletions src/views/OperationsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {
inject,
ref,
onMounted,
onBeforeUnmount,
onActivated,
onDeactivated,
computed,
watch,
reactive,
Expand Down Expand Up @@ -179,7 +180,14 @@ onMounted(async () => {
selectOperation();
});

onBeforeUnmount(() => {
onActivated(async () => {
await operationStore.getOperations($api);
await agentStore.getAgents($api);
agentStore.updateAgentGroups();
selectOperation();
Comment on lines +183 to +187
Comment on lines +183 to +187
});

onDeactivated(() => {
if (updateInterval) clearInterval(updateInterval);
});

Expand Down
6 changes: 5 additions & 1 deletion src/views/PayloadsView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { inject, onMounted, computed } from "vue";
import { inject, onMounted, onActivated, computed } from "vue";
import { storeToRefs } from "pinia";

import { useCoreDisplayStore } from "@/stores/coreDisplayStore";
Expand Down Expand Up @@ -43,6 +43,10 @@ onMounted(async () => {
await abilityStore.getPayloads($api, true, false, true);
});

onActivated(async () => {
await abilityStore.getPayloads($api, true, false, true);
});
Comment on lines +46 to +48

</script>

<template lang="pug">
Expand Down
6 changes: 5 additions & 1 deletion src/views/PlannersView.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup>
import { storeToRefs } from "pinia";
import { inject, onMounted } from "vue";
import { inject, onMounted, onActivated } from "vue";
import { useCoreStore } from "../stores/coreStore";

const coreStore = useCoreStore();
Expand All @@ -11,6 +11,10 @@ const $api = inject("$api");
onMounted(async () => {
await coreStore.getPlanners($api);
});

onActivated(async () => {
await coreStore.getPlanners($api);
});
Comment on lines +15 to +17
</script>

<template lang="pug">
Expand Down
8 changes: 7 additions & 1 deletion src/views/SchedulesView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { computed, inject, onMounted } from 'vue';
import { computed, inject, onMounted, onActivated } from 'vue';
import { storeToRefs } from "pinia";

import CreateScheduleModal from "@/components/schedules/CreateScheduleModal.vue";
Expand Down Expand Up @@ -32,6 +32,12 @@ onMounted(async () => {
await agentStore.getAgents($api);
agentStore.updateAgentGroups();
});

onActivated(async () => {
await scheduleStore.getSchedules($api);
await agentStore.getAgents($api);
agentStore.updateAgentGroups();
});
Comment on lines +36 to +40
</script>

<template lang="pug">
Expand Down
6 changes: 5 additions & 1 deletion src/views/SettingsView.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup>
import { storeToRefs } from "pinia";
import { ref, inject, onMounted, computed, watch } from "vue";
import { ref, inject, onMounted, onActivated, computed, watch } from "vue";
import { useCoreStore } from "../stores/coreStore";

const coreStore = useCoreStore();
Expand All @@ -20,6 +20,10 @@ onMounted(async () => {
await coreStore.getMainConfig($api);
});

onActivated(async () => {
await coreStore.getMainConfig($api);
});
Comment on lines +23 to +25

function isSettingChanged(setting) {
return settings.value[setting] === mainConfig.value[setting];
}
Expand Down
Loading