fix(navbar): indicate control panel on mobile
This commit is contained in:
parent
e0b77913f3
commit
da2b4932ed
1 changed files with 15 additions and 1 deletions
|
@ -29,6 +29,9 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<div :class="$style.divider"></div>
|
<div :class="$style.divider"></div>
|
||||||
<MkA v-if="iAmModerator" :class="$style.item" :activeClass="$style.active" to="/admin">
|
<MkA v-if="iAmModerator" :class="$style.item" :activeClass="$style.active" to="/admin">
|
||||||
<i :class="$style.itemIcon" class="ti ti-dashboard ti-fw"></i><span :class="$style.itemText">{{ i18n.ts.controlPanel }}</span>
|
<i :class="$style.itemIcon" class="ti ti-dashboard ti-fw"></i><span :class="$style.itemText">{{ i18n.ts.controlPanel }}</span>
|
||||||
|
<span v-if="unresolvedReportAvailable" :class="$style.itemIndicator">
|
||||||
|
<i class="_indicatorCircle"></i>
|
||||||
|
</span>
|
||||||
</MkA>
|
</MkA>
|
||||||
<button :class="$style.item" class="_button" @click="more">
|
<button :class="$style.item" class="_button" @click="more">
|
||||||
<i :class="$style.itemIcon" class="ti ti-grid-dots ti-fw"></i><span :class="$style.itemText">{{ i18n.ts.more }}</span>
|
<i :class="$style.itemIcon" class="ti ti-grid-dots ti-fw"></i><span :class="$style.itemText">{{ i18n.ts.more }}</span>
|
||||||
|
@ -50,7 +53,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, defineAsyncComponent, toRef } from 'vue';
|
import {computed, defineAsyncComponent, ref, toRef} from 'vue';
|
||||||
import { openInstanceMenu } from './common.js';
|
import { openInstanceMenu } from './common.js';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
import { navbarItemDef } from '@/navbar.js';
|
import { navbarItemDef } from '@/navbar.js';
|
||||||
|
@ -59,8 +62,10 @@ import { defaultStore } from '@/store.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { instance } from '@/instance.js';
|
import { instance } from '@/instance.js';
|
||||||
import { miLocalStorage } from "@/local-storage.js";
|
import { miLocalStorage } from "@/local-storage.js";
|
||||||
|
import { misskeyApi } from "@/scripts/misskey-api.js";
|
||||||
|
|
||||||
const menu = toRef(defaultStore.state, 'menu');
|
const menu = toRef(defaultStore.state, 'menu');
|
||||||
|
const unresolvedReportAvailable = ref<boolean>(false);
|
||||||
const otherMenuItemIndicated = computed(() => {
|
const otherMenuItemIndicated = computed(() => {
|
||||||
for (const def in navbarItemDef) {
|
for (const def in navbarItemDef) {
|
||||||
if (menu.value.includes(def)) continue;
|
if (menu.value.includes(def)) continue;
|
||||||
|
@ -69,6 +74,15 @@ const otherMenuItemIndicated = computed(() => {
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (iAmModerator) {
|
||||||
|
misskeyApi('admin/abuse-user-reports', {
|
||||||
|
state: 'unresolved',
|
||||||
|
limit: 1,
|
||||||
|
}).then(reports => {
|
||||||
|
if (reports.length > 0) unresolvedReportAvailable.value = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function openAccountMenu(ev: MouseEvent) {
|
function openAccountMenu(ev: MouseEvent) {
|
||||||
openAccountMenu_({
|
openAccountMenu_({
|
||||||
withExtraOperation: true,
|
withExtraOperation: true,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue