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
360018e2
Commit
360018e2
authored
Sep 29, 2011
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve UserView GUI (sensitive buttons)
parent
04bbdbc2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
55 deletions
+72
-55
UserView.js
www/manager/dc/UserView.js
+72
-55
No files found.
www/manager/dc/UserView.js
View file @
360018e2
...
...
@@ -23,36 +23,9 @@ Ext.define('PVE.dc.UserView', {
store
.
load
();
};
var
tbar
=
[
{
text
:
'
Create
'
,
handler
:
function
()
{
var
win
=
Ext
.
create
(
'
PVE.dc.UserEdit
'
,{
});
win
.
on
(
'
destroy
'
,
reload
);
win
.
show
();
}
},
{
text
:
'
Modify
'
,
handler
:
function
()
{
var
sm
=
me
.
getSelectionModel
();
var
rec
=
sm
.
getSelection
()[
0
];
if
(
!
rec
)
{
return
;
}
var
userid
=
rec
.
data
.
userid
;
var
win
=
Ext
.
create
(
'
PVE.dc.UserEdit
'
,{
userid
:
userid
});
win
.
on
(
'
destroy
'
,
reload
);
win
.
show
();
}
},
{
var
remove_btn
=
new
Ext
.
Button
({
text
:
'
Delete
'
,
disabled
:
true
,
handler
:
function
()
{
var
msg
;
var
sm
=
me
.
getSelectionModel
();
...
...
@@ -63,7 +36,6 @@ Ext.define('PVE.dc.UserView', {
var
userid
=
rec
.
data
.
userid
;
if
(
userid
!==
'
root@pam
'
)
{
msg
=
'
Are you sure you want to permanently delete the user:
'
+
userid
;
Ext
.
Msg
.
confirm
(
'
Deletion Confirmation
'
,
msg
,
function
(
btn
)
{
if
(
btn
!==
'
yes
'
)
{
...
...
@@ -82,12 +54,55 @@ Ext.define('PVE.dc.UserView', {
}
});
});
}
else
{
msg
=
'
You are not permitted to delete the user: root@pam
'
;
Ext
.
Msg
.
alert
(
'
Error
'
,
msg
);
}
});
var
run_editor
=
function
()
{
var
sm
=
me
.
getSelectionModel
();
var
rec
=
sm
.
getSelection
()[
0
];
if
(
!
rec
)
{
return
;
}
var
win
=
Ext
.
create
(
'
PVE.dc.UserEdit
'
,{
userid
:
rec
.
data
.
userid
});
win
.
on
(
'
destroy
'
,
reload
);
win
.
show
();
};
var
edit_btn
=
new
Ext
.
Button
({
text
:
'
Modify
'
,
disabled
:
true
,
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
:
'
Create
'
,
handler
:
function
()
{
var
win
=
Ext
.
create
(
'
PVE.dc.UserEdit
'
,{
});
win
.
on
(
'
destroy
'
,
reload
);
win
.
show
();
}
},
edit_btn
,
remove_btn
];
var
render_expire
=
function
(
date
)
{
...
...
@@ -165,7 +180,9 @@ Ext.define('PVE.dc.UserView', {
}
],
listeners
:
{
show
:
reload
show
:
reload
,
itemdblclick
:
run_editor
,
selectionchange
:
set_button_status
}
});
...
...
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