Changeset 6210


Ignore:
Timestamp:
Aug 16, 2008, 1:54:46 AM (16 years ago)
Author:
RIck van der Zwet
Message:

Final commit for this morning, made sure node-detail is displaying data and newSSID is working properly

Location:
exodus
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • exodus/sql/mode.sql

    r6190 r6210  
    1 INSERT INTO exodus_mode VALUES ( 1, 'managed');
    2 INSERT INTO exodus_mode VALUES ( 2, 'ad-hoc');
    3 INSERT INTO exodus_mode VALUES ( 3, 'master');
     1INSERT INTO exodus_mode VALUES ( 1, 'master');
     2INSERT INTO exodus_mode VALUES ( 2, 'managed');
  • exodus/templates/node-detail.html

    r6208 r6210  
    55
    66<div>
    7 
    8 Location: {{ object.location.description }} <br>
    9 X: {{ object.location.coordinateX }} <br>
    10 Y: {{ object.location.coordinateY }} <br>
     7<h3> Location </h3>
     8Description: {{ object.location.description }} <br>
     9Longitude: {{ object.location.longitude }} <br>
     10Latitude: {{ object.location.latitude }} <br>
    1111
    1212Master ip: {{ object.masterip }}
  • exodus/views.py

    r6206 r6210  
    99
    1010from exodus.models import *
    11 from exodus.wllogic import freemasterip, newssidname
     11from exodus.wllogic import freemasterip, newSSIDName
    1212
    1313class AddLocationForm(forms.ModelForm):
     
    5454                        instance  = form.save(commit=False)
    5555                        if str(instance.type) != "eth":
    56                                 print instance.iface
    57 #                               instance.ssid = newssidname(instance.node.name,
    58 #                                       instance.iface)
     56                                instance.ssid = newSSIDName(instance.node, instance.iface, 'unused')
    5957                                instance.channel = '1'
    6058                                instance.mode = Mode(pk=1) # set to master
     
    7674                        instance  = form.save(commit=False)
    7775                        if str(instance.iface1.type) != "eth":
    78                                 print instance.iface
    79                                 instance.ssid = newssidname(instance.node.name,
    80                                         instance.iface)
     76                                instance.ssid = newSSIDName(instance.node,
     77                                        instance.iface,'il')
    8178                                instance.channel = '1'
    8279                                instance.mode = Mode(pk=1) # set to master
     
    9794                form = addOmniForm(request.POST)
    9895                if form.is_valid():
    99                         instance  = form.save(commit=False)
     96                        instance = form.save(commit=False)
     97                        instance.ssid = newSSIDName(instance.iface.node, instance.iface, 'omni')
    10098                        instance.save()
    10199                        return HttpResponseRedirect("/exodus/")
  • exodus/wllogic.py

    r6191 r6210  
    33from exodus.models import Node, Network
    44
    5 def newssidname(node,desc):
     5def newSSIDName(node, nic, desc):
    66        """Generates a new ssid name for a new wifi NIC"""
    77
    8         return "%s.%s.%s" % (desc, Node.objects.get(pk=node).name,
    9                                 Node.objects.get(pk=node).network.domainname)
     8        return "%s-%s.%s.%s" % (desc, nic.iface, node.name, node.network.domainname)
    109
    11 def newname(test):
    12         return "%s.%s.%s" % ( test, test, test )
    1310#
    1411# Taken from lvoege@gmail.com's getrange.py
Note: See TracChangeset for help on using the changeset viewer.