{ "__inputs": [ { "name": "DS_YARDSTICK", "label": "yardstick", "description": "", "type": "datasource", "pluginId": "influxdb", "pluginName": "InfluxDB" } ], "__requires": [ { "type": "panel", "id": "text", "name": "Text", "version": "" }, { "type": "panel", "id": "graph", "name": "Graph", "version": "" }, { "type": "grafana", "id": "grafana", "name": "Grafana", "version": "3.1.1" }, { "type": "datasource", "id": "influxdb", "name": "InfluxDB", "version": "1.0.0" } ], "id": null, "title": "Prox_BM_L3FWD-4Port", "tags": [ "NSB", "Prox", "BM", "4Port", "L3Fwd" ], "style": "dark", "timezone": "browser", "editable": true, "hideControls": false, "sharedCrosshair": false, "rows": [ { "collapse": false, "editable": true, "height": "100px", "panels": [ { "content": "
The application performs routing of packets with LPM based look-up method.\nThe KPI is the number of packets per second for 64 byte packets with an accepted minimal packet loss
\n'use strict';
angular.module('yardStickGui2App')
.controller('ProjectController', ['$scope', '$state', '$stateParams', 'mainFactory', 'Upload', 'toaster', 'ngDialog', '$loading',
function($scope, $state, $stateParams, mainFactory, Upload, toaster, ngDialog, $loading) {
init();
function init() {
getProjectList();
$scope.openCreateProject = openCreateProject;
$scope.createName = createName;
$scope.gotoDetail = gotoDetail;
}
function getProjectList() {
$loading.start('key');
mainFactory.projectList().get({}).$promise.then(function(response) {
$loading.finish('key');
if (response.status == 1) {
$scope.projectListData = response.result.projects;
} else {
}
}, function(error) {
$loading.finish('key');
toaster.pop({
type: 'error',
title: 'fail',
body: 'unknow error',
timeout: 3000
});
})
}
function openCreateProject() {
ngDialog.open({
template: 'views/modal/projectCreate.html',
scope: $scope,
className: 'ngdialog-theme-default',
width: 400,
showClose: true,
closeByDocument: false
})
}
function createName(name) {
mainFactory.createProjectName().post({
'action': 'create_project',
'args': {
'name': name,
}
}).$promise.then(function(response) {
if (response.status == 1) {
toaster.pop({
type: 'success',
title: 'create project success',
body: 'you can go next step',
timeout: 3000
});
ngDialog.close();
getProjectList();
} else {
toaster.pop({
type: 'error',
title: 'failed',
body: 'create project failed',
timeout: 3000
});
}
}, function(error) {
toaster.pop({
type: 'error',
title: 'failed',
body: 'Something Wrong',
timeout: 3000
});
})
}
function gotoDetail(id) {
$state.go('app.projectdetail', { projectId: id })
}
$scope.openDeleteEnv = function openDeleteEnv(id, name) {
$scope.deleteName = name;
$scope.deleteId = id;
ngDialog.open({
template: 'views/modal/deleteConfirm.html',
scope: $scope,
className: 'ngdialog-theme-default',
width: 500,
showClose: true,
closeByDocument: false