Skip to content

Commit e5a03e8

Browse files
authored
Merge pull request #10 from beclab/fix/dashboard-analytics
fix: fix dashboard analytics and controlhub ui
2 parents 2105cf3 + 8d831c0 commit e5a03e8

File tree

13 files changed

+117
-40
lines changed

13 files changed

+117
-40
lines changed

apps/adminConsole/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@apps/admin_console",
3-
"version": "0.4.10",
3+
"version": "0.4.11",
44
"description": "Control Hub",
55
"productName": "Control Hub",
66
"private": true,

apps/adminConsole/src/css/quasar.variables.scss

+6
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,9 @@ $space-xl-base: 32px;
3535
$space-xxl-base: 44px;
3636

3737
$separator-color: $separator !important;
38+
39+
$tooltip-color: $ink-tooltip;
40+
$tooltip-background: $tooltip-bg;
41+
$tooltip-padding: 4px 8px;
42+
$tooltip-border-radius: 4px;
43+
$tooltip-fontsize: 12px;

apps/adminConsole/yarn.lock

+15-7
Original file line numberDiff line numberDiff line change
@@ -3295,7 +3295,7 @@ [email protected]:
32953295
dependencies:
32963296
is-obj "^2.0.0"
32973297

3298-
dunder-proto@^1.0.0:
3298+
dunder-proto@^1.0.1:
32993299
version "1.0.1"
33003300
resolved "https://registry.yarnpkg.com/dunder-proto/-/dunder-proto-1.0.1.tgz#d7ae667e1dc83482f8b70fd0f6eefc50da30f58a"
33013301
integrity sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==
@@ -3966,20 +3966,28 @@ get-intrinsic@^1.1.3, get-intrinsic@^1.2.4:
39663966
hasown "^2.0.0"
39673967

39683968
get-intrinsic@^1.2.5, get-intrinsic@^1.2.6:
3969-
version "1.2.6"
3970-
resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.6.tgz#43dd3dd0e7b49b82b2dfcad10dc824bf7fc265d5"
3971-
integrity sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA==
3969+
version "1.2.7"
3970+
resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.7.tgz#dcfcb33d3272e15f445d15124bc0a216189b9044"
3971+
integrity sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==
39723972
dependencies:
39733973
call-bind-apply-helpers "^1.0.1"
3974-
dunder-proto "^1.0.0"
39753974
es-define-property "^1.0.1"
39763975
es-errors "^1.3.0"
39773976
es-object-atoms "^1.0.0"
39783977
function-bind "^1.1.2"
3978+
get-proto "^1.0.0"
39793979
gopd "^1.2.0"
39803980
has-symbols "^1.1.0"
39813981
hasown "^2.0.2"
3982-
math-intrinsics "^1.0.0"
3982+
math-intrinsics "^1.1.0"
3983+
3984+
get-proto@^1.0.0:
3985+
version "1.0.1"
3986+
resolved "https://registry.yarnpkg.com/get-proto/-/get-proto-1.0.1.tgz#150b3f2743869ef3e851ec0c49d15b1d14d00ee1"
3987+
integrity sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==
3988+
dependencies:
3989+
dunder-proto "^1.0.1"
3990+
es-object-atoms "^1.0.0"
39833991

39843992
get-stream@^6.0.0:
39853993
version "6.0.1"
@@ -4783,7 +4791,7 @@ magic-string@^0.30.7:
47834791
dependencies:
47844792
"@jridgewell/sourcemap-codec" "^1.4.15"
47854793

4786-
math-intrinsics@^1.0.0:
4794+
math-intrinsics@^1.1.0:
47874795
version "1.1.0"
47884796
resolved "https://registry.yarnpkg.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9"
47894797
integrity sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==

apps/common/src/components/Menu/MyTree.vue

+23-3
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ import {
135135
onUnmounted,
136136
PropType,
137137
ref,
138-
watch
138+
watch,
139+
onUpdated
139140
} from 'vue';
140141
import { defaultMenuOptions, MenuItem, MenuOptions } from '../../types/menu';
141142
import { useRouter } from 'vue-router';
@@ -177,6 +178,9 @@ const props = withDefaults(defineProps<Props>(), {
177178
const options = ref({});
178179
const selected = ref(props.defaultActive);
179180
const expanded = ref(props.defaultOpeneds);
181+
const extraWidth = ref(32);
182+
183+
const extraWidthPx = computed(() => extraWidth.value + 'px');
180184
181185
watch(
182186
() => props.defaultActive,
@@ -199,6 +203,11 @@ onMounted(() => {
199203
};
200204
});
201205
206+
onUpdated(() => {
207+
extraWidth.value =
208+
document.querySelector('.my-content-page-header-extra')?.clientWidth ?? 0;
209+
});
210+
202211
const resetSelected = () => {
203212
selected.value = [];
204213
};
@@ -321,12 +330,23 @@ defineExpose({ resetSelected, setExpanded, getExpandedNodes });
321330
top: 0;
322331
left: 0;
323332
right: 0;
324-
padding-right: 64px;
333+
padding-right: v-bind(extraWidthPx);
325334
height: $content-header-height;
326335
}
327336
</style>
328-
329337
<style lang="scss" scoped>
338+
.my-tree-wrapper {
339+
::v-deep(.q-tree__arrow) {
340+
font-size: 14px;
341+
border: 1px solid rbga(255, 255, 255, 0);
342+
color: $ink-1;
343+
}
344+
::v-deep(.q-tree__spinner) {
345+
font-size: 14px;
346+
border: 1px solid rbga(255, 255, 255, 0);
347+
color: $ink-1;
348+
}
349+
}
330350
::v-deep(.selected-node) {
331351
position: relative;
332352
&::after {
Binary file not shown.

apps/monitoring/fonttools/unicodes.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ f8b6
1616
e88e
1717
f0cc
1818
f20c
19-
e89d
19+
e89e
2020
e694
2121
eb8e
2222
e8e3
2323
e8e5
24+
e8f4
25+
e8f5
2426
f1c3

apps/monitoring/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@apps/monitoring",
3-
"version": "0.4.8",
3+
"version": "0.4.9",
44
"description": "Dashboard",
55
"productName": "Dashboard",
66
"private": true,
Binary file not shown.

apps/monitoring/src/css/quasar.variables.scss

+6
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,9 @@ $space-md-base: 12px;
3333
$space-lg-base: 20px;
3434
$space-xl-base: 32px;
3535
$space-xxl-base: 44px;
36+
37+
$tooltip-color: $ink-tooltip;
38+
$tooltip-background: $tooltip-bg;
39+
$tooltip-padding: 4px 8px;
40+
$tooltip-border-radius: 4px;
41+
$tooltip-fontsize: 12px;

apps/monitoring/src/i18n/en-US/index.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ const options = {
4545
RUNNING: 'Running',
4646
SUSPEND: 'Suspend',
4747
RESUMING: 'Resuming',
48-
UNINSTALLING: 'Uninstalling'
48+
UNINSTALLING: 'Uninstalling',
49+
OPEN_APP: 'Open App',
50+
VIEW_DETAIL: 'View Detail'
4951
};
5052

5153
export default options;

apps/monitoring/src/i18n/zh-CN/index.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ const options = {
4545
RUNNING: '运行中',
4646
SUSPEND: '暂停',
4747
RESUMING: '恢复',
48-
UNINSTALLING: '正在卸载'
48+
UNINSTALLING: '正在卸载',
49+
OPEN_APP: '打开应用',
50+
VIEW_DETAIL: '查看详情'
4951
};
5052

5153
export default options;

apps/monitoring/src/pages/Analytics/IndexPage.vue

+32-23
Original file line numberDiff line numberDiff line change
@@ -47,30 +47,39 @@ const fetchData = () => {
4747
let icon = '';
4848
let title = '';
4949
apps.value = resApps.data.data.items;
50-
websites.value = res.data.map((item) => {
51-
const app = apps.value.find((app: any) => app.name === item.name);
52-
if (app) {
53-
return {
54-
...app,
55-
...item,
56-
title: app.title,
57-
icon: app.icon,
58-
url:
59-
app.name === 'profile'
60-
? `//${app.url.split('profile.')[1]}`
61-
: `//${app.url}`
62-
};
63-
} else if (item.name === 'desktop') {
64-
icon = desktopIcon;
65-
title = 'Desktop';
50+
const appNames = apps.value
51+
.map((item: any) => item.name)
52+
.concat(['desktop']);
6653
67-
const url = `//desktop.${appDetail.user.username}${
68-
location.hostname.split(appDetail.user.username)[1]
69-
}`;
70-
return { ...app, ...item, title, icon, url };
71-
}
72-
return { ...app, ...item, url: `//${app.url}` };
73-
});
54+
websites.value = res.data
55+
.filter((item) => appNames.includes(item.name))
56+
.map((item) => {
57+
const app = apps.value.find((app: any) => app.name === item.name);
58+
if (app) {
59+
const entrance = app.entrances.find(
60+
(entrance) => !entrance.invisible
61+
);
62+
return {
63+
...app,
64+
...item,
65+
title: entrance.title,
66+
icon: entrance.icon,
67+
url:
68+
entrance.name === 'profile'
69+
? `//${app.url.split('profile.')[1]}`
70+
: `//${entrance.url}`
71+
};
72+
} else if (item.name === 'desktop') {
73+
icon = desktopIcon;
74+
title = 'Desktop';
75+
76+
const url = `//desktop.${appDetail.user.username}${
77+
location.hostname.split(appDetail.user.username)[1]
78+
}`;
79+
return { ...app, ...item, title, icon, url };
80+
}
81+
return { ...app, ...item, url: `//${app.url}` };
82+
});
7483
setWebsiteDateDefault(websites.value);
7584
})
7685
.finally(() => {

apps/monitoring/src/pages/Analytics/WebsiteChart.vue

+24-2
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,37 @@
88
<MyImg :src="icon" :loading="loading" />
99
</template>
1010
<template #extra>
11+
<QButtonStyle>
12+
<q-btn
13+
icon="sym_r_open_in_new"
14+
class="rounded-borders-sm q-mr-sm"
15+
dense
16+
outline
17+
color="ink-2"
18+
@click.stop="openUrl(url)"
19+
>
20+
<q-tooltip
21+
><span class="text-body3 text-ink-tooltip">{{
22+
$t('OPEN_APP')
23+
}}</span></q-tooltip
24+
>
25+
</q-btn>
26+
</QButtonStyle>
1127
<QButtonStyle>
1228
<q-btn
1329
icon="sym_r_assignment"
1430
class="rounded-borders-sm"
1531
dense
1632
outline
1733
color="ink-2"
18-
@click.stop="openUrl(url)"
19-
></q-btn>
34+
@click.stop="onClick"
35+
>
36+
<q-tooltip
37+
><span class="text-body3 text-ink-tooltip">{{
38+
$t('VIEW_DETAIL')
39+
}}</span></q-tooltip
40+
>
41+
</q-btn>
2042
</QButtonStyle>
2143
</template>
2244
<div class="q-gutter-y-xl">

0 commit comments

Comments
 (0)