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
fad2c77d
Commit
fad2c77d
authored
Jan 12, 2012
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup: use PVE.button.Button
parent
a8875ec0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
50 deletions
+29
-50
GroupView.js
www/manager/dc/GroupView.js
+4
-4
UserView.js
www/manager/dc/UserView.js
+25
-46
No files found.
www/manager/dc/GroupView.js
View file @
fad2c77d
...
...
@@ -37,7 +37,7 @@ Ext.define('PVE.dc.GroupView', {
reload
();
},
failure
:
function
(
response
,
opts
)
{
Ext
.
Msg
.
alert
(
gettext
(
'
Error
'
),
response
.
htmlStatus
);
Ext
.
Msg
.
alert
(
gettext
(
'
Error
'
),
response
.
htmlStatus
);
}
});
}
...
...
@@ -56,9 +56,10 @@ Ext.define('PVE.dc.GroupView', {
win
.
show
();
};
var
edit_btn
=
new
Ext
.
Button
({
var
edit_btn
=
new
PVE
.
button
.
Button
({
text
:
gettext
(
'
Edit
'
),
disabled
:
true
,
selModel
:
sm
,
handler
:
run_editor
});
...
...
@@ -66,8 +67,7 @@ Ext.define('PVE.dc.GroupView', {
{
text
:
gettext
(
'
Create
'
),
handler
:
function
()
{
var
win
=
Ext
.
create
(
'
PVE.dc.GroupEdit
'
,
{
});
var
win
=
Ext
.
create
(
'
PVE.dc.GroupEdit
'
,
{});
win
.
on
(
'
destroy
'
,
reload
);
win
.
show
();
}
...
...
www/manager/dc/UserView.js
View file @
fad2c77d
...
...
@@ -19,42 +19,37 @@ Ext.define('PVE.dc.UserView', {
store
.
load
();
};
var
remove_btn
=
new
Ext
.
Button
({
var
sm
=
Ext
.
create
(
'
Ext.selection.RowModel
'
,
{});
var
remove_btn
=
new
PVE
.
button
.
Button
({
text
:
gettext
(
'
Remove
'
),
disabled
:
true
,
handler
:
function
()
{
var
msg
;
var
sm
=
me
.
getSelectionModel
();
var
rec
=
sm
.
getSelection
()[
0
];
if
(
!
rec
)
{
return
;
}
selModel
:
sm
,
enableFn
:
function
(
rec
)
{
return
rec
.
data
.
userid
!==
'
root@pam
'
;
},
confirmMsg
:
function
(
rec
)
{
return
Ext
.
String
.
format
(
gettext
(
'
Are you sure you want to remove entry {0}
'
),
"
'
"
+
rec
.
data
.
userid
+
"
'
"
);
},
handler
:
function
(
btn
,
event
,
rec
)
{
var
userid
=
rec
.
data
.
userid
;
msg
=
'
Are you sure you want to permanently delete the user:
'
+
userid
;
Ext
.
Msg
.
confirm
(
'
Deletion Confirmation
'
,
msg
,
function
(
btn
)
{
if
(
btn
!==
'
yes
'
)
{
return
;
PVE
.
Utils
.
API2Request
({
url
:
'
/access/users/
'
+
userid
,
method
:
'
DELETE
'
,
waitMsgTarget
:
me
,
callback
:
function
()
{
reload
();
},
failure
:
function
(
response
,
opts
)
{
Ext
.
Msg
.
alert
(
gettext
(
'
Error
'
),
response
.
htmlStatus
);
}
PVE
.
Utils
.
API2Request
({
url
:
'
/access/users/
'
+
userid
,
method
:
'
DELETE
'
,
waitMsgTarget
:
me
,
callback
:
function
()
{
reload
();
},
failure
:
function
(
response
,
opts
)
{
Ext
.
Msg
.
alert
(
'
Error
'
,
response
.
htmlStatus
);
}
});
});
}
});
var
run_editor
=
function
()
{
var
sm
=
me
.
getSelectionModel
();
var
rec
=
sm
.
getSelection
()[
0
];
if
(
!
rec
)
{
return
;
...
...
@@ -67,27 +62,13 @@ Ext.define('PVE.dc.UserView', {
win
.
show
();
};
var
edit_btn
=
new
Ext
.
Button
({
var
edit_btn
=
new
PVE
.
button
.
Button
({
text
:
gettext
(
'
Edit
'
),
disabled
:
true
,
selModel
:
sm
,
handler
:
run_editor
});
var
set_button_status
=
function
()
{
var
sm
=
me
.
getSelectionModel
();
var
rec
=
sm
.
getSelection
()[
0
];
if
(
!
rec
)
{
remove_btn
.
disable
();
edit_btn
.
disable
();
return
;
}
edit_btn
.
setDisabled
(
false
);
remove_btn
.
setDisabled
(
rec
.
data
.
userid
===
'
root@pam
'
);
};
var
tbar
=
[
{
text
:
gettext
(
'
Create
'
),
...
...
@@ -125,13 +106,12 @@ Ext.define('PVE.dc.UserView', {
Ext
.
apply
(
me
,
{
store
:
store
,
selModel
:
sm
,
stateful
:
false
,
tbar
:
tbar
,
viewConfig
:
{
trackOver
:
false
},
columns
:
[
{
header
:
gettext
(
'
User name
'
),
...
...
@@ -177,8 +157,7 @@ Ext.define('PVE.dc.UserView', {
],
listeners
:
{
show
:
reload
,
itemdblclick
:
run_editor
,
selectionchange
:
set_button_status
itemdblclick
:
run_editor
}
});
...
...
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