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
8f7b120a
Commit
8f7b120a
authored
Apr 22, 2015
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lxc GUI: add DNS panel
parent
d667a3f3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
148 additions
and
0 deletions
+148
-0
Makefile
www/manager/Makefile
+1
-0
Config.js
www/manager/lxc/Config.js
+5
-0
DNS.js
www/manager/lxc/DNS.js
+142
-0
No files found.
www/manager/Makefile
View file @
8f7b120a
...
...
@@ -144,6 +144,7 @@ JSSRC= \
lxc/Network.js
\
lxc/Resources.js
\
lxc/Options.js
\
lxc/DNS.js
\
lxc/Config.js
\
lxc/CreateWizard.js
\
pool/StatusView.js
\
...
...
www/manager/lxc/Config.js
View file @
8f7b120a
...
...
@@ -135,6 +135,11 @@ Ext.define('PVE.lxc.Config', {
itemId
:
'
network
'
,
xtype
:
'
pveLxcNetworkView
'
},
{
title
:
gettext
(
'
DNS
'
),
itemId
:
'
dns
'
,
xtype
:
'
pveLxcDNS
'
},
{
title
:
gettext
(
'
Options
'
),
itemId
:
'
options
'
,
...
...
www/manager/lxc/DNS.js
0 → 100644
View file @
8f7b120a
/*jslint confusion: true */
Ext
.
define
(
'
PVE.lxc.DNS
'
,
{
extend
:
'
PVE.grid.ObjectGrid
'
,
alias
:
[
'
widget.pveLxcDNS
'
],
initComponent
:
function
()
{
var
me
=
this
;
var
i
;
var
nodename
=
me
.
pveSelNode
.
data
.
node
;
if
(
!
nodename
)
{
throw
"
no node name specified
"
;
}
var
vmid
=
me
.
pveSelNode
.
data
.
vmid
;
if
(
!
vmid
)
{
throw
"
no VM ID specified
"
;
}
var
caps
=
Ext
.
state
.
Manager
.
get
(
'
GuiCap
'
);
var
rows
=
{
hostname
:
{
required
:
true
,
defaultValue
:
me
.
pveSelNode
.
data
.
name
,
header
:
gettext
(
'
Hostname
'
),
editor
:
caps
.
vms
[
'
VM.Config.Network
'
]
?
{
xtype
:
'
pveWindowEdit
'
,
subject
:
gettext
(
'
Hostname
'
),
items
:
{
xtype
:
'
textfield
'
,
name
:
'
hostname
'
,
vtype
:
'
DnsName
'
,
value
:
''
,
fieldLabel
:
gettext
(
'
Hostname
'
),
allowBlank
:
true
,
emptyText
:
me
.
pveSelNode
.
data
.
name
}
}
:
undefined
},
searchdomain
:
{
header
:
gettext
(
'
DNS domain
'
),
defaultValue
:
''
,
editor
:
caps
.
vms
[
'
VM.Config.Network
'
]
?
{
xtype
:
'
pveWindowEdit
'
,
subject
:
gettext
(
'
DNS domain
'
),
items
:
{
xtype
:
'
pvetextfield
'
,
name
:
'
searchdomain
'
,
fieldLabel
:
gettext
(
'
DNS domain
'
),
allowBlank
:
false
}
}
:
undefined
},
nameserver
:
{
header
:
gettext
(
'
DNS server
'
),
defaultValue
:
''
,
editor
:
caps
.
vms
[
'
VM.Config.Network
'
]
?
{
xtype
:
'
pveWindowEdit
'
,
subject
:
gettext
(
'
DNS server
'
),
items
:
{
xtype
:
'
pvetextfield
'
,
name
:
'
nameserver
'
,
fieldLabel
:
gettext
(
'
DNS server
'
),
allowBlank
:
false
}
}
:
undefined
}
};
var
baseurl
=
'
nodes/
'
+
nodename
+
'
/lxc/
'
+
vmid
+
'
/config
'
;
var
reload
=
function
()
{
me
.
rstore
.
load
();
};
var
sm
=
Ext
.
create
(
'
Ext.selection.RowModel
'
,
{});
var
run_editor
=
function
()
{
var
rec
=
sm
.
getSelection
()[
0
];
if
(
!
rec
)
{
return
;
}
var
rowdef
=
rows
[
rec
.
data
.
key
];
if
(
!
rowdef
.
editor
)
{
return
;
}
var
config
=
Ext
.
apply
({
pveSelNode
:
me
.
pveSelNode
,
confid
:
rec
.
data
.
key
,
url
:
'
/api2/extjs/
'
+
baseurl
},
rowdef
.
editor
);
var
win
=
Ext
.
createWidget
(
rowdef
.
editor
.
xtype
,
config
);
win
.
load
();
win
.
show
();
win
.
on
(
'
destroy
'
,
reload
);
};
var
edit_btn
=
new
PVE
.
button
.
Button
({
text
:
gettext
(
'
Edit
'
),
disabled
:
true
,
selModel
:
sm
,
enableFn
:
function
(
rec
)
{
var
rowdef
=
rows
[
rec
.
data
.
key
];
return
!!
rowdef
.
editor
;
},
handler
:
run_editor
});
var
set_button_status
=
function
()
{
var
sm
=
me
.
getSelectionModel
();
var
rec
=
sm
.
getSelection
()[
0
];
if
(
!
rec
)
{
edit_btn
.
disable
();
return
;
}
var
rowdef
=
rows
[
rec
.
data
.
key
];
edit_btn
.
setDisabled
(
!
rowdef
.
editor
);
};
Ext
.
applyIf
(
me
,
{
url
:
"
/api2/json/nodes/
"
+
nodename
+
"
/lxc/
"
+
vmid
+
"
/config
"
,
selModel
:
sm
,
cwidth1
:
150
,
tbar
:
[
edit_btn
],
rows
:
rows
,
listeners
:
{
itemdblclick
:
run_editor
,
selectionchange
:
set_button_status
}
});
me
.
callParent
();
me
.
on
(
'
show
'
,
reload
);
}
});
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