mizzkey/src/client/pages/my-antennas/index.vue
syuilo 11349561d6
Use FontAwesome as web font instead of vue component (#7469)
* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update yarn.lock

* wip

* wip
2021-04-20 23:22:59 +09:00

83 lines
1.7 KiB
Vue

<template>
<div class="ieepwinx _section">
<MkButton @click="create" primary class="add"><i class="fas fa-plus"></i> {{ $ts.add }}</MkButton>
<div class="_content">
<XAntenna v-if="draft" :antenna="draft" @created="onAntennaCreated" style="margin-bottom: var(--margin);"/>
<MkPagination :pagination="pagination" #default="{items}" class="antennas" ref="list">
<XAntenna v-for="(antenna, i) in items" :key="antenna.id" :antenna="antenna" @deleted="onAntennaDeleted"/>
</MkPagination>
</div>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import MkPagination from '@client/components/ui/pagination.vue';
import MkButton from '@client/components/ui/button.vue';
import XAntenna from './index.antenna.vue';
import * as symbols from '@client/symbols';
export default defineComponent({
components: {
MkPagination,
MkButton,
XAntenna,
},
data() {
return {
[symbols.PAGE_INFO]: {
title: this.$ts.manageAntennas,
icon: 'fas fa-satellite',
action: {
icon: 'fas fa-plus',
handler: this.create
}
},
pagination: {
endpoint: 'antennas/list',
limit: 10,
},
draft: null,
};
},
methods: {
create() {
this.draft = {
name: '',
src: 'all',
userListId: null,
userGroupId: null,
users: [],
keywords: [],
excludeKeywords: [],
withReplies: false,
caseSensitive: false,
withFile: false,
notify: false
};
},
onAntennaCreated() {
this.$refs.list.reload();
this.draft = null;
},
onAntennaDeleted() {
this.$refs.list.reload();
},
}
});
</script>
<style lang="scss" scoped>
.ieepwinx {
> .add {
margin: 0 auto 16px auto;
}
}
</style>