improve menu
This commit is contained in:
parent
b4fc96ca5b
commit
e814f3d740
3 changed files with 85 additions and 35 deletions
|
@ -82,9 +82,7 @@ const hide = ref((defaultStore.state.nsfw === 'force' || defaultStore.state.data
|
|||
const menuShowing = ref(false);
|
||||
|
||||
function showMenu(ev: MouseEvent) {
|
||||
let menu: MenuItem[] = [];
|
||||
|
||||
menu = [
|
||||
const menu: MenuItem[] = [
|
||||
// TODO: 再生キューに追加
|
||||
{
|
||||
text: i18n.ts.hide,
|
||||
|
@ -95,6 +93,12 @@ function showMenu(ev: MouseEvent) {
|
|||
},
|
||||
];
|
||||
|
||||
if ($i?.id === props.audio.userId || iAmModerator) {
|
||||
menu.push({
|
||||
type: 'divider',
|
||||
});
|
||||
}
|
||||
|
||||
if (iAmModerator) {
|
||||
menu.push({
|
||||
text: props.audio.isSensitive ? i18n.ts.unmarkAsSensitive : i18n.ts.markAsSensitive,
|
||||
|
@ -102,12 +106,19 @@ function showMenu(ev: MouseEvent) {
|
|||
danger: true,
|
||||
action: () => toggleSensitive(props.audio),
|
||||
});
|
||||
|
||||
if ($i?.id !== props.audio.userId) {
|
||||
menu.push({
|
||||
type: 'link' as const,
|
||||
text: i18n.ts._fileViewer.title,
|
||||
icon: 'ti ti-info-circle',
|
||||
to: `/admin/file/${props.audio.id}`,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if ($i?.id === props.audio.userId) {
|
||||
menu.push({
|
||||
type: 'divider',
|
||||
}, {
|
||||
type: 'link' as const,
|
||||
text: i18n.ts._fileViewer.title,
|
||||
icon: 'ti ti-info-circle',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue