BVB Source Codes

cockpit Show main.js Source code

Return Download cockpit: download main.js Source code - Download cockpit Source code - Type:.js
  1. /*
  2.  * This file is part of Cockpit.
  3.  *
  4.  * Copyright (C) 2015 Red Hat, Inc.
  5.  *
  6.  * Cockpit is free software; you can redistribute it and/or modify it
  7.  * under the terms of the GNU Lesser General Public License as published by
  8.  * the Free Software Foundation; either version 2.1 of the License, or
  9.  * (at your option) any later version.
  10.  *
  11.  * Cockpit is distributed in the hope that it will be useful, but
  12.  * WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14.  * Lesser General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU Lesser General Public License
  17.  * along with Cockpit; If not, see <http://www.gnu.org/licenses/>.
  18.  */
  19.  
  20. (function() {
  21.     "use strict";
  22.  
  23.     /* Tell webpack what to bundle here */
  24.     var angular = require('angular');
  25.     require('angular-route');
  26.     require('angular-gettext/dist/angular-gettext.js');
  27.     require('angular-bootstrap/ui-bootstrap.js');
  28.     require('kubernetes-object-describer/dist/object-describer.js');
  29.     require('kubernetes-container-terminal/dist/container-terminal.js');
  30.  
  31.     /* The kubernetes client */
  32.     require('./kube-client');
  33.     require('./kube-client-cockpit');
  34.  
  35.     /* The other angular modules */
  36.     require('./containers');
  37.     require('./dashboard');
  38.     require('./details');
  39.     require('./graphs');
  40.     require('./policy');
  41.     require('./projects');
  42.     require('./images');
  43.     require('./nodes');
  44.     require('./topology');
  45.     require('./volumes');
  46.  
  47.     /* And the actual application */
  48.     require('./app');
  49.  
  50.     angular.module('kubernetes', [
  51.         'ngRoute',
  52.         'ui.bootstrap',
  53.         'gettext',
  54.         'kubeClient',
  55.         'kubeClient.cockpit',
  56.         'kubernetes.app',
  57.         'kubernetes.graph',
  58.         'kubernetes.dashboard',
  59.         'kubernetes.containers',
  60.         'kubernetes.details',
  61.         'kubernetes.topology',
  62.         'kubernetes.volumes',
  63.         'kubernetes.nodes',
  64.         'registry.images',
  65.         'registry.policy',
  66.         'registry.projects',
  67.         'kubernetesUI'
  68.     ])
  69.  
  70.     .config([
  71.         '$routeProvider',
  72.         'KubeWatchProvider',
  73.         'KubeRequestProvider',
  74.         'KubeSocketProvider',
  75.         'KubeTranslateProvider',
  76.         'KubeFormatProvider',
  77.         'kubernetesContainerSocketProvider',
  78.         'KubeDiscoverSettingsProvider',
  79.         'KubeBrowserStorageProvider',
  80.         '$provide',
  81.         function($routeProvider, KubeWatchProvider, KubeRequestProvider,
  82.                  KubeSocketProvider, KubeTranslateProvider, KubeFormatProvider,
  83.                  kubernetesContainerSocketProvider, KubeDiscoverSettingsProvider,
  84.                  KubeBrowserStorageProvider, $provide) {
  85.  
  86.             $routeProvider.otherwise({ redirectTo: '/' });
  87.  
  88.             /* Tell the kube-client code to use cockpit watches and requests */
  89.             KubeWatchProvider.KubeWatchFactory = "CockpitKubeWatch";
  90.             KubeRequestProvider.KubeRequestFactory = "CockpitKubeRequest";
  91.             KubeSocketProvider.KubeSocketFactory = "CockpitKubeSocket";
  92.             KubeTranslateProvider.KubeTranslateFactory = "CockpitTranslate";
  93.             KubeFormatProvider.KubeFormatFactory = "CockpitFormat";
  94.             KubeDiscoverSettingsProvider.KubeDiscoverSettingsFactory = "cockpitKubeDiscoverSettings";
  95.             KubeBrowserStorageProvider.KubeBrowserStorageFactory = "cockpitBrowserStorage";
  96.  
  97.             /* Tell the container-terminal that we want to be involved in WebSocket creation */
  98.             kubernetesContainerSocketProvider.WebSocketFactory = 'cockpitContainerWebSocket';
  99.  
  100.             $provide.decorator("$exceptionHandler",
  101.                 ['$delegate',
  102.                  '$log',
  103.                  function($delegate, $log) {
  104.                     return function (exception, cause) {
  105.                         /* Displays an oops if we're running in cockpit */
  106.                         if (window.parent !== window && window.name.indexOf("cockpit1:") === 0)
  107.                             window.parent.postMessage("\n{ \"command\": \"oops\" }", "*");
  108.  
  109.                         $delegate(exception, cause);
  110.                     };
  111.               }]);
  112.         }
  113.     ]);
  114. }());
  115.  
downloadmain.js Source code - Download cockpit Source code
Related Source Codes/Software:
elasticsearch-kopf - web admin interface for elasticsearch 2017-05-07
xunlei-lixian - Thunderbolt offline download script 2017-05-07
xadmin - Drop-in replacement of Django admin comes with lot... 2017-05-07
p2pspider - DHT Spider + BitTorrent Client = P2P Spider 2017-05-07
Backbone.localStorage - A localStorage adapter for Backbone.j 2017-05-07
phenomic - 2017-05-07
shoulda - Makes tests easy on the fingers and the eyes ... 2017-05-07
mio - Metal IO library for Rust 2017-05-07
nova - OpenStack Compute (Nova) ht... 2017-05-07
gobyexample - Go by Example https://gobye... 2017-05-07
react-boilerplate - 2017-06-07
webtorrent - Streaming torrent client for the web ... 2017-06-06
machine-learning-for-software-engineers - A complete daily plan for studying to become a mac... 2017-06-06
upterm - A terminal emulator for the 21st century. 2017-06-06
huginn - Create agents that monitor and act on your behalf.... 2017-06-06
system-design-primer - Learn how to design large-scale systems. Prep for ... 2017-06-06
design-patterns-for-humans - Design Patterns for Humans - An ultra-simplified e... 2017-06-06
developer-roadmap - Roadmap to becoming a web developer in 2017 2017-06-06
nylas-mail - 2017-06-06

 Back to top