This commit is contained in:
2024-09-28 17:37:29 +02:00
parent 8dfafa9404
commit fb4d566007
64 changed files with 32325 additions and 573 deletions
+30 -87
View File
@@ -8,25 +8,26 @@
<link rel="shortcut icon" href="{% static 'img/favicon.png' %}">
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue@2.7.16/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-resource@1.5.3"></script>
<script src="https://cdn.jsdelivr.net/npm/js-cookie@3.0.5/dist/js.cookie.min.js"></script>
<script src="https://unpkg.com/vue-router@3/dist/vue-router.js"></script>
<script src="{% static "vue/index.js" %}"></script>
<script src="{% static "sweetalert2/index" %}"></script>
<script src="{% static "vue-resource/index" %}"></script>
<script src="{% static "js.cookie.min/index.js" %}"></script>
<script src="{% static "vue-router/index.js" %}"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
<link href="{% static "bootstrap.min/index.css" %}" rel="stylesheet">
<script src="{% static "bootstrap.bundle.min/index.js" %}"></script>
<link href="{% static "bootswatch.min.css/index.css" %}" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootswatch@5.3.3/dist/lux/bootstrap.min.css " rel="stylesheet">
<script src="{% url 'reverse_js' %}" type="text/javascript"></script>
<link href="https://cdn.jsdelivr.net/npm/vuetify@2.x/dist/vuetify.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/vuetify@2.x/dist/vuetify.js"></script>
<link href="{% static "vuetify.min/index.css" %}" rel="stylesheet">
<script src="{% static "vuetify/index.js" %}"></script>
<script src="{% static "vuex/index.js" %}"></script>
<link href="https://cdn.jsdelivr.net/npm/@mdi/font@7.4.47/css/materialdesignicons.min.css" rel="stylesheet">
<link href="https://fonts.cdnfonts.com/css/jetbrains-mono" rel="stylesheet">
<link href="{% static "jetbrains-mono/index" %}">
<style>
.font {
font-family: 'JetBrains Mono', sans-serif;
@@ -49,7 +50,7 @@
<div class="collapse navbar-collapse" id="navbarColor01">
<ul class="navbar-nav me-auto">
<li class="nav-item">
<router-link href="#" to="{% url 'main:home' %}" class="nav-link active" to="{% url 'main:home' %}">
<router-link class="nav-link active" to="{% url 'main:home' %}">
{% trans "K356" %}
<span class="visually-hidden"></span>
</router-link>
@@ -58,21 +59,23 @@
<router-link class="nav-link" to="/ItemView">{% trans "Items" %}</router-link>
</li>
<li class="nav-item">
<a class="nav-link" href="#">{% trans "Properties" %}</a>
<router-link class="nav-link" to="/PropertyView">{% trans "Properties" %}</router-link>
</li>
<li class="nav-item">
<router-link class="nav-link" to="/EncryptionTesting">{% trans "Encryption" %}</router-link>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">{% trans "More" %}</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="/admin/">{% trans "Admin" %}</a>
</div>
</li>
{% if request.user.is_superuser %}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">{% trans "More" %}</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="/admin/">{% trans "Admin" %}</a>
</div>
</li>
{% endif %}
</ul>
<form class="d-flex">
<input class="form-control me-sm-2" type="search" placeholder="Search">
@@ -83,9 +86,9 @@
</nav>
<div id="app" class="container">
<Loading :crypto_key="key" @update_key="update_key" v-if="locked"></Loading>
<Loading @update_key="update_key" v-if="locked"></Loading>
<template v-if="!locked">
<router-view :crypto_key="key"></router-view>
<router-view></router-view>
</template>
</div>
@@ -103,56 +106,7 @@
{% endfor %}
<script type="text/javascript">
Vue.use(VueRouter);
Vue.config.delimiters = ["[[", "]]"];
{% for name, path in components.items %}
{% include path %}
Vue.component("{{ name }}", {{ name }});
{% endfor %}
const routes = [
{ path: '/', component: null },
{% for name, path in components.items %}
{
path: "/{{ name }}",
component: {{ name }},
},
{% endfor %}
];
const router = new VueRouter({routes});
const approuter = new Vue({
router,
vuetify: new Vuetify(),
el: "#main",
data: {
key: {
key: null,
uuid: "{{ user_settings.id }}",
},
locked: true,
},
methods: {
update_key: function(key) {
this.key.key = key;
this.locked = key == null;
},
lock_me: function() {
this.locked = true;
this.key.key = null;
}
}
});
router.beforeEach((to, from, next) => {
// Prevent from routing if key is not present.
next(approuter.key.key != null);
});
{% include "vue/index.js" %}
</script>
<script type="text/javascript">
@@ -164,16 +118,5 @@
refresh_csrftoken();
</script>
<script type="module">
import { useDate } from './vuetify.js'
const date = useDate()
const formatted = date.format('2010-04-13', 'fullDateWithWeekday')
console.log(formatted) // Tuesday, April 13, 2010
</script>
</body>
</html>