aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/update-center/router.js
blob: 48f3df055ea29c9ee4df97bfcdb547db50e69249 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
define([
  'backbone'
], function (Backbone) {

  return Backbone.Router.extend({
    routes: {
      '': 'index',
      'installed': 'showInstalled',
      'updates': 'showUpdates',
      'available': 'showAvailable',
      'system': 'showSystemUpgrades'
    },

    initialize: function (options) {
      this.controller = options.controller;
    },

    index: function () {
      this.navigate('installed', { trigger: true, replace: true });
    },

    showInstalled: function () {
      this.controller.showInstalled();
    },

    showUpdates: function () {
      this.controller.showUpdates();
    },

    showAvailable: function () {
      this.controller.showAvailable();
    },

    showSystemUpgrades: function () {
      this.controller.showSystemUpgrades();
    }
  });

});