diff --git a/src/main.ts b/src/main.ts
index 5b778a8..d5a1aa7 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -14,6 +14,8 @@ import {
FwbButton,
FwbButtonGroup,
FwbCard,
+ FwbFileInput,
+ FwbHeading,
FwbInput,
FwbPagination,
FwbSelect,
@@ -41,6 +43,8 @@ const components = {
FwbButton,
FwbButtonGroup,
FwbCard,
+ FwbFileInput,
+ FwbHeading,
FwbInput,
FwbPagination,
FwbSelect,
@@ -66,7 +70,13 @@ app.use(createPinia())
app.use(router)
app.use(Vue3Toastify, {
autoClose: 3000,
- // ...
+ position: 'top-center',
+ theme: 'dark',
+ multiple: false,
+ transition: 'slide',
+ clearOnUrlChange: false,
+ pauseOnHover: true,
+ pauseOnFocusLoss: false,
} as ToastContainerOptions)
app.mount('#app')
diff --git a/src/router/index.ts b/src/router/index.ts
index a3af3bb..e5c6235 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -6,32 +6,42 @@ const router = createRouter({
{
path: '/',
name: 'home',
- component: () => import('../views/DatabasesView.vue'),
+ component: () => import('../views/databases/DatabasesView.vue'),
},
{
path: '/databases',
name: 'databases',
- component: () => import('../views/DatabasesView.vue'),
+ component: () => import('../views/databases/DatabasesView.vue'),
},
{
path: '/brands',
name: 'brands',
- component: () => import('../views/BrandsView.vue'),
+ component: () => import('../views/brands/BrandsView.vue'),
+ },
+ {
+ path: '/brands/new',
+ name: 'newBrand',
+ component: () => import('../views/brands/NewBrandView.vue'),
},
{
path: '/models',
name: 'models',
- component: () => import('../views/ModelsView.vue'),
+ component: () => import('../views/models/ModelsView.vue'),
+ },
+ {
+ path: '/models/new',
+ name: 'newModel',
+ component: () => import('../views/models/NewModelView.vue'),
},
{
path: '/login',
name: 'login',
- component: () => import('../views/LoginView.vue'),
+ component: () => import('../views/auth/LoginView.vue'),
},
{
path: '/auth/verify',
name: 'authVerify',
- component: () => import('../views/AuthVerifyView.vue'),
+ component: () => import('../views/auth/AuthVerifyView.vue'),
},
{
path: '/:pathMatch(.*)*',
diff --git a/src/types/Brand.d.ts b/src/types/Brand.d.ts
new file mode 100644
index 0000000..dc7c5b1
--- /dev/null
+++ b/src/types/Brand.d.ts
@@ -0,0 +1,4 @@
+interface Brand {
+ name: string
+ errors: string[]
+}
diff --git a/src/types/Evaluation.d.ts b/src/types/Evaluation.d.ts
new file mode 100644
index 0000000..9d25be4
--- /dev/null
+++ b/src/types/Evaluation.d.ts
@@ -0,0 +1,6 @@
+interface Evaluation {
+ reviewUrl: string | null
+ reviewScore: number | null
+ shopUrl: string | null
+ errors: string[]
+}
diff --git a/src/types/Measurement.d.ts b/src/types/Measurement.d.ts
new file mode 100644
index 0000000..93c9bf7
--- /dev/null
+++ b/src/types/Measurement.d.ts
@@ -0,0 +1,8 @@
+interface Measurement {
+ label: string
+ type: string
+ databaseId: string
+ leftChannel: File[]
+ rightChannel: File[]
+ errors: string[]
+}
diff --git a/src/types/Model.d.ts b/src/types/Model.d.ts
new file mode 100644
index 0000000..0e258a7
--- /dev/null
+++ b/src/types/Model.d.ts
@@ -0,0 +1,6 @@
+interface Model {
+ name: string
+ brandId: string
+ evaluation?: Evaluation
+ errors: string[]
+}
diff --git a/src/utils/api/brands.ts b/src/utils/api/brands.ts
index 48ae9f0..6ec9236 100644
--- a/src/utils/api/brands.ts
+++ b/src/utils/api/brands.ts
@@ -2,7 +2,7 @@ import { apiClient } from '../ApiClient'
import type { APIPage } from '../ApiClient'
export type APIBrand = {
- id: number
+ id: string
name: string
model_count: number
}
@@ -15,6 +15,13 @@ export const brandsApi = {
return response.data as APIBrands
},
- // create
- // edit
+ async create(brand: APIBrand) {
+ const response = await apiClient.post('/brands/new', brand)
+ return response.data as APIBrand
+ },
+
+ async edit(brand: APIBrand) {
+ const response = await apiClient.patch(`/brands/${brand.id}`, brand)
+ return response.data as APIBrand
+ },
}
diff --git a/src/utils/api/databases.ts b/src/utils/api/databases.ts
index d80913a..0536db2 100644
--- a/src/utils/api/databases.ts
+++ b/src/utils/api/databases.ts
@@ -2,7 +2,7 @@ import { apiClient } from '../ApiClient'
import type { APIPage } from '../ApiClient'
export type APIDatabase = {
- id: number
+ id: string
kind: string
path: string
}
diff --git a/src/utils/api/measurement.ts b/src/utils/api/measurement.ts
new file mode 100644
index 0000000..e69de29
diff --git a/src/utils/api/models.ts b/src/utils/api/models.ts
index 07c6ac3..49a2168 100644
--- a/src/utils/api/models.ts
+++ b/src/utils/api/models.ts
@@ -3,7 +3,7 @@ import type { APIPage } from '../ApiClient'
import type { APIBrand } from './brands'
export type APIModel = {
- id: number
+ id: string
name: string
shop_url: string
brand: APIBrand
diff --git a/src/views/AuthVerifyView.vue b/src/views/auth/AuthVerifyView.vue
similarity index 100%
rename from src/views/AuthVerifyView.vue
rename to src/views/auth/AuthVerifyView.vue
diff --git a/src/views/LoginView.vue b/src/views/auth/LoginView.vue
similarity index 100%
rename from src/views/LoginView.vue
rename to src/views/auth/LoginView.vue
diff --git a/src/views/BrandsView.vue b/src/views/brands/BrandsView.vue
similarity index 85%
rename from src/views/BrandsView.vue
rename to src/views/brands/BrandsView.vue
index ba84aaa..b5192c7 100644
--- a/src/views/BrandsView.vue
+++ b/src/views/brands/BrandsView.vue
@@ -3,7 +3,7 @@ import { brandsApi } from '@/utils/api/brands'
import { ref, onMounted, watch, computed } from 'vue'
import { useRoute } from 'vue-router'
-import type { APIBrand, APIBrands } from '@/utils/api/brands'
+import type { APIBrand } from '@/utils/api/brands'
import MainLayout from '@/layouts/MainLayout.vue'
import Table from '@/components/Table.vue'
@@ -65,13 +65,7 @@ onMounted(() => {
:page-count="pageCount"
>
-
-
+
Add new brand
diff --git a/src/views/brands/EditBrandView.vue b/src/views/brands/EditBrandView.vue
new file mode 100644
index 0000000..07a46a7
--- /dev/null
+++ b/src/views/brands/EditBrandView.vue
@@ -0,0 +1,72 @@
+
+
+
+
+ Add new brand
+
+
+ Cancel
+
+ Save
+
+
+
+
+
+
+
diff --git a/src/views/brands/NewBrandView.vue b/src/views/brands/NewBrandView.vue
new file mode 100644
index 0000000..07a46a7
--- /dev/null
+++ b/src/views/brands/NewBrandView.vue
@@ -0,0 +1,72 @@
+
+
+
+
+ Add new brand
+
+
+ Cancel
+
+ Save
+
+
+
+
+
+
+
diff --git a/src/views/DatabasesView.vue b/src/views/databases/DatabasesView.vue
similarity index 100%
rename from src/views/DatabasesView.vue
rename to src/views/databases/DatabasesView.vue
diff --git a/src/views/ModelsView.vue b/src/views/models/ModelsView.vue
similarity index 95%
rename from src/views/ModelsView.vue
rename to src/views/models/ModelsView.vue
index 5313bb6..7fe1caf 100644
--- a/src/views/ModelsView.vue
+++ b/src/views/models/ModelsView.vue
@@ -71,7 +71,7 @@ onMounted(() => {
-->
-
+
Add new model
diff --git a/src/views/models/NewModelView.vue b/src/views/models/NewModelView.vue
new file mode 100644
index 0000000..45edaba
--- /dev/null
+++ b/src/views/models/NewModelView.vue
@@ -0,0 +1,206 @@
+
+
+
+
+ Add new model
+
+
+ Cancel
+
+ Save
+
+
+
+
+
+
+
+
+
+ Add new measurement
+
+
+
+
+
+
+
+
diff --git a/tailwind.config.js b/tailwind.config.js
index 75398e3..88f095c 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -5,8 +5,4 @@ export default {
'./src/**/*.{vue,js,ts,jsx,tsx}',
'node_modules/flowbite-vue/**/*.{js,jsx,ts,tsx,vue}',
],
- theme: {
- extend: {},
- },
- plugins: [require('flowbite/plugin')],
}