Sha256: dcff6b16081a033c4cb206e4bcf605854784676531bcf471b727650c3552a00d

Contents?: true

Size: 1.24 KB

Versions: 14

Compression:

Stored size: 1.24 KB

Contents

<template>
  <Loading v-if="getArtifactTask.isRunning"></Loading>

  <ErrorMessage v-if="getArtifactTask.isError" :error="getArtifactTask.last?.error"></ErrorMessage>

  <ArtifactComponent
    :artifact="getArtifactTask.last.value"
    @refresh="refresh"
    v-if="getArtifactTask.last?.value"
  ></ArtifactComponent>
</template>

<script lang="ts">
import { defineComponent, onMounted, watch } from "vue"

import { generateGetArtifactTask } from "@/api-helper"
import ArtifactComponent from "@/components/artifact/Artifact.vue"
import ErrorMessage from "@/components/ErrorMessage.vue"
import Loading from "@/components/Loading.vue"

export default defineComponent({
  name: "ArtifactWrapper",
  components: {
    ArtifactComponent,
    Loading,
    ErrorMessage
  },
  props: {
    id: {
      type: String,
      required: true
    }
  },
  setup(props) {
    const getArtifactTask = generateGetArtifactTask()

    const getArtifact = async () => {
      await getArtifactTask.perform(props.id)
    }

    const refresh = async () => {
      await getArtifact()
    }

    onMounted(async () => {
      await getArtifact()
    })

    watch(props, async () => {
      await getArtifact()
    })

    return {
      getArtifactTask,
      refresh
    }
  }
})
</script>

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
mihari-5.5.0 frontend/src/components/artifact/ArtifactWrapper.vue
mihari-5.4.9 frontend/src/components/artifact/ArtifactWrapper.vue
mihari-5.4.8 frontend/src/components/artifact/ArtifactWrapper.vue
mihari-5.4.7 frontend/src/components/artifact/ArtifactWrapper.vue
mihari-5.4.6 frontend/src/components/artifact/ArtifactWrapper.vue
mihari-5.4.5 frontend/src/components/artifact/ArtifactWrapper.vue
mihari-5.4.4 frontend/src/components/artifact/ArtifactWrapper.vue
mihari-5.4.3 frontend/src/components/artifact/ArtifactWrapper.vue
mihari-5.4.2 frontend/src/components/artifact/ArtifactWrapper.vue
mihari-5.4.1 frontend/src/components/artifact/ArtifactWrapper.vue
mihari-5.4.0 frontend/src/components/artifact/ArtifactWrapper.vue
mihari-5.3.2 frontend/src/components/artifact/ArtifactWrapper.vue
mihari-5.3.1 frontend/src/components/artifact/ArtifactWrapper.vue
mihari-5.3.0 frontend/src/components/artifact/ArtifactWrapper.vue