- Timestamp:
- Oct 28, 2007, 11:27:32 PM (17 years ago)
- Location:
- trunk/web/templates
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web/templates/info.tmpl
r211 r227 69 69 <tr><td>Contact email:</td><td><input type="text" name="contact" value="$defaults.contact"/></td></tr> 70 70 $errorRow('contact', $err) 71 #if $machine.nics72 <tr><td>Hostname:</td><td><input type="text" name="hostname" value="$defaults.hostname"/>.servers.csail.mit.edu</td></tr>73 #end if74 $errorRow('hostname', $err)75 71 #if not $on 76 72 <tr><td>Machine Name:</td><td><input type="text" name="name" value="$defaults.name"/></td></tr> -
trunk/web/templates/list.tmpl
r207 r227 66 66 #set $nic = $machine.nics[0] 67 67 <td>$nic.ip</td> 68 <td>$nic.hostname</td>69 68 #else 70 <td></td>71 69 <td></td> 72 70 #end if … … 105 103 <td>owner</td> 106 104 <td>IP</td> 107 <td>Hostname</td>108 105 <td>Uptime</td> 109 106 <td>VNC</td> -
trunk/web/templates/main.py
r211 r227 259 259 """ 260 260 data_dict['num_nics'] = len(machine.nics) 261 nic_fields_template = [('nic%s_hostname', 'NIC %s hostname'),261 nic_fields_template = [('nic%s_hostname', 'NIC %s Hostname'), 262 262 ('nic%s_mac', 'NIC %s MAC Addr'), 263 263 ('nic%s_ip', 'NIC %s IP'), … … 266 266 for i in range(len(machine.nics)): 267 267 nic_fields.extend([(x % i, y % i) for x, y in nic_fields_template]) 268 data_dict['nic%s_hostname' % i] = (machine.nics[i].hostname + 269 '.servers.csail.mit.edu') 268 if not i: 269 data_dict['nic%s_hostname' % i] = (machine.name + 270 '.servers.csail.mit.edu') 270 271 data_dict['nic%s_mac' % i] = machine.nics[i].mac_addr 271 272 data_dict['nic%s_ip' % i] = machine.nics[i].ip … … 329 330 contact = validation.testContact(user, fields.getfirst('contact'), 330 331 machine) 331 hostname = validation.testHostname(owner, fields.getfirst('hostname'),332 machine)333 332 name = validation.testName(user, fields.getfirst('name'), machine) 334 333 oldname = machine.name … … 349 348 ctx.current.save(disk) 350 349 351 # XXX first NIC gets hostname on change?352 # Interface doesn't support more.353 for nic in machine.nics[:1]:354 nic.hostname = hostname355 ctx.current.save(nic)356 357 350 if owner is not None: 358 351 machine.owner = owner … … 513 506 for name in 'machine_id name administrator owner memory contact'.split(): 514 507 setattr(defaults, name, getattr(machine, name)) 515 if machine.nics:516 defaults.hostname = machine.nics[0].hostname517 508 defaults.disk = "%0.2f" % (machine.disks[0].size/1024.) 518 509 d = dict(user=user,
Note: See TracChangeset
for help on using the changeset viewer.