diff options
author | Alton MacDonald <alton.kenneth.macdonald@fokus.fraunhofer.de> | 2014-01-23 11:00:42 +0100 |
---|---|---|
committer | Alton MacDonald <alton.kenneth.macdonald@fokus.fraunhofer.de> | 2014-01-23 11:00:42 +0100 |
commit | e5010468645aa602258dd9e1f144d9aa80edb8fc (patch) | |
tree | 211d8a210fb902de9e129ccc396d60773487146b | |
parent | c512fd826427e508a8735a9b54cc770fa09a5368 (diff) |
added feature to rename BTS descriptions
-rw-r--r-- | hlr_mgmt/__init__.py | 1 | ||||
-rw-r--r-- | hlr_mgmt/telnet_backend.py | 7 | ||||
-rw-r--r-- | hlr_mgmt/templates/bts.mako | 22 | ||||
-rw-r--r-- | hlr_mgmt/templates/scripts.mako | 2 | ||||
-rw-r--r-- | hlr_mgmt/views.py | 8 | ||||
-rw-r--r-- | setup.py | 1 |
6 files changed, 39 insertions, 2 deletions
diff --git a/hlr_mgmt/__init__.py b/hlr_mgmt/__init__.py index 2b257f8..21acb99 100644 --- a/hlr_mgmt/__init__.py +++ b/hlr_mgmt/__init__.py @@ -108,6 +108,7 @@ def main(global_config, **settings): # configuration setup config = Configurator(settings=settings, session_factory=session_factory) + config.include('pyramid_mako') config.include('pyramid_debugtoolbar') config.include('pyramid_exclog') diff --git a/hlr_mgmt/telnet_backend.py b/hlr_mgmt/telnet_backend.py index c2c5dc0..cc5c5e6 100644 --- a/hlr_mgmt/telnet_backend.py +++ b/hlr_mgmt/telnet_backend.py @@ -114,6 +114,13 @@ class telnet_backend(object): def get_timeslot_info(self, bts, timeslot): return self.execute("show timeslot " + bts + " 0 " + timeslot) + + def set_bts_description(self, bts, description): + self.execute('configure terminal') + self.execute('network') + self.execute('bts ' + bts) + self.execute('description ' + description) + return self.save_config() ## OpenSGSN Commands ## diff --git a/hlr_mgmt/templates/bts.mako b/hlr_mgmt/templates/bts.mako index 04159b7..6e79960 100644 --- a/hlr_mgmt/templates/bts.mako +++ b/hlr_mgmt/templates/bts.mako @@ -40,7 +40,7 @@ % else: (OML disconnected) % endif - <br/>${bts[i]['description']} + <br/><bts_description data-pk="${i}">${bts[i]['description']}</bts_description> </h3> ${table_iterator.iterate(bts[i]['stats'])} <h3>Channel Details</h3> @@ -137,4 +137,24 @@ $('select').tooltip({ placement: "left", title: "Select desired channel configuration" }); + +$('bts_description').tooltip({ + placement: "right", + title: "Click to Edit this Description" +}); + +$('bts_description').editable({ + type: 'text', + placement: 'bottom', + title: 'Edit the Description of this BTS', + emptytext: '____', + inputclass: 'span3', + url: function(params) + { + $.ajax({ + url: '${request.route_url('rename_component',field='bts',value='val',reference='ref')}'.replace('ref/val', params.pk+'/'+params.value) + }); + } +}); + </script> diff --git a/hlr_mgmt/templates/scripts.mako b/hlr_mgmt/templates/scripts.mako index 6d76daf..abc38f3 100644 --- a/hlr_mgmt/templates/scripts.mako +++ b/hlr_mgmt/templates/scripts.mako @@ -58,7 +58,7 @@ <reload><a href="${request.route_url('manage_service', service='asterisk', action=2)}"><span class="badge badge-info"><i class="icon-repeat icon-white"></i></span></a></reload> <stop><a href="${request.route_url('manage_service', service='asterisk', action=3)}"><span class="badge badge-important"><i class="icon-pause icon-white"></i></span></a></stop> </td></tr> - <tr><td>GGSN <div class="pull-right">(Data Gateway)</div></td> + <tr><td>GGSN <div class="pull-right">(GPRS Data Gateway)</div></td> % if service_status['ggsn']: % if service_status['ggsn'].find("failed")<0: <td><span class="label label-success">Running</span></td> diff --git a/hlr_mgmt/views.py b/hlr_mgmt/views.py index 50f0ef0..078e309 100644 --- a/hlr_mgmt/views.py +++ b/hlr_mgmt/views.py @@ -394,6 +394,14 @@ def rename_component_view(request): update_imei_name(request.db, reference, value) if(field=="imsi"): update_imsi_name(request.db, reference, value) + elif(field=="bts"): + settings = request.registry.settings + bsc = connect_bsc(settings) + if bsc.connected==True: + bsc.set_bts_description(reference, value) + bsc.close() + else: + return {'success':1} else: return {'success':0} return {'success':1} @@ -31,6 +31,7 @@ CHANGES = open(os.path.join(here, 'CHANGES.txt')).read() requires = [ 'pyramid', + 'pyramid_mako', 'pyramid_debugtoolbar', 'pyramid_exclog', 'waitress', |