<commit_before>var vup = angular.module('vup', ['LocalStorageModule']);

vup.controller('dashboard', ['$rootScope', '$scope', '$location', '$http', 'localStorageService', function ($rootScope, $scope, $location, $http, localStorageService) {
    console.log("Dashboard started.");

    $scope.projects = [];
    $scope.project = null;

    var apiUrl = '';

    $scope.refresh = function () {
        if ($scope.refreshPending) return;
        $scope.refreshPending = true;

        $http({method: 'GET', url: apiUrl + '/projects'})
            .success(function (response) {
                $scope.projects = response.data;
                $rootScope.$broadcast('Blocks:Change');
                $scope.refreshPending = false;
                $scope.loading = false;
                $scope.notify({
                    message : 'Good news, everybody! ',
                    status  : 'success',
                    timeout : 3000,
                    pos     : 'bottom-center'
                });
            })
            .error(function (error) {
                $scope.projects = [];
                $scope.refreshPending = false;
                $scope.loading = false;
                console.log('Failed to list projects...', error);
                $scope.notify({
                    message : 'Bad news, everybody! ' + error,
                    status  : 'danger',
                    timeout : 3000,
                    pos     : 'bottom-center'
                });
            });
    };

    $scope.notify = jQuery.UIkit.notify;
    $scope.refresh();
}]);

/* Start angularLocalStorage */
var angularLocalStorage = angular.module('LocalStorageModule', []);

// You should set a prefix to avoid overwriting any local storage variables from the rest of your app
// e.g. angularLocalStorage.constant('prefix', 'youAppName');
angularLocalStorage.constant('prefix', 'vup');
// Cookie options (usually in case of fallback)
// expiry = Number of days before cookies expire // 0 = Does not expire
// path = The web path the cookie represents
angularLocalStorage.constant('cookie', { expiry: 30, path: '/'});
angularLocalStorage.constant('notify', { setItem: true, removeItem: false});

angularLocalStorage.service('localStorageService', [
    '$rootScope',
    'prefix',
    'cookie',
    'notify',
    function ($rootScope, prefix, cookie, notify) {

        // Checks the browser to see if local storage is supported
        var browserSupportsLocalStorage = function () {
            try {
                return ('localStorage' in window && window['localStorage'] !== null);
            } catch (e) {
                $rootScope.$broadcast('LocalStorageModule.notification.error', e.message);
                return false;
            }<commit_msg>add drag and drop to app, setup stacklets, add dummy handling<commit_after>var vup = angular.module('vup', ['LocalStorageModule', 'ngDraggable']);

vup.controller('dashboard', ['$rootScope', '$scope', '$location', '$http', 'localStorageService', function ($rootScope, $scope, $location, $http, localStorageService) {
    console.log("Dashboard started.");

    $scope.projects = [];
    $scope.project = null;

    $scope.stacklets = {
        'nginx': {
            'name': 'nginx'
        },
        'mysql': {
            'name': 'mysql'
        },
        'php': {
            'name': 'php'
        },
        'uwsgi': {
            'name': 'uwsgi'
        },
        'haproxy': {
            'name': 'haproxy'
        },
        'apache': {
            'name': 'apache'
        }
    };


    var apiUrl = '';

    $scope.dropped = function (data, event) {
        console.log('Dropped', data, event);

        if (!$scope.project) {
            $scope.project = {};
            $scope.project['containers'] = [];
        }

        $scope.project.containers.push(data);
    };

    $scope.refresh = function () {
        if ($scope.refreshPending) return;
        $scope.refreshPending = true;

        $http({method: 'GET', url: apiUrl + '/projects'})
            .success(function (response) {
                $scope.projects = response.data;
                $rootScope.$broadcast('Blocks:Change');
                $scope.refreshPending = false;
                $scope.loading = false;
                $scope.notify({
                    message : 'Good news, everybody! ',
                    status  : 'success',
                    timeout : 3000,
                    pos     : 'bottom-center'
                });
            })
            .error(function (error) {
                $scope.projects = [];
                $scope.refreshPending = false;
                $scope.loading = false;
                console.log('Failed to list projects...', error);
                $scope.notify({
                    message : 'Bad news, everybody! ' + error,
                    status  : 'danger',
                    timeout : 3000,
                    pos     : 'bottom-center'
                });
            });
    };

    $scope.notify = jQuery.UIkit.notify;
    //$scope.refresh();
}]);

/* Start angularLocalStorage */
var angularLocalStorage = angular.module('LocalStorageModule', []);

// You should set a prefix to avoid overwriting any local storage variables from the rest of your app
// e.g. angularLocalStorage.constant('prefix', 'youAppName');
angularLocalStorage.constant('prefix', 'vup');
// Cookie options (usually in case of fallback)
// expiry = Number of days before cookies expire // 0 = Does not expire
// path = The web path the cookie represents
angularLocalStorage.constant('cookie', { expiry: 30, path: '/'});
angularLocalStorage.constant('notify', { setItem: true, removeItem: false});

angularLocalStorage.service('localStorageService', [
    '$rootScope',
    'prefix',
    'cookie',
    'notify',
    function ($rootScope, prefix, cookie, notify) {

        // Checks the browser to see if local storage is supported
        var browserSupportsLocalStorage = function () {
            try {
                return ('localStorage' in window && window['localStorage'] !== null);
            } catch (e) {
                $rootScope.$broadcast('LocalStorageModule.notification.error', e.message);
                return false;
            }
{'fraction_non_alphanumeric': 0.1384343920436317, 'fraction_numerical': 0.003529034327879371, 'mean_word_length': 1.9286049788633162, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3043118', 'n_tokens_mistral': 1674, 'n_tokens_neox': 1587, 'n_words': 402}