mirror of
https://github.com/ceph/ceph
synced 2025-02-24 03:27:10 +00:00
mgr/dashboard: Display number of sessions on iSCSI overview page
Signed-off-by: Ricardo Marques <rimarques@suse.com>
This commit is contained in:
parent
b7870c8051
commit
c988a44f06
@ -90,12 +90,19 @@ class IscsiUi(BaseController):
|
||||
for gateway_name in gateways_names:
|
||||
gateway = {
|
||||
'name': gateway_name,
|
||||
'state': 'N/A',
|
||||
'num_targets': 'N/A'
|
||||
'state': '',
|
||||
'num_targets': 'n/a',
|
||||
'num_sessions': 'n/a'
|
||||
}
|
||||
try:
|
||||
IscsiClient.instance(gateway_name=gateway_name).ping()
|
||||
gateway['state'] = 'up'
|
||||
if config:
|
||||
gateway['num_sessions'] = 0
|
||||
if gateway_name in config['gateways']:
|
||||
gatewayinfo = IscsiClient.instance(
|
||||
gateway_name=gateway_name).get_gatewayinfo()
|
||||
gateway['num_sessions'] = gatewayinfo['num_sessions']
|
||||
except RequestException:
|
||||
gateway['state'] = 'down'
|
||||
if config:
|
||||
|
@ -47,6 +47,10 @@ export class IscsiComponent implements OnInit {
|
||||
{
|
||||
name: this.i18n('# Targets'),
|
||||
prop: 'num_targets'
|
||||
},
|
||||
{
|
||||
name: this.i18n('# Sessions'),
|
||||
prop: 'num_sessions'
|
||||
}
|
||||
];
|
||||
this.imagesColumns = [
|
||||
|
@ -4246,6 +4246,10 @@
|
||||
<context context-type="sourcefile">src/app/ceph/block/iscsi-target-list/iscsi-target-list.component.ts</context>
|
||||
<context context-type="linenumber">1</context>
|
||||
</context-group>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/ceph/block/iscsi/iscsi.component.ts</context>
|
||||
<context context-type="linenumber">1</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="873b72903b1858a9cd6c8967521030b4d7d1435b" datatype="html">
|
||||
<source>State</source>
|
||||
|
@ -102,6 +102,11 @@ class IscsiClient(RestClient):
|
||||
'skipchecks': 'true'
|
||||
})
|
||||
|
||||
@RestClient.api_get('/api/gatewayinfo')
|
||||
def get_gatewayinfo(self, request=None):
|
||||
logger.debug("iSCSI: Getting gatewayinfo")
|
||||
return request()
|
||||
|
||||
@RestClient.api_put('/api/disk/{pool}/{image}')
|
||||
def create_disk(self, pool, image, backstore, request=None):
|
||||
logger.debug("iSCSI: Creating disk: %s/%s", pool, image)
|
||||
|
Loading…
Reference in New Issue
Block a user