]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/ceph-short-version.pipe.ts
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / pipes / ceph-short-version.pipe.ts
1 import { Pipe, PipeTransform } from '@angular/core';
2
3 @Pipe({
4 name: 'cephShortVersion'
5 })
6 export class CephShortVersionPipe implements PipeTransform {
7 transform(value: any): any {
8 // Expect "ceph version 1.2.3-g9asdasd (as98d7a0s8d7)"
9 const result = /ceph version\s+([^ ]+)\s+\(.+\)/.exec(value);
10 if (result) {
11 // Return the "1.2.3-g9asdasd" part
12 return result[1];
13 } else {
14 // Unexpected format, pass it through
15 return value;
16 }
17 }
18 }