Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pve-manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
pve-manager
Commits
45c04975
Commit
45c04975
authored
Nov 13, 2013
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
display crush map
parent
9432f732
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
88 additions
and
9 deletions
+88
-9
Ceph.pm
PVE/API2/Ceph.pm
+39
-7
Ceph.js
www/manager/node/Ceph.js
+49
-2
No files found.
PVE/API2/Ceph.pm
View file @
45c04975
...
@@ -158,16 +158,16 @@ my $run_ceph_cmd = sub {
...
@@ -158,16 +158,16 @@ my $run_ceph_cmd = sub {
die
$err
if
$err
;
die
$err
if
$err
;
};
};
my
$run_ceph_cmd_
json
=
sub
{
my
$run_ceph_cmd_
text
=
sub
{
my
(
$cmd
,
%
opts
)
=
@_
;
my
(
$cmd
,
%
opts
)
=
@_
;
my
$
json
=
'';
my
$
out
=
'';
my
$quiet
=
delete
$opts
{
quiet
};
my
$quiet
=
delete
$opts
{
quiet
};
my
$parser
=
sub
{
my
$parser
=
sub
{
my
$line
=
shift
;
my
$line
=
shift
;
$
json
.=
$line
;
$
out
.=
"
$line
\n
"
;
};
};
my
$errfunc
=
sub
{
my
$errfunc
=
sub
{
...
@@ -175,12 +175,17 @@ my $run_ceph_cmd_json = sub {
...
@@ -175,12 +175,17 @@ my $run_ceph_cmd_json = sub {
print
"
$line
\n
"
if
!
$quiet
;
print
"
$line
\n
"
if
!
$quiet
;
};
};
&
$run_ceph_cmd
([
@$cmd
,
'
--format
',
'
json
'],
&
$run_ceph_cmd
(
$cmd
,
outfunc
=>
$parser
,
errfunc
=>
$errfunc
);
outfunc
=>
$parser
,
errfunc
=>
$errfunc
);
return
$out
;
};
my
$run_ceph_cmd_json
=
sub
{
my
(
$cmd
,
%
opts
)
=
@_
;
my
$
res
=
decode_json
(
$json
);
my
$
json
=
&
$run_ceph_cmd_text
([
@$cmd
,
'
--format
',
'
json
'],
%
opts
);
return
$res
;
return
decode_json
(
$json
)
;
};
};
sub
ceph_mon_status
{
sub
ceph_mon_status
{
...
@@ -261,6 +266,7 @@ __PACKAGE__->register_method ({
...
@@ -261,6 +266,7 @@ __PACKAGE__->register_method ({
{
name
=>
'
stop
'
},
{
name
=>
'
stop
'
},
{
name
=>
'
start
'
},
{
name
=>
'
start
'
},
{
name
=>
'
status
'
},
{
name
=>
'
status
'
},
{
name
=>
'
crush
'
},
];
];
return
$result
;
return
$result
;
...
@@ -678,3 +684,29 @@ __PACKAGE__->register_method ({
...
@@ -678,3 +684,29 @@ __PACKAGE__->register_method ({
return
undef
;
return
undef
;
}});
}});
__PACKAGE__
->
register_method
({
name
=>
'
crush
',
path
=>
'
crush
',
method
=>
'
GET
',
description
=>
"
Get OSD crush map
",
proxyto
=>
'
node
',
protected
=>
1
,
parameters
=>
{
additionalProperties
=>
0
,
properties
=>
{
node
=>
get_standard_option
('
pve-node
'),
},
},
returns
=>
{
type
=>
'
string
'
},
code
=>
sub
{
my
(
$param
)
=
@_
;
&
$check_ceph_inited
();
my
$txt
=
&
$run_ceph_cmd_text
(['
osd
',
'
crush
',
'
dump
'],
quiet
=>
1
);
return
$txt
;
}});
www/manager/node/Ceph.js
View file @
45c04975
Ext
.
define
(
'
PVE.node.CephCrushMap
'
,
{
extend
:
'
Ext.panel.Panel
'
,
alias
:
'
widget.pveNodeCephCrushMap
'
,
load
:
function
()
{
var
me
=
this
;
PVE
.
Utils
.
API2Request
({
url
:
me
.
url
,
waitMsgTarget
:
me
,
failure
:
function
(
response
,
opts
)
{
me
.
update
(
gettext
(
'
Error
'
)
+
"
"
+
response
.
htmlStatus
);
},
success
:
function
(
response
,
opts
)
{
var
data
=
response
.
result
.
data
;
me
.
update
(
data
);
}
});
},
initComponent
:
function
()
{
var
me
=
this
;
var
nodename
=
me
.
pveSelNode
.
data
.
node
;
if
(
!
nodename
)
{
throw
"
no node name specified
"
;
}
Ext
.
apply
(
me
,
{
url
:
'
/api2/extjs/nodes/
'
+
nodename
+
'
/ceph/crush
'
,
style
:
'
padding-left:10px
'
,
bodyStyle
:
'
white-space:pre
'
,
bodyPadding
:
5
,
autoScroll
:
true
,
listeners
:
{
show
:
function
()
{
me
.
load
();
}
}
});
me
.
callParent
();
me
.
load
();
}
});
Ext
.
define
(
'
PVE.node.CephStatus
'
,
{
Ext
.
define
(
'
PVE.node.CephStatus
'
,
{
extend
:
'
PVE.grid.ObjectGrid
'
,
extend
:
'
PVE.grid.ObjectGrid
'
,
alias
:
'
widget.pveNodeCephStatus
'
,
alias
:
'
widget.pveNodeCephStatus
'
,
...
@@ -178,8 +225,8 @@ Ext.define('PVE.node.Ceph', {
...
@@ -178,8 +225,8 @@ Ext.define('PVE.node.Ceph', {
},
},
{
{
title
:
'
Crush
'
,
title
:
'
Crush
'
,
itemId
:
'
test5
'
,
xtype
:
'
pveNodeCephCrushMap
'
,
html
:
"
ABCD
"
itemId
:
'
crushmap
'
}
}
],
],
listeners
:
{
listeners
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment