This commit is contained in:
j3d1 2023-10-28 20:24:25 +02:00
parent 0d4012b4c6
commit 53517e5170
8 changed files with 119 additions and 15 deletions

View file

@ -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;

View file

@ -90,7 +90,7 @@ export default {
return this.property.value
},
set(value) {
this.$emit("input", value)
this.$emit("input", {...this.property,value})
}
},
prettyDescription() {

View file

@ -29,11 +29,6 @@ import BadgeSelectField from "@/components/BadgeSelectField.vue";
export default {
name: "PropertyField",
data() {
return {
property: ""
}
},
components: {
BadgeSelectField,
PropertyBadge,

View file

@ -21,6 +21,12 @@
<span class="align-middle">Friends</span>
</router-link>
</li>
<li class="sidebar-item">
<router-link to="/admin" class="sidebar-link">
<b-icon-gear class="bi-valign-middle"></b-icon-gear>
<span class="align-middle">Admin</span>
</router-link>
</li>
</ul>
</div>
</nav>

View file

@ -11,6 +11,7 @@ import Search from '@/views/Search.vue';
import InventoryDetail from '@/views/InventoryDetail.vue';
import InventoryNew from '@/views/InventoryNew.vue';
import InventoryEdit from '@/views/InventoryEdit.vue';
import Admin from '@/views/Admin.vue';
const routes = [
@ -20,6 +21,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}},

View file

@ -25,6 +25,7 @@ export default createStore({
files: [],
categories: [],
availability_policies: [],
domains: [],
},
mutations: {
setUser(state, user) {

View file

@ -0,0 +1,102 @@
<template>
<BaseLayout>
<main class="content">
<div class="container-fluid p-0">
<h1 class="h3 mb-3">Admin</h1>
<div class="row">
<div class="col-12 col-xl-6">
<div class="card">
<div class="card-header">
<h5 class="card-title">Tags</h5>
</div>
<div class="card-body">
<ul>
<li v-for="tag in tags" :key="tag.id">
{{ tag }}
</li>
</ul>
</div>
</div>
</div>
<div class="col-12 col-xl-6">
<div class="card">
<div class="card-header">
<h5 class="card-title">Properties</h5>
</div>
<div class="card-body">
<ul>
<li v-for="property in properties" :key="property.id">
{{ property.name }} ({{ property.unit_name }}, {{ property.unit_symbol }})
</li>
</ul>
</div>
</div>
<div class="card">
<div class="card-header">
<h5 class="card-title">Categories</h5>
</div>
<div class="card-body">
<ul>
<li v-for="category in categories" :key="category.id">
{{ category }}
</li>
</ul>
</div>
</div>
<div class="card">
<div class="card-header">
<h5 class="card-title">Domains</h5>
</div>
<div class="card-body">
<ul>
<li v-for="domain in domains" :key="domain.id">
{{ domain }}
</li>
</ul>
</div>
</div>
<div class="card">
<div class="card-header">
<h5 class="card-title">Availability Policies</h5>
</div>
<div class="card-body">
<ul>
<li v-for="policy in availability_policies" :key="policy.id">
{{ policy }}
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</main>
</BaseLayout>
</template>
<script>
import {mapActions, mapState} from "vuex";
import * as BIcons from "bootstrap-icons-vue";
import BaseLayout from "@/components/BaseLayout.vue";
export default {
name: "Inventory",
components: {
BaseLayout,
...BIcons
},
computed: {
...mapState(["tags", "properties", "categories", "availability_policies", "domains"]),
},
methods: {
...mapActions(["fetchInfo"]),
},
async mounted() {
await this.fetchInfo();
}
}
</script>
<style scoped>
</style>

View file

@ -31,22 +31,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/",