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
84ab7b8b
Commit
84ab7b8b
authored
Nov 20, 2013
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correct handle history state for ceph sub-config
parent
98d00253
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
5 deletions
+55
-5
Ceph.js
www/manager/node/Ceph.js
+42
-0
Config.js
www/manager/node/Config.js
+1
-0
ConfigPanel.js
www/manager/panel/ConfigPanel.js
+12
-5
No files found.
www/manager/node/Ceph.js
View file @
84ab7b8b
...
...
@@ -882,6 +882,21 @@ Ext.define('PVE.node.Ceph', {
throw
"
no node name specified
"
;
}
if
(
!
me
.
phstateid
)
{
throw
"
no parent history state specified
"
;
}
var
sp
=
Ext
.
state
.
Manager
.
getProvider
();
var
state
=
sp
.
get
(
me
.
phstateid
);
var
hsregex
=
/^ceph-
(\S
+
)
$/
;
if
(
state
&&
state
.
value
)
{
var
res
=
hsregex
.
exec
(
state
.
value
);
if
(
res
&&
res
[
1
])
{
me
.
activeTab
=
res
[
1
];
}
}
Ext
.
apply
(
me
,
{
plain
:
true
,
tabPosition
:
'
bottom
'
,
...
...
@@ -938,11 +953,38 @@ Ext.define('PVE.node.Ceph', {
if
(
first
)
{
first
.
fireEvent
(
'
show
'
,
first
);
}
},
tabchange
:
function
(
tp
,
newcard
,
oldcard
)
{
var
first
=
tp
.
items
.
get
(
0
);
var
ntab
;
// Note: '' is alias for first tab.
if
(
newcard
.
itemId
===
first
.
itemId
)
{
ntab
=
'
ceph
'
;
}
else
{
ntab
=
'
ceph-
'
+
newcard
.
itemId
;
}
var
state
=
{
value
:
ntab
};
sp
.
set
(
me
.
phstateid
,
state
);
}
}
});
me
.
callParent
();
var
statechange
=
function
(
sp
,
key
,
state
)
{
if
((
key
===
me
.
phstateid
)
&&
state
)
{
var
first
=
me
.
items
.
get
(
0
);
var
atab
=
me
.
getActiveTab
().
itemId
;
var
res
=
hsregex
.
exec
(
state
.
value
);
var
ntab
=
(
res
&&
res
[
1
])
?
res
[
1
]
:
first
.
itemId
;
if
(
ntab
&&
(
atab
!=
ntab
))
{
me
.
setActiveTab
(
ntab
);
}
}
};
me
.
mon
(
sp
,
'
statechange
'
,
statechange
);
}
});
\ No newline at end of file
www/manager/node/Config.js
View file @
84ab7b8b
...
...
@@ -158,6 +158,7 @@ Ext.define('PVE.node.Config', {
title
:
'
Ceph
'
,
itemId
:
'
ceph
'
,
xtype
:
'
pveNodeCeph
'
,
phstateid
:
me
.
hstateid
,
nodename
:
nodename
}]);
}
...
...
www/manager/panel/ConfigPanel.js
View file @
84ab7b8b
...
...
@@ -11,10 +11,15 @@ Ext.define('PVE.panel.Config', {
var
activeTab
;
var
hsregex
=
/^
([^\-\s]
+
)(
-
\S
+
)?
$/
;
if
(
stateid
)
{
var
state
=
sp
.
get
(
stateid
);
if
(
state
&&
state
.
value
)
{
activeTab
=
state
.
value
;
var
res
=
hsregex
.
exec
(
state
.
value
);
if
(
res
&&
res
[
1
])
{
activeTab
=
res
[
1
];
}
}
}
...
...
@@ -70,13 +75,14 @@ Ext.define('PVE.panel.Config', {
},
tabchange
:
function
(
tp
,
newcard
,
oldcard
)
{
var
ntab
=
newcard
.
itemId
;
// Note: '' is alias for first tab.
// First tab can be 'search' or something else
if
(
newcard
.
itemId
===
items
[
0
].
itemId
)
{
ntab
=
''
;
}
var
state
=
{
value
:
ntab
};
if
(
stateid
)
{
if
(
stateid
&&
!
newcard
.
phstateid
)
{
sp
.
set
(
stateid
,
state
);
}
}
...
...
@@ -91,10 +97,11 @@ Ext.define('PVE.panel.Config', {
me
.
callParent
();
var
statechange
=
function
(
sp
,
key
,
state
)
{
if
(
stateid
&&
key
===
stateid
)
{
if
(
stateid
&&
(
key
===
stateid
)
&&
state
)
{
var
atab
=
tab
.
getActiveTab
().
itemId
;
var
ntab
=
state
.
value
||
items
[
0
].
itemId
;
if
(
state
&&
ntab
&&
(
atab
!=
ntab
))
{
var
res
=
hsregex
.
exec
(
state
.
value
);
var
ntab
=
(
res
&&
res
[
1
])
?
res
[
1
]
:
items
[
0
].
itemId
;
if
(
ntab
&&
(
atab
!=
ntab
))
{
tab
.
setActiveTab
(
ntab
);
}
}
...
...
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