2023-07-27 05:31:52 +00:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2020-07-11 01:13:11 +00:00
|
|
|
<template>
|
2023-11-10 08:49:09 +00:00
|
|
|
<XColumn :menu="menu" :column="column" :isStacked="isStacked" :refresher="() => timeline.reloadTimeline()">
|
2020-07-11 01:13:11 +00:00
|
|
|
<template #header>
|
2022-12-19 10:01:30 +00:00
|
|
|
<i class="ti ti-antenna"></i><span style="margin-left: 8px;">{{ column.name }}</span>
|
2020-07-11 01:13:11 +00:00
|
|
|
</template>
|
|
|
|
|
2023-05-29 08:24:46 +00:00
|
|
|
<MkTimeline v-if="column.antennaId" ref="timeline" src="antenna" :antenna="column.antennaId"/>
|
2020-10-17 11:12:00 +00:00
|
|
|
</XColumn>
|
2020-07-11 01:13:11 +00:00
|
|
|
</template>
|
|
|
|
|
2022-03-20 18:11:14 +00:00
|
|
|
<script lang="ts" setup>
|
2023-12-07 05:42:09 +00:00
|
|
|
import { onMounted, shallowRef } from 'vue';
|
2020-07-11 01:13:11 +00:00
|
|
|
import XColumn from './column.vue';
|
2023-09-19 07:37:43 +00:00
|
|
|
import { updateColumn, Column } from './deck-store.js';
|
2023-02-22 02:00:34 +00:00
|
|
|
import MkTimeline from '@/components/MkTimeline.vue';
|
2023-09-19 07:37:43 +00:00
|
|
|
import * as os from '@/os.js';
|
2024-01-04 09:32:46 +00:00
|
|
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
2023-09-19 07:37:43 +00:00
|
|
|
import { i18n } from '@/i18n.js';
|
2020-07-11 01:13:11 +00:00
|
|
|
|
2022-03-20 18:11:14 +00:00
|
|
|
const props = defineProps<{
|
|
|
|
column: Column;
|
|
|
|
isStacked: boolean;
|
|
|
|
}>();
|
2020-07-11 01:13:11 +00:00
|
|
|
|
2023-12-07 05:42:09 +00:00
|
|
|
const timeline = shallowRef<InstanceType<typeof MkTimeline>>();
|
2020-07-11 01:13:11 +00:00
|
|
|
|
2022-03-20 18:11:14 +00:00
|
|
|
onMounted(() => {
|
|
|
|
if (props.column.antennaId == null) {
|
|
|
|
setAntenna();
|
2020-07-11 01:13:11 +00:00
|
|
|
}
|
|
|
|
});
|
2022-03-20 18:11:14 +00:00
|
|
|
|
|
|
|
async function setAntenna() {
|
2024-01-04 09:32:46 +00:00
|
|
|
const antennas = await misskeyApi('antennas/list');
|
2022-03-20 18:11:14 +00:00
|
|
|
const { canceled, result: antenna } = await os.select({
|
|
|
|
title: i18n.ts.selectAntenna,
|
|
|
|
items: antennas.map(x => ({
|
2022-07-16 20:33:21 +00:00
|
|
|
value: x, text: x.name,
|
2022-03-20 18:11:14 +00:00
|
|
|
})),
|
2022-07-16 20:33:21 +00:00
|
|
|
default: props.column.antennaId,
|
2022-03-20 18:11:14 +00:00
|
|
|
});
|
|
|
|
if (canceled) return;
|
|
|
|
updateColumn(props.column.id, {
|
2022-07-16 20:33:21 +00:00
|
|
|
antennaId: antenna.id,
|
2022-03-20 18:11:14 +00:00
|
|
|
});
|
|
|
|
}
|
2022-07-16 20:33:21 +00:00
|
|
|
|
2023-07-05 04:04:27 +00:00
|
|
|
function editAntenna() {
|
|
|
|
os.pageWindow('my/antennas/' + props.column.antennaId);
|
|
|
|
}
|
|
|
|
|
|
|
|
const menu = [
|
|
|
|
{
|
|
|
|
icon: 'ti ti-pencil',
|
|
|
|
text: i18n.ts.selectAntenna,
|
|
|
|
action: setAntenna,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
icon: 'ti ti-settings',
|
|
|
|
text: i18n.ts.editAntenna,
|
|
|
|
action: editAntenna,
|
|
|
|
},
|
|
|
|
];
|
2022-07-16 20:33:21 +00:00
|
|
|
|
2022-03-20 18:11:14 +00:00
|
|
|
/*
|
|
|
|
function focus() {
|
|
|
|
timeline.focus();
|
|
|
|
}
|
|
|
|
|
|
|
|
defineExpose({
|
|
|
|
focus,
|
|
|
|
});
|
|
|
|
*/
|
2020-07-11 01:13:11 +00:00
|
|
|
</script>
|