Fine0830 commented on a change in pull request #530:
URL:
https://github.com/apache/skywalking-rocketbot-ui/pull/530#discussion_r695485138
##########
File path: src/views/components/trace/trace-search.vue
##########
@@ -156,12 +169,12 @@ limitations under the License. -->
};
}
private chooseService(i: Option) {
- if (this.service.key === i.key) {
+ if (this.rocketTrace.currentService.key === i.key) {
return;
}
this.instance = { label: 'All', key: '' };
this.endpoint = { label: 'All', key: '' };
- this.service = i;
+ this.rocketTrace.currentService = i;
Review comment:
The same as above
##########
File path: src/utils/queryParameter.ts
##########
@@ -0,0 +1,30 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export const getQueryParameter = (name: string) => {
+ const reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
+ const r = window.location.search.substr(1).match(reg);
+ if (r != null) {
+ return decodeURIComponent(r[2]);
+ } else {
+ return '';
+ }
+};
+
+export const getServiceName = () => {
Review comment:
The function is not used, please delete it.
##########
File path: src/views/components/dashboard/charts/chart-slow.vue
##########
@@ -54,10 +79,34 @@ limitations under the License. -->
private handleClick(i: any) {
copy(i);
}
+ private handleLink(i: any) {
+ if (this.isServiceChart) {
+ this.redirectData.log = {
+ path: 'log',
+ query: {
+ service: encodeURIComponent(i.name),
+ },
+ };
+ this.redirectData.trace = {
+ path: 'trace',
+ query: {
+ service: encodeURIComponent(i.name),
+ },
+ };
+ this.showModal = true;
+ }
+ }
get datas() {
if (!this.data.length) {
return [];
}
+ for (const i of this.data) {
+ if (this.isServiceChart) {
+ i.url = '/trace?service=' + encodeURIComponent(i.name);
+ } else {
+ i.url = undefined;
Review comment:
Where is the filed of `url` used? It seems to be needed.
##########
File path: src/views/components/trace/trace-search.vue
##########
@@ -132,19 +131,33 @@ limitations under the License. -->
private tagsMap: Array<{ key: string; value: string }> = [];
private tagsList: string[] = [];
private clearTags: boolean = false;
+ private serviceName: string = '';
private created() {
this.traceId = this.$route.query.traceid ?
this.$route.query.traceid.toString() : this.traceId;
+ this.serviceName = this.$route.query.service ?
this.$route.query.service.toString() : this.serviceName;
this.time = [this.rocketbotGlobal.durationRow.start,
this.rocketbotGlobal.durationRow.end];
}
private mounted() {
- this.getTraceList();
- if (this.service && this.service.key) {
- this.GET_INSTANCES({
- duration: this.durationTime,
- serviceId: this.service.key,
+ this.GET_SERVICES({ duration: this.durationTime })
+ .then(() => {
+ if (this.serviceName) {
+ for (const s of this.rocketTrace.services) {
+ if (s.label === this.serviceName) {
+ this.rocketTrace.currentService.key = s.key;
+ this.rocketTrace.currentService.label = s.label;
Review comment:
You should set the `rocketTrace.currentService` value in [Trace
Mutations](https://github.com/apache/skywalking-rocketbot-ui/blob/master/src/store/modules/trace/index.ts#L62)
##########
File path: src/views/components/trace/trace-search.vue
##########
@@ -248,7 +260,7 @@ limitations under the License. -->
localStorage.removeItem('maxTraceDuration');
this.minTraceDuration = '';
localStorage.removeItem('minTraceDuration');
- this.service = { label: 'All', key: '' };
+ this.rocketTrace.currentService = { label: 'All', key: '' };
Review comment:
The same as above
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]