Skip to content
This repository was archived by the owner on Jun 1, 2022. It is now read-only.

Commit 4e6d387

Browse files
authored
Change the app display name to service (#366)
1 parent 00bf514 commit 4e6d387

File tree

9 files changed

+53
-37
lines changed

9 files changed

+53
-37
lines changed

src/assets/lang/en.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@ const m = {
2727
currentService: 'Current Service',
2828
currentEndpoint: 'Current Endpoint',
2929
currentInstance: 'Current Instance',
30-
currentApp: 'Current App',
3130
currentVersion: 'Current Version',
3231
currentPage: 'Current Page',
33-
app: 'App',
3432
version: 'Version',
3533
page: 'Page',
3634
currentDatabase: 'Current Database',

src/assets/lang/zh.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@ const m = {
2727
currentService: '当前服务',
2828
currentEndpoint: '当前端点',
2929
currentInstance: '当前实例',
30-
currentApp: '当前应用',
3130
currentVersion: '当前版本',
3231
currentPage: '当前页面',
33-
app: '应用',
3432
version: '版本',
3533
page: '页面',
3634
currentDatabase: '当前数据库',

src/components/rk-header.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,18 @@ limitations under the License. -->
4343
</svg>
4444
<span class="vm hide-xs ml-5">{{ this.$t('profile') }}</span>
4545
</router-link>
46-
<router-link class="nav-link mr-20" to="/alarm">
47-
<svg class="icon sm vm">
48-
<use xlink:href="#spam"></use>
49-
</svg>
50-
<span class="vm hide-xs ml-5">{{ this.$t('alarm') }}</span>
51-
</router-link>
5246
<router-link class="nav-link mr-20" to="/log">
5347
<svg class="icon sm vm">
5448
<use xlink:href="#assignment"></use>
5549
</svg>
5650
<span class="vm hide-xs ml-5">{{ this.$t('log') }}</span>
5751
</router-link>
52+
<router-link class="nav-link mr-20" to="/alarm">
53+
<svg class="icon sm vm">
54+
<use xlink:href="#spam"></use>
55+
</svg>
56+
<span class="vm hide-xs ml-5">{{ this.$t('alarm') }}</span>
57+
</router-link>
5858
</div>
5959
<div class="flex-h">
6060
<a class="rk-btn mr-5 sm" :class="auto ? 'blue' : 'ghost'" @click="handleAuto">

src/store/modules/dashboard/dashboard-option.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { Commit, ActionTree, MutationTree, Dispatch } from 'vuex';
1919
import * as types from './mutation-types';
2020
import { AxiosResponse } from 'axios';
2121
import graph from '@/graph';
22+
import router from '../../../router';
2223

2324
export interface State {
2425
services: any[];
@@ -44,12 +45,17 @@ const initState: State = {
4445
updateDashboard: {},
4546
};
4647

48+
const concatOption = (data: any) => {
49+
const isLog: boolean = router.app.$route.fullPath === '/log';
50+
return isLog ? [{ label: 'All', key: '' }].concat(data) : data;
51+
};
4752
// getters
4853
const getters = {};
4954

5055
// mutations
5156
const mutations: MutationTree<State> = {
5257
[types.SET_SERVICES](state: State, data: any) {
58+
data = concatOption(data);
5359
state.services = data;
5460
state.currentService = data[0] || {};
5561
},
@@ -63,6 +69,7 @@ const mutations: MutationTree<State> = {
6369
},
6470

6571
[types.SET_ENDPOINTS](state: State, data: any) {
72+
data = concatOption(data);
6673
state.endpoints = data;
6774
if (!data.length) {
6875
state.currentEndpoint = {};
@@ -77,6 +84,7 @@ const mutations: MutationTree<State> = {
7784
state.updateDashboard = endpoint;
7885
},
7986
[types.SET_INSTANCES](state: State, data: any) {
87+
data = concatOption(data);
8088
state.instances = data;
8189
if (!data.length) {
8290
state.currentInstance = {};
@@ -185,6 +193,11 @@ const actions: ActionTree<State, any> = {
185193
context.dispatch('GET_SERVICE_ENDPOINTS', {});
186194
context.dispatch('GET_SERVICE_INSTANCES', { duration: params.duration });
187195
},
196+
SELECT_LOG_SERVICE(context: { commit: Commit; dispatch: Dispatch }, params: any) {
197+
context.commit('SET_CURRENT_SERVICE', params.service);
198+
context.dispatch('GET_SERVICE_ENDPOINTS', {});
199+
context.dispatch('GET_SERVICE_INSTANCES', { duration: params.duration });
200+
},
188201
SELECT_ENDPOINT(context: { commit: Commit; dispatch: Dispatch; state: any; rootState: any }, params: any) {
189202
context.commit('SET_CURRENT_ENDPOINT', params.endpoint);
190203
},

src/store/modules/log/index.ts

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,14 @@ import * as types from '@/store/mutation-types';
2020
import { AxiosResponse } from 'axios';
2121
import graph from '@/graph';
2222

23-
enum ErrorCategory {
24-
ALL,
25-
AJAX,
26-
RESOURCE,
27-
VUE,
28-
PROMISE,
29-
JS,
30-
UNKNOWN,
31-
}
32-
33-
const categories = [];
34-
for (const key in ErrorCategory) {
35-
const keyToAny: any = key;
36-
if (isNaN(keyToAny)) {
37-
categories.push({ label: keyToAny, key: keyToAny });
38-
}
39-
}
23+
const categories: any = [
24+
{ label: 'All', key: 'ALL' },
25+
{ label: 'Ajax', key: 'AJAX' },
26+
{ label: 'Resource', key: 'RESOURCE' },
27+
{ label: 'Vue', key: 'VUE' },
28+
{ label: 'Js', key: 'JS' },
29+
{ label: 'Unknown', key: 'UNKNOWN' },
30+
];
4031

4132
export interface State {
4233
type: any;
@@ -57,7 +48,7 @@ const initState: State = {
5748
logs: [],
5849
total: 0,
5950
categories,
60-
category: { label: 'ALL', key: 'ALL' },
51+
category: { label: 'All', key: 'ALL' },
6152
loading: false,
6253
};
6354

src/views/components/dashboard/charts/constant.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ export const EntityType = [
2222
{ key: 'ServiceInstance', label: 'Service Instance' },
2323
];
2424
export const BrowserEntityType = [
25-
{ key: 'Service', label: 'App' },
25+
{ key: 'Service', label: 'Service' },
2626
{ key: 'All', label: 'All' },
27-
{ key: 'Endpoint', label: 'App Page' },
28-
{ key: 'ServiceInstance', label: 'App Single Version' },
27+
{ key: 'Endpoint', label: 'Page Path' },
28+
{ key: 'ServiceInstance', label: 'Service Version' },
2929
];
3030

3131
export const IndependentType = [

src/views/components/dashboard/tool-bar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ limitations under the License. -->
5959
<template v-if="compType === dashboardType.BROWSER">
6060
<ToolBarSelect
6161
@onChoose="selectService"
62-
:title="this.$t('currentApp')"
62+
:title="this.$t('currentService')"
6363
:current="stateDashboard.currentService"
6464
:data="stateDashboard.services"
6565
icon="package"

src/views/components/log/log-bar.vue

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ limitations under the License. -->
2323
/>
2424
<ToolBarSelect
2525
@onChoose="selectService"
26-
:title="this.$t('app')"
26+
:title="this.$t('service')"
2727
:current="rocketOption.currentService"
2828
:data="rocketOption.services"
2929
icon="package"
@@ -35,7 +35,7 @@ limitations under the License. -->
3535
:data="rocketOption.instances"
3636
icon="disk"
3737
/>
38-
<ToolBarEndpointSelect
38+
<ToolBarSelect
3939
@onChoose="selectEndpoint"
4040
:title="this.$t('page')"
4141
:current="rocketOption.currentEndpoint"
@@ -52,6 +52,12 @@ limitations under the License. -->
5252
</div>
5353

5454
<span class="flex-h rk-right">
55+
<a class="rk-log-clear-btn r mr-10" @click="clearSearch">
56+
<svg class="icon mr-5 vm">
57+
<use xlink:href="#clear"></use>
58+
</svg>
59+
<span class="vm">{{ this.$t('clear') }}</span>
60+
</a>
5561
<a class="rk-log-search-btn bg-blue mr-10" @click="queryLogs">
5662
<svg class="icon mr-5 vm">
5763
<use xlink:href="#search"></use>
@@ -81,7 +87,7 @@ limitations under the License. -->
8187
@Mutation('SELECT_LOG_TYPE') private SELECT_LOG_TYPE: any;
8288
@Mutation('SELECT_ERROR_CATALOG') private SELECT_ERROR_CATALOG: any;
8389
84-
@Action('SELECT_SERVICE') private SELECT_SERVICE: any;
90+
@Action('SELECT_LOG_SERVICE') private SELECT_LOG_SERVICE: any;
8591
@Action('SELECT_DATABASE') private SELECT_DATABASE: any;
8692
@Action('SELECT_ENDPOINT') private SELECT_ENDPOINT: any;
8793
@Action('SELECT_INSTANCE') private SELECT_INSTANCE: any;
@@ -91,6 +97,7 @@ limitations under the License. -->
9197
@Getter('durationTime') private durationTime: any;
9298
9399
private pageNum: number = 1;
100+
94101
private beforeMount() {
95102
this.MIXHANDLE_GET_OPTION({
96103
compType: this.logState.type.key,
@@ -106,7 +113,7 @@ limitations under the License. -->
106113
}
107114
108115
private selectService(i: any) {
109-
this.SELECT_SERVICE({ service: i, duration: this.durationTime });
116+
this.SELECT_LOG_SERVICE({ service: i, duration: this.durationTime });
110117
}
111118
112119
private selectEndpoint(i: any) {
@@ -116,6 +123,10 @@ limitations under the License. -->
116123
private selectInstance(i: any) {
117124
this.SELECT_INSTANCE({ instance: i, duration: this.durationTime });
118125
}
126+
private clearSearch() {
127+
this.SELECT_LOG_SERVICE({ service: { label: 'All', key: '' }, duration: this.durationTime });
128+
this.SELECT_ERROR_CATALOG({ label: 'All', key: 'ALL' });
129+
}
119130
120131
private queryLogs() {
121132
const { currentService, currentInstance, currentEndpoint } = this.rocketOption;
@@ -158,4 +169,9 @@ limitations under the License. -->
158169
background-color: #448dfe;
159170
}
160171
}
172+
.rk-log-clear-btn {
173+
padding: 3px 9px;
174+
background-color: #484b55;
175+
border-radius: 4px;
176+
}
161177
</style>

src/views/components/log/log-table/log-constant.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const BrowserLogConstants = [
4949
},
5050
{
5151
label: 'errorUrl',
52-
value: 'Error Url',
52+
value: 'Error Page',
5353
},
5454
// {
5555
// label: 'pagePath',

0 commit comments

Comments
 (0)