|
@@ -2,20 +2,42 @@
|
|
|
<v-container fluid>
|
|
|
<v-card class="ma-3 pa-3">
|
|
|
<v-card-title primary-title>
|
|
|
- <div class="headline primary--text">Test Celery</div>
|
|
|
+ <div class="headline primary--text">Message</div>
|
|
|
</v-card-title>
|
|
|
<v-card-text>
|
|
|
- <v-form v-model="valid" ref="form">
|
|
|
- <v-text-field @keyup.enter="submit" label="Message" v-model="msg" :rules="required" ></v-text-field>
|
|
|
+ <v-form v-model="validMsg" ref="msgForm">
|
|
|
+ <v-text-field @keyup.enter="msgSubmit" label="Message" v-model="msg" :rules="required" ></v-text-field>
|
|
|
</v-form>
|
|
|
</v-card-text>
|
|
|
<v-card-actions>
|
|
|
<v-spacer></v-spacer>
|
|
|
- <v-btn @click="submit" :disabled="!valid">
|
|
|
+ <v-btn @click="msgSubmit" :disabled="!validMsg">
|
|
|
Send
|
|
|
</v-btn>
|
|
|
</v-card-actions>
|
|
|
</v-card>
|
|
|
+ <v-card class="ma-3 pa-3">
|
|
|
+ <v-card-title primary-title>
|
|
|
+ <div class="headline primary--text">File</div>
|
|
|
+ </v-card-title>
|
|
|
+ <v-card-text>
|
|
|
+ <v-form v-model="validFile" ref="fileForm">
|
|
|
+ <v-file-input
|
|
|
+ v-model="zipFiles"
|
|
|
+ :rules="[v=>!v]"
|
|
|
+ accept=".zip"
|
|
|
+ label="File input"
|
|
|
+ prepend-icon="folder_zip"
|
|
|
+ ></v-file-input>
|
|
|
+ </v-form>
|
|
|
+ </v-card-text>
|
|
|
+ <v-card-actions>
|
|
|
+ <v-spacer></v-spacer>
|
|
|
+ <v-btn @click="fileSubmit" :disabled="!validFile">
|
|
|
+ Send
|
|
|
+ </v-btn>
|
|
|
+ </v-card-actions>
|
|
|
+ </v-card>
|
|
|
</v-container>
|
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
@@ -23,17 +45,30 @@ import { ref} from 'vue';
|
|
|
import { required } from '@/utils';
|
|
|
import { useAdminStore } from '@/stores/admin';
|
|
|
|
|
|
-const valid = ref(true);
|
|
|
+const validMsg = ref(true);
|
|
|
const msg = ref('');
|
|
|
-const form = ref(null);
|
|
|
+const msgForm = ref(null);
|
|
|
+
|
|
|
+const validFile = ref(true);
|
|
|
+const zipFiles = ref();
|
|
|
+const fileForm = ref();
|
|
|
+
|
|
|
|
|
|
const adminStore = useAdminStore();
|
|
|
|
|
|
-async function submit() {
|
|
|
- await (form as any).value.validate();
|
|
|
- if (valid.value) {
|
|
|
- await adminStore.actionTestCelery({msg:msg.value});
|
|
|
- (form as any).value.reset();
|
|
|
+async function msgSubmit() {
|
|
|
+ await (msgForm as any).value.validate();
|
|
|
+ if (validMsg.value) {
|
|
|
+ await adminStore.actionTestCeleryMsg({msg:msg.value});
|
|
|
+ (msgForm as any).value.reset();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+async function fileSubmit() {
|
|
|
+ await (fileForm as any).value.validate();
|
|
|
+ if (validFile.value) {
|
|
|
+ await adminStore.actionTestCeleryFile(zipFiles.value[0]);
|
|
|
+ (fileForm as any).value.reset();
|
|
|
}
|
|
|
}
|
|
|
</script>
|