diff --git a/Tailwind/dist/output.css b/Tailwind/dist/output.css index c6a540a49b68aac248bf2f0480148c44a9f6ce80..64f659e2d44636c881243b8fb9b11b22b9d88658 100644 --- a/Tailwind/dist/output.css +++ b/Tailwind/dist/output.css @@ -564,6 +564,10 @@ Ensure the default browser behavior of the `hidden` attribute. margin-left: 0.75rem; } +.box-border { + box-sizing: border-box; +} + .block { display: block; } @@ -592,6 +596,10 @@ Ensure the default browser behavior of the `hidden` attribute. height: 3rem; } +.h-8 { + height: 2rem; +} + .w-full { width: 100%; } diff --git a/Tailwind/html/pages/index.html b/Tailwind/html/pages/index.html index 7211fea3bad3ad8c5a037e3469ed90f92908a9e2..53834634396102610359eda0ac8d6e160faf4367 100644 --- a/Tailwind/html/pages/index.html +++ b/Tailwind/html/pages/index.html @@ -28,11 +28,30 @@ </div> <div class = "container w-full mt-1.5 mb-3 sm:pl-36 sm:pr-36 flex justify-center overflow-hidden"> - <a href="./undersok"> + <a href="/undersok"> <button class="bg-orange-500 p-2 rounded justify-center">Undersøk</button> </a> + +<!-- TODO: Decide on keeping current implementation of submitting a link, og implement new below here, from last push. + Form input for retrieving search request (domain, url or filehash) + <form class="bg-gray-200 w-full grid place-items-center"> + + <div class = "bg-green-300 container w-full mt-3 mb-1.5 pl-2 pr-2 sm:pl-36 sm:pr-36 overflow-hidden"> + <label for="inputText">Input url, filehash or domain:</label> + <input class="w-full rounded h-8 box-border p-2 m-0" + placeholder="https://www.ntnu.no" + type="text" name="inputText" id="inputText"> + </div> + + <div class = "bg-green-300 container w-full mt-1.5 mb-3 sm:pl-36 sm:pr-36 flex justify-center overflow-hidden"> + <a href="./investigate"> + <button class="bg-orange-500 p-2 rounded justify-center" type="submit">Investigate</button> +>>>>>>> b0fd00433d7850c57e2a671a259721d4edcfc6ed + </a> </div> + </form> --> + </div> </body> diff --git a/consts/structs.go b/consts/structs.go index 90a93adc581474667f6ff02feb0826fe309fac42..93a6bd7439bde8bb549f6031910da1413aacf36a 100644 --- a/consts/structs.go +++ b/consts/structs.go @@ -8,23 +8,20 @@ type fileData struct { } type reputationDomain struct { - domain string - isGood bool - threatScore int + domain string + isGood bool + threatScore int } -type reputationUrl struct { - url string - isGood bool +type ReputationUrl struct { + url string + isGood bool threatScore int - } -type fileHashReputation struct{ +type fileHashReputation struct { filehash string filename string fileType string fileSize string } - - diff --git a/main.go b/main.go index 9d15e0a70876953bf1c56de8f4f0c7136de0e661..18dfcb2836c7fb45ec368008587f2e8cdfa771c8 100644 --- a/main.go +++ b/main.go @@ -1,10 +1,10 @@ package main import ( + "fmt" "log" "net/http" - //"net/http" "github.com/gin-gonic/gin" ) @@ -24,6 +24,12 @@ func main() { r.Static("/img", "./Tailwind/img") r.GET("/", func(c *gin.Context) { + fmt.Print("The input text is: ") + + // All parameters in the url can be retrieved with the c.Request.Url.Query() command + // Returns a map of all the items, can be used for parsing several values / put into a struct? + fmt.Println(c.Request.URL.Query()["inputText"]) + c.HTML(http.StatusOK, "index.html", gin.H{ "isSelected": true, }) diff --git a/searchReputation/searchPublicSources.go b/searchReputation/searchPublicSources.go new file mode 100644 index 0000000000000000000000000000000000000000..3901b253b8f0c9798c2bf0d6e8f9ba50aaac94e7 --- /dev/null +++ b/searchReputation/searchPublicSources.go @@ -0,0 +1,2 @@ +package searchreputation +