From e685f50a8853ee42489131d9b7eedc5bc458d9f0 Mon Sep 17 00:00:00 2001 From: jedi Date: Sat, 28 Oct 2023 20:24:25 +0200 Subject: [PATCH] stash --- frontend/src/assets/css/toolshed.css | 3 +- frontend/src/components/PropertyBadge.vue | 4 +- frontend/src/components/PropertyField.vue | 45 +++++----- frontend/src/components/Sidebar.vue | 6 ++ frontend/src/router.js | 2 + frontend/src/store.js | 15 +++- frontend/src/views/Admin.vue | 102 ++++++++++++++++++++++ frontend/vite.config.js | 13 ++- 8 files changed, 156 insertions(+), 34 deletions(-) create mode 100644 frontend/src/views/Admin.vue diff --git a/frontend/src/assets/css/toolshed.css b/frontend/src/assets/css/toolshed.css index b4bcaa2..daced67 100644 --- a/frontend/src/assets/css/toolshed.css +++ b/frontend/src/assets/css/toolshed.css @@ -13394,7 +13394,8 @@ a.list-group-item { min-width: 0; min-height: 100vh; transition: margin-left .35s ease-in-out, left .35s ease-in-out, margin-right .35s ease-in-out, right .35s ease-in-out; - background: #f7f7fc; + /*background: #f7f7fc;*/ + background-color: #ddd; flex-direction: column; overflow: hidden; border-top-left-radius: 0; diff --git a/frontend/src/components/PropertyBadge.vue b/frontend/src/components/PropertyBadge.vue index a0716f0..edad1a3 100644 --- a/frontend/src/components/PropertyBadge.vue +++ b/frontend/src/components/PropertyBadge.vue @@ -76,7 +76,7 @@ export default { } }, property: { - prop: "value", + prop: "property", event: "input" }, computed: { @@ -85,7 +85,7 @@ export default { return this.property.value }, set(value) { - this.$emit("input", value) + this.$emit("input", {...this.property,value}) } }, prettyDescription() { diff --git a/frontend/src/components/PropertyField.vue b/frontend/src/components/PropertyField.vue index ed1b280..cdc153f 100644 --- a/frontend/src/components/PropertyField.vue +++ b/frontend/src/components/PropertyField.vue @@ -1,19 +1,23 @@ @@ -30,15 +34,12 @@ import * as BIcons from "bootstrap-icons-vue"; import {mapActions, mapState} from "vuex"; import PropertyBadge from "@/components/PropertyBadge.vue"; +import BadgeSelectField from "@/components/BadgeSelectField.vue"; export default { name: "PropertyField", - data() { - return { - property: "" - } - }, components: { + BadgeSelectField, PropertyBadge, ...BIcons }, @@ -81,9 +82,9 @@ export default { }, methods: { ...mapActions(["fetchProperties"]), - addProperty() { - if (this.property !== "") { - this.localValue.push({name: this.property.name, value: 0}); + addProperty(property) { + if (property !== "") { + this.localValue.push({name: property, value: 0}); this.property = ""; } }, diff --git a/frontend/src/components/Sidebar.vue b/frontend/src/components/Sidebar.vue index 2a438bd..66b379e 100644 --- a/frontend/src/components/Sidebar.vue +++ b/frontend/src/components/Sidebar.vue @@ -21,6 +21,12 @@ Friends + diff --git a/frontend/src/router.js b/frontend/src/router.js index e87f59e..0d31dcf 100644 --- a/frontend/src/router.js +++ b/frontend/src/router.js @@ -11,6 +11,7 @@ import Search from "@/views/Search.vue"; import InventoryNew from "@/views/InventoryNew.vue"; import InventoryEdit from "@/views/InventoryEdit.vue"; import InventoryDetail from "@/views/InventoryDetail.vue"; +import Admin from "@/views/Admin.vue"; const routes = [ @@ -22,6 +23,7 @@ const routes = [ {path: '/inventory/:id/edit', component: InventoryEdit, meta: {requiresAuth: true}, props: true}, {path: '/inventory/new', component: InventoryNew, meta: {requiresAuth: true}}, {path: '/friends', component: Friends, meta: {requiresAuth: true}}, + {path: '/admin', component: Admin, meta: {requiresAuth: true}}, {path: '/search/:query', component: Search, meta: {requiresAuth: true}, props: true}, {path: '/login', component: Login, meta: {requiresAuth: false}}, {path: '/register', component: Register, meta: {requiresAuth: false}}, diff --git a/frontend/src/store.js b/frontend/src/store.js index 6791827..c966ebc 100644 --- a/frontend/src/store.js +++ b/frontend/src/store.js @@ -24,6 +24,9 @@ export default createStore({ tags: [], properties: [], files: [], + categories: [], + availability_policies: [], + domains: [], }, mutations: { setUser(state, user) { @@ -68,6 +71,15 @@ export default createStore({ setProperties(state, properties) { state.properties = properties; }, + setCategories(state, categories) { + state.categories = categories; + }, + setAvailabilityPolicies(state, availability_policies) { + state.availability_policies = availability_policies; + }, + setDomains(state, domains) { + state.domains = domains; + }, setFiles(state, files) { state.files = files; }, @@ -312,7 +324,8 @@ export default createStore({ commit('setTags', data.tags) commit('setProperties', data.properties) commit('setCategories', data.categories) - commit('setAvailabilityPolicies', data.availability_policies) + commit('setAvailabilityPolicies', data.policies) + commit('setDomains', data.domains) state.last_load.tags = Date.now() state.last_load.properties = Date.now() state.last_load.categories = Date.now() diff --git a/frontend/src/views/Admin.vue b/frontend/src/views/Admin.vue new file mode 100644 index 0000000..1c73781 --- /dev/null +++ b/frontend/src/views/Admin.vue @@ -0,0 +1,102 @@ + + + + + \ No newline at end of file diff --git a/frontend/vite.config.js b/frontend/vite.config.js index a2af71a..d62fb1e 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -32,22 +32,19 @@ export default defineConfig({ },*/ proxy: { '^/api/': { - target: "http://127.0.0.1:8000/", + target: "https://toolshed.j3d1.de:8000/", }, '^/auth/': { - target: "http://127.0.0.1:8000/", - }, - '^/admin/': { - target: "http://127.0.0.1:8000/", + target: "https://toolshed.j3d1.de:8000/", }, '^/docs/': { - target: "http://127.0.0.1:8000/", + target: "https://toolshed.j3d1.de:8000/", }, '^/static/': { - target: "http://127.0.0.1:8000/", + target: "https://toolshed.j3d1.de:8000/", }, '^/media/': { - target: "http://127.0.0.1:8000/", + target: "https://toolshed.j3d1.de:8000/", }, '^/wiki/': { target: "http://127.0.0.1:8080/",