wip: clip
This commit is contained in:
parent
ea33d61a90
commit
d53c55ecb5
15 changed files with 699 additions and 11 deletions
|
@ -6,7 +6,7 @@
|
|||
<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" @created="onAntennaDeleted"/>
|
||||
<XAntenna v-for="(antenna, i) in items" :key="antenna.id" :antenna="antenna" @deleted="onAntennaDeleted"/>
|
||||
</MkPagination>
|
||||
</div>
|
||||
</div>
|
||||
|
|
78
src/client/pages/my-clips/index.vue
Normal file
78
src/client/pages/my-clips/index.vue
Normal file
|
@ -0,0 +1,78 @@
|
|||
<template>
|
||||
<div class="_section">
|
||||
<MkButton @click="create" primary class="add"><Fa :icon="faPlus"/> {{ $t('add') }}</MkButton>
|
||||
|
||||
<div class="_content">
|
||||
<MkPagination :pagination="pagination" #default="{items}" ref="list">
|
||||
<MkA v-for="item in items" :key="item.id" :to="`/clips/${item.id}`">{{ item.name }}</MkA>
|
||||
</MkPagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { faPlus, faPaperclip } from '@fortawesome/free-solid-svg-icons';
|
||||
import MkPagination from '@/components/ui/pagination.vue';
|
||||
import MkButton from '@/components/ui/button.vue';
|
||||
import * as os from '@/os';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
MkPagination,
|
||||
MkButton,
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
INFO: {
|
||||
title: this.$t('clip'),
|
||||
icon: faPaperclip,
|
||||
action: {
|
||||
icon: faPlus,
|
||||
handler: this.create
|
||||
}
|
||||
},
|
||||
pagination: {
|
||||
endpoint: 'clips/list',
|
||||
limit: 10,
|
||||
},
|
||||
draft: null,
|
||||
faPlus
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
async create() {
|
||||
const { canceled, result } = await os.form(this.$t('createNewClip'), {
|
||||
name: {
|
||||
type: 'string',
|
||||
label: this.$t('name')
|
||||
},
|
||||
description: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
multiline: true,
|
||||
label: this.$t('description')
|
||||
},
|
||||
isPublic: {
|
||||
type: 'boolean',
|
||||
label: this.$t('public')
|
||||
}
|
||||
});
|
||||
if (canceled) return;
|
||||
|
||||
os.apiWithDialog('clips/create', result);
|
||||
},
|
||||
|
||||
onClipCreated() {
|
||||
this.$refs.list.reload();
|
||||
this.draft = null;
|
||||
},
|
||||
|
||||
onClipDeleted() {
|
||||
this.$refs.list.reload();
|
||||
},
|
||||
}
|
||||
});
|
||||
</script>
|
|
@ -162,7 +162,7 @@ export default defineComponent({
|
|||
dialogCancelByBgClick: true,
|
||||
dialogInput: false,
|
||||
dialogResult: null,
|
||||
formTitle: null,
|
||||
formTitle: 'Test form',
|
||||
formForm: JSON.stringify({
|
||||
foo: {
|
||||
type: 'boolean',
|
||||
|
@ -179,6 +179,12 @@ export default defineComponent({
|
|||
default: 'Misskey makes you happy.',
|
||||
label: 'This is a string property'
|
||||
},
|
||||
qux: {
|
||||
type: 'string',
|
||||
multiline: true,
|
||||
default: 'Misskey makes\nyou happy.',
|
||||
label: 'Multiline string'
|
||||
},
|
||||
}, null, '\t'),
|
||||
formResult: null,
|
||||
mfm: '',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue