AdSense 대시보드 헤더 정리
This commit is contained in:
@@ -80,9 +80,7 @@ const createEmptyAdsenseBalance = () => ({
|
||||
})
|
||||
|
||||
const {
|
||||
data: adsenseSummary,
|
||||
pending: isAdsenseLoading,
|
||||
refresh: refreshAdsenseSummary
|
||||
data: adsenseSummary
|
||||
} = await useFetch('/admin/api/adsense/summary', {
|
||||
server: false,
|
||||
default: () => ({
|
||||
@@ -189,16 +187,6 @@ const chartPagination = computed(() => {
|
||||
const adsenseCards = computed(() => adsenseSummary.value.periods || [])
|
||||
const adsenseBalance = computed(() => adsenseSummary.value.balance || createEmptyAdsenseBalance())
|
||||
|
||||
const adsenseGeneratedLabel = computed(() => {
|
||||
const value = adsenseSummary.value?.generatedAt
|
||||
|
||||
if (!value) {
|
||||
return ''
|
||||
}
|
||||
|
||||
return formatCompactDateTime(value)
|
||||
})
|
||||
|
||||
/**
|
||||
* AdSense 통화 코드를 표시 가능한 값으로 보정한다.
|
||||
* @returns {string} 통화 코드
|
||||
@@ -553,29 +541,6 @@ const formatCompactDate = (value) => {
|
||||
return `${year}.${month}.${day}`
|
||||
}
|
||||
|
||||
/**
|
||||
* 통계 갱신 시각을 짧은 문자열로 변환한다.
|
||||
* @param {string | null | undefined} value - ISO 날짜
|
||||
* @returns {string} 표시 날짜와 시간
|
||||
*/
|
||||
const formatCompactDateTime = (value) => {
|
||||
if (!value) {
|
||||
return '-'
|
||||
}
|
||||
|
||||
const date = new Date(value)
|
||||
if (Number.isNaN(date.getTime())) {
|
||||
return '-'
|
||||
}
|
||||
|
||||
const year = date.getFullYear()
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(date.getDate()).padStart(2, '0')
|
||||
const hours = String(date.getHours()).padStart(2, '0')
|
||||
const minutes = String(date.getMinutes()).padStart(2, '0')
|
||||
return `${year}.${month}.${day} ${hours}:${minutes}`
|
||||
}
|
||||
|
||||
/**
|
||||
* 스크롤 도달 지표를 짧은 문자열로 반환한다.
|
||||
* @param {Object} row - 통계 행
|
||||
@@ -691,27 +656,7 @@ watch(trendRows, () => {
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<section class="admin-dashboard__adsense border border-line bg-white p-4">
|
||||
<div class="admin-dashboard__adsense-header flex flex-wrap items-center justify-between gap-3">
|
||||
<div>
|
||||
<h2 class="admin-dashboard__section-title text-sm font-semibold text-ink">
|
||||
AdSense
|
||||
</h2>
|
||||
<p class="admin-dashboard__section-description mt-1 text-xs text-muted">
|
||||
예상 수입
|
||||
<span v-if="adsenseGeneratedLabel">· {{ adsenseGeneratedLabel }} 갱신</span>
|
||||
</p>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
class="admin-dashboard__adsense-refresh border border-line bg-white px-3 py-1 text-xs font-medium text-muted transition hover:bg-paper hover:text-ink disabled:cursor-not-allowed disabled:opacity-50"
|
||||
:disabled="isAdsenseLoading"
|
||||
@click="refreshAdsenseSummary"
|
||||
>
|
||||
{{ isAdsenseLoading ? '갱신 중' : '새로고침' }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<section class="admin-dashboard__adsense">
|
||||
<p
|
||||
v-if="adsenseSummary.configured && !adsenseSummary.ok"
|
||||
class="admin-dashboard__adsense-message mt-3 border border-red-100 bg-red-50 px-3 py-2 text-xs text-red-700"
|
||||
@@ -719,7 +664,7 @@ watch(trendRows, () => {
|
||||
{{ adsenseSummary.message || 'AdSense 통계를 불러오지 못했습니다.' }}
|
||||
</p>
|
||||
|
||||
<div class="admin-dashboard__adsense-layout mt-3 grid gap-3 xl:grid-cols-[minmax(0,5fr)_minmax(220px,1fr)]">
|
||||
<div class="admin-dashboard__adsense-layout grid gap-3 xl:grid-cols-[minmax(0,5fr)_minmax(220px,1fr)]">
|
||||
<div class="admin-dashboard__adsense-earnings bg-[#2f6cc4] p-4 text-white shadow-sm">
|
||||
<h3 class="text-sm font-semibold">
|
||||
예상 수입
|
||||
|
||||
Reference in New Issue
Block a user