Skip to content

Commit

Permalink
Merge pull request #42 from mitre/magma
Browse files Browse the repository at this point in the history
Update to Vue
  • Loading branch information
elegantmoose authored Feb 13, 2024
2 parents c07538e + 299ce77 commit 4f489bb
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 49 deletions.
4 changes: 0 additions & 4 deletions app/atomic_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,3 @@ def __init__(self, services, name, description):
self.data_svc = services.get('data_svc')

self.log = logging.getLogger('atomic_gui')

@template('atomic.html')
async def splash(self, request):
return dict()
37 changes: 37 additions & 0 deletions gui/views/atomic.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<script setup>
import { inject, onMounted, computed } from "vue";
import { storeToRefs } from "pinia";
import { useAbilityStore } from '@/stores/abilityStore.js';
import { useAdversaryStore } from '@/stores/adversaryStore.js';
const $api = inject("$api");
const abilityStore = useAbilityStore();
const { abilities } = storeToRefs(abilityStore);
const adversaryStore = useAdversaryStore();
const { adversaries } = storeToRefs(adversaryStore);
onMounted(async () => {
await abilityStore.getAbilities($api);
await adversaryStore.getAdversaries($api);
});
const atomicAbilities = computed(() => abilities.value.filter((ability) => ability.plugin === "atomic"));
</script>

<template lang="pug">
.content
h2 Atomic
p The collection of abilities in the Red Canary Atomic test project.
hr

.is-flex.is-align-items-center.is-justify-content-center
.card.is-flex.is-flex-direction-column.is-align-items-center.p-4.m-4
h1.is-size-1.mb-0 {{ atomicAbilities.length || "---" }}
p abilities
router-link.button.is-primary.mt-4(to="/abilities?plugin=atomic")
span View Abilities
span.icon
font-awesome-icon(icon="fas fa-angle-right")

</template>
1 change: 0 additions & 1 deletion hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
async def enable(services):
atomic_gui = AtomicGUI(services, name, description)
app = services.get('app_svc').application
app.router.add_route('GET', '/plugin/atomic/gui', atomic_gui.splash)

# we only ingest data once, and save new abilities in the data/ folder of the plugin
if "abilities" not in os.listdir(data_dir):
Expand Down
44 changes: 0 additions & 44 deletions templates/atomic.html

This file was deleted.

0 comments on commit 4f489bb

Please sign in to comment.