Skip to content

Commit

Permalink
Merge pull request #239 from chengyumeng/hotfix/router
Browse files Browse the repository at this point in the history
frontend:fix error route in jump url
  • Loading branch information
chengyumeng committed Jan 22, 2019
2 parents 15545df + 2d7a1b2 commit bfb8e0b
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@ export class ListPodComponent implements OnInit, OnDestroy {

enterContainer(pod: Pod): void {
const appId = this.route.parent.snapshot.params['id'];
const url = `portal/namespace/${this.cacheService.namespaceId}/app
/${appId}/job/${this.job.metadata.name}/pod/${pod.name}/terminal/${this.currentCluster}/${this.cacheService.kubeNamespace}`;
const url = `portal/namespace/${this.cacheService.namespaceId}/app` +
`/${appId}/job/${this.job.metadata.name}/pod/${pod.name}/terminal/${this.currentCluster}/${this.cacheService.kubeNamespace}`;
window.open(url, '_blank');
}

podLog(pod: Pod): void {
const appId = this.route.parent.snapshot.params['id'];
const url = `portal/logging/namespace/${this.cacheService.namespaceId}/app
/${appId}/job/${this.job.metadata.name}/pod/${pod.name}/${this.currentCluster}/${this.cacheService.kubeNamespace}`;
const url = `portal/logging/namespace/${this.cacheService.namespaceId}/app` +
`/${appId}/job/${this.job.metadata.name}/pod/${pod.name}/${this.currentCluster}/${this.cacheService.kubeNamespace}`;
window.open(url, '_blank');
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,17 @@ export class ListPodComponent implements OnInit, OnDestroy {

enterContainer(pod: Pod): void {
const appId = this.route.parent.snapshot.params['id'];
const url = `portal/namespace/${this.cacheService.namespaceId}/app
/${appId}/daemonSet/${this.daemonSet}/pod/${pod.name}/terminal/${this.currentCluster}/${this.cacheService.kubeNamespace}`;
const url = `portal/namespace/${this.cacheService.namespaceId}/app` +
`/${appId}/daemonSet/${this.daemonSet}/pod/${pod.name}/terminal/${this.currentCluster}/${this.cacheService.kubeNamespace}`;
window.open(url, '_blank');
}


podLog(pod: Pod): void {

const appId = this.route.parent.snapshot.params['id'];
const url = `portal/logging/namespace/${this.cacheService.namespaceId}/app
/${appId}/daemonSet/${this.daemonSet}/pod/${pod.name}/${this.currentCluster}/${this.cacheService.kubeNamespace}`;
const url = `portal/logging/namespace/${this.cacheService.namespaceId}/app` +
`/${appId}/daemonSet/${this.daemonSet}/pod/${pod.name}/${this.currentCluster}/${this.cacheService.kubeNamespace}`;
window.open(url, '_blank');
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ export class ListPodComponent implements OnInit, OnDestroy {

enterContainer(pod: Pod): void {
const appId = this.route.parent.snapshot.params['id'];
const url = `portal/namespace/${this.cacheService.namespaceId}/app/${appId}/deployment
/${this.deployment}/pod/${pod.name}/terminal/${this.currentCluster}/${this.cacheService.kubeNamespace}`;
const url = `portal/namespace/${this.cacheService.namespaceId}/app/${appId}/deployment` +
`/${this.deployment}/pod/${pod.name}/terminal/${this.currentCluster}/${this.cacheService.kubeNamespace}`;
window.open(url, '_blank');
}

Expand All @@ -185,8 +185,8 @@ export class ListPodComponent implements OnInit, OnDestroy {

podLog(pod: Pod): void {
const appId = this.route.parent.snapshot.params['id'];
const url = `portal/logging/namespace/${this.cacheService.namespaceId}/app/${appId}/deployment/${this.deployment}
/pod/${pod.name}/${this.currentCluster}/${this.cacheService.kubeNamespace}`;
const url = `portal/logging/namespace/${this.cacheService.namespaceId}/app/${appId}/deployment/${this.deployment}` +
`/pod/${pod.name}/${this.currentCluster}/${this.cacheService.kubeNamespace}`;
window.open(url, '_blank');
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/frontend/src/app/portal/pod-logging/pod-logging.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ export class PodLoggingComponent implements OnInit, OnDestroy {
if (this.pods && this.pods.length > 0) {
const pod = this.getPodByName(podName);
if (!pod) {
const url = `portal/logging/namespace/${this.nid}/app/${this.appId}/
${this.resourceType}/${this.resourceName}/pod/${this.pods[0].name}/${this.cluster}/${this.namespace}`;
const url = `portal/logging/namespace/${this.nid}/app/${this.appId}/` +
`${this.resourceType}/${this.resourceName}/pod/${this.pods[0].name}/${this.cluster}/${this.namespace}`;
this.router.navigateByUrl(url);
}
this.selectedPod = pod;
Expand Down Expand Up @@ -123,8 +123,8 @@ export class PodLoggingComponent implements OnInit, OnDestroy {
}

containerChange() {
const url = `portal/logging/namespace/${this.nid}/app/${this.appId}/${this.resourceType}/
${this.resourceName}/pod/${this.selectedPod.name}/container/${this.selectedContainer}/${this.cluster}/${this.namespace}`;
const url = `portal/logging/namespace/${this.nid}/app/${this.appId}/${this.resourceType}/` +
`${this.resourceName}/pod/${this.selectedPod.name}/container/${this.selectedContainer}/${this.cluster}/${this.namespace}`;
this.router.navigateByUrl(url);
this.refreshLog();
}
Expand Down Expand Up @@ -157,8 +157,8 @@ export class PodLoggingComponent implements OnInit, OnDestroy {
this.containers = this.selectedPod.containerStatus;
if (this.containers && this.containers.length > 0) {
this.selectedContainer = this.containers[0].name;
const url = `portal/logging/namespace/${this.nid}/app/${this.appId}/${this.resourceType}/
${this.resourceName}/pod/${this.selectedPod.name}/container/${this.selectedContainer}/${this.cluster}/${this.namespace}`;
const url = `portal/logging/namespace/${this.nid}/app/${this.appId}/${this.resourceType}/` +
`${this.resourceName}/pod/${this.selectedPod.name}/container/${this.selectedContainer}/${this.cluster}/${this.namespace}`;
this.router.navigateByUrl(url);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export class PodTerminalComponent implements OnInit, OnDestroy {
if (this.pods && this.pods.length > 0) {
const pod = this.getPodByName(podName);
if (!pod) {
const url = `portal/namespace/${this.nid}/app/${this.appId}/${this.resourceType}
/${this.resourceName}/pod/${this.pods[0].name}/terminal/${this.cluster}/${this.namespace}`;
const url = `portal/namespace/${this.nid}/app/${this.appId}/${this.resourceType}` +
`/${this.resourceName}/pod/${this.pods[0].name}/terminal/${this.cluster}/${this.namespace}`;
this.router.navigateByUrl(url);
}
this.selectedPod = pod;
Expand All @@ -83,8 +83,8 @@ export class PodTerminalComponent implements OnInit, OnDestroy {
}

containerChange() {
const url = `portal/namespace/${this.nid}/app/${this.appId}/${this.resourceType}
/${this.resourceName}/pod/${this.selectedPod.name}/container/${this.selectedContainer}/terminal/${this.cluster}/${this.namespace}`;
const url = `portal/namespace/${this.nid}/app/${this.appId}/${this.resourceType}` +
`/${this.resourceName}/pod/${this.selectedPod.name}/container/${this.selectedContainer}/terminal/${this.cluster}/${this.namespace}`;
this.router.navigateByUrl(url);
}

Expand All @@ -104,8 +104,8 @@ export class PodTerminalComponent implements OnInit, OnDestroy {
podChange() {
this.containers = this.selectedPod.containerStatus;
this.selectedContainer = this.containers[0].name;
const url = `portal/namespace/${this.nid}/app/${this.appId}/${this.resourceType}/${this.resourceName}
/pod/${this.selectedPod.name}/container/${this.selectedContainer}/terminal/${this.cluster}/${this.namespace}`;
const url = `portal/namespace/${this.nid}/app/${this.appId}/${this.resourceType}/${this.resourceName}` +
`/pod/${this.selectedPod.name}/container/${this.selectedContainer}/terminal/${this.cluster}/${this.namespace}`;
this.router.navigateByUrl(url);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,16 @@ export class ListPodComponent implements OnInit, OnDestroy {

enterContainer(pod: Pod): void {
const appId = this.route.parent.snapshot.params['id'];
const url = `portal/namespace/${this.cacheService.namespaceId}/app/${appId}/statefulset
/${this.statefulset}/pod/${pod.name}/terminal/${this.currentCluster}/${this.cacheService.kubeNamespace}`;
const url = `portal/namespace/${this.cacheService.namespaceId}/app/${appId}/statefulset` +
`/${this.statefulset}/pod/${pod.name}/terminal/${this.currentCluster}/${this.cacheService.kubeNamespace}`;
window.open(url, '_blank');
}


podLog(pod: Pod): void {
const appId = this.route.parent.snapshot.params['id'];
const url = `portal/logging/namespace/${this.cacheService.namespaceId}/app
/${appId}/statefulset/${this.statefulset}/pod/${pod.name}/${this.currentCluster}/${this.cacheService.kubeNamespace}`;
const url = `portal/logging/namespace/${this.cacheService.namespaceId}/app` +
`/${appId}/statefulset/${this.statefulset}/pod/${pod.name}/${this.currentCluster}/${this.cacheService.kubeNamespace}`;
window.open(url, '_blank');
}
}
Expand Down

0 comments on commit bfb8e0b

Please sign in to comment.