Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(frontend/admin/ads): 広告のIDを確認できるように #921

Merged
merged 3 commits into from
Feb 1, 2025
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions packages/frontend/src/pages/admin/ads.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ SPDX-License-Identifier: AGPL-3.0-only
<div>
<div v-for="ad in ads" class="_panel _gaps_m" :class="$style.ad">
<MkAd v-if="ad.url" :key="ad.id" :specify="ad"/>
<div v-if="ad.id !== '' && ad.id " class="_gaps_s">
<MkInput v-model="ad.id" :readonly="true">
<template #label>ID</template>
</MkInput>
<MkButton @click="copyAdId(ad.id)">
<i class="ti ti-clipboard"></i>
{{ i18n.ts.copy }}
</MkButton>
</div>
<MkInput v-model="ad.url" type="url">
<template #label>URL</template>
</MkInput>
Expand Down Expand Up @@ -100,6 +109,7 @@ import * as os from '@/os.js';
import { misskeyApi } from '@/scripts/misskey-api.js';
import { i18n } from '@/i18n.js';
import { definePageMetadata } from '@/scripts/page-metadata.js';
import copyToClipboard from '@/scripts/copy-to-clipboard.js';

const ads = ref<Misskey.entities.Ad[]>([]);

Expand Down Expand Up @@ -245,6 +255,11 @@ function refresh() {
});
}

function copyAdId(id) {
copyToClipboard(id);
os.success();
}

refresh();

const headerActions = computed(() => [{
Expand Down
Loading