<commit_before>/* Router: maps hash navigation */

Atmo.Router = Backbone.Router.extend({
    routes: {
        "": "instances",
        "instances": "instances",
        "instances/:instance_id": "select_instance",
        "volumes": "volumes",
        "volumes/:volume_id": "select_volume",
        "new_instance": "new_instance",
        "new_instance/:image_query": "select_image",
        "settings": "settings"
    },
    initialize: function() {
      Atmo.profile = new Atmo.Models.Profile();
      Atmo.profile.fetch({
        async: false,
        success: function(profile, foo, bar) {
          $("#username").html(profile.get('id'));
        }, 
        error: function() {
          window.location.replace(site_root+"/CASlogin/"+site_root+"/login/");
        }
      });
      Atmo.Utils.update_weather();
      Atmo.providers = new Atmo.Collections.Providers();
      Atmo.providers.fetch({
        async: false,
        success: function(providers, foo, bar) {
        }
      });
	  Atmo.identities = new Atmo.Collections.Identities();
	  Atmo.identities.fetch({
		  async: false,
	  });

      var identity = Atmo.profile.get('selected_identity');
      var identity_provider_id = identity.get("provider_id");

      Atmo.maintenances = new Atmo.Collections.Maintenances();
      Atmo.maintenances.fetch({
        async: false,
      });
      if (!Atmo.maintenances.in_maintenance(identity_provider_id)) {
        Atmo.instances = new Atmo.Collections.Instances();
        Atmo.volumes = new Atmo.Collections.Volumes();
        Atmo.images = new Atmo.Collections.Machines();
        Atmo.instance_types = new Atmo.Collections.Sizes();
        Atmo.instance_types.fetch({async: false});
        new Atmo.Views.Sidebar({el: $('#menu_wrapper')}).render();
        Atmo.instances.fetch({
          async: false
        });
        Atmo.volumes.fetch();
        Atmo.images.fetch();
      }

      Atmo.notifications = new Atmo.Collections.Notifications();
      
      this.main = new Atmo.Views.Main({el: $('#main')[0]}).render();

      setInterval(function() {
        $('#refresh_instances_button').click();
      }, 5*60*1000);

      new Atmo.Views.FeedbackLink({el: $('#feedback_link')[0]});
      Atmo.request_resources_modal = new Atmo.Views.RequestResourcesModal();
      $('body').append(Atmo.request_resources_modal.render().el);
<commit_msg>Update router for new collection (Only if used by staff user)<commit_after>/* Router: maps hash navigation */

Atmo.Router = Backbone.Router.extend({
    routes: {
        "": "instances",
        "instances": "instances",
        "instances/:instance_id": "select_instance",
        "volumes": "volumes",
        "volumes/:volume_id": "select_volume",
        "new_instance": "new_instance",
        "new_instance/:image_query": "select_image",
        "settings": "settings"
    },
    initialize: function() {
      Atmo.profile = new Atmo.Models.Profile();
      Atmo.profile.fetch({
        async: false,
        success: function(profile, foo, bar) {
          $("#username").html(profile.get('id'));
        }, 
        error: function() {
          window.location.replace(site_root+"/CASlogin/"+site_root+"/login/");
        }
      });
      Atmo.Utils.update_weather();
      Atmo.providers = new Atmo.Collections.Providers();
      Atmo.providers.fetch({
        async: false,
        success: function(providers, foo, bar) {
        }
      });
	  Atmo.identities = new Atmo.Collections.Identities();
	  Atmo.identities.fetch({
		  async: false,
	  });

      var identity = Atmo.profile.get('selected_identity');
      var identity_provider_id = identity.get("provider_id");

      Atmo.maintenances = new Atmo.Collections.Maintenances();
      Atmo.maintenances.fetch({
        async: false,
      });
      if (!Atmo.maintenances.in_maintenance(identity_provider_id)) {
        Atmo.instances = new Atmo.Collections.Instances();
        Atmo.volumes = new Atmo.Collections.Volumes();
        Atmo.images = new Atmo.Collections.Machines();
        if (Atmo.profile.get('is_staff') === true) {
            Atmo.instance_hypervisors = new Atmo.Collections.Hypervisors();
            Atmo.instance_hypervisors.fetch({async: false});
        }
        Atmo.instance_types = new Atmo.Collections.Sizes();
        Atmo.instance_types.fetch({async: false});
        new Atmo.Views.Sidebar({el: $('#menu_wrapper')}).render();
        Atmo.instances.fetch({
          async: false
        });
        Atmo.volumes.fetch();
        Atmo.images.fetch();
      }

      Atmo.notifications = new Atmo.Collections.Notifications();
      
      this.main = new Atmo.Views.Main({el: $('#main')[0]}).render();

      setInterval(function() {
        $('#refresh_instances_button').click();
      }, 5*60*1000);

      new Atmo.Views.FeedbackLink({el: $('#feedback_link')[0]});
      Atmo.request_resources_modal = new Atmo.Views.RequestResourcesModal();
      $('body').append(Atmo.request_resources_modal.render().el);

{'fraction_non_alphanumeric': 0.15637530072173217, 'fraction_numerical': 0.0036086607858861267, 'mean_word_length': 2.6683823529411765, 'pattern_counts': {'":': 16, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1751058', 'n_tokens_mistral': 1540, 'n_tokens_neox': 1512, 'n_words': 236}