<commit_before>import Ember from 'ember';
const { Controller, inject, computed } = Ember;
import AlertifyHandler from 'explorviz-frontend/mixins/alertify-handler';
import FileSaverMixin from 'ember-cli-file-saver/mixins/file-saver';

/**
* TODO
*
* @class Application-Controller
* @extends Ember.Controller
*
* @module explorviz
* @submodule page
*/
export default Controller.extend(AlertifyHandler, FileSaverMixin, {

ajax: inject.service(),
  session: inject.service('session'),
  visualization: inject.controller(),
  landscapeRepo: inject.service("repos/landscape-repository"),
  renderingService: inject.service("rendering-service"),
  reloadHandler: inject.service("reload-handler"),

  actions: {

    exportState() {
      if(this.get('currentRouteName') === 'visualization') {
        try {
          this.get('visualization').send('exportState');
        }
        catch(err) {
          this.debug("Error when exporting URL", err);
        }
      }
    },

    resetView(){
      this.get('visualization').send('resetView');
    },

    exportLandscape(){
      const currentLandscape = this.get('landscapeRepo.latestLandscape');

      const currentTimestamp = currentLandscape.get('timestamp');

this.get('ajax').raw('http://localhost:8083/landscape/export/' + currentTimestamp, {
dataType: 'text',
  options: {
    arraybuffer: true
  }
  }
).then((content) => {
  console.log('content: ', content);
  this.saveFileAs(currentTimestamp + '-' + currentLandscape.get('overallCalls') +'.expl', content.payload, 'text/plain');
}).catch((error) => {
  console.log(error);
});
}
  },

  username: computed(function(){<commit_msg>set path to env variable<commit_after>import Ember from 'ember';
import AlertifyHandler from 'explorviz-frontend/mixins/alertify-handler';
import FileSaverMixin from 'ember-cli-file-saver/mixins/file-saver';
import ENV from 'explorviz-frontend/config/environment';

const { Controller, inject, computed } = Ember;
/**
* TODO
*
* @class Application-Controller
* @extends Ember.Controller
*
* @module explorviz
* @submodule page
*/
export default Controller.extend(AlertifyHandler, FileSaverMixin, {

  ajax: inject.service(),
  session: inject.service('session'),
  visualization: inject.controller(),
  landscapeRepo: inject.service("repos/landscape-repository"),
  renderingService: inject.service("rendering-service"),
  reloadHandler: inject.service("reload-handler"),

  actions: {

    exportState() {
      if(this.get('currentRouteName') === 'visualization') {
        try {
          this.get('visualization').send('exportState');
        }
        catch(err) {
          this.debug("Error when exporting URL", err);
        }
      }
    },

    resetView(){
      this.get('visualization').send('resetView');
    },

    exportLandscape(){
      const currentLandscape = this.get('landscapeRepo.latestLandscape');
      const currentTimestamp = currentLandscape.get('timestamp');

      this.get('ajax').raw(ENV.APP.API_ROOT + '/landscape/export/' + currentTimestamp, {
        dataType: 'text',
        options: {
          arraybuffer: true
        }
      }
    ).then((content) => {
      console.log('content: ', content);
      this.saveFileAs(currentTimestamp + '-' + currentLandscape.get('overallCalls') +'.expl', content.payload, 'text/plain');
    }).catch((error) => {
      console.log(error);
    });
  }
  },

  username: computed(function(){
{'fraction_non_alphanumeric': 0.1566265060240964, 'fraction_numerical': 0.0011754334410813989, 'mean_word_length': 3.7876230661040786, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1529976', 'n_tokens_mistral': 1032, 'n_tokens_neox': 1009, 'n_words': 172}