Skip to content
Snippets Groups Projects
  1. Aug 08, 2018
    • Benjamin Bertrand's avatar
      Replace jwt decorators with flask-login · fb3f568e
      Benjamin Bertrand authored
      Using flask-login request_loader, we can validate jwt tokens.
      This allows to use the same decorators for the web UI (using cookies)
      and the API (using JWT) as well as the current_user local proxy.
      fb3f568e
  2. Jul 12, 2018
  3. Jul 11, 2018
  4. Jul 09, 2018
    • Benjamin Bertrand's avatar
      Use sqlalchemy events hook to trigger tasks · d9516a98
      Benjamin Bertrand authored
      Use the before_flush hook to trigger the core services update.
      It's much nicer than having to call a method in several places.
      
      The core services update is triggered on creation/modification/deletion
      of an Interface.
      
      In the before_flush we can manipulate the session (add objects) but we
      shouldn't call commit.
      The db.session.commit() was removed from the launch_task method.
      d9516a98
  5. Jul 06, 2018
  6. Apr 23, 2018
    • Benjamin Bertrand's avatar
      Add stack_member field to item · ce031db6
      Benjamin Bertrand authored
      This is to be used for stack of switches only
      
      - a stack_member is linked to an host (device_type has to be "Switch")
      - a stack_member is an integer between 0 and 9 (included) or can be None
      - the couple (host_id, stack_member) must be unique
      
      JIRA INFRA-267
      ce031db6
  7. Apr 09, 2018
    • Benjamin Bertrand's avatar
      Sort network names in the register new host form · c302b5e3
      Benjamin Bertrand authored
      The sorting of the models was done in the utils.get_model_choices
      funtion but a specific query was passed to not display admin_only networks.
      
      The sorting is now done even when passing a specific query to
      get_model_choices.
      
      JIRA INFRA-284
      c302b5e3
    • Benjamin Bertrand's avatar
      Add attributes favorites page · 3050ce17
      Benjamin Bertrand authored
      - create many-to-many relationships between the user table and
      attributes tables (manufacturer / model / location / status / action)
      - add a checkbox as the first column of the attributes table to add or
      remove an attribute to the favorites
      - add a new page to display the favorite attributes
      
      JIRA INFRA-283
      3050ce17
  8. Feb 26, 2018
    • Benjamin Bertrand's avatar
      Fix broken test · 815463b9
      Benjamin Bertrand authored
      Fix error:
      User instance is not bound to a Session; attribute refresh operation cannot proceed
      815463b9
  9. Feb 12, 2018
    • Benjamin Bertrand's avatar
      Allow admin to create interface outside range · a653f0d9
      Benjamin Bertrand authored
      The network range defines the IP to be allocated.
      This is to reserve some specific addresses (for gateway for example).
      
      An admin user should be able to define an interface outside the network
      range.
      
      The IP address select field was replaced with a string field
      (initialized to the first available IP).
      
      Fixes INFRA-200
      a653f0d9
  10. Feb 09, 2018
  11. Jan 08, 2018
  12. Dec 22, 2017
  13. Dec 21, 2017
  14. Dec 19, 2017
  15. Dec 15, 2017
    • Benjamin Bertrand's avatar
      Fix validation error when field is disabled · 2db946d2
      Benjamin Bertrand authored
      If a selectfield is disabled, None is returned (not a string).
      To pass wtforms validation, that value shall be part of the choices.
      
      We use None as the value for SelectField that are optional (instead of
      '').
      We were previously converting '' to None when creating a model.
      We now use the coerce function to let the form convert 'None' to None.
      2db946d2
  16. Dec 06, 2017
  17. Nov 15, 2017
  18. Nov 03, 2017
  19. Sep 07, 2017
  20. Sep 06, 2017
    • Benjamin Bertrand's avatar
      Add page to create QR codes · 99536bdd
      Benjamin Bertrand authored
      This can be done via the Admin interface but this latter shall be
      restricted to admin users. This simple page allows the group "create"
      to easily add new Manufacturer, Model or Location.
      99536bdd
    • Benjamin Bertrand's avatar
      Replace hash with specific ICS Id (3 letters + 3 digits) · fe73933d
      Benjamin Bertrand authored
      The serial number might not be unique and can't be used
      as the string to hash.
      There are for example SD cards that all have the same SN.
      
      Using an ICS id allows to pre-print labels that can be assigned to
      hardware when scanning serial numbers.
      This id shall be easy to remember (unlike UUID).
      fe73933d
  21. Aug 18, 2017
  22. Jul 20, 2017
  23. Jul 19, 2017
    • Benjamin Bertrand's avatar
      Fix hash computation in admin view · 74437b80
      Benjamin Bertrand authored
      The hash is supposed to be computed in the __init__ method of Item.
      But flask-admin never passes any parameter when creating the model class.
      The attributes are changed after creation.
      
      When creating an item in the admin view, we use the on_model_change
      method to update the hash.
      
      There might be a better way to avoid this code duplication.
      This works for now.
      74437b80
    • Benjamin Bertrand's avatar
      Add QR Codes page · 380551d2
      Benjamin Bertrand authored
      380551d2
    • Benjamin Bertrand's avatar
      Initial commit · 5c62905e
      Benjamin Bertrand authored
      5c62905e
Loading