@windwalker-io/core 4.0.9 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/debugger/100-a64696bac484f689dc7f.js +2 -0
- package/dist/debugger/100.js.map +1 -0
- package/dist/debugger/153-0a5b226321a7cb0ca385.js +2 -0
- package/dist/debugger/153.js.map +1 -0
- package/dist/debugger/282-a3b07d57b6065a0ab97b.js +2 -0
- package/dist/debugger/282.js.map +1 -0
- package/dist/debugger/358-bdcf2ec8126fe2a9a049.js +2 -0
- package/dist/debugger/358.js.map +1 -1
- package/dist/debugger/416-86068592d1c650d90f44.js +2 -0
- package/dist/debugger/416.js.map +1 -0
- package/dist/debugger/489-6dc4df1408fa9cfc4c39.js +2 -0
- package/dist/debugger/489.js.map +1 -0
- package/dist/debugger/694-c816d301f72b3ee67630.js +2 -0
- package/dist/debugger/694.js.map +1 -1
- package/dist/debugger/941-b055306408b55426de85.js +2 -0
- package/dist/debugger/941.js.map +1 -0
- package/dist/debugger/index.js +3 -0
- package/dist/debugger/index.js.LICENSE.txt +7 -0
- package/dist/debugger/main.js.map +1 -0
- package/dist/debugger/windwalker-logo-h-w.svg +1 -0
- package/dist/debugger-console.css +1 -1
- package/dist/debugger-console.css.map +1 -1
- package/dist/debugger-console.js +1 -1
- package/fusionfile.mjs +14 -27
- package/images/debugger-icon.png +0 -0
- package/package.json +54 -48
- package/scss/_variables.scss +9 -0
- package/scss/base/_typography.scss +1 -1
- package/scss/debugger-console.scss +6 -0
- package/scss/layout/_sidebar.scss +1 -2
- package/src/asset-sync.mjs +51 -3
- package/src/console/debugger-console.js +1 -6
- package/src/debugger/App.vue +18 -24
- package/src/debugger/Store.vue +1 -1
- package/src/debugger/components/BsModal.vue +1 -1
- package/src/debugger/components/db/QueryInfo.vue +9 -8
- package/src/debugger/components/timeline/TimelineTable.vue +1 -1
- package/src/debugger/debugger.js +5 -10
- package/src/debugger/font-awesome.js +11 -12
- package/src/debugger/images/windwalker-logo-h-w.svg +1 -0
- package/src/debugger/layouts/DefaultLayout.vue +5 -18
- package/src/debugger/routes.js +1 -6
- package/src/debugger/services/http.js +1 -6
- package/src/debugger/services/nav.js +3 -8
- package/src/debugger/services/store.js +2 -9
- package/src/debugger/services/utilities.js +17 -6
- package/src/debugger/types/global.d.js +2 -0
- package/src/debugger/views/Dashboard.vue +33 -34
- package/src/debugger/views/Database.vue +52 -76
- package/src/debugger/views/Events.vue +4 -77
- package/src/debugger/views/Routing.vue +2 -2
- package/src/debugger/views/System.vue +1 -1
- package/src/install-vendors.mjs +51 -22
- package/tsconfig.js.json +15 -0
- package/types/global.d.ts +12 -0
- package/types/index.d.ts +5 -0
- package/types/shims-sweetalert.d.ts +8 -0
- package/types/unicorn.d.ts +1 -0
- package/types/vendor.d.ts +1 -0
- package/types/vue/global.d.ts +14 -0
- package/types/vue/shims-vue.d.ts +5 -0
- package/types/vue/vue-runtime.d.ts +16 -0
- package/dist/debugger/114.js.map +0 -1
- package/dist/debugger/338.js.map +0 -1
- package/dist/debugger/500.js.map +0 -1
- package/dist/debugger/548.js.map +0 -1
- package/dist/debugger/798.js.map +0 -1
- package/dist/debugger/851.js.map +0 -1
- package/dist/debugger/864.js.map +0 -1
- package/dist/debugger/chunk-vendor-114.js +0 -3
- package/dist/debugger/chunk-vendor-114.js.LICENSE.txt +0 -8
- package/dist/debugger/chunk-vendor-338.js +0 -3
- package/dist/debugger/chunk-vendor-338.js.LICENSE.txt +0 -15
- package/dist/debugger/chunk-vendor-358.js +0 -2
- package/dist/debugger/chunk-vendor-500.js +0 -3
- package/dist/debugger/chunk-vendor-500.js.LICENSE.txt +0 -8
- package/dist/debugger/chunk-vendor-548.js +0 -3
- package/dist/debugger/chunk-vendor-548.js.LICENSE.txt +0 -15
- package/dist/debugger/chunk-vendor-694.js +0 -3
- package/dist/debugger/chunk-vendor-694.js.LICENSE.txt +0 -1
- package/dist/debugger/chunk-vendor-798.js +0 -3
- package/dist/debugger/chunk-vendor-798.js.LICENSE.txt +0 -1
- package/dist/debugger/chunk-vendor-851.js +0 -3
- package/dist/debugger/chunk-vendor-851.js.LICENSE.txt +0 -8
- package/dist/debugger/chunk-vendor-864.js +0 -3
- package/dist/debugger/chunk-vendor-864.js.LICENSE.txt +0 -1
- package/dist/debugger/debugger.js +0 -3
- package/dist/debugger/debugger.js.LICENSE.txt +0 -21
- package/dist/debugger/debugger.js.map +0 -1
- package/dist/debugger/dev/chunk-vendor-scss_debugger_scss.js +0 -219
- package/dist/debugger/dev/chunk-vendor-src_debugger_layouts_DefaultLayout_vue.js +0 -77
- package/dist/debugger/dev/chunk-vendor-src_debugger_views_Dashboard_vue.js +0 -81
- package/dist/debugger/dev/chunk-vendor-src_debugger_views_Database_vue.js +0 -187
- package/dist/debugger/dev/chunk-vendor-src_debugger_views_Events_vue.js +0 -122
- package/dist/debugger/dev/chunk-vendor-src_debugger_views_Request_vue.js +0 -122
- package/dist/debugger/dev/chunk-vendor-src_debugger_views_Routing_vue.js +0 -122
- package/dist/debugger/dev/chunk-vendor-src_debugger_views_System_vue.js +0 -67
- package/dist/debugger/dev/chunk-vendor-src_debugger_views_Timeline_vue.js +0 -132
- package/dist/debugger/dev/chunk-vendor-vendors-node_modules_bootstrap_js_src_modal_js-node_modules_sql-formatter_lib_index_js.js +0 -923
- package/dist/debugger/dev/chunk-vendor-vendors-node_modules_sql-formatter_lib_index_js-node_modules_bootstrap_js_src_modal_js.js +0 -923
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div v-if="currentData">
|
|
3
|
-
<div class="p-3" style="background-color: var(--bs-gray-
|
|
3
|
+
<div class="p-3 mt-3 mx-4 rounded-3" style="background-color: var(--bs-gray-800);">
|
|
4
4
|
<h1 class="text-xl font-bold text-gray-800">
|
|
5
5
|
<slot name="title"></slot>
|
|
6
6
|
</h1>
|
|
@@ -21,25 +21,12 @@
|
|
|
21
21
|
</div>
|
|
22
22
|
</template>
|
|
23
23
|
|
|
24
|
-
<script>
|
|
24
|
+
<script setup>
|
|
25
25
|
import { useRoute } from 'vue-router';
|
|
26
|
-
import { goToLast } from '../services/nav
|
|
27
|
-
import { currentData, currentId } from '../services/store
|
|
26
|
+
import { goToLast } from '../services/nav';
|
|
27
|
+
import { currentData, currentId } from '../services/store';
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
name: 'DefaultLayout',
|
|
31
|
-
setup() {
|
|
32
|
-
const route = useRoute();
|
|
33
|
-
|
|
34
|
-
return {
|
|
35
|
-
currentId,
|
|
36
|
-
currentData,
|
|
37
|
-
route,
|
|
38
|
-
|
|
39
|
-
goToLast
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
};
|
|
29
|
+
const route = useRoute();
|
|
43
30
|
</script>
|
|
44
31
|
|
|
45
32
|
<style scoped>
|
package/src/debugger/routes.js
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
* Part of starter project.
|
|
3
|
-
*
|
|
4
|
-
* @copyright Copyright (C) 2021 __ORGANIZATION__.
|
|
5
|
-
* @license __LICENSE__
|
|
6
|
-
*/
|
|
1
|
+
|
|
7
2
|
|
|
8
3
|
import router from '../routes.js';
|
|
9
4
|
import $http from './http.js';
|
|
10
5
|
|
|
11
|
-
export async function goToLast(currentRoute =
|
|
6
|
+
export async function goToLast(currentRoute = undefined) {
|
|
12
7
|
const res = await $http.get('ajax/last');
|
|
13
8
|
let route = '';
|
|
14
9
|
|
|
15
10
|
if (currentRoute) {
|
|
16
|
-
route = currentRoute
|
|
11
|
+
route = currentRoute + '/' + res.data.data;
|
|
17
12
|
} else {
|
|
18
13
|
route = '/system/' + res.data.data;
|
|
19
14
|
}
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Part of starter project.
|
|
3
|
-
*
|
|
4
|
-
* @copyright Copyright (C) 2021 __ORGANIZATION__.
|
|
5
|
-
* @license __LICENSE__
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
1
|
import { ref } from 'vue';
|
|
9
2
|
|
|
10
|
-
export const currentId = ref(
|
|
11
|
-
export const currentData = ref(
|
|
3
|
+
export const currentId = ref();
|
|
4
|
+
export const currentData = ref();
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Part of earth project.
|
|
3
|
-
*
|
|
4
|
-
* @copyright Copyright (C) 2022 __ORGANIZATION__.
|
|
5
|
-
* @license __LICENSE__
|
|
6
|
-
*/
|
|
1
|
+
|
|
7
2
|
|
|
8
3
|
export function stateColor(value, avg) {
|
|
9
4
|
if (value > (avg * 2)) {
|
|
@@ -16,3 +11,19 @@ export function stateColor(value, avg) {
|
|
|
16
11
|
return 'info';
|
|
17
12
|
}
|
|
18
13
|
}
|
|
14
|
+
|
|
15
|
+
export function httpStatusColor(status) {
|
|
16
|
+
if (status >= 300 && status < 400) {
|
|
17
|
+
return 'info';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (status >= 400 && status < 500) {
|
|
21
|
+
return 'warning';
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (status >= 200 && status < 300) {
|
|
25
|
+
return 'success';
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return 'danger';
|
|
29
|
+
}
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
<tbody>
|
|
31
31
|
<tr v-for="item of items">
|
|
32
32
|
<td>
|
|
33
|
-
<a href="#" @click.prevent="selectId(item.id)" class="
|
|
33
|
+
<a href="#" @click.prevent="selectId(item.id)" class="">
|
|
34
34
|
{{ item.id }}
|
|
35
35
|
</a>
|
|
36
36
|
</td>
|
|
@@ -45,9 +45,16 @@
|
|
|
45
45
|
{{ item.ip }}
|
|
46
46
|
</td>
|
|
47
47
|
<td>
|
|
48
|
-
|
|
48
|
+
<div>
|
|
49
|
+
{{ item.method }}
|
|
50
|
+
</div>
|
|
51
|
+
<div>
|
|
52
|
+
<span v-if="item.ajax" class="badge bg-danger">
|
|
53
|
+
AJAX | API
|
|
54
|
+
</span>
|
|
55
|
+
</div>
|
|
49
56
|
</td>
|
|
50
|
-
<td>
|
|
57
|
+
<td style="word-break: break-all">
|
|
51
58
|
<a :href="item.url"
|
|
52
59
|
target="_blank"
|
|
53
60
|
class="link-secondary">
|
|
@@ -59,7 +66,9 @@
|
|
|
59
66
|
{{ dateFormat(item.time) }}
|
|
60
67
|
</td>
|
|
61
68
|
<td>
|
|
62
|
-
{
|
|
69
|
+
<span class="badge" :class="`bg-${httpStatusColor(item.response?.status || 0)}`">
|
|
70
|
+
{{ item.response?.status }}
|
|
71
|
+
</span>
|
|
63
72
|
</td>
|
|
64
73
|
</tr>
|
|
65
74
|
</tbody>
|
|
@@ -67,43 +76,33 @@
|
|
|
67
76
|
</div>
|
|
68
77
|
</template>
|
|
69
78
|
|
|
70
|
-
<script>
|
|
79
|
+
<script setup>
|
|
71
80
|
import * as dayjs from 'dayjs';
|
|
72
|
-
import { onMounted, reactive, toRefs } from 'vue';
|
|
73
|
-
import router from '
|
|
74
|
-
import $http from '
|
|
75
|
-
import { currentId } from '
|
|
76
|
-
|
|
77
|
-
export default {
|
|
78
|
-
name: 'Dashboard',
|
|
79
|
-
setup() {
|
|
80
|
-
const state = reactive({
|
|
81
|
-
items: [],
|
|
82
|
-
});
|
|
81
|
+
import { onMounted, reactive, ref, toRefs } from 'vue';
|
|
82
|
+
import router from '../routes.js';
|
|
83
|
+
import $http from '../services/http.js';
|
|
84
|
+
import { currentId } from '../services/store.js';
|
|
85
|
+
import { httpStatusColor } from '../services/utilities.js';
|
|
83
86
|
|
|
84
|
-
|
|
85
|
-
|
|
87
|
+
const state = reactive({
|
|
88
|
+
items: [],
|
|
89
|
+
});
|
|
86
90
|
|
|
87
|
-
|
|
88
|
-
});
|
|
91
|
+
const items = ref([]);
|
|
89
92
|
|
|
90
|
-
|
|
91
|
-
|
|
93
|
+
onMounted(async () => {
|
|
94
|
+
const res = await $http.get('ajax/history');
|
|
92
95
|
|
|
93
|
-
|
|
94
|
-
|
|
96
|
+
items.value = res.data.data;
|
|
97
|
+
});
|
|
95
98
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
+
function selectId(id) {
|
|
100
|
+
router.push('/system/' + id);
|
|
101
|
+
}
|
|
99
102
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
dateFormat,
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
};
|
|
103
|
+
function dateFormat(ts) {
|
|
104
|
+
return dayjs.unix(ts).format('YYYY-MM-DD HH:mm:ssZ');
|
|
105
|
+
}
|
|
107
106
|
</script>
|
|
108
107
|
|
|
109
108
|
<style scoped>
|
|
@@ -35,12 +35,14 @@
|
|
|
35
35
|
Count: <span class="badge bg-info">{{ data?.queries[instance]?.length || 0 }}</span>
|
|
36
36
|
-
|
|
37
37
|
Time:
|
|
38
|
-
<span class="badge"
|
|
38
|
+
<span class="badge"
|
|
39
|
+
:class="`bg-${stateColor(totalTime(instance), 15 * (data?.queries[instance]?.length || 0))}`">
|
|
39
40
|
{{ round(totalTime(instance)) }}ms
|
|
40
41
|
</span>
|
|
41
42
|
-
|
|
42
43
|
Memory:
|
|
43
|
-
<span class="badge"
|
|
44
|
+
<span class="badge"
|
|
45
|
+
:class="`bg-${stateColor(totalMemory(instance), 0.05 * (data?.queries[instance]?.length || 0))}`">
|
|
44
46
|
{{ round(totalMemory(instance)) }}MB
|
|
45
47
|
</span>
|
|
46
48
|
</div>
|
|
@@ -81,87 +83,61 @@
|
|
|
81
83
|
</defaultLayout>
|
|
82
84
|
</template>
|
|
83
85
|
|
|
84
|
-
<script>
|
|
86
|
+
<script setup>
|
|
85
87
|
import { computed, ref } from 'vue';
|
|
86
|
-
import BsModal from '
|
|
87
|
-
import QueryInfo from '
|
|
88
|
-
import DefaultLayout from '
|
|
89
|
-
import $http from '
|
|
88
|
+
import BsModal from '../components/BsModal.vue';
|
|
89
|
+
import QueryInfo from '../components/db/QueryInfo.vue';
|
|
90
|
+
import DefaultLayout from '../layouts/DefaultLayout.vue';
|
|
91
|
+
import $http from '../services/http.js';
|
|
90
92
|
import { stateColor } from '../services/utilities.js';
|
|
91
93
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
function getEditorLink(trace) {
|
|
134
|
-
return `${editor}://open?file=${trace.pathname}&line=${trace.line}`;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
function replaceRoot(path) {
|
|
138
|
-
return path.replace(sysPath, 'ROOT');
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
const instances = computed(() => data.value.connections.map((conn) => conn.name));
|
|
142
|
-
|
|
143
|
-
return {
|
|
144
|
-
data,
|
|
145
|
-
totalTime,
|
|
146
|
-
totalMemory,
|
|
147
|
-
showBacktraceModal,
|
|
148
|
-
backtrace,
|
|
149
|
-
backtraceIndex,
|
|
150
|
-
instances,
|
|
151
|
-
|
|
152
|
-
openBacktrace,
|
|
153
|
-
getEditorLink,
|
|
154
|
-
|
|
155
|
-
stateColor,
|
|
156
|
-
round,
|
|
157
|
-
replaceRoot,
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
};
|
|
94
|
+
const data = ref(null);
|
|
95
|
+
|
|
96
|
+
async function updateData() {
|
|
97
|
+
const res = await $http.get('ajax/data?path=db');
|
|
98
|
+
data.value = res.data.data;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function totalTime(instance) {
|
|
102
|
+
return data.value?.queries[instance]?.reduce((sum, query) => {
|
|
103
|
+
return sum + query.time;
|
|
104
|
+
}, 0) * 1000;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function totalMemory(instance) {
|
|
108
|
+
return data.value?.queries[instance]?.reduce((sum, query) => {
|
|
109
|
+
return sum + query.memory;
|
|
110
|
+
}, 0) / 1024 / 1024;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const showBacktraceModal = ref(false);
|
|
114
|
+
const backtrace = ref([]);
|
|
115
|
+
const backtraceIndex = ref(0);
|
|
116
|
+
|
|
117
|
+
function openBacktrace(trace, i) {
|
|
118
|
+
backtrace.value = trace;
|
|
119
|
+
backtraceIndex.value = i;
|
|
120
|
+
showBacktraceModal.value = true;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const editor = document.__data.editor;
|
|
124
|
+
const sysPath = document.__data.systemPath;
|
|
125
|
+
|
|
126
|
+
function getEditorLink(trace) {
|
|
127
|
+
return `${editor}://open?file=${trace.pathname}&line=${trace.line}`;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function replaceRoot(path) {
|
|
131
|
+
return path.replace(sysPath, 'ROOT');
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const instances = computed(() => data.value.connections.map((conn) => conn.name));
|
|
161
135
|
|
|
162
136
|
function round(num) {
|
|
163
137
|
return Math.round(num * 100) / 100;
|
|
164
138
|
}
|
|
139
|
+
|
|
140
|
+
await updateData();
|
|
165
141
|
</script>
|
|
166
142
|
|
|
167
143
|
<style scoped>
|
|
@@ -22,90 +22,17 @@
|
|
|
22
22
|
</DefaultLayout>
|
|
23
23
|
</template>
|
|
24
24
|
|
|
25
|
-
<script>
|
|
25
|
+
<script setup>
|
|
26
26
|
import { computed, ref } from 'vue';
|
|
27
27
|
import EventListenersTable from '../components/events/EventListenersTable.vue';
|
|
28
28
|
import DefaultLayout from '../layouts/DefaultLayout.vue';
|
|
29
29
|
import $http from '../services/http.js';
|
|
30
|
-
export default {
|
|
31
|
-
name: 'Events',
|
|
32
|
-
components: { EventListenersTable, DefaultLayout },
|
|
33
|
-
async beforeRouteEnter(to, from ,next) {
|
|
34
|
-
next(async (vm) => {
|
|
35
|
-
const res = await $http.get('ajax/data?path=events');
|
|
36
|
-
vm.data = res.data.data;
|
|
37
|
-
});
|
|
38
|
-
},
|
|
39
|
-
async beforeRouteUpdate(to, from ,next) {
|
|
40
|
-
const res = await $http.get('ajax/data?path=events');
|
|
41
|
-
this.data = res.data.data;
|
|
42
|
-
},
|
|
43
|
-
setup() {
|
|
44
|
-
const data = ref(null);
|
|
45
30
|
|
|
46
|
-
|
|
47
|
-
// const items = [];
|
|
48
|
-
//
|
|
49
|
-
// for (const eventName in data.value) {
|
|
50
|
-
// const listeners = data.value[eventName] || {};
|
|
51
|
-
//
|
|
52
|
-
// for (const listenerName in listeners) {
|
|
53
|
-
// const count = listeners[listenerName] || 0;
|
|
54
|
-
//
|
|
55
|
-
// items.push({
|
|
56
|
-
// event: eventName,
|
|
57
|
-
// listener: listenerName,
|
|
58
|
-
// count
|
|
59
|
-
// });
|
|
60
|
-
// }
|
|
61
|
-
// }
|
|
62
|
-
//
|
|
63
|
-
// return items;
|
|
64
|
-
// });
|
|
31
|
+
const data = ref(null);
|
|
65
32
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
//
|
|
69
|
-
// for (const eventName in data.value) {
|
|
70
|
-
// const listeners = data.value[eventName] || {};
|
|
71
|
-
//
|
|
72
|
-
// for (const listenerName in listeners) {
|
|
73
|
-
// const count = listeners[listenerName] || 0;
|
|
74
|
-
//
|
|
75
|
-
// if (count > 0) {
|
|
76
|
-
// items[eventName] = items[eventName] || {};
|
|
77
|
-
// items[eventName][listenerName] = count;
|
|
78
|
-
// }
|
|
79
|
-
// }
|
|
80
|
-
// }
|
|
81
|
-
//
|
|
82
|
-
// return items;
|
|
83
|
-
// });
|
|
84
|
-
//
|
|
85
|
-
// const untriggeredEvents = computed(() => {
|
|
86
|
-
// const items = {};
|
|
87
|
-
//
|
|
88
|
-
// for (const eventName in data.value) {
|
|
89
|
-
// const listeners = data.value[eventName] || {};
|
|
90
|
-
//
|
|
91
|
-
// for (const listenerName in listeners) {
|
|
92
|
-
// const count = listeners[listenerName] || 0;
|
|
93
|
-
//
|
|
94
|
-
// if (count <= 0) {
|
|
95
|
-
// items[eventName] = items[eventName] || {};
|
|
96
|
-
// items[eventName][listenerName] = count;
|
|
97
|
-
// }
|
|
98
|
-
// }
|
|
99
|
-
// }
|
|
100
|
-
//
|
|
101
|
-
// return items;
|
|
102
|
-
// });
|
|
33
|
+
const res = await $http.get('ajax/data?path=events');
|
|
34
|
+
data.value = res.data.data;
|
|
103
35
|
|
|
104
|
-
return {
|
|
105
|
-
data,
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
36
|
</script>
|
|
110
37
|
|
|
111
38
|
<style scoped>
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
<section class="l-section l-section--routes mt-5">
|
|
91
91
|
<h3 class="mb-3">Routes</h3>
|
|
92
92
|
|
|
93
|
-
<table class="table table-bordered">
|
|
93
|
+
<table class="table table-dark table-bordered">
|
|
94
94
|
<thead>
|
|
95
95
|
<tr>
|
|
96
96
|
<th>
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
|
|
114
114
|
<tbody>
|
|
115
115
|
<tr v-for="(route, name) of data.routing.routes"
|
|
116
|
-
:class="{ 'table-
|
|
116
|
+
:class="{ 'table-primary': data.routing.matched?.name === route.name }">
|
|
117
117
|
<td>
|
|
118
118
|
<code>{{ route.name }}</code>
|
|
119
119
|
</td>
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
<div class="mt-5">
|
|
55
55
|
<h4>Config</h4>
|
|
56
56
|
|
|
57
|
-
<pre class="
|
|
57
|
+
<pre class="border rounded p-3"><code>{{ JSON.stringify(data.config, null, 2) }}</code></pre>
|
|
58
58
|
</div>
|
|
59
59
|
</div>
|
|
60
60
|
</DefaultLayout>
|
package/src/install-vendors.mjs
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Part of starter project.
|
|
3
|
-
*
|
|
4
|
-
* @copyright Copyright (C) 2021 __ORGANIZATION__.
|
|
5
|
-
* @license __LICENSE__
|
|
6
|
-
*/
|
|
1
|
+
|
|
7
2
|
|
|
8
3
|
import { src, symlink, copy } from '@windwalker-io/fusion';
|
|
9
4
|
import { extractDest } from '@windwalker-io/fusion/src/utilities/utilities.js';
|
|
@@ -11,7 +6,7 @@ import { loadJson } from './utils.mjs';
|
|
|
11
6
|
import path from 'path';
|
|
12
7
|
import fs from 'fs';
|
|
13
8
|
|
|
14
|
-
export async function installVendors(npmVendors, composerVendors = [], to = 'www/assets/vendor') {
|
|
9
|
+
export async function installVendors(npmVendors = [], composerVendors = [], to = 'www/assets/vendor') {
|
|
15
10
|
const root = to;
|
|
16
11
|
let vendors = npmVendors;
|
|
17
12
|
const action = process.env.INSTALL_VENDOR === 'hard' ? 'Copy' : 'Link';
|
|
@@ -30,7 +25,13 @@ export async function installVendors(npmVendors, composerVendors = [], to = 'www
|
|
|
30
25
|
deleteExists(dir);
|
|
31
26
|
});
|
|
32
27
|
|
|
33
|
-
|
|
28
|
+
const composerJsons = getInstalledComposerVendors(composerVendors)
|
|
29
|
+
.map((cv) => `vendor/${cv}/composer.json`)
|
|
30
|
+
.map((file) => loadJson(file))
|
|
31
|
+
.filter((composerJson) => composerJson?.extra?.windwalker != null);
|
|
32
|
+
|
|
33
|
+
// Install npm vendors
|
|
34
|
+
vendors = findNpmVendors(composerJsons).concat(vendors);
|
|
34
35
|
vendors = [...new Set(vendors)];
|
|
35
36
|
|
|
36
37
|
vendors.forEach((vendor) => {
|
|
@@ -40,13 +41,27 @@ export async function installVendors(npmVendors, composerVendors = [], to = 'www
|
|
|
40
41
|
}
|
|
41
42
|
});
|
|
42
43
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
// Install composer packages assets
|
|
45
|
+
composerJsons.forEach((composerJson) => {
|
|
46
|
+
const vendorName = composerJson.name;
|
|
47
|
+
|
|
48
|
+
let assets = composerJson?.extra?.windwalker?.assets?.link;
|
|
49
|
+
|
|
50
|
+
if (!assets) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (!assets.endsWith('/')) {
|
|
55
|
+
assets += '/';
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (fs.existsSync(`vendor/${vendorName}/${assets}`)) {
|
|
59
|
+
console.log(`[${action} Composer] vendor/${vendorName}/${assets} => ${root}/${vendorName}/`);
|
|
60
|
+
doInstall(`vendor/${vendorName}/${assets}`, `${root}/${vendorName}/`);
|
|
47
61
|
}
|
|
48
62
|
});
|
|
49
63
|
|
|
64
|
+
// Install local saved vendors
|
|
50
65
|
console.log(`[${action} Local] resources/assets/vendor/**/* => ${root}/`);
|
|
51
66
|
doInstall('resources/assets/vendor/*', `${root}/`);
|
|
52
67
|
}
|
|
@@ -59,27 +74,41 @@ function doInstall(source, dest) {
|
|
|
59
74
|
}
|
|
60
75
|
}
|
|
61
76
|
|
|
62
|
-
function
|
|
77
|
+
function findNpmVendors(composerJsons = []) {
|
|
63
78
|
const pkg = path.resolve(process.cwd(), 'package.json');
|
|
64
|
-
|
|
65
79
|
const pkgJson = loadJson(pkg);
|
|
66
80
|
|
|
67
81
|
let vendors = Object.keys(pkgJson.devDependencies || {})
|
|
68
82
|
.concat(Object.keys(pkgJson.dependencies || {}))
|
|
69
83
|
.map(id => `node_modules/${id}/package.json`)
|
|
70
84
|
.map((file) => loadJson(file))
|
|
71
|
-
.filter(pkgJson => pkgJson
|
|
72
|
-
.map(pkgJson => pkgJson
|
|
85
|
+
.filter(pkgJson => pkgJson?.windwalker != null)
|
|
86
|
+
.map(pkgJson => pkgJson?.windwalker.vendors || [])
|
|
73
87
|
.flat();
|
|
74
88
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
89
|
+
const vendorsFromComposer = composerJsons
|
|
90
|
+
.map((composerJson) => composerJson?.extra?.windwalker?.assets?.vendors || {})
|
|
91
|
+
.map((vendors) => Object.keys(vendors))
|
|
92
|
+
.flat();
|
|
78
93
|
|
|
79
|
-
|
|
80
|
-
|
|
94
|
+
return [ ...new Set(vendors.concat(vendorsFromComposer)) ];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function injectNpmPackages(composerVendors = []) {
|
|
98
|
+
|
|
99
|
+
}
|
|
81
100
|
|
|
82
|
-
|
|
101
|
+
function getInstalledComposerVendors(composerVendors = []) {
|
|
102
|
+
const composerFile = path.resolve(process.cwd(), 'composer.json');
|
|
103
|
+
const composerJson = loadJson(composerFile);
|
|
104
|
+
|
|
105
|
+
return [
|
|
106
|
+
...new Set(
|
|
107
|
+
Object.keys(composerJson['require'] || {})
|
|
108
|
+
.concat(Object.keys(composerJson['require-dev'] || {}))
|
|
109
|
+
.concat(composerVendors)
|
|
110
|
+
)
|
|
111
|
+
];
|
|
83
112
|
}
|
|
84
113
|
|
|
85
114
|
function deleteExists(dir) {
|
package/tsconfig.js.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import '@windwalker-io/unicorn';
|
|
2
|
+
import 'systemjs';
|
|
3
|
+
import 'jquery';
|
|
4
|
+
import 'axios';
|
|
5
|
+
import boostrap from 'bootstrap';
|
|
6
|
+
import * as vue from 'vue';
|
|
7
|
+
|
|
8
|
+
declare global {
|
|
9
|
+
var S: typeof System;
|
|
10
|
+
var bootstrap: typeof boostrap;
|
|
11
|
+
var Vue: typeof vue;
|
|
12
|
+
}
|