<commit_before>// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import ServerDisplay from '@rundeck/ui-trellis/lib/components/version/ServerDisplay'
import { getRundeckContext } from '@rundeck/ui-trellis'
import { ServerInfo }  from '@rundeck/ui-trellis/src/stores/System'

Vue.config.productionTip = false


/* eslint-disable no-new */

const serverCollection = Array.from(document.body.getElementsByClassName('rundeck-server-uuid'))
serverCollection.forEach( serverElement => {
    new Vue({
        el: serverElement,
        components: {
            ServerDisplay
        },
        data() {
            return {
                serverInfo:null,
                showId:true,
                nameClass:''
            }
        },
        async mounted () {
            this.showId = serverElement.attributes['data-show-id']?serverElement.attributes['data-show-id'].value !== 'false':true
            this.nameClass = serverElement.attributes['data-name-class']?serverElement.attributes['data-name-class'].value:''
            if (serverElement.attributes['data-server-name'] && serverElement.attributes['data-server-uuid']) {
                this.serverInfo =
                    new ServerInfo(serverElement.attributes['data-server-name'].value, serverElement.attributes['data-server-uuid'].value)
            } else {
                const rootStore=getRundeckContext().rootStore
                try {
                    await rootStore.system.load()
                } catch (e) {
                }
                this.serverInfo = rootStore.system.serverInfo
            }
        },
        template:`<server-display :uuid="serverInfo.uuid"
                                  :name="serverInfo.name"
                                  :name-class="nameClass"
                                  :glyphicon="serverInfo.icon"
                                  :show-id="showId"
                                  v-if="serverInfo">
        </server-display>`
    })
})<commit_msg>wait for document to be fully loaded before running server-identity script<commit_after>// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import ServerDisplay from '@rundeck/ui-trellis/lib/components/version/ServerDisplay'
import { getRundeckContext } from '@rundeck/ui-trellis'
import { ServerInfo }  from '@rundeck/ui-trellis/src/stores/System'

Vue.config.productionTip = false


/* eslint-disable no-new */
window.addEventListener('load', function () {
  const serverCollection = Array.from(document.body.getElementsByClassName('rundeck-server-uuid'))
  serverCollection.forEach(serverElement => {
    new Vue({
      el: serverElement,
      components: {
        ServerDisplay
      },
      data() {
        return {
          serverInfo: null,
          showId: true,
          nameClass: ''
        }
      },
      async mounted() {
        this.showId = serverElement.attributes['data-show-id'] ? serverElement.attributes['data-show-id'].value !== 'false' : true
        this.nameClass = serverElement.attributes['data-name-class'] ? serverElement.attributes['data-name-class'].value : ''
        if (serverElement.attributes['data-server-name'] && serverElement.attributes['data-server-uuid']) {
          this.serverInfo =
            new ServerInfo(serverElement.attributes['data-server-name'].value, serverElement.attributes['data-server-uuid'].value)
        } else {
          const rootStore = getRundeckContext().rootStore
          try {
            await rootStore.system.load()
          } catch (e) {
          }
          this.serverInfo = rootStore.system.serverInfo
        }
      },
      template: `
        <server-display :uuid="serverInfo.uuid"
                        :name="serverInfo.name"
                        :name-class="nameClass"
                        :glyphicon="serverInfo.icon"
                        :show-id="showId"
                        v-if="serverInfo">
        </server-display>`
    })
  })
})
{'fraction_non_alphanumeric': 0.12043269230769231, 'fraction_numerical': 0.0, 'mean_word_length': 2.0731166912850814, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5327116', 'n_tokens_mistral': 1121, 'n_tokens_neox': 1081, 'n_words': 198}