Browse Source

Merge branch 'devel' of github.com:nerosketch/djing into devel

devel v0.2.3
bashmak 8 years ago
parent
commit
9f03e88d44
  1. 7
      devapp/dev_types.py
  2. 6
      devapp/templates/devapp/custom_dev_page/olt_ztec320.html
  3. 8
      djing/settings.py

7
devapp/dev_types.py

@ -516,7 +516,12 @@ class ZteOnuDevice(OnuDevice):
ip = device.parent_dev.ip_address
if ip:
mac = str(device.mac_addr).encode()
sn = b"ZTEG%s" % b''.join(mac.split(b':')[-4:]).upper()
# Format serial number from mac address
# because saved mac address was make from serial number
sn = (b'%.2X' % int(x, base=16) for x in mac.split(b':')[-4:])
sn = b"ZTEG%s" % b''.join(sn)
telnet = extra_data.get('telnet')
if telnet is None:
raise DeviceConfigurationError('For ZTE configuration needed "telnet" section in extra_data')

6
devapp/templates/devapp/custom_dev_page/olt_ztec320.html

@ -17,15 +17,9 @@
{% for fiber in dev_manager.get_fibers %}
<div class="port{% if fiber.fb_onu_num > 0 %} mega{% endif %} text-center">
<b>{{ fiber.fb_name }}</b>
{% if fiber.fb_onu_num > 0 %}
<a href="{% url 'devapp:zte_port_view_uncfg' grp dev.id fiber.fb_id %}" class="port-img">
<b>{{ fiber.fb_onu_num }}</b>
</a>
{% else %}
<a href="#" class="port-img">
<b>0</b>
</a>
{% endif %}
</div>
{% empty %}
<h3>{% trans 'We have not received info, please check options :(' %}</h3>

8
djing/settings.py

@ -126,12 +126,12 @@ SESSION_COOKIE_HTTPONLY = True
# Internationalization
# https://docs.djangoproject.com/en/1.11/topics/i18n/
LANGUAGE_CODE = 'ru-RU'
LANGUAGE_CODE = 'ru'
#LANGUAGES = (
# ('ru', _('Russian')),
LANGUAGES = (
('ru', _('Russian')),
#('en', _('English'))
#)
)
PROJECT_PATH = os.path.dirname(os.path.abspath(__file__))

Loading…
Cancel
Save