mirror of
https://github.com/ceph/ceph
synced 2025-01-17 16:34:22 +00:00
mgr/dashboard: fix linting errors
Signed-off-by: Pere Diaz Bou <pdiazbou@redhat.com>
This commit is contained in:
parent
3c308804d5
commit
90869173ee
@ -167,7 +167,7 @@ describe('IscsiTargetFormComponent', () => {
|
||||
httpTesting.expectOne('ui-api/iscsi/settings').flush(SETTINGS);
|
||||
httpTesting.expectOne('ui-api/iscsi/portals').flush(PORTALS);
|
||||
httpTesting.expectOne('ui-api/iscsi/version').flush(VERSION);
|
||||
httpTesting.expectOne('api/block/image?offset=0&limit=-1').flush(RBD_LIST);
|
||||
httpTesting.expectOne('api/block/image?offset=0&limit=-1&search=&sort=%3Ename').flush(RBD_LIST);
|
||||
httpTesting.expectOne('api/iscsi/target').flush(LIST_TARGET);
|
||||
httpTesting.verify();
|
||||
});
|
||||
|
@ -658,7 +658,7 @@ export class TableComponent implements AfterContentChecked, OnInit, OnChanges, O
|
||||
context.search = this.userConfig.search;
|
||||
if (this.userConfig.sorts?.length) {
|
||||
const sort = this.userConfig.sorts[0];
|
||||
context.sort = `${sort.dir == 'desc' ? '<' : '>'}${sort.prop}`;
|
||||
context.sort = `${sort.dir === 'desc' ? '<' : '>'}${sort.prop}`;
|
||||
}
|
||||
this.fetchData.emit(context);
|
||||
this.updating = true;
|
||||
|
@ -171,6 +171,11 @@ paths:
|
||||
name: search
|
||||
schema:
|
||||
type: string
|
||||
- default: ''
|
||||
in: query
|
||||
name: sort
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
content:
|
||||
|
@ -430,7 +430,8 @@ class RbdService(object):
|
||||
return joint_refs
|
||||
|
||||
@classmethod
|
||||
def rbd_pool_list(cls, pool_names: List[str], namespace=None, offset=0, limit=0, search='', sort=''):
|
||||
def rbd_pool_list(cls, pool_names: List[str], namespace=None, offset=0, limit=0,
|
||||
search='', sort=''):
|
||||
offset = int(offset)
|
||||
limit = int(limit)
|
||||
# let's use -1 to denotate we want ALL images for now. Iscsi currently gathers
|
||||
@ -451,6 +452,8 @@ class RbdService(object):
|
||||
|
||||
result = []
|
||||
end = offset + limit
|
||||
if len(sort) < 2:
|
||||
sort = '>name'
|
||||
descending = sort[0] == '<'
|
||||
sort_by = sort[1:]
|
||||
if sort_by == 'pool_name':
|
||||
|
Loading…
Reference in New Issue
Block a user