From a4e939fe0bae7a0ec67cef69aa6c170da0b65d7c Mon Sep 17 00:00:00 2001
From: am9zZWY <46693545+am9zZWY@users.noreply.github.com>
Date: Wed, 10 Jul 2024 16:42:55 +0200
Subject: [PATCH] Rewrite search engine interface
---
client/src/App.vue | 33 +++++++++++-----
client/src/components/SearchBox.vue | 26 -------------
client/src/router/index.ts | 10 ++---
client/src/stores/search.ts | 9 +++--
client/src/views/HomeView.vue | 21 ----------
client/src/views/Search.vue | 59 +++++++++++++++++++++++++++++
client/src/views/index.vue | 17 ---------
client/src/views/results.vue | 34 -----------------
8 files changed, 94 insertions(+), 115 deletions(-)
delete mode 100644 client/src/components/SearchBox.vue
delete mode 100644 client/src/views/HomeView.vue
create mode 100644 client/src/views/Search.vue
delete mode 100644 client/src/views/index.vue
delete mode 100644 client/src/views/results.vue
diff --git a/client/src/App.vue b/client/src/App.vue
index b5722db..f5300d3 100644
--- a/client/src/App.vue
+++ b/client/src/App.vue
@@ -1,15 +1,30 @@
-
-
-
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+
+
+
+
-
-
diff --git a/client/src/components/SearchBox.vue b/client/src/components/SearchBox.vue
deleted file mode 100644
index cf0d73a..0000000
--- a/client/src/components/SearchBox.vue
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
diff --git a/client/src/router/index.ts b/client/src/router/index.ts
index e58491f..751ae1b 100644
--- a/client/src/router/index.ts
+++ b/client/src/router/index.ts
@@ -1,13 +1,13 @@
-import { createRouter, createWebHistory } from 'vue-router'
-import HomeView from '../views/HomeView.vue'
+import { createRouter, createWebHashHistory } from 'vue-router'
+import Search from '../views/Search.vue'
const router = createRouter({
- history: createWebHistory(import.meta.env.BASE_URL),
+ history: createWebHashHistory(import.meta.env.BASE_URL),
routes: [
{
path: '/',
- name: 'home',
- component: HomeView
+ name: 'search',
+ component: Search
}
]
})
diff --git a/client/src/stores/search.ts b/client/src/stores/search.ts
index d8424ee..7f26a4e 100644
--- a/client/src/stores/search.ts
+++ b/client/src/stores/search.ts
@@ -6,18 +6,21 @@ export interface SearchResult {
title: string
url: string
description: string
+ summary: string
}
const dummyResults: SearchResult[] = [
{
title: 'Dummy result',
url: 'https://example.com',
- description: 'This is a dummy result'
+ description: 'This is a dummy result',
+ summary: 'This is a dummy summary'
},
{
title: 'Another dummy result',
- url: 'https://example.com',
- description: 'This is another dummy result'
+ url: 'https://uni-tuebingen.de/en',
+ description: 'This is another dummy result',
+ summary: 'This is another dummy summary'
}
]
diff --git a/client/src/views/HomeView.vue b/client/src/views/HomeView.vue
deleted file mode 100644
index a8d5173..0000000
--- a/client/src/views/HomeView.vue
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/client/src/views/Search.vue b/client/src/views/Search.vue
new file mode 100644
index 0000000..d655e10
--- /dev/null
+++ b/client/src/views/Search.vue
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+ Loading...
+
+
+
+
+
+
+
diff --git a/client/src/views/index.vue b/client/src/views/index.vue
deleted file mode 100644
index 4885919..0000000
--- a/client/src/views/index.vue
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
diff --git a/client/src/views/results.vue b/client/src/views/results.vue
deleted file mode 100644
index a06cb9b..0000000
--- a/client/src/views/results.vue
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
{{ result.title }}
-
-
{{ result.url }}
-
-
-
- {{
- category
- }}
-
-
-
-
{{ result.description }}
-
-
-
-
-
-