Replace serviceFilter with serviceGroup (#375)
* Change "Service filter" to "Service group"
Signed-off-by: Gao Hongtao <hanahmily@gmail.com>
* Replace serviceFilter with serviceGroup
Signed-off-by: Gao Hongtao <hanahmily@gmail.com>
diff --git a/src/assets/lang/en.ts b/src/assets/lang/en.ts
index 307c863..81c5ccb 100644
--- a/src/assets/lang/en.ts
+++ b/src/assets/lang/en.ts
@@ -143,8 +143,7 @@
parentService: 'Parent Service',
isParentService: 'Set Parent Service',
noneParentService: 'No Parent Service',
- // TODO: var name should be updated to "serviceGroup" correspondingly.
- serviceFilter: 'Service Group',
+ serviceGroup: 'Service Group',
endpointFilter: 'Endpoint Filter',
editConfig: 'Edit Config',
databaseView: 'Database',
diff --git a/src/assets/lang/zh.ts b/src/assets/lang/zh.ts
index 1c79ecc..c781b1e 100644
--- a/src/assets/lang/zh.ts
+++ b/src/assets/lang/zh.ts
@@ -143,7 +143,7 @@
parentService: '父级服务',
isParentService: '设置父服务',
noneParentService: '不设置父服务',
- serviceFilter: '服务组',
+ serviceGroup: '服务组',
endpointFilter: '端点过滤器',
editConfig: '编辑',
databaseView: '数据库视图',
diff --git a/src/store/modules/dashboard/dashboard-data-layout.ts b/src/store/modules/dashboard/dashboard-data-layout.ts
index ea43176..02e45a4 100644
--- a/src/store/modules/dashboard/dashboard-data-layout.ts
+++ b/src/store/modules/dashboard/dashboard-data-layout.ts
@@ -33,7 +33,7 @@
tree: [
{
name: '',
- serviceFilter: '',
+ serviceGroup: '',
type: 'service',
query: {
service: {},
@@ -69,8 +69,8 @@
state.group = current;
state.current = 0;
},
- [types.SET_CURRENT_SERVICE_FILTER](state: State, serviceFilter: string) {
- state.tree.splice(state.group, 1, Object.assign(state.tree[state.group], { serviceFilter }));
+ [types.SET_CURRENT_SERVICE_GROUP](state: State, serviceGroup: string) {
+ state.tree.splice(state.group, 1, Object.assign(state.tree[state.group], { serviceGroup }));
window.localStorage.setItem('dashboard', JSON.stringify(state.tree));
},
[types.SET_CURRENT_GROUP_WITH_CURRENT](state: State, { index, current = 0 }: { index: number; current: number }) {
diff --git a/src/store/modules/dashboard/mutation-types.ts b/src/store/modules/dashboard/mutation-types.ts
index e3d7509..110b0dd 100644
--- a/src/store/modules/dashboard/mutation-types.ts
+++ b/src/store/modules/dashboard/mutation-types.ts
@@ -38,7 +38,7 @@
// comp
export const SET_CURRENT_GROUP = 'SET_CURRENT_GROUP';
-export const SET_CURRENT_SERVICE_FILTER = 'SET_CURRENT_SERVICE_FILTER';
+export const SET_CURRENT_SERVICE_GROUP = 'SET_CURRENT_SERVICE_GROUP';
export const SET_CURRENT_GROUP_WITH_CURRENT = 'SET_CURRENT_GROUP_WITH_CURRENT';
export const SET_CURRENT_COMPS = 'SET_CURRENT_COMPS';
export const ADD_COMPS_GROUP = 'ADD_COMPS_GROUP';
diff --git a/src/types/dashboard.d.ts b/src/types/dashboard.d.ts
index 991847e..ace8a2f 100644
--- a/src/types/dashboard.d.ts
+++ b/src/types/dashboard.d.ts
@@ -41,7 +41,7 @@
export interface CompsTree {
name?: string;
- serviceFilter?: string;
+ serviceGroup?: string;
type: string;
query: any;
children: any;
diff --git a/src/views/components/dashboard/tool-bar-btns.vue b/src/views/components/dashboard/tool-bar-btns.vue
index 293678d..28e9b40 100644
--- a/src/views/components/dashboard/tool-bar-btns.vue
+++ b/src/views/components/dashboard/tool-bar-btns.vue
@@ -75,7 +75,7 @@
compType: this.compType,
duration: this.durationTime,
keywordServiceName:
- this.rocketComps.tree[this.rocketComps.group] && this.rocketComps.tree[this.rocketComps.group].serviceFilter,
+ this.rocketComps.tree[this.rocketComps.group] && this.rocketComps.tree[this.rocketComps.group].serviceGroup,
});
}
private handleSetEdit() {
diff --git a/src/views/components/dashboard/tool-bar.vue b/src/views/components/dashboard/tool-bar.vue
index 3d8aea5..e6fe483 100644
--- a/src/views/components/dashboard/tool-bar.vue
+++ b/src/views/components/dashboard/tool-bar.vue
@@ -24,10 +24,10 @@
></ToolBarBtns>
<div class="rk-dashboard-bar flex-h" v-if="compType !== dashboardType.DATABASE">
<div class="sm grey service-search" v-if="compType === dashboardType.SERVICE">
- <div>{{ this.$t('serviceFilter') }}</div>
+ <div>{{ this.$t('serviceGroup') }}</div>
<input
type="text"
- :value="rocketComps.tree[rocketComps.group].serviceFilter"
+ :value="rocketComps.tree[rocketComps.group].serviceGroup"
@change="searchServices($event.target.value)"
/>
</div>
@@ -109,7 +109,7 @@
@Prop() private durationTime!: any;
@State('rocketOption') private rocketOption: any;
@Mutation('ADD_COMP') private ADD_COMP: any;
- @Mutation('SET_CURRENT_SERVICE_FILTER') private SET_CURRENT_SERVICE_FILTER: any;
+ @Mutation('SET_CURRENT_SERVICE_GROUP') private SET_CURRENT_SERVICE_GROUP: any;
@Mutation('UPDATE_DASHBOARD') private UPDATE_DASHBOARD: any;
@Action('SELECT_SERVICE') private SELECT_SERVICE: any;
@Action('SELECT_DATABASE') private SELECT_DATABASE: any;
@@ -134,7 +134,7 @@
this.SELECT_INSTANCE({ instance: i, duration: this.durationTime });
}
private searchServices(value: string) {
- this.SET_CURRENT_SERVICE_FILTER(value);
+ this.SET_CURRENT_SERVICE_GROUP(value);
this.MIXHANDLE_GET_OPTION({
compType: this.dashboardType.SERVICE,
duration: this.durationTime,
diff --git a/src/views/components/dashboard/tool-group.vue b/src/views/components/dashboard/tool-group.vue
index 249e113..7e6c105 100644
--- a/src/views/components/dashboard/tool-group.vue
+++ b/src/views/components/dashboard/tool-group.vue
@@ -17,7 +17,7 @@
<span v-for="(i, index) in rocketComps.tree || []" :key="index" class="mr-15">
<a
class="rk-dashboard-group-i mb-10"
- @click="handleOption(index, i.serviceFilter)"
+ @click="handleOption(index, i.serviceGroup)"
:class="{
active: rocketComps.group == index,
grey: rocketComps.group != index,
@@ -112,12 +112,12 @@
return templates;
}
- private handleOption(index: number, serviceFilter: string) {
+ private handleOption(index: number, serviceGroup: string) {
this.MIXHANDLE_CHANGE_GROUP(index);
return this.MIXHANDLE_GET_OPTION({
compType: this.compType,
duration: this.durationTime,
- keywordServiceName: serviceFilter,
+ keywordServiceName: serviceGroup,
});
}
private handleHide() {
diff --git a/src/views/containers/dashboard.vue b/src/views/containers/dashboard.vue
index 016bfc8..c1daf01 100644
--- a/src/views/containers/dashboard.vue
+++ b/src/views/containers/dashboard.vue
@@ -100,7 +100,7 @@
compType: this.compType,
duration: this.durationTime,
keywordServiceName:
- this.rocketComps.tree[this.rocketComps.group] && this.rocketComps.tree[this.rocketComps.group].serviceFilter,
+ this.rocketComps.tree[this.rocketComps.group] && this.rocketComps.tree[this.rocketComps.group].serviceGroup,
});
}
private beforeMount() {