Skip to content

Commit c3d7a6f

Browse files
authored
_Dashboard app: upgrade to Vue3 (#981)
1 parent be63886 commit c3d7a6f

9 files changed

Lines changed: 1717 additions & 528 deletions

File tree

apps/_dashboard/diff2kryten.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def diff2kryten(data):
161161
+ '</style></head><body><div style="text-align:right">'
162162
+ "</div>"
163163
+ div
164-
+ '<script src="/_dashboard/static/js/jquery.min.js"></script>'
164+
+ '<script src="https://unpkg.com/jquery.min.js"></script>'
165165
+ '<script src="/_dashboard/static/js/highlight.min.js"></script>'
166166
+ "<script>"
167167
+ (script % block)
Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,46 @@
1-
var app = {data: {}, methods:{}};
2-
app.params = new URLSearchParams(window.location.search);
3-
app.data.loading = 0;
4-
app.data.app = app.params.get('app');
5-
app.data.dbname = app.params.get('dbname');
6-
app.data.tablename = app.params.get('tablename');
7-
app.data.url = '../rest/{app}/{dbname}/{tablename}'.format(app.data);
8-
app.data.filter = app.params.get('filter') || '';
9-
app.data.order = app.params.get('order') || '';
10-
app.vue = new Vue({el:"#vue", data: app.data, methods: app.methods});
1+
/**
2+
*
3+
* This script initializes a Vue 3 application that handles URL parameters
4+
*/
5+
const app = {
6+
data: {
7+
loading: 0,
8+
app: '',
9+
dbname: '',
10+
tablename: '',
11+
url: '',
12+
filter: '',
13+
order: ''
14+
},
15+
methods: {}
16+
};
17+
18+
// Initialize the Vue application
19+
const { createApp } = Vue;
20+
21+
// Create app instance
22+
const initApp = () => {
23+
app.params = new URLSearchParams(window.location.search);
24+
app.data.app = app.params.get('app');
25+
app.data.dbname = app.params.get('dbname');
26+
app.data.tablename = app.params.get('tablename');
27+
app.data.url = '../rest/{app}/{dbname}/{tablename}'.format(app.data);
28+
app.data.filter = app.params.get('filter') || '';
29+
app.data.order = app.params.get('order') || '';
30+
31+
// Create Vue 3 app with original data structure
32+
const vueApp = createApp({
33+
data() {
34+
return app.data;
35+
},
36+
methods: app.methods
37+
});
38+
39+
// Mount the application
40+
vueApp.mount('#vue');
41+
42+
return vueApp;
43+
};
44+
45+
// Initialize the app
46+
const vueInstance = initApp();

apps/_dashboard/static/js/highlight.min.js

Lines changed: 1243 additions & 43 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)