api-client/components/collections/request.vue

60 lines
1.3 KiB
Vue
Raw Normal View History

2019-10-01 22:20:23 +00:00
<template>
2019-10-25 08:14:34 +00:00
<div class="flex-wrap">
<div>
<button class="icon" @click="selectRequest()" v-tooltip="'Use request'">
<i class="material-icons">insert_drive_file</i>
2019-11-12 04:52:50 +00:00
<span>{{ request.name }}</span>
2019-10-25 08:14:34 +00:00
</button>
2019-10-01 22:20:23 +00:00
</div>
2019-10-25 08:14:34 +00:00
<div>
<button class="icon" @click="removeRequest" v-tooltip="'Delete request'">
<i class="material-icons">delete</i>
</button>
2019-11-12 04:52:50 +00:00
<button
class="icon"
@click="$emit('edit-request')"
v-tooltip="'Edit request'"
>
2019-10-25 08:14:34 +00:00
<i class="material-icons">edit</i>
</button>
</div>
</div>
2019-10-01 22:20:23 +00:00
</template>
2019-10-17 15:23:26 +00:00
<style scoped>
2019-11-02 05:32:21 +00:00
ul {
display: flex;
flex-direction: column;
}
2019-10-22 12:02:26 +00:00
2019-11-02 05:32:21 +00:00
ul li {
display: flex;
padding-left: 16px;
border-left: 1px solid var(--brd-color);
}
2019-10-17 15:23:26 +00:00
</style>
2019-10-01 22:20:23 +00:00
<script>
2019-11-02 05:32:21 +00:00
export default {
props: {
request: Object,
collectionIndex: Number,
folderIndex: Number,
requestIndex: Number
},
methods: {
selectRequest() {
this.$store.commit("postwoman/selectRequest", { request: this.request });
2019-10-01 22:20:23 +00:00
},
2019-11-02 05:32:21 +00:00
removeRequest() {
if (!confirm("Are you sure you want to remove this request?")) return;
this.$store.commit("postwoman/removeRequest", {
collectionIndex: this.collectionIndex,
folderIndex: this.folderIndex,
requestIndex: this.requestIndex
});
2019-10-25 08:14:34 +00:00
}
2019-11-02 05:32:21 +00:00
}
};
2019-10-22 09:13:54 +00:00
</script>