+++ /dev/null
-angular.module('common.navigation', ['ngCookies'])\r
-\r
- .directive('mcNavigation', function () {\r
- return {\r
- templateUrl: 'navigation/navigation.tpl.html',\r
- replace: true\r
- };\r
- })\r
-\r
-\r
- .factory('navigationFactory', function ($cookieStore) {\r
- var factory = {};\r
- factory.getNavigationData = function (mobile) { // used for mock only\r
-\r
- /* this part need to be different for each usesr ( if the user cannot access razor page,\r
- we shouldn't let him access that page). */\r
- var navItem = [\r
- \r
- {\r
- "link": "index.html#/node/index",\r
- "active": "node",\r
- "title": "NODES",\r
- "icon": "icon-sitemap",\r
- "page": {\r
- "title": "NODES",\r
- "description": "NODES"\r
- }\r
- },\r
- // {\r
- // "link": "index.html#/connection_manager/index",\r
- // "active": "connection_manager",\r
- // "title": "CONNECTION_MANAGER",\r
- // "icon": "icon-bolt",\r
- // "page": {\r
- // "title": "CONNECTION_MANAGER",\r
- // "description": "CONNECTION_MANAGER"\r
- // }\r
- // },\r
- // {\r
- // "link": "index.html#/flow/index",\r
- // "active": "flow",\r
- // "title": "FLOWS",\r
- // "icon": "icon-level-down",\r
- // "page": {\r
- // "title": "FLOWS",\r
- // "description": "FLOWS"\r
- // }\r
- // },\r
- {\r
- "link": "index.html#/yangui/index",\r
- "active": "yangui",\r
- "title": "Yang UI",\r
- "icon": "icon-level-down",\r
- "page": {\r
- "title": "Yang UI",\r
- "description": "Yang UI"\r
- }\r
- },\r
- {\r
- "link": "index.html#/topology",\r
- "title": "TOPOLOGY",\r
- "active": "topology",\r
- "icon": "icon-link",\r
- "page": {\r
- "title": "TOPOLOGY",\r
- "description": "TOPOLOGY"\r
- }\r
- },\r
- // {\r
- // "link": "index.html#/network/staticroute",\r
- // "title": "NETWORK",\r
- // "active": "network",\r
- // "icon": "icon-cloud",\r
- // "page": {\r
- // "title": "NETWORK",\r
- // "description": "NETWORK"\r
- // }\r
- // },\r
- // {\r
- // "link": "index.html#/container/index",\r
- // "title": "CONTAINER",\r
- // "active": "container",\r
- // "icon": "icon-sign-blank",\r
- // "page": {\r
- // "title": "CONTAINER",\r
- // "description": "CONTAINER"\r
- // }\r
- // }\r
- /*,\r
- {\r
- "link": "index.html#/user/index",\r
- "title": "User",\r
- "active": "user",\r
- "icon": "icon-user",\r
- "page": {\r
- "title": "User",\r
- "description": "User Management"\r
- }\r
- }*/\r
- ];\r
- if (mobile) { //temporary, we have an issue with topology preview\r
- navItem.splice(3,1); \r
- }\r
- \r
- return navItem;\r
-\r
- };\r
- return factory;\r
- })\r
- .controller('navItemCtrl', function ($scope, $location, $window) {\r
-\r
- $scope.display = 'none';\r
- $scope.isOpen = false;\r
-\r
- $scope.isValid = function (value) {\r
- if (angular.isUndefined(value) || value === null) {\r
- return false;\r
- }\r
- else {\r
- return true;\r
- }\r
- };\r
-\r
- $scope.updateTemplate = function (e, item) {\r
-\r
- e.stopPropagation();\r
- e.preventDefault();\r
-\r
-\r
- $scope.isOpen = !$scope.isOpen;\r
- if ($scope.display == 'none') {\r
- $scope.display = 'block';\r
- }\r
- else {\r
- $scope.display = 'none';\r
- }\r
-\r
-\r
- };\r
- });\r
+++ /dev/null
-angular.module('common.topbar', ['ngCookies', 'common.auth', 'common.navigation'])
- .factory('taskFactory',function () {
- var factory = {};
- factory.getTaskData = function () {
- return {
- count: 4,
- latest: [
- {
- title: "Software Update",
- percentage: 65
- },
- {
- title: "Hardware Upgrade" ,
- percentage: 35 ,
- progressBarClass: "progress-bar-danger"
- },
- {
- title: "Unit Testing" ,
- percentage: 15 ,
- progressBarClass: "progress-bar-warning"
- },
- {
- title: "Bug Fixes" ,
- percentage: 90 ,
- progressClass: "progress-striped active",
- progressBarClass: "progress-bar-success"
- }
- ]
- };
-
- };
- return factory;
- }).factory('messageFactory', function () {
- var factory = {};
- factory.getMessageData = function () {
- return {
- count: 5,
- latest: [
- {
- name: "Alex",
- img: "avatar.png",
- time: "a moment ago",
- summary: "Ciao sociis natoque penatibus et auctor ..."
- },
- {
- name: "Susan",
- img: "avatar3.png",
- time: "20 minutes ago",
- summary: "Vestibulum id ligula porta felis euismod ..."
- },
- {
- name: "Bob",
- img: "avatar4.png",
- time: "3:15 pm",
- summary: "Nullam quis risus eget urna mollis ornare ..."
- }
- ]
- };
- };
- return factory;
- })
- .factory('notifsFactory', function () {
- var factory = {};
- factory.getNotifsData = function () {
- return {
- "count": 8,
- "latest": [
- {
- title: "New Comments",
- icon: "icon-comment",
- iconClass: "btn-pink",
- badge: "+12",
- badgeClass: "badge-info"
- },
- {
- title: "Bob just signed up as an editor ...",
- icon: "icon-user",
- iconClass: "btn-primary"
- },
- {
- title: "New Orders",
- icon: "icon-shopping-cart",
- iconClass: "btn-success",
- badge: "+8",
- badgeClass: "badge-success"
- },
- {
- title: "Followers",
- icon: "icon-twitter",
- iconClass: "btn-info",
- badge: "+11",
- badgeClass: "badge-info"
- }
- ]
- };
-
- };
- return factory;
- })
- .directive('mcTopBar', function () {
- return {
- replace: true,
- templateUrl: 'topbar/topbar.tpl.html',
- };
- })
- .directive('mcTopBarTasks', function () {
- return {
- replace: true,
- controller: 'topBarTasksCtrl',
- templateUrl: 'topbar/tasks.tpl.html'
- };
- })
- .directive('mcTopBarNotifications', function () {
- return {
- replace: true,
- controller: 'topBarNotifsCtrl',
- templateUrl: 'topbar/notifications.tpl.html'
- };
- })
- .directive('mcTopBarMessages', function () {
- return {
- replace: true,
- controller: 'topBarMessagesCtrl',
- templateUrl: 'topbar/messages.tpl.html'
- };
- })
- .directive('mcTopBarUserMenu', function () {
- return {
- replace: true,
- controller: 'topBarUserMenuCtrl',
- templateUrl: 'topbar/user_menu.tpl.html'
- };
- })
- .controller('topBarTasksCtrl',function ($scope, taskFactory) {
- $scope.tasks = taskFactory.getTaskData();
- }).controller('topBarNotifsCtrl',function ($scope, notifsFactory) {
- $scope.notifs = notifsFactory.getNotifsData();
- $scope.isValid = function (value) {
- if (angular.isUndefined(value) || value === null) {
- return false;
- }
- else {
- return true;
- }
- };
- }).controller('topBarMessagesCtrl',function ($scope, messageFactory) {
- $scope.messages = messageFactory.getMessageData();
- $scope.isValid = function (value) {
- if (angular.isUndefined(value) || value === null) {
- return false;
- }
- else {
- return true;
- }
- };
- }).controller('topBarUserMenuCtrl', function ($scope, $cookieStore, Auth, $window) {
- $scope.logOut = function () {
- Auth.logout(
- function(res) {
- $window.location.href = 'login.html';
- });
-
- };
- });
\ No newline at end of file