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', {
...
@@ -37,7 +37,7 @@ Ext.define('PVE.dc.GroupView', {
reload
();
reload
();
},
},
failure
:
function
(
response
,
opts
)
{
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', {
...
@@ -56,9 +56,10 @@ Ext.define('PVE.dc.GroupView', {
win
.
show
();
win
.
show
();
};
};
var
edit_btn
=
new
Ext
.
Button
({
var
edit_btn
=
new
PVE
.
button
.
Button
({
text
:
gettext
(
'
Edit
'
),
text
:
gettext
(
'
Edit
'
),
disabled
:
true
,
disabled
:
true
,
selModel
:
sm
,
handler
:
run_editor
handler
:
run_editor
});
});
...
@@ -66,8 +67,7 @@ Ext.define('PVE.dc.GroupView', {
...
@@ -66,8 +67,7 @@ Ext.define('PVE.dc.GroupView', {
{
{
text
:
gettext
(
'
Create
'
),
text
:
gettext
(
'
Create
'
),
handler
:
function
()
{
handler
:
function
()
{
var
win
=
Ext
.
create
(
'
PVE.dc.GroupEdit
'
,
{
var
win
=
Ext
.
create
(
'
PVE.dc.GroupEdit
'
,
{});
});
win
.
on
(
'
destroy
'
,
reload
);
win
.
on
(
'
destroy
'
,
reload
);
win
.
show
();
win
.
show
();
}
}
...
...
www/manager/dc/UserView.js
View file @
fad2c77d
...
@@ -19,42 +19,37 @@ Ext.define('PVE.dc.UserView', {
...
@@ -19,42 +19,37 @@ Ext.define('PVE.dc.UserView', {
store
.
load
();
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
'
),
text
:
gettext
(
'
Remove
'
),
disabled
:
true
,
disabled
:
true
,
handler
:
function
()
{
selModel
:
sm
,
var
msg
;
enableFn
:
function
(
rec
)
{
var
sm
=
me
.
getSelectionModel
();
return
rec
.
data
.
userid
!==
'
root@pam
'
;
var
rec
=
sm
.
getSelection
()[
0
];
},
if
(
!
rec
)
{
confirmMsg
:
function
(
rec
)
{
return
;
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
;
var
userid
=
rec
.
data
.
userid
;
msg
=
'
Are you sure you want to permanently delete the user:
'
+
userid
;
PVE
.
Utils
.
API2Request
({
Ext
.
Msg
.
confirm
(
'
Deletion Confirmation
'
,
msg
,
function
(
btn
)
{
url
:
'
/access/users/
'
+
userid
,
if
(
btn
!==
'
yes
'
)
{
method
:
'
DELETE
'
,
return
;
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
run_editor
=
function
()
{
var
sm
=
me
.
getSelectionModel
();
var
rec
=
sm
.
getSelection
()[
0
];
var
rec
=
sm
.
getSelection
()[
0
];
if
(
!
rec
)
{
if
(
!
rec
)
{
return
;
return
;
...
@@ -67,27 +62,13 @@ Ext.define('PVE.dc.UserView', {
...
@@ -67,27 +62,13 @@ Ext.define('PVE.dc.UserView', {
win
.
show
();
win
.
show
();
};
};
var
edit_btn
=
new
Ext
.
Button
({
var
edit_btn
=
new
PVE
.
button
.
Button
({
text
:
gettext
(
'
Edit
'
),
text
:
gettext
(
'
Edit
'
),
disabled
:
true
,
disabled
:
true
,
selModel
:
sm
,
handler
:
run_editor
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
=
[
var
tbar
=
[
{
{
text
:
gettext
(
'
Create
'
),
text
:
gettext
(
'
Create
'
),
...
@@ -125,13 +106,12 @@ Ext.define('PVE.dc.UserView', {
...
@@ -125,13 +106,12 @@ Ext.define('PVE.dc.UserView', {
Ext
.
apply
(
me
,
{
Ext
.
apply
(
me
,
{
store
:
store
,
store
:
store
,
selModel
:
sm
,
stateful
:
false
,
stateful
:
false
,
tbar
:
tbar
,
tbar
:
tbar
,
viewConfig
:
{
viewConfig
:
{
trackOver
:
false
trackOver
:
false
},
},
columns
:
[
columns
:
[
{
{
header
:
gettext
(
'
User name
'
),
header
:
gettext
(
'
User name
'
),
...
@@ -177,8 +157,7 @@ Ext.define('PVE.dc.UserView', {
...
@@ -177,8 +157,7 @@ Ext.define('PVE.dc.UserView', {
],
],
listeners
:
{
listeners
:
{
show
:
reload
,
show
:
reload
,
itemdblclick
:
run_editor
,
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