fs_map = mgr.get('fs_map')
if self._minimal:
fs_map = self._partial_dict(fs_map, ['filesystems', 'standbys'])
- fs_map['standbys'] = [{}] * len(fs_map['standbys'])
fs_map['filesystems'] = [self._partial_dict(item, ['mdsmap']) for
item in fs_map['filesystems']]
for fs in fs_map['filesystems']:
min_mdsmap_info = dict()
for k, v in mdsmap_info.items():
min_mdsmap_info[k] = self._partial_dict(v, ['state'])
- fs['mdsmap'] = dict(info=min_mdsmap_info)
return fs_map
def host_count(self):
mgr_map = mgr.get('mgr_map')
if self._minimal:
mgr_map = self._partial_dict(mgr_map, ['active_name', 'standbys'])
- mgr_map['standbys'] = [{}] * len(mgr_map['standbys'])
return mgr_map
def mon_status(self):
<cd-info-card cardTitle="Metadata Servers"
i18n-cardTitle
class="col-sm-6 col-md-4 col-lg-3"
- *ngIf="(enabledFeature.cephfs && healthData.fs_map | mdsSummary) as transformedResult"
+ *ngIf="((enabledFeature.cephfs && healthData.fs_map) | mdsSummary) as transformedResult"
[contentClass]="(transformedResult.length > 1 ? 'text-area-size-2' : '') + ' content-highlight'">
<span *ngFor="let result of transformedResult"
- [ngClass]="result.class">
+ [ngClass]="result.class"
+ [title]="result.titleText != null ? result.titleText : ''">
{{ result.content }}
</span>
</cd-info-card>
white-space: pre;
}
-.mgr-active-name:hover {
+.popover-info:hover {
cursor: pointer;
}
mgr_map: { standbys: [] },
hosts: 0,
rgw: 0,
- fs_map: { filesystems: [] },
+ fs_map: { filesystems: [], standbys: [] },
iscsi_daemons: 0,
client_perf: {},
scrub_status: 'Inactive',
it('transforms with 0 active and 2 standy', () => {
const payload = {
- standbys: [0],
+ standbys: [{ name: 'a' }],
filesystems: [{ mdsmap: { info: [{ state: 'up:standby-replay' }] } }]
};
const expected = [
- { class: '', content: '0 active' },
- { class: 'card-text-line-break', content: '' },
- { class: '', content: '2 standby' }
+ { class: 'popover-info', content: '0 active', titleText: '1 standbyReplay' },
+ { class: 'card-text-line-break', content: '', titleText: '' },
+ { class: 'popover-info', content: '2 standby', titleText: 'standby daemons: a' }
];
expect(pipe.transform(payload)).toEqual(expected);
it('transforms with 1 active and 1 standy', () => {
const payload = {
- standbys: [0],
- filesystems: [{ mdsmap: { info: [{ state: 'up:active' }] } }]
+ standbys: [{ name: 'b' }],
+ filesystems: [{ mdsmap: { info: [{ state: 'up:active', name: 'a' }] } }]
};
const expected = [
- { class: '', content: '1 active' },
- { class: 'card-text-line-break', content: '' },
- { class: '', content: '1 standby' }
+ { class: 'popover-info', content: '1 active', titleText: 'active daemon: a' },
+ { class: 'card-text-line-break', content: '', titleText: '' },
+ { class: 'popover-info', content: '1 standby', titleText: 'standby daemons: b' }
];
expect(pipe.transform(payload)).toEqual(expected);
});
standbys: [0],
filesystems: []
};
- const expected = [{ class: '', content: 'no filesystems' }];
+ const expected = [{ class: 'popover-info', content: 'no filesystems', titleText: '' }];
expect(pipe.transform(payload)).toEqual(expected);
});
it('transforms without filesystem', () => {
- const payload = { standbys: [0] };
+ const payload = { standbys: [{ name: 'a' }] };
const expected = [
- { class: '', content: '1 up' },
- { class: 'card-text-line-break', content: '' },
- { class: '', content: 'no filesystems' }
+ { class: 'popover-info', content: '1 up', titleText: '' },
+ { class: 'card-text-line-break', content: '', titleText: '' },
+ { class: 'popover-info', content: 'no filesystems', titleText: 'standby daemons: a' }
];
expect(pipe.transform(payload)).toEqual(expected);
contentLine1 = `${active} ${this.i18n('active')}`;
contentLine2 = `${standbys + standbyReplay} ${this.i18n('standby')}`;
}
-
+ const standbyHoverText = value.standbys.map((s: any): string => s.name).join(', ');
+ const standbyTitleText = !standbyHoverText
+ ? ''
+ : `${this.i18n('standby daemons')}: ${standbyHoverText}`;
+ const fsLength = value.filesystems ? value.filesystems.length : 0;
+ const infoObject = fsLength > 0 ? value.filesystems[0].mdsmap.info : {};
+ const activeHoverText = Object.values(infoObject)
+ .map((info: any): string => info.name)
+ .join(', ');
+ let activeTitleText = !activeHoverText
+ ? ''
+ : `${this.i18n('active daemon')}: ${activeHoverText}`;
+ // There is always one standbyreplay to replace active daemon, if active one is down
+ if (!active && fsLength > 0) {
+ activeTitleText = `${standbyReplay} ${this.i18n('standbyReplay')}`;
+ }
const mgrSummary = [
{
content: contentLine1,
- class: ''
+ class: 'popover-info',
+ titleText: activeTitleText
}
];
-
if (contentLine2) {
mgrSummary.push({
content: '',
- class: 'card-text-line-break'
+ class: 'card-text-line-break',
+ titleText: ''
});
mgrSummary.push({
content: contentLine2,
- class: ''
+ class: 'popover-info',
+ titleText: standbyTitleText
});
}
standbys: []
};
const expected = [
- { class: 'mgr-active-name', content: 'n/a active', titleText: '' },
+ { class: 'popover-info', content: 'n/a active', titleText: '' },
{ class: 'card-text-line-break', content: '', titleText: '' },
- { class: '', content: '0 standby', titleText: '' }
+ { class: 'popover-info', content: '0 standby', titleText: '' }
];
expect(pipe.transform(payload)).toEqual(expected);
it('transforms with 1 active and 2 standbys', () => {
const payload = {
- active_name: 'a',
- standbys: ['b', 'c']
+ active_name: 'x',
+ standbys: [{ name: 'y' }, { name: 'z' }]
};
const expected = [
- { class: 'mgr-active-name', content: '1 active', titleText: 'active daemon: a' },
+ { class: 'popover-info', content: '1 active', titleText: 'active daemon: x' },
{ class: 'card-text-line-break', content: '', titleText: '' },
- { class: '', content: '2 standby', titleText: '' }
+ { class: 'popover-info', content: '2 standby', titleText: 'standby daemons: y, z' }
];
expect(pipe.transform(payload)).toEqual(expected);
}
let activeCount = this.i18n('n/a');
- const titleText = _.isUndefined(value.active_name)
+ const activeTitleText = _.isUndefined(value.active_name)
? ''
: `${this.i18n('active daemon')}: ${value.active_name}`;
- if (titleText.length > 0) {
+ // There is always one standbyreplay to replace active daemon, if active one is down
+ if (activeTitleText.length > 0) {
activeCount = '1';
}
+ const standbyHoverText = value.standbys.map((s: any): string => s.name).join(', ');
+ const standbyTitleText = !standbyHoverText
+ ? ''
+ : `${this.i18n('standby daemons')}: ${standbyHoverText}`;
const standbyCount = value.standbys.length;
const mgrSummary = [
{
content: `${activeCount} ${this.i18n('active')}`,
- class: 'mgr-active-name',
- titleText: titleText
+ class: 'popover-info',
+ titleText: activeTitleText
}
];
});
mgrSummary.push({
content: `${standbyCount} ${this.i18n('standby')}`,
- class: '',
- titleText: ''
+ class: 'popover-info',
+ titleText: standbyTitleText
});
return mgrSummary;