diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | cobbler/webui/CobblerWeb.py | 27 | ||||
-rw-r--r-- | cobbler/webui/master.py | 18 | ||||
-rw-r--r-- | webui_templates/master.tmpl | 1 | ||||
-rw-r--r-- | webui_templates/profile_edit.tmpl | 101 | ||||
-rw-r--r-- | webui_templates/profile_list.tmpl | 8 |
6 files changed, 121 insertions, 36 deletions
@@ -31,6 +31,8 @@ devinstall: make install cp /tmp/cobbler_settings /var/lib/cobbler/settings cp /tmp/cobbler_auth.conf /etc/cobbler/auth.conf + /sbin/service cobblerd restart + /sbin/service httpd restart sdist: clean messages updatewui python setup.py sdist diff --git a/cobbler/webui/CobblerWeb.py b/cobbler/webui/CobblerWeb.py index f2e901a..aa5b32c 100644 --- a/cobbler/webui/CobblerWeb.py +++ b/cobbler/webui/CobblerWeb.py @@ -1,6 +1,7 @@ -# Web Interface for Cobbler - Model +# Web Interface for Cobbler # # Copyright 2007 Albert P. Tobey <tobert@gmail.com> +# additions: Michael DeHaan <mdehaan@redhat.com> # # This software may be freely redistributed under the terms of the GNU # general public license. @@ -496,8 +497,10 @@ class CobblerWeb(object): else: return self.__render('empty.tmpl', {}) - # FIXME: implement handling of delete1, delete2 + renames - def profile_edit(self, name=None): + def subprofile_edit(self, name=None): + return self.profile_edit(self,name,subprofile=1) + + def profile_edit(self, name=None, subprofile=0): if not self.__xmlrpc_setup(): return self.login(message=INVALID_CREDS) @@ -510,14 +513,17 @@ class CobblerWeb(object): 'edit' : True, 'profile': input_profile, 'distros': self.remote.get_distros(), + 'profiles': self.remote.get_profiles(), 'repos': self.remote.get_repos(), - 'ksfiles': self.remote.get_kickstart_templates(self.token) + 'ksfiles': self.remote.get_kickstart_templates(self.token), + 'subprofile': subprofile } ) def profile_save(self,new_or_edit=None,editmode='edit',name=None,oldname=None, distro=None,kickstart=None,kopts=None, ksmeta=None,virtfilesize=None,virtram=None,virttype=None, - virtpath=None,repos=None,dhcptag=None,delete1=None,delete2=None,**args): + virtpath=None,repos=None,dhcptag=None,delete1=None,delete2=None, + parent=None,subprofile=None,**args): if not self.__xmlrpc_setup(): return self.login(message=INVALID_CREDS) @@ -547,11 +553,17 @@ class CobblerWeb(object): except: return self.error_page("Failed to lookup profile: %s" % name) else: - profile = self.remote.new_profile(self.token) + if str(subprofile) != "1": + profile = self.remote.new_profile(self.token, is_subobject=False) + else: + profile = self.remote.new_profile(self.token, is_subobject=True) try: self.remote.modify_profile(profile, 'name', name, self.token) - self.remote.modify_profile(profile, 'distro', distro, self.token) + if str(subprofile) != "1": + self.remote.modify_profile(profile, 'distro', distro, self.token) + else: + self.remote.modify_profile(profile, 'parent', parent, self.token) if kickstart: self.remote.modify_profile(profile, 'kickstart', kickstart, self.token) if kopts: @@ -766,6 +778,7 @@ class CobblerWeb(object): distro_list.exposed = True distro_save.exposed = True + subprofile_edit.exposed = True profile_edit.exposed = True profile_list.exposed = True profile_save.exposed = True diff --git a/cobbler/webui/master.py b/cobbler/webui/master.py index 4efbb6a..6024e01 100644 --- a/cobbler/webui/master.py +++ b/cobbler/webui/master.py @@ -33,10 +33,10 @@ VFN=valueForName currentTime=time.time __CHEETAH_version__ = '2.0rc8' __CHEETAH_versionTuple__ = (2, 0, 0, 'candidate', 8) -__CHEETAH_genTime__ = 1191014111.8635781 -__CHEETAH_genTimestamp__ = 'Fri Sep 28 17:15:11 2007' +__CHEETAH_genTime__ = 1192115178.6960659 +__CHEETAH_genTimestamp__ = 'Thu Oct 11 11:06:18 2007' __CHEETAH_src__ = 'webui_templates/master.tmpl' -__CHEETAH_srcLastModified__ = 'Thu Sep 27 12:20:28 2007' +__CHEETAH_srcLastModified__ = 'Thu Oct 11 10:45:56 2007' __CHEETAH_docstring__ = 'Autogenerated by CHEETAH: The Python-Powered Template Engine' if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple: @@ -69,7 +69,7 @@ class master(Template): - ## CHEETAH: generated from #block body at line 55, col 1. + ## CHEETAH: generated from #block body at line 56, col 1. trans = KWS.get("trans") if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)): trans = self.transaction # is None unless self.awake() was called @@ -196,15 +196,19 @@ class master(Template): <li><a href="''') _v = VFFSL(SL,"base_url",True) # '$base_url' on line 44, col 26 if _v is not None: write(_filter(_v, rawExpr='$base_url')) # from line 44, col 26. - write('''/system_edit" class="menu">System</a></li> + write('''/profile_edit&subprofile=1" class="menu">Subprofile</a></li> <li><a href="''') _v = VFFSL(SL,"base_url",True) # '$base_url' on line 45, col 26 if _v is not None: write(_filter(_v, rawExpr='$base_url')) # from line 45, col 26. + write('''/system_edit" class="menu">System</a></li> + <li><a href="''') + _v = VFFSL(SL,"base_url",True) # '$base_url' on line 46, col 26 + if _v is not None: write(_filter(_v, rawExpr='$base_url')) # from line 46, col 26. write('''/repo_edit" class="menu">Repo</a></li> <li><hr/><br/></li> <li><a class="button sync" href="''') - _v = VFFSL(SL,"base_url",True) # '$base_url' on line 47, col 46 - if _v is not None: write(_filter(_v, rawExpr='$base_url')) # from line 47, col 46. + _v = VFFSL(SL,"base_url",True) # '$base_url' on line 48, col 46 + if _v is not None: write(_filter(_v, rawExpr='$base_url')) # from line 48, col 46. write('''/sync">Sync</a></li> ''') write(''' diff --git a/webui_templates/master.tmpl b/webui_templates/master.tmpl index 9c58fe9..b5b1fcf 100644 --- a/webui_templates/master.tmpl +++ b/webui_templates/master.tmpl @@ -41,6 +41,7 @@ <li>ADD</li> <li><a href="$base_url/distro_edit" class="menu">Distro</a></li> <li><a href="$base_url/profile_edit" class="menu">Profile</a></li> + <li><a href="$base_url/subprofile_edit" class="menu">Subprofile</a></li> <li><a href="$base_url/system_edit" class="menu">System</a></li> <li><a href="$base_url/repo_edit" class="menu">Repo</a></li> <li><hr/><br/></li> diff --git a/webui_templates/profile_edit.tmpl b/webui_templates/profile_edit.tmpl index 28af17e..547ad0d 100644 --- a/webui_templates/profile_edit.tmpl +++ b/webui_templates/profile_edit.tmpl @@ -31,6 +31,18 @@ function disablename(value) <input type="hidden" name="new_or_edit" value="new"/> #end if + #if $profile + #if $profile.distro == "<<inherit>>" + #set $subprofile = 1 + <input type="hidden" name="subprofile" value="1"/> + #else + #set $subprofile = 0 + <input type="hidden" name="subprofile" value="0"/> + #end if + #else + <input type="hidden" name="subprofile" value="$subprofile"/> + #end + <table border=0> <tr> @@ -65,24 +77,45 @@ function disablename(value) </tr> #end if - <tr> - <td> - <label for="distro">Distribution</label> - </td> - <td> - <select name="distro" id="distro"> - #for $distro in $distros: - <option name="$distro.name" - #if $profile and $profile.distro == $distro.name - selected="true" - #end if - >$distro.name - </option> - #end for - </select> - <p class="context-tip">What OS is this profile based on?</p> - </td> - </tr> + #if $subprofile + <tr> + <td> + <label for="distro">Parent</label> + </td> + <td> + <select name="parent" id="parent"> + #for $parentobj in $profiles: + <option name="$parentobj.name" + #if $profile and $profile.parent == $parentobj.name + selected="true" + #end if + >$parentobj.name + </option> + #end for + </select> + <p class="context-tip">Inherit parameters from what profile?</p> + </td> + </tr> + #else + <tr> + <td> + <label for="distro">Distribution</label> + </td> + <td> + <select name="distro" id="distro"> + #for $distro in $distros: + <option name="$distro.name" + #if $profile and $profile.distro == $distro.name + selected="true" + #end if + >$distro.name + </option> + #end for + </select> + <p class="context-tip">What OS is this profile based on?</p> + </td> + </tr> + #end <!-- should allow freeform input but still show a list of choices? --> <!-- probably should implement a combo box eventually --> @@ -131,7 +164,7 @@ function disablename(value) <tr> <td> - <label for="virtfilesize">Virt File Size (GB)</label> + <label for="virtfilesize">Virt Disk (GB)</label> </td> <td> <input type="text" size="5" style="width: 150px;" name="virtfilesize" id="virtfilesize" @@ -201,7 +234,35 @@ function disablename(value) <tr> <td> - <label for="repos">Repo Names</label> + <label for="virtpath">Virt Bridge</label> + </td> + <td> + <input type="text" size="255" style="width: 150px;" name="virtbridge" id="virtbridge" + #if $profile + value="$profile.virt_bridge" + #end if + /> + <p class="context-tip">Overrides the virtual networking bridge choice in settings.</p> + </td> + </tr> + + <tr> + <td> + <label for="virtpath">Virt CPUs</label> + </td> + <td> + <input type="text" size="255" style="width: 150px;" name="virtcpus" id="virtcpus" + #if $profile + value="$profile.virt_cpus" + #end if + /> + <p class="context-tip">How many virtual CPUs? This is an integer.</p> + </td> + </tr> + + <tr> + <td> + <label for="repos">Yum Repos</label> </td> <td> diff --git a/webui_templates/profile_list.tmpl b/webui_templates/profile_list.tmpl index 09e3678..1ccbf31 100644 --- a/webui_templates/profile_list.tmpl +++ b/webui_templates/profile_list.tmpl @@ -6,7 +6,7 @@ <caption>Cobbler Profiles</caption> <tr> <th class="text">Name</th> - <th class="text">Distribution</th> + <th class="text">Parent</th> <th class="text">Kickstart</th> </tr> </thead> @@ -25,7 +25,11 @@ <a href="$base_url/profile_edit?name=$profile.name">$profile.name</a> </td> <td> - <a href="$base_url/distro_edit?name=$profile.distro">$profile.distro</a> + #if $profile.distro != "<<inherit>>" + <a href="$base_url/distro_edit?name=$profile.distro">$profile.distro</a> + #else + <a href="$base_url/profile_edit?name=$profile.parent">$profile.parent</A> + #end if </td> <td>$profile.kickstart</td> </tr> |