<template>
  <DataView v-bind="vbind" v-if="vbind"></DataView>
</template>
<script>
export default {
  props: ['ssh', 'vpagename'],
  data() {
    return {
      showmodal: undefined,
      vbind: undefined
    }
  },
  async created() {
    await this.getApi()
  },
  methods: {
    async getApi() {
      let data = {ssh: this.ssh || 1, path: '', cmd: `df -h`, format: 'diskinfo', user: this.$store.login.id}
      let rows = await this.$insertapi('executecommand', data, undefined, false)
      console.log('rows', rows)
      this.vbind = {pagename: this.vpagename, setting: 'diskinfo-fields', data: rows}
    }
  }
}
</script>