-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #213 from ninoseki/renew-frontend
refactor: renew frontend
- Loading branch information
Showing
31 changed files
with
1,218 additions
and
1,092 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,14 @@ | ||
<template> | ||
<div id="app"> | ||
<Navbar></Navbar> | ||
<section class="section is-medium"> | ||
<div class="container"> | ||
<h2 class="subtitle">URL fingerprinting made easy.</h2> | ||
<Calculator></Calculator> | ||
</div> | ||
</section> | ||
</div> | ||
<Navbar /> | ||
<section class="section is-medium"> | ||
<div class="container"> | ||
<h2 class="subtitle">URL fingerprinting made easy.</h2> | ||
<Calculator /> | ||
</div> | ||
</section> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from "vue" | ||
import Calculator from "@/components/Calculator.vue" | ||
import Navbar from "@/components/Navbar.vue" | ||
export default defineComponent({ | ||
name: "App", | ||
components: { | ||
Navbar, | ||
Calculator | ||
} | ||
}) | ||
<script setup lang="ts"> | ||
import Calculator from "@/components/CalculatorItem.vue" | ||
import Navbar from "@/components/NavbarItem.vue" | ||
</script> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<script setup lang="ts"> | ||
import { ref } from "vue" | ||
import { useAsyncTask } from "vue-concurrency" | ||
import { API } from "@/api" | ||
import ErrorMessage from "@/components/ErrorMessage.vue" | ||
import FingerprintComponent from "@/components/Fingerprint.vue" | ||
import Loading from "@/components/LoadingItem.vue" | ||
import BinaryEdge from "@/components/services/BinaryEdgeItem.vue" | ||
import Censys from "@/components/services/CensysItem.vue" | ||
import Fofa from "@/components/services/FofaItem.vue" | ||
import Onyphe from "@/components/services/OnypheItem.vue" | ||
import SecurityTrails from "@/components/services/SecurityTrailsItem.vue" | ||
import Shodan from "@/components/services/ShodanItem.vue" | ||
import SpyOnWeb from "@/components/services/SpyOnWebItem.vue" | ||
import Urlscan from "@/components/services/UrlscanItem.vue" | ||
import VirusTotal from "@/components/services/VirusTotalItem.vue" | ||
import ZoomEye from "@/components/services/ZoomEyeItem.vue" | ||
import type { Fingerprint } from "@/types" | ||
const url = ref<string>("https://example.com") | ||
const calculateTask = useAsyncTask<Fingerprint, []>(async () => { | ||
return await API.calculateFingerprint(url.value || "") | ||
}) | ||
const calculate = async () => { | ||
if (!url.value) { | ||
return | ||
} | ||
await calculateTask.perform() | ||
} | ||
</script> | ||
|
||
<template> | ||
<div class="field"> | ||
<div class="control is-clearfix"> | ||
<input | ||
type="url" | ||
autocomplete="on" | ||
class="input" | ||
placeholder="http://example.com" | ||
v-model="url" | ||
/> | ||
</div> | ||
</div> | ||
<div class="block has-text-centered"> | ||
<button type="button" class="button is-light" @click="calculate"> | ||
<span>Calculate</span> | ||
</button> | ||
</div> | ||
<Loading v-if="calculateTask.isRunning" /> | ||
<ErrorMessage :error="calculateTask.last?.error" v-if="calculateTask.isError" /> | ||
<div v-if="calculateTask.last?.value"> | ||
<FingerprintComponent :fingerprint="calculateTask.last.value" /> | ||
<hr /> | ||
<BinaryEdge :fingerprint="calculateTask.last.value" /> | ||
<Censys :fingerprint="calculateTask.last.value" /> | ||
<Fofa :fingerprint="calculateTask.last.value" /> | ||
<Onyphe :fingerprint="calculateTask.last.value" /> | ||
<SecurityTrails :fingerprint="calculateTask.last.value" /> | ||
<Shodan :fingerprint="calculateTask.last.value" /> | ||
<SpyOnWeb :fingerprint="calculateTask.last.value" /> | ||
<Urlscan :fingerprint="calculateTask.last.value" /> | ||
<VirusTotal :fingerprint="calculateTask.last.value" /> | ||
<ZoomEye :fingerprint="calculateTask.last.value" /> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,35 @@ | ||
<template> | ||
<article class="message is-warning"> | ||
<div class="message-header"> | ||
<p>Warning</p> | ||
</div> | ||
<div class="message-body"> | ||
<div v-if="error?.detail"> | ||
<VueJsonPretty :data="anyError"></VueJsonPretty> | ||
</div> | ||
<div v-else>Something went wrong...</div> | ||
</div> | ||
</article> | ||
</template> | ||
|
||
<script lang="ts"> | ||
<script setup lang="ts"> | ||
import "vue-json-pretty/lib/styles.css" | ||
import { computed, defineComponent, type PropType } from "vue" | ||
import { AxiosError } from "axios" | ||
import { computed } from "vue" | ||
import VueJsonPretty from "vue-json-pretty" | ||
import type { ErrorData } from "@/types" | ||
import type { ErrorDataType } from "@/types" | ||
const props = defineProps({ | ||
error: { | ||
type: AxiosError, | ||
required: true | ||
} | ||
}) | ||
export default defineComponent({ | ||
name: "ErrorMessage", | ||
props: { | ||
error: { | ||
type: Object as PropType<ErrorData>, | ||
required: false | ||
} | ||
}, | ||
components: { VueJsonPretty }, | ||
setup(props) { | ||
const anyError = computed(() => { | ||
return props.error as any | ||
}) | ||
return { anyError } | ||
const data = computed<ErrorDataType | undefined>(() => { | ||
if (props.error.response) { | ||
return props.error.response?.data as ErrorDataType | ||
} | ||
return undefined | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div class="notification is-danger is-light"> | ||
<div v-if="data?.detail"> | ||
<div v-if="typeof data.detail === 'string'"> | ||
{{ data.detail }} | ||
</div> | ||
<VueJsonPretty :data="data.detail" v-else /> | ||
</div> | ||
<p v-else>{{ error }}</p> | ||
</div> | ||
</template> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<template> | ||
<div class="has-text-centered"> | ||
<div class="fa-3x"> | ||
<font-awesome-icon icon="spinner" spin></font-awesome-icon> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"></script> |
Oops, something went wrong.