<commit_before>//
// Copyright (c) 2013-2016 SKYARCH NETWORKS INC.
//
// This software is released under the MIT License.
//
// http://opensource.org/licenses/mit-license.php
//
(function () {
  'use_strict';

  //browserify functions for vue filters functionality
  var wrap = require('./modules/wrap');
  var listen = require('./modules/listen');
  var md5 = require('md5');
  var queryString = require('query-string').parse(location.search);
  var modal = require('modal');

  var app;

  Vue.component('demo-grid', require('demo-grid.js'));


  var clientIndex = new Vue({
    el: '#indexElement',
    data: {
      searchQuery: '',
      gridColumns: ['fqdn', 'version', 'details', 'username'],
      gridData: [],
      index: 'zabbix_servers',
      picked: {
        users_admin_path: null,
        id: null
      }
    },
    methods:  {
      can_delete: function() {
        return (this.picked.users_admin_path === null);
      },
      can_edit: function() {
        return (this.picked.id === null);
      },

      delete_entry: function()  {
        var self = this;
        modal.Confirm(t('users.user'), t('users.msg.delete_user', self.email), 'danger').done(function () {
          $.ajax({
            type: "POST",
            url: self.picked.users_admin_path,
            dataType: "json",
            data: {"_method":"delete"},
            success: function (data) {
              self.gridData = data;
              self.picked = {};
            },
          }).fail(function() { location.reload(); });
        });
      }

    }
  });
})();<commit_msg> Edit and delete policy of zabbix servers<commit_after>//
// Copyright (c) 2013-2016 SKYARCH NETWORKS INC.
//
// This software is released under the MIT License.
//
// http://opensource.org/licenses/mit-license.php
//
(function () {
  'use_strict';

  //browserify functions for vue filters functionality
  var wrap = require('./modules/wrap');
  var listen = require('./modules/listen');
  var md5 = require('md5');
  var queryString = require('query-string').parse(location.search);
  var modal = require('modal');

  var app;

  Vue.component('demo-grid', require('demo-grid.js'));


  var clientIndex = new Vue({
    el: '#indexElement',
    data: {
      searchQuery: '',
      gridColumns: ['fqdn', 'version', 'details'],
      gridData: [],
      index: 'zabbix_servers',
      picked: {
        users_admin_path: null,
        id: null
      }
    },
    methods:  {
      can_delete: function() {
        if (this.picked.delete_zabbix_server_path)
          return this.picked.delete_zabbix_server_path ? true : false;
      },
      can_edit: function() {
        if (this.picked.edit_zabbix_server_url)
          return this.picked.edit_zabbix_server_url ? true : false;
      },

      delete_entry: function()  {
        var self = this;
        modal.Confirm(t('users.user'), t('users.msg.delete_user', self.email), 'danger').done(function () {
          $.ajax({
            type: "POST",
            url: self.picked.delete_zabbix_server_path,
            dataType: "json",
            data: {"_method":"delete"},
            success: function (data) {
              self.gridData = data;
              self.picked = {};
            },
          }).fail(function() { location.reload(); });
        });
      }

    }
  });
})();
{'fraction_non_alphanumeric': 0.16039723141739393, 'fraction_numerical': 0.006018657839301836, 'mean_word_length': 2.2115942028985507, 'pattern_counts': {'":': 2, '<': 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': '6425678', 'n_tokens_mistral': 1032, 'n_tokens_neox': 1005, 'n_words': 214}