未验证 提交 2a2cc9b9 编写于 作者: M Marcos Diez 提交者: GitHub

On the PV detail page, the PVC should be a link (#5767)

上级 2873139f
......@@ -23,6 +23,8 @@ import {ActionbarService, ResourceMeta} from '../../../../common/services/global
import {NotificationsService} from '../../../../common/services/global/notifications';
import {EndpointManager, Resource} from '../../../../common/services/resource/endpoint';
import {ResourceService} from '../../../../common/services/resource/resource';
import {KdStateService} from '../../../../common/services/global/state';
import {GlobalServicesModule} from '../../../../common/services/global/module';
@Component({
selector: 'kd-persistent-volume-detail',
......@@ -32,6 +34,8 @@ export class PersistentVolumeDetailComponent implements OnInit, OnDestroy {
private readonly endpoint_ = EndpointManager.resource(Resource.persistentVolume);
private readonly unsubscribe_ = new Subject<void>();
private readonly kdState_: KdStateService = GlobalServicesModule.injector.get(KdStateService);
persistentVolume: PersistentVolumeDetail;
isInitialized = false;
......@@ -87,4 +91,15 @@ export class PersistentVolumeDetailComponent implements OnInit, OnDestroy {
trackByCapacityItemName(_: number, item: CapacityItem): any {
return item.resourceName;
}
getClaimHref(claimReference: string): string {
let href = '';
const splittedRef = claimReference.split('/');
if (splittedRef.length === 2) {
href = this.kdState_.href('persistentvolumeclaim', splittedRef[1], splittedRef[0]);
}
return href;
}
}
......@@ -33,7 +33,12 @@ limitations under the License.
<kd-property *ngIf="persistentVolume?.claim">
<div key
i18n>Claim</div>
<div value>{{persistentVolume.claim}}</div>
<div value>
<a [routerLink]="getClaimHref(persistentVolume.claim)"
queryParamsHandling="preserve">
{{persistentVolume.claim}}
</a>
</div>
</kd-property>
<kd-property *ngIf="persistentVolume?.reclaimPolicy">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册