Skip to content

Commit

Permalink
feat: show not default args
Browse files Browse the repository at this point in the history
  • Loading branch information
popstas committed Dec 28, 2020
1 parent a83e3bc commit 17e4441
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
8 changes: 7 additions & 1 deletion components/Panel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<template slot="title">
<i v-if="icon" :class="icon"></i>
<span class="panel__title" v-html="title"></span>
<span v-if="subtitle" class="panel__subtitle" v-html="subtitle"></span>
</template>
<slot></slot>
</el-collapse-item>
Expand All @@ -16,13 +17,18 @@
.panel__title {
margin-left: 10px;
}
.panel__subtitle {
margin-left: 10px;
font-weight: normal;
color: #999;
}
}
</style>

<script>
export default {
components: {},
props: ["icon", "title", "name"],
props: ["icon", "title", "subtitle", "name"],
computed: {},
methods: {},
};
Expand Down
24 changes: 14 additions & 10 deletions pages/scan.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@

<el-form class="scan__form-settings">
<el-collapse v-model="openedPanels" class="panels">
<Panel
name="settings"
title="Settings"
icon="el-icon-setting"
>
<Panel name="settings" icon="el-icon-setting" title="Settings" :subtitle="argsWithoutDefault" >
<el-form-item label="Preset">
<el-select v-model="form.preset">
<el-option
Expand Down Expand Up @@ -145,6 +141,10 @@
}
}
.scan__args {
font-weight: normal;
}
.scan__log {
font-family: monospace;
background: #2d2d2d;
Expand Down Expand Up @@ -205,10 +205,10 @@ const controlsMap = {
arg: '--preset',
},
depth: {
arg: '-d'
arg: '--max-depth'
},
maxRequests: {
arg: '-m'
arg: '--max-requests'
},
ignoreRobotsTxt: {
arg: '--ignore-robots-txt',
Expand Down Expand Up @@ -274,6 +274,7 @@ export default {
this.$store.commit('urls', val);
}
},
args: {
get() {
return this.$store.state.args;
Expand All @@ -282,6 +283,10 @@ export default {
this.$store.commit('args', val);
}
},
argsWithoutDefault() {
return this.buildArgs(false);
},
serverUrl: {
get() {
return this.$store.state.serverUrl;
Expand Down Expand Up @@ -317,7 +322,7 @@ export default {
const parts = [];
if (days) parts.push(`${days}d`);
if (hours) parts.push(`${hours}h`);
if (hours || days) parts.push(`${hours}h`);
parts.push(`${mins}m`);
return parts.join(' ');
},
Expand Down Expand Up @@ -354,8 +359,7 @@ export default {
if (this.url) query.url = this.url;
}
const args = this.buildArgs(false);
if (args) query.args = args;
if (this.argsWithoutDefault) query.args = this.argsWithoutDefault;
// console.log('route scan: updateUrlQuery:', query);
if (push) this.$router.push({ query });
Expand Down

0 comments on commit 17e4441

Please sign in to comment.