<commit_before>/** @jsx React.DOM */
"use strict";

var _ = require('underscore');
var Backbone = require('backbone');
var ItemTemplate = require('../tpl/vms-list-item.hbs');
var adminui = require('../adminui');
var Vms = require('../models/vms');
var React = require('react');
var request = require('../request');

var Images = require('../models/images');
var User = require('../models/user');
var Package = require('../models/package');
var JSONExport = require('../components/json-export.jsx');


var _getServerPromises = {};
function getServer(serverUuid) {
    var url = _.str.sprintf('/api/servers/%s', serverUuid);
    if (_getServerPromises[serverUuid]) {
        return _getServerPromises[serverUuid];
    } else {
        _getServerPromises[serverUuid] = new Promise(function(resolve, reject) {
            request.get(url).end(function(res) {
                if (res.ok) {
                    resolve(res.body);
                } else {
                    reject(res.body);
                }
            });
        });
        return _getServerPromises[serverUuid];
    }
}
<commit_msg>ADMINUI-1838 Latest adminui does't load the /vms page on safari<commit_after>/** @jsx React.DOM */
"use strict";

var _ = require('underscore');
var Backbone = require('backbone');
var ItemTemplate = require('../tpl/vms-list-item.hbs');
var adminui = require('../adminui');
var Vms = require('../models/vms');
var React = require('react');
var request = require('../request');
var Promise = require('promise');

var Images = require('../models/images');
var User = require('../models/user');
var Package = require('../models/package');
var JSONExport = require('../components/json-export.jsx');


var _getServerPromises = {};
function getServer(serverUuid) {
    var url = _.str.sprintf('/api/servers/%s', serverUuid);
    if (_getServerPromises[serverUuid]) {
        return _getServerPromises[serverUuid];
    } else {
        _getServerPromises[serverUuid] = new Promise(function(resolve, reject) {
            request.get(url).end(function(res) {
                if (res.ok) {
                    resolve(res.body);
                } else {
                    reject(res.body);
                }
            });
        });
        return _getServerPromises[serverUuid];
    }
}

{'fraction_non_alphanumeric': 0.1668126094570928, 'fraction_numerical': 0.0017513134851138354, 'mean_word_length': 2.6501597444089455, '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': '6926698', 'n_tokens_mistral': 689, 'n_tokens_neox': 677, 'n_words': 136}