<commit_before>var ccs = window.ccs || {};

ccs.NewViewModel = function() {
    var self = this;
    self.visible = ko.observable(false);

    self.registryURL = ccs.endpoint + '/v2/containers/images';

    self.step2 = ko.observable(false); // wizard page
    self.next = function() {
        self.step2(true);
    };

    self.back = function() {
        self.step2(false);
    };

    self.Volume = function() {
        return {
            name: ko.observable(),
            size: 20,
            path: ko.observable(),
            readOnly: ko.observable(),
        };
    };

    // TODO: API call needed to get available CF Apps
    self.availableCFApps = ko.observableArray();

    // editable fields for launch wizard
    self.launchData = {
        name: ko.observable(),
        filter: ko.observable(),
        image: ko.observable(),
        imageName: ko.observable(),
        images: ko.observableArray(),
        minContainers: ko.observable(0),
        maxContainers: ko.observable(8),
        desiredContainers: ko.observable(2),
        availableSizes: ko.observableArray(),
        selectedSize: ko.observable(),
        deploymentMethods: [
            {name: 'container', label: 'Deploy as a single container'},
            {name: 'group', label: 'Deploy as a scalable group'}
        ],
        selectedDeploymentMethod: ko.observable(),
        publicIP: ko.observable('--'),
        ports: ko.observable(),
        httpPort: ko.observable(),
        volumes: ko.observableArray(),
        availableVolumes: ko.observableArray([
            'Exiting Volume 1',
            'Exiting Volume 2',
            'Exiting Volume 3',
            'Exiting Volume 4',
            'Exiting Volume 5',
        ]),
        dockerRepos: ko.observableArray([
            {name: 'Your Image Registry', url: window.location.origin + '/v2/containers/images/json'},
            {name: 'DockerHub', url: window.location.protocol + '//' + window.location.hostname + ':4243/images/search?term='}
        ]),
        selectedRepo: ko.observable()
    };
    self.launchData.selectedRepo(self.launchData.dockerRepos()[0]);

    self.launchData.isGroup = ko.pureComputed(function() {
        return self.launchData.selectedDeploymentMethod().name == 'group';
    });

    self.launchData.isGroupText = ko.pureComputed(function() {
        return self.launchData.selectedDeploymentMethod().name == 'group' ? 'Yes' : 'No';
    });

    self.launchData.route = ko.pureComputed(function() {
        if (self.launchData.selectedDeploymentMethod().name == 'container') return '--';

        var host = self.launchData.name();
        return host ? host + '.mybluemix.net' : '--';
    });

    self.launchData.deleteVolume = function(v) {
        v.name('');
        v.path('');
    };

    self.launchData.showVolumesDialog = function() {

    };

    self.launchData.updateVolumes = function() {
        console.log(self.launchData.volumes());
    }

    self.launchData.filteredImages = ko.pureComputed(function() {
        var filter = self.launchData.filter();
        if (!filter) {
            return self.launchData.images();
        } else {
            filter = filter.trim().toLowerCase();
            return ko.utils.arrayFilter(self.launchData.images(), function(item) {
                return (item.Name.toLowerCase().indexOf(filter) != -1);
            });
        }
    }, self);

    self.launchData.setImage = function(image) {
        self.launchData.image(image);
        self.launchData.imageName(image.Name + ':' + image.Tag);
    };

    self.launchData.searchImageRepository = function() {
        var filter = self.launchData.filter();
        if (filter) {
            self.launchData.getContainerImages(filter);
        }
    };

    self.launchData.repoChanged = function() {
        self.launchData.images.removeAll();
        self.launchData.filter('');
        self.launchData.getContainerImages();
    };

    self.launchData.getContainerImages = function(query) {
        var localRepoCallback = function(data) {
            self.launchData.images.removeAll();
            data.forEach(function(image) {
                if (image.Image.toLowerCase().indexOf('<none>') == -1) {
                    //var d = new Date(image.Created);
                    //image.Created = d.getTime() / 1000;
                    image.VirtualSize = (image.VirtualSize/1024/1024).toFixed(0);

                    image.Name = image.Image;
                    image.Tag = '';
                    var name_tag = image.Name.split(':');
                    if (name_tag[1]) {
                        image.Name = name_tag[0];
                        image.Tag =  name_tag[1];
                    }
                    self.launchData.images.push(image);
                }
            });

            $("body").css("cursor", "default");
        };

        var remoteRepoCallback = function(data) {
            self.launchData.images.removeAll();
            data.forEach(function(elem) {
                var image = elem;
                image.Name = elem.name;
                image.Created = 0;
                image.Id = '--';
                self.launchData.images.push(image);
            });

            $("body").css("cursor", "default");
        };

        $("body").css("cursor", "progress");
<commit_msg>detect missing VirtualSize param in image repo get<commit_after>var ccs = window.ccs || {};

ccs.NewViewModel = function() {
    var self = this;
    self.visible = ko.observable(false);

    self.registryURL = ccs.endpoint + '/v2/containers/images';

    self.step2 = ko.observable(false); // wizard page
    self.next = function() {
        self.step2(true);
    };

    self.back = function() {
        self.step2(false);
    };

    self.Volume = function() {
        return {
            name: ko.observable(),
            size: 20,
            path: ko.observable(),
            readOnly: ko.observable(),
        };
    };

    // TODO: API call needed to get available CF Apps
    self.availableCFApps = ko.observableArray();

    // editable fields for launch wizard
    self.launchData = {
        name: ko.observable(),
        filter: ko.observable(),
        image: ko.observable(),
        imageName: ko.observable(),
        images: ko.observableArray(),
        minContainers: ko.observable(0),
        maxContainers: ko.observable(8),
        desiredContainers: ko.observable(2),
        availableSizes: ko.observableArray(),
        selectedSize: ko.observable(),
        deploymentMethods: [
            {name: 'container', label: 'Deploy as a single container'},
            {name: 'group', label: 'Deploy as a scalable group'}
        ],
        selectedDeploymentMethod: ko.observable(),
        publicIP: ko.observable('--'),
        ports: ko.observable(),
        httpPort: ko.observable(),
        volumes: ko.observableArray(),
        availableVolumes: ko.observableArray([
            'Exiting Volume 1',
            'Exiting Volume 2',
            'Exiting Volume 3',
            'Exiting Volume 4',
            'Exiting Volume 5',
        ]),
        dockerRepos: ko.observableArray([
            {name: 'Your Image Registry', url: window.location.origin + '/v2/containers/images/json'},
            {name: 'DockerHub', url: window.location.protocol + '//' + window.location.hostname + ':4243/images/search?term='}
        ]),
        selectedRepo: ko.observable()
    };
    self.launchData.selectedRepo(self.launchData.dockerRepos()[0]);

    self.launchData.isGroup = ko.pureComputed(function() {
        return self.launchData.selectedDeploymentMethod().name == 'group';
    });

    self.launchData.isGroupText = ko.pureComputed(function() {
        return self.launchData.selectedDeploymentMethod().name == 'group' ? 'Yes' : 'No';
    });

    self.launchData.route = ko.pureComputed(function() {
        if (self.launchData.selectedDeploymentMethod().name == 'container') return '--';

        var host = self.launchData.name();
        return host ? host + '.mybluemix.net' : '--';
    });

    self.launchData.deleteVolume = function(v) {
        v.name('');
        v.path('');
    };

    self.launchData.showVolumesDialog = function() {

    };

    self.launchData.updateVolumes = function() {
        console.log(self.launchData.volumes());
    }

    self.launchData.filteredImages = ko.pureComputed(function() {
        var filter = self.launchData.filter();
        if (!filter) {
            return self.launchData.images();
        } else {
            filter = filter.trim().toLowerCase();
            return ko.utils.arrayFilter(self.launchData.images(), function(item) {
                return (item.Name.toLowerCase().indexOf(filter) != -1);
            });
        }
    }, self);

    self.launchData.setImage = function(image) {
        self.launchData.image(image);
        self.launchData.imageName(image.Name + ':' + image.Tag);
    };

    self.launchData.searchImageRepository = function() {
        var filter = self.launchData.filter();
        if (filter) {
            self.launchData.getContainerImages(filter);
        }
    };

    self.launchData.repoChanged = function() {
        self.launchData.images.removeAll();
        self.launchData.filter('');
        self.launchData.getContainerImages();
    };

    self.launchData.getContainerImages = function(query) {
        var localRepoCallback = function(data) {
            self.launchData.images.removeAll();
            data.forEach(function(image) {
                if (image.Image.toLowerCase().indexOf('<none>') == -1) {
                    //var d = new Date(image.Created);
                    //image.Created = d.getTime() / 1000;
                    if (image.VirtualSize && image.VirtualSize > 1024 * 1024)
                        image.VirtualSize = (image.VirtualSize/1024/1024).toFixed(0);
                    else
                        image.VirtualSize = '--';
                    image.Name = image.Image;
                    image.Tag = '';
                    var name_tag = image.Name.split(':');
                    if (name_tag[1]) {
                        image.Name = name_tag[0];
                        image.Tag =  name_tag[1];
                    }
                    self.launchData.images.push(image);
                }
            });

            $("body").css("cursor", "default");
        };

        var remoteRepoCallback = function(data) {
            self.launchData.images.removeAll();
            data.forEach(function(elem) {
                var image = elem;
                image.Name = elem.name;
                image.Created = 0;
                image.Id = '--';
                self.launchData.images.push(image);
            });

            $("body").css("cursor", "default");
        };

        $("body").css("cursor", "progress");

{'fraction_non_alphanumeric': 0.14251408515747668, 'fraction_numerical': 0.007943105199963055, 'mean_word_length': 1.8967362225789193, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '1013511', 'n_tokens_mistral': 3188, 'n_tokens_neox': 2983, 'n_words': 526}