added feature to rename BTS descriptions
This commit is contained in:
parent
c512fd8264
commit
e501046864
|
@ -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')
|
||||
|
||||
|
|
|
@ -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 ##
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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}
|
||||
|
|
Reference in New Issue