|
| 1 | +<template> |
| 2 | + <div id="file-system"> |
| 3 | + <source-modal v-show="sourceActive === true" :saveMessage="fileStatus" @close="closeSourceModal"> |
| 4 | + <template v-slot:header> |
| 5 | + <!-- The code below goes into the header slot --> |
| 6 | + <button |
| 7 | + type="button" |
| 8 | + class="btn-green" |
| 9 | + @click="closeSourceModal" |
| 10 | + aria-label="Close modal" |
| 11 | + > |
| 12 | + Close |
| 13 | + </button> |
| 14 | + </template> |
| 15 | + <template v-slot:source-file> |
| 16 | + <div class="package-form-item"> |
| 17 | + <label for="add-code-name">API address </label> |
| 18 | + <input type="text" id="mapping-base-address" placeholder="https://" required @change="apibaseSave" @input="apibaseSave" @paste="apibaseSave" @keyup="apibaseSave" v-model="formData.baseaddress" /> |
| 19 | + </div> |
| 20 | + </template> |
| 21 | + </source-modal> |
| 22 | + </div> |
| 23 | +</template> |
| 24 | + |
| 25 | +<script> |
| 26 | +import SourceModal from '@/components/source/sourceModal.vue' |
| 27 | +import axios from 'axios' |
| 28 | +
|
| 29 | +export default { |
| 30 | + name: 'fileupload-page', |
| 31 | + components: { |
| 32 | + SourceModal |
| 33 | + }, |
| 34 | + props: { |
| 35 | + sourceType: String, |
| 36 | + sourceActive: Boolean, |
| 37 | + saveMessage: Boolean |
| 38 | + }, |
| 39 | + created () { |
| 40 | + }, |
| 41 | + mounted () { |
| 42 | + }, |
| 43 | + computed: { |
| 44 | + fileStatus: function () { |
| 45 | + return this.$store.state.fileSaveStatus |
| 46 | + }, |
| 47 | + fileFeedback: function () { |
| 48 | + return this.$store.state.fileFeedback |
| 49 | + } |
| 50 | + }, |
| 51 | + data: () => ({ |
| 52 | + sourceButton: |
| 53 | + { |
| 54 | + active: false, |
| 55 | + text: 'sourcebutton' |
| 56 | + }, |
| 57 | + formData: |
| 58 | + { |
| 59 | + baseaddress: '' |
| 60 | + }, |
| 61 | + feedbackM: '' |
| 62 | + }), |
| 63 | + methods: { |
| 64 | + apibaseSave () { |
| 65 | + this.$store.dispatch('actionRESTSave', this.formData) |
| 66 | + }, |
| 67 | + getRemotefile () { |
| 68 | + this.sourceLocation = 'web' |
| 69 | + axios.get(this.readRemotefile) |
| 70 | + .then(function (response) { |
| 71 | + // handle success |
| 72 | + }) |
| 73 | + .catch(function (error) { |
| 74 | + // handle error |
| 75 | + console.log(error) |
| 76 | + }) |
| 77 | + .then(function () { |
| 78 | + // always executed |
| 79 | + }) |
| 80 | + }, |
| 81 | + closeSourceModal () { |
| 82 | + // clear the feedback on close |
| 83 | + // this.$store.dispatch('actionClearFileFeeback', 'clear') |
| 84 | + this.$emit('closeSModal') |
| 85 | + } |
| 86 | + } |
| 87 | +} |
| 88 | +</script> |
| 89 | + |
| 90 | +<style scoped> |
| 91 | +#file-system { |
| 92 | + display: grid; |
| 93 | + grid-template-columns: 1fr; |
| 94 | +} |
| 95 | +
|
| 96 | +#file-container { |
| 97 | + display: grid; |
| 98 | + grid-template-columns: 1fr; |
| 99 | +} |
| 100 | +
|
| 101 | +.file-section { |
| 102 | + display: grid; |
| 103 | + grid-template-columns: 1fr; |
| 104 | + margin-top: 1em; |
| 105 | +} |
| 106 | +
|
| 107 | +.file-section input { |
| 108 | + font-size: 1.2em; |
| 109 | + margin: 0 auto 1em auto; |
| 110 | +} |
| 111 | +
|
| 112 | +.file-section input.web-path-file { |
| 113 | + width: 20em; |
| 114 | +} |
| 115 | +
|
| 116 | +.file-select { |
| 117 | + font-size: 1.2em; |
| 118 | +} |
| 119 | +
|
| 120 | +#web-file-path input { |
| 121 | + width: 30em; |
| 122 | +} |
| 123 | +
|
| 124 | +#web-file-path button { |
| 125 | + width: 6em; |
| 126 | + margin: 0 auto 1em auto; |
| 127 | + font-size: 1.2em; |
| 128 | +} |
| 129 | +
|
| 130 | +.url-remote-file { |
| 131 | + font-size: 1.2em; |
| 132 | + margin: 0 auto 1em auto; |
| 133 | + width: 8em; |
| 134 | + font-size: 1.2em; |
| 135 | +} |
| 136 | +
|
| 137 | +form.file-info { |
| 138 | + font-size: 1.2em; |
| 139 | +} |
| 140 | +
|
| 141 | +.file-info-label { |
| 142 | + display: grid; |
| 143 | + grid-template-columns: 1fr 1fr; |
| 144 | + line-height: 1.4em; |
| 145 | + margin-bottom: .5em; |
| 146 | +} |
| 147 | +
|
| 148 | +.file-info-label label { |
| 149 | + justify-self: end; |
| 150 | + margin-right: 1em; |
| 151 | +} |
| 152 | +
|
| 153 | +.file-info-label input { |
| 154 | + width: 40%; |
| 155 | +} |
| 156 | +
|
| 157 | +.convert-button { |
| 158 | + margin: 1em; |
| 159 | + font-size: 1.2em; |
| 160 | +} |
| 161 | +
|
| 162 | +#summary-content { |
| 163 | + height: 100px; |
| 164 | + overflow: scroll; |
| 165 | + background-color: lightgrey; |
| 166 | +} |
| 167 | +
|
| 168 | +#feedback-save { |
| 169 | + display: grid; |
| 170 | + grid-template-columns: 1fr; |
| 171 | + border: 1px dashed orange; |
| 172 | + margin-bottom: 2em; |
| 173 | +} |
| 174 | +
|
| 175 | +#file-save-feedback { |
| 176 | + display: grid; |
| 177 | + grid-template-columns: 1fr; |
| 178 | +} |
| 179 | +
|
| 180 | +.file-feedback-info { |
| 181 | + padding-bottom: 1em; |
| 182 | +} |
| 183 | +
|
| 184 | +.file-feedback-summary { |
| 185 | + display: grid; |
| 186 | + grid-template-columns: 1fr 1fr; |
| 187 | + padding-bottom: 1em; |
| 188 | +} |
| 189 | +
|
| 190 | +.file-detail-info { |
| 191 | + justify-self: end; |
| 192 | + margin-right: 1em; |
| 193 | +} |
| 194 | +
|
| 195 | +.file-detail-data { |
| 196 | + justify-self: start; |
| 197 | + font-weight: bold; |
| 198 | +} |
| 199 | +
|
| 200 | +</style> |
0 commit comments