<commit_before>/* -------------------------------------------------------------------------- */
/* Copyright 2002-2020, OpenNebula Project, OpenNebula Systems                */
/*                                                                            */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may    */
/* not use this file except in compliance with the License. You may obtain    */
/* a copy of the License at                                                   */
/*                                                                            */
/* http://www.apache.org/licenses/LICENSE-2.0                                 */
/*                                                                            */
/* Unless required by applicable law or agreed to in writing, software        */
/* distributed under the License is distributed on an "AS IS" BASIS,          */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   */
/* See the License for the specific language governing permissions and        */
/* limitations under the License.                                             */
/* -------------------------------------------------------------------------- */

define(function(require) {
  var Config = require('sunstone-config');

  return {
    "downloadWFile": _downloadWFile,
    "downloadRdpFile": _downloadRdpFile,
  };

  function _downloadRdpFile(ip, name = "vm_name", credentials = {}) {
    var file = _rdpFile(ip, credentials.username, credentials.password);
    _download(name, ".rdp", file);
  }

  function _downloadWFile(response, vm_host, graphics_type, graphics_port) {
    var protocol = window.location.protocol;
    var proxy_host = window.location.hostname;
    var proxy_port = Config.vncProxyPort;
    var token = response["token"];
    var password = response["password"];
    var vm_name = response["vm_name"];

    if ($.inArray(graphics_type, ['spice', 'vnc']) < 0) {
      Notifier.notifyError(Locale.tr("Type grapichs supported: vnc, spice"));
      return;
    }

    if (!graphics_type || !graphics_port) {
      Notifier.notifyError(Locale.tr("Must specify type and port in graphics options"));
      return;
    }

    if (!proxy_host || !proxy_port) {<commit_msg>M #-: small typo in a sunstone translatable string (#4649)<commit_after>/* -------------------------------------------------------------------------- */
/* Copyright 2002-2020, OpenNebula Project, OpenNebula Systems                */
/*                                                                            */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may    */
/* not use this file except in compliance with the License. You may obtain    */
/* a copy of the License at                                                   */
/*                                                                            */
/* http://www.apache.org/licenses/LICENSE-2.0                                 */
/*                                                                            */
/* Unless required by applicable law or agreed to in writing, software        */
/* distributed under the License is distributed on an "AS IS" BASIS,          */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   */
/* See the License for the specific language governing permissions and        */
/* limitations under the License.                                             */
/* -------------------------------------------------------------------------- */

define(function(require) {
  var Config = require('sunstone-config');

  return {
    "downloadWFile": _downloadWFile,
    "downloadRdpFile": _downloadRdpFile,
  };

  function _downloadRdpFile(ip, name = "vm_name", credentials = {}) {
    var file = _rdpFile(ip, credentials.username, credentials.password);
    _download(name, ".rdp", file);
  }

  function _downloadWFile(response, vm_host, graphics_type, graphics_port) {
    var protocol = window.location.protocol;
    var proxy_host = window.location.hostname;
    var proxy_port = Config.vncProxyPort;
    var token = response["token"];
    var password = response["password"];
    var vm_name = response["vm_name"];

    if ($.inArray(graphics_type, ['spice', 'vnc']) < 0) {
      Notifier.notifyError(Locale.tr("Type graphics supported: vnc, spice"));
      return;
    }

    if (!graphics_type || !graphics_port) {
      Notifier.notifyError(Locale.tr("Must specify type and port in graphics options"));
      return;
    }

    if (!proxy_host || !proxy_port) {
{'fraction_non_alphanumeric': 0.16597510373443983, 'fraction_numerical': 0.006551648831622625, 'mean_word_length': 1.4850786760716224, 'pattern_counts': {'":': 4, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 40, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4109728', 'n_tokens_mistral': 1051, 'n_tokens_neox': 1016, 'n_words': 320}