2019-03-29 18:58:20 -07:00
|
|
|
<template>
|
|
|
|
<div class="importer">
|
|
|
|
<form>
|
2019-07-05 00:17:44 -07:00
|
|
|
<input
|
|
|
|
ref="input"
|
|
|
|
type="file"
|
|
|
|
@change="change"
|
|
|
|
>
|
2019-03-29 18:58:20 -07:00
|
|
|
</form>
|
2020-10-20 14:01:28 -07:00
|
|
|
<FAIcon
|
2019-07-05 00:17:44 -07:00
|
|
|
v-if="submitting"
|
2020-10-20 14:01:28 -07:00
|
|
|
class="importer-uploading"
|
|
|
|
spin
|
|
|
|
icon="circle-notch"
|
2019-07-05 00:17:44 -07:00
|
|
|
/>
|
|
|
|
<button
|
|
|
|
v-else
|
|
|
|
class="btn btn-default"
|
|
|
|
@click="submit"
|
|
|
|
>
|
|
|
|
{{ submitButtonLabel }}
|
|
|
|
</button>
|
2019-03-29 18:58:20 -07:00
|
|
|
<div v-if="success">
|
2020-10-20 14:01:28 -07:00
|
|
|
<FAIcon
|
|
|
|
icon="times"
|
2019-07-05 00:17:44 -07:00
|
|
|
@click="dismiss"
|
|
|
|
/>
|
|
|
|
<p>{{ successMessage }}</p>
|
2019-03-29 18:58:20 -07:00
|
|
|
</div>
|
|
|
|
<div v-else-if="error">
|
2020-10-20 14:01:28 -07:00
|
|
|
<FAIcon
|
|
|
|
icon="times"
|
2019-07-05 00:17:44 -07:00
|
|
|
@click="dismiss"
|
|
|
|
/>
|
|
|
|
<p>{{ errorMessage }}</p>
|
2019-03-29 18:58:20 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script src="./importer.js"></script>
|
2019-03-29 20:55:49 -07:00
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.importer {
|
2019-03-30 02:10:57 -07:00
|
|
|
&-uploading {
|
2019-03-29 20:55:49 -07:00
|
|
|
font-size: 1.5em;
|
|
|
|
margin: 0.25em;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|