Skip to content

Commit

Permalink
allow finding www subdomains and make ui for adding domains more cons…
Browse files Browse the repository at this point in the history
…istent
  • Loading branch information
stitch committed Dec 11, 2024
1 parent 5923619 commit f20bece
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 16 deletions.
6 changes: 3 additions & 3 deletions src/components/domains/UrlList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ h2 {
<b-button variant="success" @click="visible.discover_subdomains = true" v-if="store.config.app.subdomain_suggestion.enabled" size="sm">🌪️️ {{ $t("domain.urllist.button.discover_subdomains") }}</b-button> &nbsp;
<b-button variant="success" @click="visible.upload = true" size="sm">⬆️ {{ $t("domain.urllist.button.upload") }}</b-button> &nbsp;
<!-- <button class="border-success" @click="get_urls()">⬆️ {{ $t("button.reload") }}</button> -->
<SubdomainDiscovery v-if="urls.length" :list_id="list.id" @finished="get_urls"/>
<WwwDiscovery v-if="urls.length" :list_id="list.id" @finished="get_urls"/>
</div>

<template v-if="urls.length">
Expand Down Expand Up @@ -121,13 +121,13 @@ import DomainTable from "@/components/domains/DomainTable.vue";
import autorefresh from '@/components/autorefresh.vue'
import Probe from '@/components/probe.vue'
import DiscoverSubdomains from "@/components/domains/list/DiscoverSubdomainsModal.vue";
import SubdomainDiscovery from "@/components/domains/list/WwwDiscovery.vue";
import WwwDiscovery from "@/components/domains/list/WwwDiscovery.vue";

import { dashboardStore } from '@/dashboardStore'

export default {
components: {
SubdomainDiscovery,
WwwDiscovery,
DiscoverSubdomains,

DomainTable,
Expand Down
8 changes: 4 additions & 4 deletions src/components/domains/list/AddDomainsModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,19 @@
</div>
</template>
<template #footer>
<b-button variant="secondary" @click="stop()">{{ $t("domain.list.add-domains.cancel") }}</b-button>
&nbsp;
<template v-if="!loading">
<b-button variant="warning" @click="bulk_add_new()" :disabled="too_many_new_domains">
<b-button variant="success" @click="bulk_add_new()" :disabled="too_many_new_domains">
{{ $t("domain.list.add-domains.ok") }}
</b-button>
</template>
<template v-else>
<b-button variant="warning" disabled="disabled">
<b-button variant="success" disabled="disabled">
<probe/>
{{ $t("domain.list.add-domains.loading") }}
</b-button>
</template>
&nbsp;
<b-button variant="warning" @click="stop()">{{ $t("domain.list.add-domains.cancel") }}</b-button>
</template>
</b-modal>
</template>
Expand Down
17 changes: 13 additions & 4 deletions src/components/domains/list/WwwDiscovery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
🔎 {{ $t("domain.www-discovery.scanning-done-click-reload") }}
</b-button>

<b-button variant="success" size="sm" v-if="!success_while_visible" v-b-modal="`subdomain_discovery_modal_${list_id}`" :disabled="loading" @click="visible=true;">
<b-button variant="success" size="sm" v-if="!success_while_visible" v-b-modal="`subdomain_discovery_modal_${list_id}`" :disabled="loading" @click="make_visible()">
🔎 {{ $t("domain.www-discovery.find-www-subdomains") }}
<span v-if="state_changed_on">{{ $t("domain.www-discovery.last-scan-finished") }}</span></b-button>
</template>
Expand All @@ -17,7 +17,8 @@
{{ $t("domain.www-discovery.finding-www-subdomains") }}
</b-button>
</template>
<subdomain-discovery-modal :id="`subdomain_discovery_modal_${list_id}`" @ok="request(); visible=false;" @cancel="visible=false;" v-model="visible" :show="visible" />

<subdomain-discovery-modal :id="`subdomain_discovery_modal_${list_id}`" v-if="modal_visible" @close="modal_visible=false" @ok="request(); modal_visible=false"/>
</span>
</template>

Expand Down Expand Up @@ -45,7 +46,7 @@ export default {
domains_discovered: {},
success_while_visible: false,
visible: false,
modal_visible: false,
}
},
beforeDestroy() {
Expand All @@ -56,13 +57,20 @@ export default {
},
mounted() {
// todo: recheck every minute or so until the state is finished|error|cancelled
// note: do not automatically reload lists as a side effect, might be annoying when someones edits just disappear.
// note: do not automatically reload lists as a aside effect, might be annoying when someones edits just disappear.
this.status()
},
computed: {
is_scanning() {return ['requested', 'scanning'].includes(this.state)}
},
methods: {
make_visible() {
this.modal_visible = true;
this.modal_visible = true;
this.modal_visible = true;
this.modal_visible_2 = "true";
console.log('show modal');
},
reset() {
this.state = 'finished';
this.state_message = '';
Expand All @@ -85,6 +93,7 @@ export default {
this.reset()
this.status()
this.visible = true;
console.log('tada')
},
status() {
this.loading = true;
Expand Down
10 changes: 5 additions & 5 deletions src/components/domains/list/WwwDiscoveryModal.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<!-- SPDX-License-Identifier: Apache-2.0 -->
<template>
<b-modal :id="id" @ok="$emit('ok')" header-bg-variant="info" header-text-variant="light" no-fade scrollable size="lg">
<b-modal :id="id" @ok="$emit('ok')" @close="$emit('close')" header-bg-variant="info" header-text-variant="light" no-fade scrollable size="lg">

<template #header><h4>{{ $t("domain.www-discovery-modal.title") }}</h4></template>
<template #default>
<p>{{ $t("domain.www-discovery-modal.message") }}</p>
</template>
<template #footer>
<b-button variant="secondary" @click="$emit('close');">{{ $t("domain.www-discovery-modal.cancel") }}</b-button>
&nbsp;
<b-button variant="warning" @click="$emit('ok')">{{ $t("domain.www-discovery-modal.ok") }}</b-button>
<b-button variant="success" @click="$emit('ok')">{{ $t("domain.www-discovery-modal.ok") }}</b-button>
</template>
</b-modal>
</template>
<script>

export default {
name: "SubdomainDiscoveryModal",
name: "WwwDiscoveryModal",
props: {
id: {type: String},
visible: {type: Boolean, default: false}
id: {type: String}
}
}
</script>

0 comments on commit f20bece

Please sign in to comment.