<commit_before>angular
    .module('dart.directives.graph')
    .directive('dtGraphMenuBar', [function() {
        return {
            restrict: 'E',
            scope: {
                options: '='
            },
            templateUrl: 'static/partials/directives/graph/menu_bar.html',
            controller: ['$scope', '$state', 'EntityModalService', 'GraphService', 'ActionService', 'DatasetService', 'DatastoreService',
                'EventService', 'SubscriptionService', 'TriggerService', 'WorkflowService', 'WorkflowInstanceService', '$q', '$timeout',
                '$window', 'GraphLoadModalService', 'dtUtils', '$mdDialog',
                function($scope, $state, EntityModalService, GraphService, ActionService, DatasetService, DatastoreService,
                         EventService, SubscriptionService, TriggerService, WorkflowService, WorkflowInstanceService, $q,
                         $timeout, $window, GraphLoadModalService, dtUtils, $mdDialog) {

                    $scope._ = $window._;

                    $scope.reset = function() {
                        $scope.subGraphCounter = 0;
                        $scope.activeSubGraphEntityMaps = {};
                        $scope.relatedNodes = {};
                        $scope.editOperations = [];
                    };

                    $scope.nodeId = function(node) { return node.entity_type + '-' + node.entity_id };

                    $scope.subGraphEntityMap = function(node) {
                        return $scope.activeSubGraphEntityMaps[node.engine_name][node.sub_graph_name];
                    };

                    $scope.subGraphEntity = function(node) {
                        var nodeId = $scope.nodeId(node);
                        return $scope.subGraphEntityMap(node)[nodeId];
                    };

                    $scope.nodeData = function(entity, entityType, entityId) {
                        return {
                            entity_type: entityType,
                            entity_id: entityId,
                            name: entity.data.name,
                            state: entity.data.state
                        }
                    };

                    $scope.showGraphLoadModal = function(ev) {
                        GraphLoadModalService.showDialog(ev, $scope.options.onSelectedItemChange)
                    };

                    $scope.saveGraph = function(ev) {
                        var unsavedEntities = {};
                        _.each($scope.activeSubGraphEntityMaps, function(entityMapsByName) {
                            _.each(entityMapsByName, function(entityMap) {
                                _.assign(unsavedEntities, entityMap);
                            });
                        });
                        _.each(unsavedEntities, function(entity, entity_id) {
                            unsavedEntities[entity_id] = dtUtils.stripSingleArrayElementNulls(entity)
                        });

                        var entityMap = {unsaved_entities: unsavedEntities, related_entity_data: $scope.relatedNodes};
                        GraphService.saveEntityMap(entityMap, true).then(function(response) {
                            if (response.data && response.data.results === 'ERROR') {
                                $scope.errorMessage = response.data.error_message;
                                $scope.$root.$broadcast('dt-graph-save-failed', JSON.parse($scope.errorMessage));
                                return
                            }
                            $scope.reset();
                            $scope.$root.$broadcast('dt-graph-reload');
                        })
                    };

                    $scope.$on('dt-graph-node-selected', function(evt, current_node) {
                        if ($scope.selectedNode && $scope.nodeId($scope.selectedNode) === $scope.nodeId(current_node)) {
                            return
                        }

                        $timeout(function () {
                            $scope.editOperations = [];
                            if (current_node.entity_type === 'workflow' && !current_node.entity_id.startsWith('UNSAVED')) {
                                $scope.editOperations.push({
                                    name: 'run',
                                    description: 'manually run workflow',
                                    md_icon: 'directions_run',
                                    func: function() { WorkflowService.manuallyRunWorkflow(current_node.entity_id) }
                                })
                            }
                            if (current_node.entity_type === 'action' && current_node.state === 'TEMPLATE') {
                                $scope.editOperations.push({
                                    name: 'delete',
                                    description: 'delete this workflow step',
                                    md_icon: 'delete',
                                    func: function() {
                                        var confirm = $mdDialog.confirm()
                                            .title('Are you sure you want to delete this workflow step?')
                                            .content('This cannot be undone.')
                                            .ariaLabel('delete')
                                            .ok('ok')
                                            .cancel('cancel')
                                            .targetEvent(evt);
                                        $mdDialog.show(confirm).then(function() {
                                            if (current_node.entity_id.startsWith('UNSAVED')) {
                                                delete $scope.subGraphEntityMap(current_node)[$scope.nodeId(current_node)];
                                                $scope.$root.$broadcast('dt-graph-remove-node', current_node);
                                                return
                                            }
                                            ActionService.deleteEntity(current_node.entity_id).then(function() {
                                                $scope.reset();
                                                $scope.$root.$broadcast('dt-graph-reload');
                                            });
                                        });
                                    }
                                })
                            }
                            $scope.selectedNode = current_node;
                            $scope.loadSubGraphMap();
                        });
                    });
                    $scope.$on('dt-graph-node-unselected', function(evt) {
                        $timeout(function () {
                            $scope.selectedNode = null;
                            $scope.subGraphMap = null;
                            $scope.editOperations = [];
                            $scope.loadSubGraphMap();
                        });
                    });

                    $scope.loadSubGraphMap = function() {
                        var entityType = $scope.selectedNode ? $scope.selectedNode.entity_type : null;
                        var engineName = $scope.selectedNode ? $scope.selectedNode.engine_name : null;
                        var relatedId = $scope.selectedNode ? $scope.selectedNode.entity_id : null;
                        if (relatedId && relatedId.startsWith('UNSAVED-')) {
                            relatedId = null;
                        }
                        GraphService.getSubGraphMap(entityType, relatedId, engineName).then(function(response) {
                            $scope.noEngineSubGraphs = response.results[null];
                            $scope.subGraphMap = response.results;
                            delete $scope.subGraphMap[null]
                        });
                    };

                    $scope.reset();

                    $scope.addSubGraph = function(engine_name, subGraphFromServer) {
                        var subGraph = JSON.parse(JSON.stringify(subGraphFromServer));
                        var graph = subGraph.graph;

                        if (!$scope.activeSubGraphEntityMaps[engine_name]) { $scope.activeSubGraphEntityMaps[engine_name] = {} }
                        if (!$scope.activeSubGraphEntityMaps[engine_name][subGraph.name]) { $scope.activeSubGraphEntityMaps[engine_name][subGraph.name] = {} }
                        _.assign($scope.activeSubGraphEntityMaps[engine_name][subGraph.name], subGraph.entity_map);

                        $scope.subGraphCounter++;
                        _.each(graph.nodes, function(e) {
                            e.engine_name = engine_name;
                            e.sub_graph_name = subGraph.name;

                            // this is because the angular-schema-form library has issues applying defaults to null objects
                            var entity = $scope.subGraphEntity(e);
                            if (!entity.data.args) { delete entity.data.args; }
                        });
                        var prop = null;
                        if (subGraph.related_is_a) {
                            if (subGraph.related_is_a == 'PARENT') { prop = 'source_id' }
                            if (subGraph.related_is_a == 'CHILD')  { prop = 'destination_id' }
                            _.each(graph.edges, function(e) {
                                if (e[prop].startsWith(subGraph.related_is_a)) {
                                    $scope.relatedNodes[$scope.selectedNode.entity_type + '-' + e[prop]] = {
                                        entity_id: $scope.selectedNode.entity_id,
                                        entity_type: $scope.selectedNode.entity_type,
                                        relationship: subGraph.related_is_a,
                                        edge: JSON.parse(JSON.stringify(e))
                                    };
                                    e[prop] = $scope.selectedNode.entity_id;
                                }
                            })
                        }
                        $scope.$root.$broadcast('dt-graph-add-sub-graph', graph);
                        $scope.loadSubGraphMap();
                    };

                    $scope.navigateToEntity = function() {
                        $state.go('app.entities.' + $scope.selectedNode.entity_type + 's', {f: JSON.stringify(['id=' + $scope.selectedNode.entity_id])})
                    };

                    $scope.onCancelChanges = function() {
                        $scope.reset();
                        $scope.loadSubGraphMap();
                        $scope.$root.$broadcast('dt-graph-cancel-sub-graph');
                    };

                    var getEntityMap = {
                        'action': function(entity_id) { return ActionService.getEntity(entity_id) },
                        'dataset': function(entity_id) { return DatasetService.getEntity(entity_id) },
                        'datastore': function(entity_id) { return DatastoreService.getEntity(entity_id) },
                        'event': function(entity_id) { return EventService.getEntity(entity_id) },
                        'subscription': function(entity_id) { return SubscriptionService.getEntity(entity_id) },
                        'trigger': function(entity_id) { return TriggerService.getEntity(entity_id) },
                        'workflow': function(entity_id) { return WorkflowService.getEntity(entity_id) },
                        'workflow_instance': function(entity_id) { return WorkflowInstanceService.getEntity(entity_id) }
                    };
                    var updateEntityMap = {
                        'action': function(entity) { return ActionService.updateEntity(entity) },
                        'dataset': function(entity) { return DatasetService.updateEntity(entity) },
                        'datastore': function(entity) { return DatastoreService.updateEntity(entity) },
                        'event': function(entity) { return EventService.updateEntity(entity) },
                        'subscription': function(entity) { return SubscriptionService.updateEntity(entity) },
                        'trigger': function(entity) { return TriggerService.updateEntity(entity) },
                        'workflow': function(entity) { return WorkflowService.updateEntity(entity) }
                    };
                    var getSchemaMap = {
                        'action': function(entity_id) { return ActionService.getSchema({entity_id: entity_id}) },
                        'dataset': function() { return DatasetService.getSchema() },
                        'datastore': function(entity_id) { return DatastoreService.getSchema({entity_id: entity_id}) },
                        'event': function() { return EventService.getSchema() },
                        'subscription': function() { return SubscriptionService.getSchema() },
                        'trigger': function(entity_id) { return TriggerService.getSchema({entity_id: entity_id}) },
                        'workflow': function() { return WorkflowService.getSchema() },
                        'workflow_instance': function() { return WorkflowInstanceService.getSchema() }
                    };
                    var getNewSchemaMap = {
                        'action': function() {
                            return ActionService.getSchema({
                                engine_name: $scope.selectedNode.engine_name,
                                action_type_name: $scope.subGraphEntity($scope.selectedNode).data.action_type_name
                            })
                        },
                        'dataset': function() { return DatasetService.getSchema() },
                        'datastore': function() { return DatastoreService.getSchema({engine_name: $scope.selectedNode.engine_name}) },
                        'event': function() { return EventService.getSchema() },
                        'subscription': function() { return SubscriptionService.getSchema() },
                        'trigger': function() {
                            return TriggerService.getSchema({
                                trigger_type_name: $scope.subGraphEntity($scope.selectedNode).data.trigger_type_name
                            })
                        },
                        'workflow': function() { return WorkflowService.getSchema() },
                        'workflow_instance': function() { return WorkflowInstanceService.getSchema() }
                    };

                    var showViewExistingEntityModal = function(ev) {
                        $q.all([
                            getEntityMap[$scope.selectedNode.entity_type]($scope.selectedNode.entity_id),
                            getSchemaMap[$scope.selectedNode.entity_type]($scope.selectedNode.entity_id)
                        ]).then(function(responses) {
                            var entity = responses[0].results;
                            EntityModalService.showDialog(ev, entity,
                                function getSchema() {
                                    var deferred = $q.defer();
                                    responses[1].results.readonly = true;
                                    deferred.resolve(responses[1]);
                                    return deferred.promise;
                                },
                                null
                            )
                        });
                    };
                    var showEditExistingEntityModal = function(ev) {
                        var entityType = $scope.selectedNode.entity_type;
                        var entityId = $scope.selectedNode.entity_id;
                        $q.all([
                            getEntityMap[entityType](entityId),
                            getSchemaMap[entityType](entityId)
                        ]).then(function(responses) {
                            var entity = responses[0].results;
                            EntityModalService.showDialog(ev, entity,
                                function getSchema() {
                                    var deferred = $q.defer();
                                    deferred.resolve(responses[1]);
                                    return deferred.promise;
                                },
                                function updateEntity(entity) {
                                    return updateEntityMap[entityType](entity).then(function(response) {
                                        var nodeData = $scope.nodeData(response.results, entityType, entityId);
                                        $scope.$root.$broadcast('dt-graph-update-node-data', nodeData);
                                        return response;
                                    })
                                }
                            )
                        });
                    };
                    var showViewNewEntityModal = function(ev) {
                        var entityType = $scope.selectedNode.entity_type;
                        var entity = $scope.subGraphEntity($scope.selectedNode);
                        getNewSchemaMap[entityType]().then(function(response) {
                            EntityModalService.showDialog(ev, entity,
                                function getSchema() {
                                    var deferred = $q.defer();
                                    response.results.readonly = true;
                                    deferred.resolve(response);
                                    return deferred.promise;
                                },
                                null
                            );
                        })
                    };
                    var showEditNewEntityModal = function(ev) {
                        var entityType = $scope.selectedNode.entity_type;
                        var entityId = $scope.selectedNode.entity_id;
                        var entity = $scope.subGraphEntity($scope.selectedNode);
                        EntityModalService.showDialog(ev, entity,
                            getNewSchemaMap[entityType],
                            function saveEntity(entity) {
                                var nodeData = $scope.nodeData(entity, entityType, entityId);
                                var nodeId = $scope.nodeId($scope.selectedNode);
                                $scope.subGraphEntityMap($scope.selectedNode)[nodeId] = entity;
                                $scope.$root.$broadcast('dt-graph-update-node-data', nodeData);
                                var deferred = $q.defer();
                                deferred.resolve(entity);
                                return deferred.promise;
                            }
                        );
                    };

                    var showEntityModalMap = {
                        'view':     showViewExistingEntityModal,
                        'view/new': showViewNewEntityModal,
                        'edit':     showEditExistingEntityModal,
                        'edit/new': showEditNewEntityModal
                    };

                    $scope.showEntityModal = function(ev, mode) {
                        mode = $scope.selectedNode.entity_id.startsWith('UNSAVED') ? mode + '/new' : mode;
                        showEntityModalMap[mode](ev)
                    };

                    $scope.toggleLiveUpdatesEnabled = function() {
                        // needed due to angular material menuBar bug
                        $scope.liveUpdatesEnabled = !$scope.liveUpdatesEnabled;
                    };

                    $scope.liveUpdatesEnabled = true;
                    var timer;
                    function poll() {
                        if ($scope.liveUpdatesEnabled && $scope.subGraphCounter == 0) {
                            $scope.options.queryGraph().then(function(response) {
                                if (!response) { return }
                                $scope.$root.$broadcast('dt-graph-merge-graph', response.results);
                                timer = $timeout(poll, 5000)
                            });
                        }
                    }
                    timer = $timeout(poll, 5000);

                    $scope.$on('$destroy', function() { $timeout.cancel(timer) });

                    $scope.$watch('options.layout', function(newValue) {
                        $scope.$root.$broadcast('dt-graph-reset-layout', newValue);
                    });

                    $scope.resetLayout = function() {
                        $scope.$root.$broadcast('dt-graph-reset-layout', $scope.options.layout);
                    };
                }
            ]
        }
    }])
;
<commit_msg>Change refresh rate from 5 sec to 30 sec<commit_after>angular
    .module('dart.directives.graph')
    .directive('dtGraphMenuBar', [function() {
        return {
            restrict: 'E',
            scope: {
                options: '='
            },
            templateUrl: 'static/partials/directives/graph/menu_bar.html',
            controller: ['$scope', '$state', 'EntityModalService', 'GraphService', 'ActionService', 'DatasetService', 'DatastoreService',
                'EventService', 'SubscriptionService', 'TriggerService', 'WorkflowService', 'WorkflowInstanceService', '$q', '$timeout',
                '$window', 'GraphLoadModalService', 'dtUtils', '$mdDialog',
                function($scope, $state, EntityModalService, GraphService, ActionService, DatasetService, DatastoreService,
                         EventService, SubscriptionService, TriggerService, WorkflowService, WorkflowInstanceService, $q,
                         $timeout, $window, GraphLoadModalService, dtUtils, $mdDialog) {

                    $scope._ = $window._;

                    $scope.reset = function() {
                        $scope.subGraphCounter = 0;
                        $scope.activeSubGraphEntityMaps = {};
                        $scope.relatedNodes = {};
                        $scope.editOperations = [];
                    };

                    $scope.nodeId = function(node) { return node.entity_type + '-' + node.entity_id };

                    $scope.subGraphEntityMap = function(node) {
                        return $scope.activeSubGraphEntityMaps[node.engine_name][node.sub_graph_name];
                    };

                    $scope.subGraphEntity = function(node) {
                        var nodeId = $scope.nodeId(node);
                        return $scope.subGraphEntityMap(node)[nodeId];
                    };

                    $scope.nodeData = function(entity, entityType, entityId) {
                        return {
                            entity_type: entityType,
                            entity_id: entityId,
                            name: entity.data.name,
                            state: entity.data.state
                        }
                    };

                    $scope.showGraphLoadModal = function(ev) {
                        GraphLoadModalService.showDialog(ev, $scope.options.onSelectedItemChange)
                    };

                    $scope.saveGraph = function(ev) {
                        var unsavedEntities = {};
                        _.each($scope.activeSubGraphEntityMaps, function(entityMapsByName) {
                            _.each(entityMapsByName, function(entityMap) {
                                _.assign(unsavedEntities, entityMap);
                            });
                        });
                        _.each(unsavedEntities, function(entity, entity_id) {
                            unsavedEntities[entity_id] = dtUtils.stripSingleArrayElementNulls(entity)
                        });

                        var entityMap = {unsaved_entities: unsavedEntities, related_entity_data: $scope.relatedNodes};
                        GraphService.saveEntityMap(entityMap, true).then(function(response) {
                            if (response.data && response.data.results === 'ERROR') {
                                $scope.errorMessage = response.data.error_message;
                                $scope.$root.$broadcast('dt-graph-save-failed', JSON.parse($scope.errorMessage));
                                return
                            }
                            $scope.reset();
                            $scope.$root.$broadcast('dt-graph-reload');
                        })
                    };

                    $scope.$on('dt-graph-node-selected', function(evt, current_node) {
                        if ($scope.selectedNode && $scope.nodeId($scope.selectedNode) === $scope.nodeId(current_node)) {
                            return
                        }

                        $timeout(function () {
                            $scope.editOperations = [];
                            if (current_node.entity_type === 'workflow' && !current_node.entity_id.startsWith('UNSAVED')) {
                                $scope.editOperations.push({
                                    name: 'run',
                                    description: 'manually run workflow',
                                    md_icon: 'directions_run',
                                    func: function() { WorkflowService.manuallyRunWorkflow(current_node.entity_id) }
                                })
                            }
                            if (current_node.entity_type === 'action' && current_node.state === 'TEMPLATE') {
                                $scope.editOperations.push({
                                    name: 'delete',
                                    description: 'delete this workflow step',
                                    md_icon: 'delete',
                                    func: function() {
                                        var confirm = $mdDialog.confirm()
                                            .title('Are you sure you want to delete this workflow step?')
                                            .content('This cannot be undone.')
                                            .ariaLabel('delete')
                                            .ok('ok')
                                            .cancel('cancel')
                                            .targetEvent(evt);
                                        $mdDialog.show(confirm).then(function() {
                                            if (current_node.entity_id.startsWith('UNSAVED')) {
                                                delete $scope.subGraphEntityMap(current_node)[$scope.nodeId(current_node)];
                                                $scope.$root.$broadcast('dt-graph-remove-node', current_node);
                                                return
                                            }
                                            ActionService.deleteEntity(current_node.entity_id).then(function() {
                                                $scope.reset();
                                                $scope.$root.$broadcast('dt-graph-reload');
                                            });
                                        });
                                    }
                                })
                            }
                            $scope.selectedNode = current_node;
                            $scope.loadSubGraphMap();
                        });
                    });
                    $scope.$on('dt-graph-node-unselected', function(evt) {
                        $timeout(function () {
                            $scope.selectedNode = null;
                            $scope.subGraphMap = null;
                            $scope.editOperations = [];
                            $scope.loadSubGraphMap();
                        });
                    });

                    $scope.loadSubGraphMap = function() {
                        var entityType = $scope.selectedNode ? $scope.selectedNode.entity_type : null;
                        var engineName = $scope.selectedNode ? $scope.selectedNode.engine_name : null;
                        var relatedId = $scope.selectedNode ? $scope.selectedNode.entity_id : null;
                        if (relatedId && relatedId.startsWith('UNSAVED-')) {
                            relatedId = null;
                        }
                        GraphService.getSubGraphMap(entityType, relatedId, engineName).then(function(response) {
                            $scope.noEngineSubGraphs = response.results[null];
                            $scope.subGraphMap = response.results;
                            delete $scope.subGraphMap[null]
                        });
                    };

                    $scope.reset();

                    $scope.addSubGraph = function(engine_name, subGraphFromServer) {
                        var subGraph = JSON.parse(JSON.stringify(subGraphFromServer));
                        var graph = subGraph.graph;

                        if (!$scope.activeSubGraphEntityMaps[engine_name]) { $scope.activeSubGraphEntityMaps[engine_name] = {} }
                        if (!$scope.activeSubGraphEntityMaps[engine_name][subGraph.name]) { $scope.activeSubGraphEntityMaps[engine_name][subGraph.name] = {} }
                        _.assign($scope.activeSubGraphEntityMaps[engine_name][subGraph.name], subGraph.entity_map);

                        $scope.subGraphCounter++;
                        _.each(graph.nodes, function(e) {
                            e.engine_name = engine_name;
                            e.sub_graph_name = subGraph.name;

                            // this is because the angular-schema-form library has issues applying defaults to null objects
                            var entity = $scope.subGraphEntity(e);
                            if (!entity.data.args) { delete entity.data.args; }
                        });
                        var prop = null;
                        if (subGraph.related_is_a) {
                            if (subGraph.related_is_a == 'PARENT') { prop = 'source_id' }
                            if (subGraph.related_is_a == 'CHILD')  { prop = 'destination_id' }
                            _.each(graph.edges, function(e) {
                                if (e[prop].startsWith(subGraph.related_is_a)) {
                                    $scope.relatedNodes[$scope.selectedNode.entity_type + '-' + e[prop]] = {
                                        entity_id: $scope.selectedNode.entity_id,
                                        entity_type: $scope.selectedNode.entity_type,
                                        relationship: subGraph.related_is_a,
                                        edge: JSON.parse(JSON.stringify(e))
                                    };
                                    e[prop] = $scope.selectedNode.entity_id;
                                }
                            })
                        }
                        $scope.$root.$broadcast('dt-graph-add-sub-graph', graph);
                        $scope.loadSubGraphMap();
                    };

                    $scope.navigateToEntity = function() {
                        $state.go('app.entities.' + $scope.selectedNode.entity_type + 's', {f: JSON.stringify(['id=' + $scope.selectedNode.entity_id])})
                    };

                    $scope.onCancelChanges = function() {
                        $scope.reset();
                        $scope.loadSubGraphMap();
                        $scope.$root.$broadcast('dt-graph-cancel-sub-graph');
                    };

                    var getEntityMap = {
                        'action': function(entity_id) { return ActionService.getEntity(entity_id) },
                        'dataset': function(entity_id) { return DatasetService.getEntity(entity_id) },
                        'datastore': function(entity_id) { return DatastoreService.getEntity(entity_id) },
                        'event': function(entity_id) { return EventService.getEntity(entity_id) },
                        'subscription': function(entity_id) { return SubscriptionService.getEntity(entity_id) },
                        'trigger': function(entity_id) { return TriggerService.getEntity(entity_id) },
                        'workflow': function(entity_id) { return WorkflowService.getEntity(entity_id) },
                        'workflow_instance': function(entity_id) { return WorkflowInstanceService.getEntity(entity_id) }
                    };
                    var updateEntityMap = {
                        'action': function(entity) { return ActionService.updateEntity(entity) },
                        'dataset': function(entity) { return DatasetService.updateEntity(entity) },
                        'datastore': function(entity) { return DatastoreService.updateEntity(entity) },
                        'event': function(entity) { return EventService.updateEntity(entity) },
                        'subscription': function(entity) { return SubscriptionService.updateEntity(entity) },
                        'trigger': function(entity) { return TriggerService.updateEntity(entity) },
                        'workflow': function(entity) { return WorkflowService.updateEntity(entity) }
                    };
                    var getSchemaMap = {
                        'action': function(entity_id) { return ActionService.getSchema({entity_id: entity_id}) },
                        'dataset': function() { return DatasetService.getSchema() },
                        'datastore': function(entity_id) { return DatastoreService.getSchema({entity_id: entity_id}) },
                        'event': function() { return EventService.getSchema() },
                        'subscription': function() { return SubscriptionService.getSchema() },
                        'trigger': function(entity_id) { return TriggerService.getSchema({entity_id: entity_id}) },
                        'workflow': function() { return WorkflowService.getSchema() },
                        'workflow_instance': function() { return WorkflowInstanceService.getSchema() }
                    };
                    var getNewSchemaMap = {
                        'action': function() {
                            return ActionService.getSchema({
                                engine_name: $scope.selectedNode.engine_name,
                                action_type_name: $scope.subGraphEntity($scope.selectedNode).data.action_type_name
                            })
                        },
                        'dataset': function() { return DatasetService.getSchema() },
                        'datastore': function() { return DatastoreService.getSchema({engine_name: $scope.selectedNode.engine_name}) },
                        'event': function() { return EventService.getSchema() },
                        'subscription': function() { return SubscriptionService.getSchema() },
                        'trigger': function() {
                            return TriggerService.getSchema({
                                trigger_type_name: $scope.subGraphEntity($scope.selectedNode).data.trigger_type_name
                            })
                        },
                        'workflow': function() { return WorkflowService.getSchema() },
                        'workflow_instance': function() { return WorkflowInstanceService.getSchema() }
                    };

                    var showViewExistingEntityModal = function(ev) {
                        $q.all([
                            getEntityMap[$scope.selectedNode.entity_type]($scope.selectedNode.entity_id),
                            getSchemaMap[$scope.selectedNode.entity_type]($scope.selectedNode.entity_id)
                        ]).then(function(responses) {
                            var entity = responses[0].results;
                            EntityModalService.showDialog(ev, entity,
                                function getSchema() {
                                    var deferred = $q.defer();
                                    responses[1].results.readonly = true;
                                    deferred.resolve(responses[1]);
                                    return deferred.promise;
                                },
                                null
                            )
                        });
                    };
                    var showEditExistingEntityModal = function(ev) {
                        var entityType = $scope.selectedNode.entity_type;
                        var entityId = $scope.selectedNode.entity_id;
                        $q.all([
                            getEntityMap[entityType](entityId),
                            getSchemaMap[entityType](entityId)
                        ]).then(function(responses) {
                            var entity = responses[0].results;
                            EntityModalService.showDialog(ev, entity,
                                function getSchema() {
                                    var deferred = $q.defer();
                                    deferred.resolve(responses[1]);
                                    return deferred.promise;
                                },
                                function updateEntity(entity) {
                                    return updateEntityMap[entityType](entity).then(function(response) {
                                        var nodeData = $scope.nodeData(response.results, entityType, entityId);
                                        $scope.$root.$broadcast('dt-graph-update-node-data', nodeData);
                                        return response;
                                    })
                                }
                            )
                        });
                    };
                    var showViewNewEntityModal = function(ev) {
                        var entityType = $scope.selectedNode.entity_type;
                        var entity = $scope.subGraphEntity($scope.selectedNode);
                        getNewSchemaMap[entityType]().then(function(response) {
                            EntityModalService.showDialog(ev, entity,
                                function getSchema() {
                                    var deferred = $q.defer();
                                    response.results.readonly = true;
                                    deferred.resolve(response);
                                    return deferred.promise;
                                },
                                null
                            );
                        })
                    };
                    var showEditNewEntityModal = function(ev) {
                        var entityType = $scope.selectedNode.entity_type;
                        var entityId = $scope.selectedNode.entity_id;
                        var entity = $scope.subGraphEntity($scope.selectedNode);
                        EntityModalService.showDialog(ev, entity,
                            getNewSchemaMap[entityType],
                            function saveEntity(entity) {
                                var nodeData = $scope.nodeData(entity, entityType, entityId);
                                var nodeId = $scope.nodeId($scope.selectedNode);
                                $scope.subGraphEntityMap($scope.selectedNode)[nodeId] = entity;
                                $scope.$root.$broadcast('dt-graph-update-node-data', nodeData);
                                var deferred = $q.defer();
                                deferred.resolve(entity);
                                return deferred.promise;
                            }
                        );
                    };

                    var showEntityModalMap = {
                        'view':     showViewExistingEntityModal,
                        'view/new': showViewNewEntityModal,
                        'edit':     showEditExistingEntityModal,
                        'edit/new': showEditNewEntityModal
                    };

                    $scope.showEntityModal = function(ev, mode) {
                        mode = $scope.selectedNode.entity_id.startsWith('UNSAVED') ? mode + '/new' : mode;
                        showEntityModalMap[mode](ev)
                    };

                    $scope.toggleLiveUpdatesEnabled = function() {
                        // needed due to angular material menuBar bug
                        $scope.liveUpdatesEnabled = !$scope.liveUpdatesEnabled;
                    };

                    $scope.liveUpdatesEnabled = true;
                    var timer;
                    function poll() {
                        if ($scope.liveUpdatesEnabled && $scope.subGraphCounter == 0) {
                            $scope.options.queryGraph().then(function(response) {
                                if (!response) { return }
                                $scope.$root.$broadcast('dt-graph-merge-graph', response.results);
                                timer = $timeout(poll, 30000);
                            });
                        }
                    }
                    timer = $timeout(poll, 30000);

                    $scope.$on('$destroy', function() { $timeout.cancel(timer) });

                    $scope.$watch('options.layout', function(newValue) {
                        $scope.$root.$broadcast('dt-graph-reset-layout', newValue);
                    });

                    $scope.resetLayout = function() {
                        $scope.$root.$broadcast('dt-graph-reset-layout', $scope.options.layout);
                    };
                }
            ]
        }
    }])
;
<|endoftext|>


<commit_before>// CONSTANTS
var image_default = '/home/pi/losp/keep_walking.jpg';
var image10 = '/home/pi/losp/image10.png';
var image11 = '/home/pi/losp/image11.png';
var image20 = '/home/pi/losp/image20.png';
var image21 = '/home/pi/losp/image21.png';
var image30 = '/home/pi/losp/image30.png';
var image31 = '/home/pi/losp/image31.png';
var image40 = '/home/pi/losp/image40.png';
var image41 = '/home/pi/losp/image41.png';
var image50 = '/home/pi/losp/image50.png';
var image51 = '/home/pi/losp/image51.png';
var image60 = '/home/pi/losp/image60.png';
var image61 = '/home/pi/losp/image61.png';
var image70 = '/home/pi/losp/image70.png';
var image71 = '/home/pi/losp/image71.png';
var image80 = '/home/pi/losp/image80.png';
var image81 = '/home/pi/losp/image81.png';
var image90 = '/home/pi/losp/image90.png';
var image91 = '/home/pi/losp/image91.png';
var audio10 = '/home/pi/losp/audio10.wav';
var audio11 = '/home/pi/losp/audio11.wav';
var audio20 = '/home/pi/losp/audio20.wav';
var audio21 = '/home/pi/losp/audio21.wav';
var audio30 = '/home/pi/losp/audio30.wav';
var audio31 = '/home/pi/losp/audio31.wav';
var audio40 = '/home/pi/losp/audio40.wav';
var audio41 = '/home/pi/losp/audio41.wav';
var audio50 = '/home/pi/losp/audio50.wav';
var audio51 = '/home/pi/losp/audio51.wav';
var audio60 = '/home/pi/losp/audio60.wav';
var audio61 = '/home/pi/losp/audio61.wav';
var audio70 = '/home/pi/losp/audio70.wav';
var audio71 = '/home/pi/losp/audio71.wav';
var audio80 = '/home/pi/losp/audio80.wav';
var audio81 = '/home/pi/losp/audio81.wav';
var audio90 = '/home/pi/losp/audio90.wav';
var audio91 = '/home/pi/losp/audio91.wav';

var rangeLimit = 3;
var playMax = 2;
var lastPlayed = '';
var checking = false;

// Load beacon scanner package
var UriBeaconScanner = require('uri-beacon-scanner');
// load package to run child process
var childProcess = require('child_process');

// Ranging function
function calc_range(rssi, tx_power) {
    var diff_db = tx_power - rssi;
    var ratio_linear = Math.pow(10, diff_db / 10);
    var r = Math.sqrt(ratio_linear);
    console.log('Range: ' +Math.round(r))
    return Math.round(r);
}

// Ranging function for Blesh beacons
function calc_range_alt(rssi, tx_power) {
    // Alternative calculation to test, likely very similar answer!
    // rssi1m needs to be found with testing
    // Based on; http://matts-soup.blogspot.co.uk/2013/12/finding-distance-from-rssi.html
    var rssi1m = -40;
    var pathLoss = 5.2; // free space
    if (rssi > 0) { rssi = 0 };
    var rawRange = Math.pow(10, (rssi - (tx_power + rssi1m)) / (-10*pathLoss));
    console.log('rangeAlt = ' +  Math.round(rawRange));
    return Math.round(rawRange);
}

// Step up 'listen' station
var station = function(name, audio1, image1, audio2, image2) {
    console.log('station creation');
    this.playCount = 0;
    this.showImage = true;
    this.beacon = name;
    this.audio1 = audio1;
    this.image1 = image1;
    this.audio2 = audio2;
    this.image2 = image2;
    this.audio = this.audio1;
    this.image = this.image1;
};

// Test for if station is in range and hasn't just been played
station.prototype.playTest = function(txPower, rssi) {
    if (calc_range_alt(rssi, txPower) < rangeLimit
                && this.playCount < playMax
                && this.beacon != lastPlayed) {
        if (this.playCount == 0) {
            console.log('Play beacon ' + this.beacon + ' ' + this.playCount)
            this.playCount = 1;
            this.image = this.image1;
            this.audio = this.audio1;
            lastPlayed = this.beacon;
        } else {
            console.log('Play beacon ' + this.beacon + ' ' + this.playCount)
            this.playCount = 2;
            this.image = this.image2;
            this.audio = this.audio2;
            lastPlayed = this.beacon;
        }
        this.showImage = true;
        return true;
    } else {
        console.log('This beacon: ' + this.beacon + ' last played: ' + lastPlayed);
        console.log('playCount: ' + this.playCount)
        this.showImage = false;
        return false;
    }
}

// Show the image for this station
station.prototype.show = function() {
    if (this.showImage) {
        this.picture = childProcess.exec('sudo fbi -T 2 -d /dev/fb1 -noverbose -a '
                                            + this.image, function(error, stdout, stderr) {
            if (error) {
                console.log(error.stack);
                console.log('Error code: '+error.code);
                console.log('Signal received: '+error.signal);
            }
            console.log('Child Process STDOUT: '+stdout);
            console.log('Child Process STDERR: '+stderr);
        });

        this.picture.on('exit', function(code) {
            console.log('Show exit code '+code);
            // UriBeaconScanner.startScanning();
        });
    };
};

// Play the audio for this station
station.prototype.play = function(txPower, rssi) {
    if (this.playTest(txPower, rssi)) {
        UriBeaconScanner.stopScanning();
        console.log('Play tune...');
        this.sound = childProcess.exec('aplay ' +this.audio, function(error, stdout, stderr) {
            if (error) {
                console.log(error.stack);
                console.log('Error code: '+error.code);
                console.log('Signal received: '+error.signal);
            }
            console.log('Child Process STDOUT: '+stdout);
            console.log('Child Process STDERR: '+stderr);
        });

        this.sound.on('exit', function(code) {
            console.log('Child process exited with exit code '+code);
            console.log('Tune has finished');
            walking.show();
            UriBeaconScanner.startScanning(true);
        });
    };
};

// Create instances of the stations
walking = new station('walking', '', image_default, '', '');
number1 = new station('number1', audio10, image10, audio11, image11);
number2 = new station('number2', audio20, image20, audio21, image21);
number3 = new station('number3', audio30, image30, audio31, image31);
number4 = new station('number4', audio40, image40, audio41, image41);
number5 = new station('number5', audio50, image50, audio51, image51);
number6 = new station('number6', audio60, image60, audio61, image61);
number7 = new station('number7', audio70, image70, audio71, image71);
number8 = new station('number8', audio80, image80, audio81, image81);
number9 = new station('number9', audio90, image90, audio91, image91);

// Event handler for when beacon is discovered
UriBeaconScanner.on('discover', function(uriBeacon) {
    if (!checking) {
        checking = true;
        console.log();
        console.log('discovered UriBeacon:');
        console.log('  uri      = ' + uriBeacon.uri);
        console.log('  flags    = ' + uriBeacon.flags);
        console.log('  TX power = ' + uriBeacon.txPower);
        console.log('  RSSI     = ' + uriBeacon.rssi);
        if(uriBeacon.uri.search('number1') > 0) {
            number1.play(uriBeacon.txPower, uriBeacon.rssi);
            number1.show();
        } else if(uriBeacon.uri.search('number2') > 0) {
            number2.play(uriBeacon.txPower, uriBeacon.rssi);
            number2.show();
        } else if(uriBeacon.uri.search('number3') > 0) {
            number3.play(uriBeacon.txPower, uriBeacon.rssi);
            number3.show();
        } else if(uriBeacon.uri.search('number4') > 0) {
            number4.play(uriBeacon.txPower, uriBeacon.rssi);
            number4.show();
        } else if(uriBeacon.uri.search('number5') > 0) {
            number5.play(uriBeacon.txPower, uriBeacon.rssi);
            number5.show();
        } else if(uriBeacon.uri.search('number6') > 0) {
            number6.play(uriBeacon.txPower, uriBeacon.rssi);
            number6.show();
        } else if(uriBeacon.uri.search('number7') > 0) {
            number7.play(uriBeacon.txPower, uriBeacon.rssi);
            number7.show();
        } else if(uriBeacon.uri.search('number8') > 0) {
            number8.play(uriBeacon.txPower, uriBeacon.rssi);
            number8.show();
        } else if(uriBeacon.uri.search('number9') > 0) {
            number9.play(uriBeacon.txPower, uriBeacon.rssi);
            number9.show();
        }
        checking = false;
    }
});

// Start scanning for beacons (duplicates allowed)
UriBeaconScanner.startScanning(true);
<commit_msg>Add time delay on beacons being played<commit_after>// CONSTANTS
var image_default = '/home/pi/losp/keep_walking.jpg';
var image10 = '/home/pi/losp/image10.png';
var image11 = '/home/pi/losp/image11.png';
var image20 = '/home/pi/losp/image20.png';
var image21 = '/home/pi/losp/image21.png';
var image30 = '/home/pi/losp/image30.png';
var image31 = '/home/pi/losp/image31.png';
var image40 = '/home/pi/losp/image40.png';
var image41 = '/home/pi/losp/image41.png';
var image50 = '/home/pi/losp/image50.png';
var image51 = '/home/pi/losp/image51.png';
var image60 = '/home/pi/losp/image60.png';
var image61 = '/home/pi/losp/image61.png';
var image70 = '/home/pi/losp/image70.png';
var image71 = '/home/pi/losp/image71.png';
var image80 = '/home/pi/losp/image80.png';
var image81 = '/home/pi/losp/image81.png';
var image90 = '/home/pi/losp/image90.png';
var image91 = '/home/pi/losp/image91.png';
var audio10 = '/home/pi/losp/audio10.wav';
var audio11 = '/home/pi/losp/audio11.wav';
var audio20 = '/home/pi/losp/audio20.wav';
var audio21 = '/home/pi/losp/audio21.wav';
var audio30 = '/home/pi/losp/audio30.wav';
var audio31 = '/home/pi/losp/audio31.wav';
var audio40 = '/home/pi/losp/audio40.wav';
var audio41 = '/home/pi/losp/audio41.wav';
var audio50 = '/home/pi/losp/audio50.wav';
var audio51 = '/home/pi/losp/audio51.wav';
var audio60 = '/home/pi/losp/audio60.wav';
var audio61 = '/home/pi/losp/audio61.wav';
var audio70 = '/home/pi/losp/audio70.wav';
var audio71 = '/home/pi/losp/audio71.wav';
var audio80 = '/home/pi/losp/audio80.wav';
var audio81 = '/home/pi/losp/audio81.wav';
var audio90 = '/home/pi/losp/audio90.wav';
var audio91 = '/home/pi/losp/audio91.wav';

var rangeLimit = 3;
var playMax = 2;
var lastPlayed = '';
var checking = false;
var timeLimit = 0;

// Load beacon scanner package
var UriBeaconScanner = require('uri-beacon-scanner');
// load package to run child process
var childProcess = require('child_process');

// Ranging function
function calc_range(rssi, tx_power) {
    var diff_db = tx_power - rssi;
    var ratio_linear = Math.pow(10, diff_db / 10);
    var r = Math.sqrt(ratio_linear);
    console.log('Range: ' +Math.round(r))
    return Math.round(r);
}

// Ranging function for Blesh beacons
function calc_range_alt(rssi, tx_power) {
    // Alternative calculation to test, likely very similar answer!
    // rssi1m needs to be found with testing
    // Based on; http://matts-soup.blogspot.co.uk/2013/12/finding-distance-from-rssi.html
    var rssi1m = -40;
    var pathLoss = 5.2; // free space
    if (rssi > 0) { rssi = 0 };
    var rawRange = Math.pow(10, (rssi - (tx_power + rssi1m)) / (-10*pathLoss));
    console.log('rangeAlt = ' +  Math.round(rawRange));
    return Math.round(rawRange);
}

// Step up 'listen' station
var station = function(name, audio1, image1, audio2, image2) {
    console.log('station creation');
    this.playCount = 0;
    this.lastPlayed  = 0;
    this.showImage = true;
    this.beacon = name;
    this.audio1 = audio1;
    this.image1 = image1;
    this.audio2 = audio2;
    this.image2 = image2;
    this.audio = this.audio1;
    this.image = this.image1;
};

// Test for if station is in range and hasn't just been played
station.prototype.playTest = function(txPower, rssi) {
    now = Math.floor(new Date()/1000);
    if (calc_range_alt(rssi, txPower) < rangeLimit
                && this.playCount < playMax
                && this.beacon != lastPlayed
                && now - this.lastPlayed > timeLimit) {
        if (this.playCount == 0) {
            console.log('Play beacon ' + this.beacon + ' ' + this.playCount)
            this.playCount = 1;
            this.image = this.image1;
            this.audio = this.audio1;
            lastPlayed = this.beacon;
        } else {
            console.log('Play beacon ' + this.beacon + ' ' + this.playCount)
            this.playCount = 2;
            this.image = this.image2;
            this.audio = this.audio2;
            lastPlayed = this.beacon;
        }
        this.lastPlayed = now;
        this.showImage = true;
        return true;
    } else {
        console.log('This beacon: ' + this.beacon + ' last played: ' + lastPlayed);
        console.log('playCount: ' + this.playCount)
        this.showImage = false;
        return false;
    }
}

// Show the image for this station
station.prototype.show = function() {
    if (this.showImage) {
        this.picture = childProcess.exec('sudo fbi -T 2 -d /dev/fb1 -noverbose -a '
                                            + this.image, function(error, stdout, stderr) {
            if (error) {
                console.log(error.stack);
                console.log('Error code: '+error.code);
                console.log('Signal received: '+error.signal);
            }
            console.log('Child Process STDOUT: '+stdout);
            console.log('Child Process STDERR: '+stderr);
        });

        this.picture.on('exit', function(code) {
            console.log('Show exit code '+code);
            // UriBeaconScanner.startScanning();
        });
    };
};

// Play the audio for this station
station.prototype.play = function(txPower, rssi) {
    if (this.playTest(txPower, rssi)) {
        UriBeaconScanner.stopScanning();
        console.log('Play tune...');
        this.sound = childProcess.exec('aplay ' +this.audio, function(error, stdout, stderr) {
            if (error) {
                console.log(error.stack);
                console.log('Error code: '+error.code);
                console.log('Signal received: '+error.signal);
            }
            console.log('Child Process STDOUT: '+stdout);
            console.log('Child Process STDERR: '+stderr);
        });

        this.sound.on('exit', function(code) {
            console.log('Child process exited with exit code '+code);
            console.log('Tune has finished');
            walking.show();
            UriBeaconScanner.startScanning(true);
        });
    };
};

// Create instances of the stations
walking = new station('walking', '', image_default, '', '');
number1 = new station('number1', audio10, image10, audio11, image11);
number2 = new station('number2', audio20, image20, audio21, image21);
number3 = new station('number3', audio30, image30, audio31, image31);
number4 = new station('number4', audio40, image40, audio41, image41);
number5 = new station('number5', audio50, image50, audio51, image51);
number6 = new station('number6', audio60, image60, audio61, image61);
number7 = new station('number7', audio70, image70, audio71, image71);
number8 = new station('number8', audio80, image80, audio81, image81);
number9 = new station('number9', audio90, image90, audio91, image91);

// Event handler for when beacon is discovered
UriBeaconScanner.on('discover', function(uriBeacon) {
    if (!checking) {
        checking = true;
        console.log();
        console.log('discovered UriBeacon:');
        console.log('  uri      = ' + uriBeacon.uri);
        console.log('  flags    = ' + uriBeacon.flags);
        console.log('  TX power = ' + uriBeacon.txPower);
        console.log('  RSSI     = ' + uriBeacon.rssi);
        if(uriBeacon.uri.search('number1') > 0) {
            number1.play(uriBeacon.txPower, uriBeacon.rssi);
            number1.show();
        } else if(uriBeacon.uri.search('number2') > 0) {
            number2.play(uriBeacon.txPower, uriBeacon.rssi);
            number2.show();
        } else if(uriBeacon.uri.search('number3') > 0) {
            number3.play(uriBeacon.txPower, uriBeacon.rssi);
            number3.show();
        } else if(uriBeacon.uri.search('number4') > 0) {
            number4.play(uriBeacon.txPower, uriBeacon.rssi);
            number4.show();
        } else if(uriBeacon.uri.search('number5') > 0) {
            number5.play(uriBeacon.txPower, uriBeacon.rssi);
            number5.show();
        } else if(uriBeacon.uri.search('number6') > 0) {
            number6.play(uriBeacon.txPower, uriBeacon.rssi);
            number6.show();
        } else if(uriBeacon.uri.search('number7') > 0) {
            number7.play(uriBeacon.txPower, uriBeacon.rssi);
            number7.show();
        } else if(uriBeacon.uri.search('number8') > 0) {
            number8.play(uriBeacon.txPower, uriBeacon.rssi);
            number8.show();
        } else if(uriBeacon.uri.search('number9') > 0) {
            number9.play(uriBeacon.txPower, uriBeacon.rssi);
            number9.show();
        }
        checking = false;
    }
});

// Start scanning for beacons (duplicates allowed)
UriBeaconScanner.startScanning(true);
<|endoftext|>


<commit_before>//Translated by
lang="en_US"
datatable_lang=""
locale={
    "Accept (default)":"",
    "Acl":"",
    "ACL Rules":"",
    "ACLs":"",
    "ACL String preview":"",
    "ACPI":"",
    "Add":"",
    "Add context variables":"",
    "Add custom variables":"",
    "Add disk/image":"",
    "Add disks/images":"",
    "Add Graphics":"",
    "Add Hypervisor raw options":"",
    "Add inputs":"",
    "Add lease":"",
    "Add network":"",
    "Add placement options":"",
    "Advanced mode":"",
    "Affected resources":"",
    "All":"",
    "Allowed operations":"",
    "Amount of RAM required for the VM, in Megabytes.":"",
    "Applies to":"",
    "Architecture":"",
    "are mandatory":"",
    "Arguments for the booting kernel":"",
    "Authentication":"",
    "Authentication driver":"",
    "Block":"",
    "Boolean expression that rules out provisioning hosts from list of machines suitable to run this VM":"",
    "Boot":"",
    "Boot device type":"",
    "Bootloader":"",
    "Boot method":"",
    "Boot/OS options":"",
    "Bridge":"",
    "Bus":"",
    "Cancel":"",
    "Cannot contact server: is it running and reachable?":"",
    "Canvas not supported.":"",
    "Capacity":"",
    "Capacity options":"",
    "cdrom":"",
    "CD-ROM":"",
    "Change":"",
    "Change authentication":"",
    "Change group":"",
    "Change owner":"",
    "Change password":"",
    "Clone":"",
    "Clone this image":"",
    "Community":"",
    "Confirmation of action":"",
    "Context":"",
    "Context variable name and value must be filled in":"",
    "Core":"",
    "CPU":"",
    "CPU architecture to virtualization":"",
    "CPU Monitoring information":"",
    "CPU Use":"",
    "Create":"",
    "Create ACL":"",
    "Create an empty datablock":"",
    "Create group":"",
    "Create host":"",
    "Create Image":"",
    "Create user":"",
    "Create Virtual Machine":"",
    "Create Virtual Network":"",
    "Create VM Template":"",
    "Current disks":"",
    "Current inputs":"",
    "Current leases":"",
    "Current NICs":"",
    "Current variables":"",
    "Custom attribute name and value must be filled in":"",
    "Custom attributes":"",
    "Custom variable name and value must be filled in":"",
    "Custom variables":"",
    "Dashboard":"",
    "Data":"",
    "Datablock":"",
    "Default":"",
    "Default (current image type)":"",
    "Define a subnet by IP range":"",
    "Delete":"",
    "Delete host":"",
    "Deploy":"",
    "Deploy ID":"",
    "Deploy # VMs":"",
    "Description":"",
    "Device prefix":"",
    "Device to be mounted as root":"",
    "Device to map image disk. If set, it will overwrite the default device mapping":"",
    "Disable":"",
    "disabled":"",
    "Disallow access to the VM through the specified ports in the TCP protocol":"",
    "Disallow access to the VM through the specified ports in the UDP protocol":"",
    "Disk":"",
    "Disk file location path or URL":"",
    "disk id":"",
    "Disks":"",
    "Disk type":"",
    "Documentation":"",
    "Do you want to proceed?":"",
    "Driver":"",
    "Driver default":"",
    "Drivers":"",
    "Drop":"",
    "Dummy":"",
    "EC2":"",
    "Enable":"",
    "Error":"",
    "failed":"",
    "fd":"",
    "Features":"",
    "Fields marked with":"",
    "File":"",
    "Filesystem type":"",
    "Filesystem type for the fs images":"",
    "Fill in a new password":"",
    "Fixed network":"",
    "Floppy":"",
    "Fold / Unfold all sections":"",
    "Format":"",
    "FS":"",
    "FS type":"",
    "Get Information":"",
    "Get Pool of my/group\'s resources":"",
    "Get Pool of resources":"",
    "Graphics":"",
    "Graphics type":"",
    "Group":"",
    "Group ":"",
    "Group name":"",
    "Groups":"",
    "Hardware that will emulate this network interface. With Xen this is the type attribute of the vif.":"",
    "hd":"",
    "Historical monitoring information":"",
    "hold":"",
    "Hold":"",
    "Hold lease":"",
    "Host":"",
    "Host information":"",
    "Hostname":"",
    "Host name missing!":"",
    "Host parameters":"",
    "Hosts":"",
    "Hosts CPU":"",
    "Host shares":"",
    "Hosts memory":"",
    "Hosts (total/active)":"",
    "Host template":"",
    "Human readable description of the image for other users.":"",
    "HW address associated with the network interface":"",
    "Icmp":"",
    "ICMP policy":"",
    "id":"",
    "ID":"",
    "IDE":"",
    "Image":"",
    "Image cannot be public and persistent":"",
    "Image information":"",
    "Image name":"",
    "Images":"",
    "Images (total/public)":"",
    "Image template":"",
    "IM MAD":"",
    "Info":"",
    "information":"",
    "Information":"",
    "Information Manager":"",
    "Initrd":"",
    "Inputs":"",
    "Instantiate":"",
    "IP":"",
    "IP End":"",
    "IP Start":"",
    "IP to listen on":"",
    "Kernel":"",
    "Kernel commands":"",
    "Keyboard configuration locale to use in the VNC display":"",
    "Keymap":"",
    "KVM":"",
    "LCM State":"",
    "Lease IP":"",
    "Lease MAC (opt):":"",
    "Lease management":"",
    "Leases information":"",
    "Listen IP":"",
    "Live migrate":"",
    "Loading":"",
    "MAC":"",
    "Make non persistent":"",
    "Make persistent":"",
    "Manage":"",
    "Manual":"",
    "Max Mem":"",
    "Memory":"",
    "Memory monitoring information":"",
    "Memory use":"",
    "Migrate":"",
    "Model":"",
    "Monitoring information":"",
    "Mount image as read-only":"",
    "Mouse":"",
    "Name":"",
    "Name for the context variable":"",
    "Name for the custom variable":"",
    "Name for the tun device created for the VM":"",
    "Name of a shell script to be executed after creating the tun device for the VM":"",
    "Name of the bridge the network device is going to be attached to":"",
    "Name of the image to use":"",
    "Name of the network to attach this device":"",
    "Name that the Image will get. Every image must have a unique name.":"",
    "Name that the VM will get for description purposes. If NAME is not supplied a name generated by one will be in the form of one-<VID>.":"",
    "Net_RX":"",
    "Net_TX":"",
    "network":"",
    "Network":"",
    "Network Address":"",
    "Network is unreachable: is OpenNebula running?":"",
    "Network mask":"",
    "Network Mask":"",
    "Network reception":"",
    "Network transmission":"",
    "Network type":"",
    "New":"",
    "+ New":"",
    "+ New Group":"",
    "New password":"",
    "No":"",
    "No disk id or image name specified":"",
    "No disks defined":"",
    "No leases to show":"",
    "None":"",
    "Number of virtual cpus. This value is optional, the default hypervisor behavior is used, usually one virtual CPU.":"",
    "OK":"",
    "Open VNC Session":"",
    "Optional, please select":"",
    "OS":"",
    "OS and Boot options":"",
    "Owned by group":"",
    "Owner":"",
    "PAE":"",
    "Password":"",
    "Password for the VNC server":"",
    "Path":"",
    "Path to the bootloader executable":"",
    "Path to the initrd image":"",
    "Path to the original file that will be copied to the image repository. If not specified for a DATABLOCK type image, an empty image will be created.":"",
    "Path to the OS kernel to boot the image":"",
    "Path vs. source":"",
    "Percentage of CPU divided by 100 required for the Virtual Machine. Half a processor is written 0.5.":"",
    "Permits access to the VM only through the specified ports in the TCP protocol":"",
    "Permits access to the VM only through the specified ports in the UDP protocol":"",
    "Persistence of the image":"",
    "Persistent":"",
    "Physical address extension mode allows 32-bit guests to address more than 4 GB of memory":"",
    "Physical device":"",
    "Placement":"",
    "Please choose":"",
    "Please, choose and modify the image you want to update":"",
    "Please, choose and modify the template you want to update":"",
    "Please, choose and modify the virtual network you want to update":"",
    "Please choose path if you have a file-based image. Choose source otherwise or create an empty datablock disk.":"",
    "Please choose the new type of authentication for the selected users":"",
    "Please provide a lease IP":"",
    "Please provide a network address":"",
    "Please provide a resource ID for the resource(s) in this rule":"",
    "Please select":"",
    "Please select at least one resource":"",
    "Please specify to who this ACL applies":"",
    "Port":"",
    "Port blacklist":"",
    "Port for the VNC server":"",
    "Port whitelist":"",
    "Predefined":"",
    "Prefix for the emulated device this image will be mounted at. For instance, “hd”, “sd”. If omitted, the default value is the one defined in oned.conf (installation default is “hd”).":"",
    "Previous action":"",
    "Provide a path":"",
    "Provide a source":"",
    "PS2":"",
    "Public":"",
    "Public scope of the image":"",
    "Publish":"",
    "Quickstart":"",
    "Ranged network":"",
    "Rank":"",
    "Raw":"",
    "Raw data to be passed directly to the hypervisor":"",
    "Read only":"",
    "Refresh list":"",
    "Register time":"",
    "Registration time":"",
    "release":"",
    "Release":"",
    "Remove selected":"",
    "Request an specific IP from the Network":"",
    "Requirements":"",
    "Reset":"",
    "Resource ID":"",
    "Resource ID / Owned by":"",
    "Resource subset":"",
    "Restart":"",
    "Resubmit":"",
    "Resume":"",
    "Retrieving":"",
    "Root":"",
    "running":"",
    "Running VMs":"",
    "Running #VMS":"",
    "Save":"",
    "Save as":"",
    "Saveas for VM with ID":"",
    "Save this image after shutting down the VM":"",
    "Script":"",
    "SCSI":"",
    "SDL":"",
    "Select a network":"",
    "Select an image":"",
    "Select a template":"",
    "Select boot method":"",
    "Select disk":"",
    "Select template":"",
    "Select the new group":"",
    "Select the new owner":"",
    "Server (Cipher)":"",
    "Server (x509)":"",
    "Setup Networks":"",
    "Shared":"",
    "Shutdown":"",
    "Sign out":"",
    "Size":"",
    "Size in MB":"",
    "Size (Mb)":"",
    "Size of the datablock in MB.":"",
    "Skipping VM ":"",
    "Source":"",
    "Source to be used in the DISK attribute. Useful for not file-based images.":"",
    "Specific ID":"",
    "Specific image mapping driver. KVM: raw, qcow2. XEN: tap:aio, file:":"",
    "Specific image mapping driver. KVM: raw, qcow2. Xen:tap:aio:, file:. VMware unsupported":"",
    "SSH":"",
    "Start time":"",
    "Start Time":"",
    "State":"",
    "Status":"",
    "Stop":"",
    "Submitted":"",
    "Summary of resources":"",
    "Support":"",
    "Suspend":"",
    "Swap":"",
    "Tablet":"",
    "Target":"",
    "Tcp black ports":"",
    "Tcp firewall mode":"",
    "Tcp white ports":"",
    "Template":"",
    "Template information":"",
    "Templates":"",
    "Template updated correctly":"",
    "There are mandatory fields missing in the capacity section":"",
    "There are mandatory fields missing in the OS Boot options section":"",
    "There are mandatory parameters missing":"",
    "There are mandatory parameters missing in this section":"",
    "This field sets which attribute will be used to sort the suitable hosts for this VM. Basically, it defines which hosts are more suitable than others":"",
    "This rule applies to":"",
    "This will cancel selected VMs":"",
    "This will change the main group of the selected users. Select the new group":"",
    "This will change the password for the selected users":"",
    "This will delete the selected VMs from the database":"",
    "This will deploy the selected VMs on the chosen host":"",
    "This will hold selected pending VMs from being deployed":"",
    "This will initiate the shutdown process in the selected VMs":"",
    "This will live-migrate the selected VMs to the chosen host":"",
    "This will migrate the selected VMs to the chosen host":"",
    "This will redeploy selected VMs (in UNKNOWN or BOOT state)":"",
    "This will release held machines":"",
    "This will resubmits VMs to PENDING state":"",
    "This will resume selected stopped or suspended VMs":"",
    "This will suspend selected machines":"",
    "TM MAD":"",
    "total":"",
    "Total Leases":"",
    "Total VM count":"",
    "Total VM CPU":"",
    "Total VM Memory":"",
    "Transfer Manager":"",
    "Type":"",
    "Type of disk device to emulate.":"",
    "Type of disk device to emulate: ide, scsi":"",
    "Type of file system to be built. This can be any value understood by mkfs unix command.":"",
    "Type of the image, explained in detail in the following section. If omitted, the default value is the one defined in oned.conf (install default is OS).":"",
    "Udp black ports":"",
    "Udp firewall mode":"",
    "Udp white ports":"",
    "Unauthorized":"",
    "Unpublish":"",
    "Update":"",
    "Update a template":"",
    "Update image template":"",
    "Update network template":"",
    "Update template":"",
    "USB":"",
    "Use":"",
    "Used by VM":"",
    "Used CPU":"",
    "Used CPU (allocated)":"",
    "Used CPU (real)":"",
    "Used Mem (allocated)":"",
    "Used Memory":"",
    "Used Mem (real)":"",
    "Useful for power management, for example, normally required for graceful shutdown to work":"",
    "User":"",
    "Username":"",
    "User name and password must be filled in":"",
    "Users":"",
    "Value":"",
    "Value of the context variable":"",
    "Value of the custom variable":"",
    "VCPU":"",
    "Virtio":"",
    "Virtio (KVM)":"",
    "Virtualization Manager":"",
    "Virtual Machine information":"",
    "Virtual Machines":"",
    "Virtual Network":"",
    "Virtual network information":"",
    "Virtual Network information":"",
    "Virtual Network name missing!":"",
    "Virtual Networks":"",
    "Virtual Networks (total/public)":"",
    "Virtual Network template (attributes)":"",
    "VM information":"",
    "VM Instance":"",
    "VM Instances":"",
    "VM log":"",
    "VM MAD":"",
    "VM Name":"",
    "VM Network stats":"",
    "#VMS":"",
    "VM Save As":"",
    "VM template":"",
    "VM Template":"",
    "VM Templates":"",
    "VM Templates (total/public)":"",
    "VNC":"",
    "VNC Access":"",
    "VNC connection":"",
    "VNC Disabled":"",
    "VNC Session":"",
    "VNET ID":"",
    "VN MAD":"",
    "Welcome":"",
    "Wizard":"",
    "Wizard KVM":"",
    "Wizard VMware":"",
    "Wizard XEN":"",
    "Write the image template here":"",
    "Write the Virtual Machine template here":"",
    "Write the Virtual Network template here":"",
    "x509":"",
    "XEN":"",
    "Xen templates must specify a boot method":"",
    "yes":"",
    "Yes":"",
    "You have not selected a template":"",
    "You have to confirm this action.":"",
    "You need to select something.":"",
};
<commit_msg>Feature #1004: Update default translation file<commit_after>//Translated by
lang="en_US"
datatable_lang=""
locale={
    "Accept (default)":"",
    "Acl":"",
    "ACL Rules":"",
    "ACLs":"",
    "ACL String preview":"",
    "ACPI":"",
    "Add":"",
    "Add context variables":"",
    "Add custom variables":"",
    "Add disk/image":"",
    "Add disks/images":"",
    "Add Graphics":"",
    "Add Hypervisor raw options":"",
    "Add inputs":"",
    "Add lease":"",
    "Add network":"",
    "Add placement options":"",
    "Advanced mode":"",
    "Affected resources":"",
    "All":"",
    "Allowed operations":"",
    "Amount of RAM required for the VM, in Megabytes.":"",
    "Applies to":"",
    "Architecture":"",
    "are mandatory":"",
    "Arguments for the booting kernel":"",
    "Authentication":"",
    "Authentication driver":"",
    "Block":"",
    "Boolean expression that rules out provisioning hosts from list of machines suitable to run this VM":"",
    "Boot":"",
    "Boot device type":"",
    "Bootloader":"",
    "Boot method":"",
    "Boot/OS options":"",
    "Bridge":"",
    "Bus":"",
    "Cancel":"",
    "Cannot contact server: is it running and reachable?":"",
    "Canvas not supported.":"",
    "Capacity":"",
    "Capacity options":"",
    "cdrom":"",
    "CD-ROM":"",
    "Change":"",
    "Change authentication":"",
    "Change group":"",
    "Change owner":"",
    "Change password":"",
    "Changing language":"",
    "Clone":"",
    "Clone this image":"",
    "Community":"",
    "Configuration":"",
    "Confirmation of action":"",
    "Context":"",
    "Context variable name and value must be filled in":"",
    "Core":"",
    "CPU":"",
    "CPU architecture to virtualization":"",
    "CPU Monitoring information":"",
    "CPU Use":"",
    "Create":"",
    "Create ACL":"",
    "Create an empty datablock":"",
    "Create group":"",
    "Create host":"",
    "Create Image":"",
    "Create user":"",
    "Create Virtual Machine":"",
    "Create Virtual Network":"",
    "Create VM Template":"",
    "Current disks":"",
    "Current inputs":"",
    "Current leases":"",
    "Current NICs":"",
    "Current variables":"",
    "Custom attribute name and value must be filled in":"",
    "Custom attributes":"",
    "Custom variable name and value must be filled in":"",
    "Custom variables":"",
    "Dashboard":"",
    "Data":"",
    "Datablock":"",
    "Default":"",
    "Default (current image type)":"",
    "Define a subnet by IP range":"",
    "Delete":"",
    "Delete host":"",
    "Deploy":"",
    "Deploy ID":"",
    "Deploy # VMs":"",
    "Description":"",
    "Device prefix":"",
    "Device to be mounted as root":"",
    "Device to map image disk. If set, it will overwrite the default device mapping":"",
    "Disable":"",
    "disabled":"",
    "Disallow access to the VM through the specified ports in the TCP protocol":"",
    "Disallow access to the VM through the specified ports in the UDP protocol":"",
    "Disk":"",
    "Disk file location path or URL":"",
    "disk id":"",
    "Disks":"",
    "Disk type":"",
    "Documentation":"",
    "Do you want to proceed?":"",
    "Driver":"",
    "Driver default":"",
    "Drivers":"",
    "Drop":"",
    "Dummy":"",
    "EC2":"",
    "Enable":"",
    "English":"",
    "Error":"",
    "failed":"",
    "fd":"",
    "Features":"",
    "Fields marked with":"",
    "File":"",
    "Filesystem type":"",
    "Filesystem type for the fs images":"",
    "Fill in a new password":"",
    "Fixed network":"",
    "Floppy":"",
    "Fold / Unfold all sections":"",
    "Format":"",
    "FS":"",
    "FS type":"",
    "Get Information":"",
    "Get Pool of my/group\'s resources":"",
    "Get Pool of resources":"",
    "Graphics":"",
    "Graphics type":"",
    "Group":"",
    "Group ":"",
    "Group name":"",
    "Groups":"",
    "Hardware that will emulate this network interface. With Xen this is the type attribute of the vif.":"",
    "hd":"",
    "Historical monitoring information":"",
    "hold":"",
    "Hold":"",
    "Hold lease":"",
    "Host":"",
    "Host information":"",
    "Hostname":"",
    "Host name missing!":"",
    "Host parameters":"",
    "Hosts":"",
    "Hosts CPU":"",
    "Host shares":"",
    "Hosts memory":"",
    "Hosts (total/active)":"",
    "Host template":"",
    "Human readable description of the image for other users.":"",
    "HW address associated with the network interface":"",
    "Icmp":"",
    "ICMP policy":"",
    "id":"",
    "ID":"",
    "IDE":"",
    "Image":"",
    "Image cannot be public and persistent":"",
    "Image information":"",
    "Image name":"",
    "Images":"",
    "Images (total/public)":"",
    "Image template":"",
    "IM MAD":"",
    "Info":"",
    "information":"",
    "Information":"",
    "Information Manager":"",
    "Initrd":"",
    "Inputs":"",
    "Instantiate":"",
    "IP":"",
    "IP End":"",
    "IP Start":"",
    "IP to listen on":"",
    "Kernel":"",
    "Kernel commands":"",
    "Keyboard configuration locale to use in the VNC display":"",
    "Keymap":"",
    "KVM":"",
    "Language":"",
    "LCM State":"",
    "Lease IP":"",
    "Lease MAC (opt):":"",
    "Lease management":"",
    "Leases information":"",
    "Listen IP":"",
    "Live migrate":"",
    "Loading":"",
    "MAC":"",
    "Make non persistent":"",
    "Make persistent":"",
    "Manage":"",
    "Manual":"",
    "Max Mem":"",
    "Memory":"",
    "Memory monitoring information":"",
    "Memory use":"",
    "Migrate":"",
    "Model":"",
    "Monitoring information":"",
    "Mount image as read-only":"",
    "Mouse":"",
    "Name":"",
    "Name for the context variable":"",
    "Name for the custom variable":"",
    "Name for the tun device created for the VM":"",
    "Name of a shell script to be executed after creating the tun device for the VM":"",
    "Name of the bridge the network device is going to be attached to":"",
    "Name of the image to use":"",
    "Name of the network to attach this device":"",
    "Name that the Image will get. Every image must have a unique name.":"",
    "Name that the VM will get for description purposes. If NAME is not supplied a name generated by one will be in the form of one-<VID>.":"",
    "Net_RX":"",
    "Net_TX":"",
    "network":"",
    "Network":"",
    "Network Address":"",
    "Network is unreachable: is OpenNebula running?":"",
    "Network mask":"",
    "Network Mask":"",
    "Network reception":"",
    "Network transmission":"",
    "Network type":"",
    "New":"",
    "+ New":"",
    "+ New Group":"",
    "New password":"",
    "No":"",
    "No disk id or image name specified":"",
    "No disks defined":"",
    "No leases to show":"",
    "None":"",
    "Number of virtual cpus. This value is optional, the default hypervisor behavior is used, usually one virtual CPU.":"",
    "OK":"",
    "Open VNC Session":"",
    "Optional, please select":"",
    "OS":"",
    "OS and Boot options":"",
    "Owned by group":"",
    "Owner":"",
    "PAE":"",
    "Password":"",
    "Password for the VNC server":"",
    "Path":"",
    "Path to the bootloader executable":"",
    "Path to the initrd image":"",
    "Path to the original file that will be copied to the image repository. If not specified for a DATABLOCK type image, an empty image will be created.":"",
    "Path to the OS kernel to boot the image":"",
    "Path vs. source":"",
    "Percentage of CPU divided by 100 required for the Virtual Machine. Half a processor is written 0.5.":"",
    "Permits access to the VM only through the specified ports in the TCP protocol":"",
    "Permits access to the VM only through the specified ports in the UDP protocol":"",
    "Persistence of the image":"",
    "Persistent":"",
    "Physical address extension mode allows 32-bit guests to address more than 4 GB of memory":"",
    "Physical device":"",
    "Placement":"",
    "Please choose":"",
    "Please, choose and modify the image you want to update":"",
    "Please, choose and modify the template you want to update":"",
    "Please, choose and modify the virtual network you want to update":"",
    "Please choose path if you have a file-based image. Choose source otherwise or create an empty datablock disk.":"",
    "Please choose the new type of authentication for the selected users":"",
    "Please provide a lease IP":"",
    "Please provide a network address":"",
    "Please provide a resource ID for the resource(s) in this rule":"",
    "Please select":"",
    "Please select at least one resource":"",
    "Please specify to who this ACL applies":"",
    "Port":"",
    "Port blacklist":"",
    "Port for the VNC server":"",
    "Port whitelist":"",
    "Predefined":"",
    "Prefix for the emulated device this image will be mounted at. For instance, “hd”, “sd”. If omitted, the default value is the one defined in oned.conf (installation default is “hd”).":"",
    "Previous action":"",
    "Provide a path":"",
    "Provide a source":"",
    "PS2":"",
    "Public":"",
    "Public scope of the image":"",
    "Publish":"",
    "Quickstart":"",
    "Ranged network":"",
    "Rank":"",
    "Raw":"",
    "Raw data to be passed directly to the hypervisor":"",
    "Read only":"",
    "Refresh list":"",
    "Register time":"",
    "Registration time":"",
    "release":"",
    "Release":"",
    "Remove selected":"",
    "Request an specific IP from the Network":"",
    "Requirements":"",
    "Reset":"",
    "Resource ID":"",
    "Resource ID / Owned by":"",
    "Resource subset":"",
    "Restart":"",
    "Resubmit":"",
    "Resume":"",
    "Retrieving":"",
    "Root":"",
    "running":"",
    "Running VMs":"",
    "Running #VMS":"",
    "Russian":"",
    "Save":"",
    "Save as":"",
    "Saveas for VM with ID":"",
    "Save this image after shutting down the VM":"",
    "Script":"",
    "SCSI":"",
    "SDL":"",
    "Select a network":"",
    "Select an image":"",
    "Select a template":"",
    "Select boot method":"",
    "Select disk":"",
    "Select template":"",
    "Select the new group":"",
    "Select the new owner":"",
    "Server (Cipher)":"",
    "Server (x509)":"",
    "Setup Networks":"",
    "Shared":"",
    "Shutdown":"",
    "Sign out":"",
    "Size":"",
    "Size in MB":"",
    "Size (Mb)":"",
    "Size of the datablock in MB.":"",
    "Skipping VM ":"",
    "Source":"",
    "Source to be used in the DISK attribute. Useful for not file-based images.":"",
    "Specific ID":"",
    "Specific image mapping driver. KVM: raw, qcow2. XEN: tap:aio, file:":"",
    "Specific image mapping driver. KVM: raw, qcow2. Xen:tap:aio:, file:. VMware unsupported":"",
    "SSH":"",
    "Start time":"",
    "Start Time":"",
    "State":"",
    "Status":"",
    "Stop":"",
    "Submitted":"",
    "Summary of resources":"",
    "Sunstone UI Configuration":"",
    "Support":"",
    "Suspend":"",
    "Swap":"",
    "Tablet":"",
    "Target":"",
    "Tcp black ports":"",
    "Tcp firewall mode":"",
    "Tcp white ports":"",
    "Template":"",
    "Template information":"",
    "Templates":"",
    "Template updated correctly":"",
    "There are mandatory fields missing in the capacity section":"",
    "There are mandatory fields missing in the OS Boot options section":"",
    "There are mandatory parameters missing":"",
    "There are mandatory parameters missing in this section":"",
    "This field sets which attribute will be used to sort the suitable hosts for this VM. Basically, it defines which hosts are more suitable than others":"",
    "This rule applies to":"",
    "This will cancel selected VMs":"",
    "This will change the main group of the selected users. Select the new group":"",
    "This will change the password for the selected users":"",
    "This will delete the selected VMs from the database":"",
    "This will deploy the selected VMs on the chosen host":"",
    "This will hold selected pending VMs from being deployed":"",
    "This will initiate the shutdown process in the selected VMs":"",
    "This will live-migrate the selected VMs to the chosen host":"",
    "This will migrate the selected VMs to the chosen host":"",
    "This will redeploy selected VMs (in UNKNOWN or BOOT state)":"",
    "This will release held machines":"",
    "This will resubmits VMs to PENDING state":"",
    "This will resume selected stopped or suspended VMs":"",
    "This will suspend selected machines":"",
    "TM MAD":"",
    "total":"",
    "Total Leases":"",
    "Total VM count":"",
    "Total VM CPU":"",
    "Total VM Memory":"",
    "Transfer Manager":"",
    "Type":"",
    "Type of disk device to emulate.":"",
    "Type of disk device to emulate: ide, scsi":"",
    "Type of file system to be built. This can be any value understood by mkfs unix command.":"",
    "Type of the image, explained in detail in the following section. If omitted, the default value is the one defined in oned.conf (install default is OS).":"",
    "Udp black ports":"",
    "Udp firewall mode":"",
    "Udp white ports":"",
    "Unauthorized":"",
    "Unpublish":"",
    "Update":"",
    "Update a template":"",
    "Update image template":"",
    "Update network template":"",
    "Update template":"",
    "USB":"",
    "Use":"",
    "Used by VM":"",
    "Used CPU":"",
    "Used CPU (allocated)":"",
    "Used CPU (real)":"",
    "Used Mem (allocated)":"",
    "Used Memory":"",
    "Used Mem (real)":"",
    "Useful for power management, for example, normally required for graceful shutdown to work":"",
    "User":"",
    "Username":"",
    "User name and password must be filled in":"",
    "Users":"",
    "Value":"",
    "Value of the context variable":"",
    "Value of the custom variable":"",
    "VCPU":"",
    "Virtio":"",
    "Virtio (KVM)":"",
    "Virtualization Manager":"",
    "Virtual Machine information":"",
    "Virtual Machines":"",
    "Virtual Network":"",
    "Virtual network information":"",
    "Virtual Network information":"",
    "Virtual Network name missing!":"",
    "Virtual Networks":"",
    "Virtual Networks (total/public)":"",
    "Virtual Network template (attributes)":"",
    "VM information":"",
    "VM Instance":"",
    "VM Instances":"",
    "VM log":"",
    "VM MAD":"",
    "VM Name":"",
    "VM Network stats":"",
    "#VMS":"",
    "VM Save As":"",
    "VM template":"",
    "VM Template":"",
    "VM Templates":"",
    "VM Templates (total/public)":"",
    "VNC":"",
    "VNC Access":"",
    "VNC connection":"",
    "VNC Disabled":"",
    "VNC Session":"",
    "VNET ID":"",
    "VN MAD":"",
    "Welcome":"",
    "Wizard":"",
    "Wizard KVM":"",
    "Wizard VMware":"",
    "Wizard XEN":"",
    "Write the image template here":"",
    "Write the Virtual Machine template here":"",
    "Write the Virtual Network template here":"",
    "x509":"",
    "XEN":"",
    "Xen templates must specify a boot method":"",
    "yes":"",
    "Yes":"",
    "You have not selected a template":"",
    "You have to confirm this action.":"",
    "You need to select something.":"",
};
<|endoftext|>


<commit_before>import Ember from 'ember';

export default Ember.LinkComponent.extend({
  href: Ember.computed(function () {
    // http://discuss.emberjs.com/t/best-practices-accessing-app-config-from-addon-code/7006/19
    const ENV = Ember.getOwner(this).resolveRegistration('config:environment');
    let href = this._super(...arguments);

    if (!ENV.staticSite.appendFileExtension) {
      return href;
    }

    // Strip out query params
    const splitHref = href.split('?');
    if (splitHref.length > 1) {
      Ember.Logger.warn('Query params are ignored when using link-to with ember-cli-staticboot');
    }
    href = splitHref[0];

    // Append extension if not an index route
    return href[href.length -1] === '/' ? href : `${href}.html`;
  })
});
<commit_msg>Improve query params warning<commit_after>import Ember from 'ember';

export default Ember.LinkComponent.extend({
  href: Ember.computed(function () {
    // http://discuss.emberjs.com/t/best-practices-accessing-app-config-from-addon-code/7006/19
    const ENV = Ember.getOwner(this).resolveRegistration('config:environment');
    let href = this._super(...arguments);

    if (!ENV.staticSite.appendFileExtension) {
      return href;
    }

    // Strip out query params
    const splitHref = href.split('?');
    if (splitHref.length > 1) {
      Ember.Logger.warn(`
        Query params are included in href attributes when using link-to with ember-cli-staticboot.
        If you require query params this suggests your app is dynamic and not best suited for ember-cli-staticboot.
      `);
    }
    href = splitHref[0];

    // Append extension if not an index route
    return href[href.length -1] === '/' ? href : `${href}.html`;
  })
});
<|endoftext|>


<commit_before>import React from 'react'
import loadScript from 'load-script'

import Base from './Base'
import { parseStartTime } from '../utils'

const SDK_URL = 'https://www.youtube.com/iframe_api'
const SDK_GLOBAL = 'YT'
const SDK_GLOBAL_READY = 'onYouTubeIframeAPIReady'
const MATCH_URL = /^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/
const PLAYER_ID = 'youtube-player'
const BLANK_VIDEO_URL = 'https://www.youtube.com/watch?v=GlCmAC4MHek'
const DEFAULT_PLAYER_VARS = {
  autoplay: 0,
  playsinline: 1,
  showinfo: 0,
  rel: 0,
  iv_load_policy: 3
}

let playerIdCount = 0

export default class YouTube extends Base {
  static displayName = 'YouTube'
  static canPlay (url) {
    return MATCH_URL.test(url)
  }
  playerId = PLAYER_ID + '-' + playerIdCount++
  componentDidMount () {
    const { url, youtubeConfig } = this.props
    if (!url && youtubeConfig.preload) {
      this.preloading = true
      this.load(BLANK_VIDEO_URL)
    }
    super.componentDidMount()
  }
  getSDK () {
    if (window[SDK_GLOBAL] && window[SDK_GLOBAL].loaded) {
      return Promise.resolve(window[SDK_GLOBAL])
    }
    return new Promise((resolve, reject) => {
      const previousOnReady = window[SDK_GLOBAL_READY]
      window[SDK_GLOBAL_READY] = function () {
        if (previousOnReady) previousOnReady()
        resolve(window[SDK_GLOBAL])
      }
      loadScript(SDK_URL, err => {
        if (err) reject(err)
      })
    })
  }
  load (url) {
    const { controls, youtubeConfig, onError } = this.props
    const id = url && url.match(MATCH_URL)[1]
    if (this.isReady) {
      this.player.cueVideoById({
        videoId: id,
        startSeconds: parseStartTime(url)
      })
      return
    }
    if (this.loadingSDK) {
      this.loadOnReady = url
      return
    }
    this.loadingSDK = true
    this.getSDK().then(YT => {
      this.player = new YT.Player(this.playerId, {
        width: '100%',
        height: '100%',
        videoId: id,
        playerVars: {
          ...DEFAULT_PLAYER_VARS,
          controls: controls ? 1 : 0,
          ...youtubeConfig.playerVars,
          start: parseStartTime(url),
          origin: window.location.origin
        },
        events: {
          onReady: () => {
            this.loadingSDK = false
            this.onReady()
          },
          onStateChange: this.onStateChange,
          onError: event => onError(event.data)
        }
      })
    }, onError)
  }
  onStateChange = ({ data }) => {
    const { onPause, onBuffer } = this.props
    const { PLAYING, PAUSED, BUFFERING, ENDED, CUED } = window[SDK_GLOBAL].PlayerState
    if (data === PLAYING) this.onPlay()
    if (data === PAUSED) onPause()
    if (data === BUFFERING) onBuffer()
    if (data === ENDED) this.onEnded()
    if (data === CUED) this.onReady()
  }
  onEnded = () => {
    const { loop, onEnded } = this.props
    if (loop) {
      this.seekTo(0)
    }
    onEnded()
  }
  play () {
    if (!this.isReady || !this.player.playVideo) return
    this.player.playVideo()
  }
  pause () {
    if (!this.isReady || !this.player.pauseVideo) return
    this.player.pauseVideo()
  }
  stop () {
    if (!this.isReady || !this.player.stopVideo) return
    this.player.stopVideo()
  }
  seekTo (fraction) {
    super.seekTo(fraction)
    if (!this.isReady || !this.player.seekTo) return
    this.player.seekTo(this.getDuration() * fraction)
  }
  setVolume (fraction) {
    if (!this.isReady || !this.player.setVolume) return
    this.player.setVolume(fraction * 100)
  }
  getDuration () {
    if (!this.isReady || !this.player.getDuration) return null
    return this.player.getDuration()
  }
  getFractionPlayed () {
    if (!this.isReady || !this.getDuration()) return null
    return this.player.getCurrentTime() / this.getDuration()
  }
  getFractionLoaded () {
    if (!this.isReady || !this.player.getVideoLoadedFraction) return null
    return this.player.getVideoLoadedFraction()
  }
  render () {
    const style = {
      height: '100%',
      display: this.props.url ? 'block' : 'none'
    }
    return (

    )
  }
}
<commit_msg>Pass DOM node to YouTube Player instead of ID<commit_after>import React from 'react'
import loadScript from 'load-script'

import Base from './Base'
import { parseStartTime } from '../utils'

const SDK_URL = 'https://www.youtube.com/iframe_api'
const SDK_GLOBAL = 'YT'
const SDK_GLOBAL_READY = 'onYouTubeIframeAPIReady'
const MATCH_URL = /^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/
const BLANK_VIDEO_URL = 'https://www.youtube.com/watch?v=GlCmAC4MHek'
const DEFAULT_PLAYER_VARS = {
  autoplay: 0,
  playsinline: 1,
  showinfo: 0,
  rel: 0,
  iv_load_policy: 3
}

export default class YouTube extends Base {
  static displayName = 'YouTube'
  static canPlay (url) {
    return MATCH_URL.test(url)
  }
  componentDidMount () {
    const { url, youtubeConfig } = this.props
    if (!url && youtubeConfig.preload) {
      this.preloading = true
      this.load(BLANK_VIDEO_URL)
    }
    super.componentDidMount()
  }
  getSDK () {
    if (window[SDK_GLOBAL] && window[SDK_GLOBAL].loaded) {
      return Promise.resolve(window[SDK_GLOBAL])
    }
    return new Promise((resolve, reject) => {
      const previousOnReady = window[SDK_GLOBAL_READY]
      window[SDK_GLOBAL_READY] = function () {
        if (previousOnReady) previousOnReady()
        resolve(window[SDK_GLOBAL])
      }
      loadScript(SDK_URL, err => {
        if (err) reject(err)
      })
    })
  }
  load (url) {
    const { controls, youtubeConfig, onError } = this.props
    const id = url && url.match(MATCH_URL)[1]
    if (this.isReady) {
      this.player.cueVideoById({
        videoId: id,
        startSeconds: parseStartTime(url)
      })
      return
    }
    if (this.loadingSDK) {
      this.loadOnReady = url
      return
    }
    this.loadingSDK = true
    this.getSDK().then(YT => {
      this.player = new YT.Player(this.refNode, {
        width: '100%',
        height: '100%',
        videoId: id,
        playerVars: {
          ...DEFAULT_PLAYER_VARS,
          controls: controls ? 1 : 0,
          ...youtubeConfig.playerVars,
          start: parseStartTime(url),
          origin: window.location.origin
        },
        events: {
          onReady: () => {
            this.loadingSDK = false
            this.onReady()
          },
          onStateChange: this.onStateChange,
          onError: event => onError(event.data)
        }
      })
    }, onError)
  }
  onStateChange = ({ data }) => {
    const { onPause, onBuffer } = this.props
    const { PLAYING, PAUSED, BUFFERING, ENDED, CUED } = window[SDK_GLOBAL].PlayerState
    if (data === PLAYING) this.onPlay()
    if (data === PAUSED) onPause()
    if (data === BUFFERING) onBuffer()
    if (data === ENDED) this.onEnded()
    if (data === CUED) this.onReady()
  }
  onEnded = () => {
    const { loop, onEnded } = this.props
    if (loop) {
      this.seekTo(0)
    }
    onEnded()
  }
  play () {
    if (!this.isReady || !this.player.playVideo) return
    this.player.playVideo()
  }
  pause () {
    if (!this.isReady || !this.player.pauseVideo) return
    this.player.pauseVideo()
  }
  stop () {
    if (!this.isReady || !this.player.stopVideo) return
    this.player.stopVideo()
  }
  seekTo (fraction) {
    super.seekTo(fraction)
    if (!this.isReady || !this.player.seekTo) return
    this.player.seekTo(this.getDuration() * fraction)
  }
  setVolume (fraction) {
    if (!this.isReady || !this.player.setVolume) return
    this.player.setVolume(fraction * 100)
  }
  getDuration () {
    if (!this.isReady || !this.player.getDuration) return null
    return this.player.getDuration()
  }
  getFractionPlayed () {
    if (!this.isReady || !this.getDuration()) return null
    return this.player.getCurrentTime() / this.getDuration()
  }
  getFractionLoaded () {
    if (!this.isReady || !this.player.getVideoLoadedFraction) return null
    return this.player.getVideoLoadedFraction()
  }
  setRefNode = (node) => {
    this.refNode = node
  }
  render () {
    const style = {
      height: '100%',
      display: this.props.url ? 'block' : 'none'
    }
    return (

    )
  }
}
<|endoftext|>