Skip to content

Commit

Permalink
#22 #23 Open static analysis menu by default , Dynamic Analysis in …
Browse files Browse the repository at this point in the history
…a line (font size), Trid
  • Loading branch information
yassinrais committed Jan 15, 2022
1 parent aa70a0f commit 8a4bba1
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/common/components/elements/ActivityBlock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export default {
}
.header {
@apply flex flex-wrap w-full justify-between flex-grow border-none;
@apply flex flex-col items-center w-full justify-between flex-grow border-none;
}
> * {
Expand All @@ -251,7 +251,7 @@ export default {
}
.tags {
@apply mt-8 mx-0 px-0 lg:px-4 w-full;
@apply mt-8 ml-4 mx-0 px-0 lg:px-4 w-full;
.list li {
@apply flex py-1 px-2 bg-blue-500 m-1 rounded text-light;
Expand Down
2 changes: 1 addition & 1 deletion src/common/components/elements/Card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default {

<style lang="scss" scoped>
.card {
@apply bg-light p-5 xl:p-6 md:rounded-lg shadow-sm content-center items-center;
@apply bg-light p-4 xl:p-6 md:rounded-lg shadow-sm content-center items-center;
.title {
@apply text-2xl xl:text-3xl mb-4;
Expand Down
23 changes: 19 additions & 4 deletions src/common/components/partials/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@
</li>

<li :class="isPageActive('static-analysis') ? 'active' : ''">
<router-link :to="getPageLink('static-analysis')">
<router-link
:to="getPageLink('static-analysis')"
v-on:click="toggleMenu('static-analysis')"
>
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-6 w-6 ml-2"
Expand All @@ -70,7 +73,7 @@

<ul
class="sub-items"
:class="isPageActive('static-analysis') ? '' : 'hide'"
:class="isMenuOpen('static-analysis') ? '' : 'hide'"
>
<li :class="isPageActive('static-analysis/pe') ? 'active' : ''">
<router-link :to="getPageLink('static-analysis/pe')">
Expand Down Expand Up @@ -181,6 +184,9 @@ export default {
data: () => ({
file: null,
hash: null,
menuOpen: {
"static-analysis": true,
},
}),
computed: {
...scanGetters,
Expand All @@ -190,8 +196,17 @@ export default {
return `/file/${this.hash}/${to}`;
},
isPageActive(to) {
let pageActive = this.$route.fullPath.indexOf(this.getPageLink(to));
return pageActive >= 0;
let pageActive = this.$route.fullPath.indexOf(this.getPageLink(to)) != -1;
return pageActive;
},
toggleMenu(to) {
if (this.menuOpen[to] !== undefined) {
this.menuOpen[to] = !this.isPageActive(to) ? true : !this.menuOpen[to];
}
},
isMenuOpen(to) {
return this.menuOpen[to] === true;
},
},
async beforeMount() {
Expand Down
2 changes: 1 addition & 1 deletion src/common/components/tables/TableCols.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ table {
td,
th {
@apply px-3 py-3;
@apply px-3 py-2 text-sm xl:text-base;
}
td:nth-child(2n) {
@apply text-gray font-normal;
Expand Down
31 changes: 23 additions & 8 deletions src/modules/scan/pages/Summary.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="summary">
<div class="summary space-y-2">
<template v-if="isFileLoaded">
<Card>
<Progress
Expand Down Expand Up @@ -108,13 +108,28 @@ export default {
};
});
data.push({
title: "Packer",
value: (() => {
this.allowHtmlFields.properties.push(`${data.length}-value`);
return (items.Packer || []).join("<br>");
})(),
});
data = [
...data,
...Object.keys(items)
.filter(
(key) =>
items[key] instanceof Array &&
items[key].reduce(
(isSimpleArray, item) =>
isSimpleArray && ["string", "number"].includes(typeof item),
true
)
)
.map((key, index) => {
this.allowHtmlFields.properties.push(
`${data.length + index}-value`
);
return {
title: translateKey(key),
value: items[key].join("<br />"),
};
}),
];
data.push({
title: "Tags",
Expand Down

0 comments on commit 8a4bba1

Please sign in to comment.