feat(admin-web): surface monitoring platform authorization status
Dashboard and question-detail views now read platform_authorization_status from the API. Tracking disables collect-now when the account has no desktop client, no authorized platforms, or the selected platform is unauthorized, and keeps the six-platform matrix stable; question-detail replaces tabs and cards with an explicit unavailable notice when the account is not authorized for monitoring. Adds the shared type and en/zh strings covering each status. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -65,6 +65,21 @@ const detailQuery = useQuery({
|
||||
|
||||
const activePlatformId = ref("");
|
||||
const detailPlatforms = computed<MonitoringQuestionDetailPlatform[]>(() => detailQuery.data.value?.platforms ?? []);
|
||||
const hasNoDetailPlatforms = computed(() => {
|
||||
return Boolean(detailQuery.data.value) && detailPlatforms.value.length === 0;
|
||||
});
|
||||
const shouldShowDetailUnavailableNotice = computed(() => {
|
||||
return hasNoDetailPlatforms.value;
|
||||
});
|
||||
const detailUnavailableNoticeType = computed<"warning" | "info">(() => {
|
||||
return "info";
|
||||
});
|
||||
const detailUnavailableNoticeTitle = computed(() => {
|
||||
return requestedPlatformId.value ? t("tracking.selectedPlatformUnauthorizedTitle") : t("tracking.noDetailPlatformsTitle");
|
||||
});
|
||||
const detailUnavailableNoticeDescription = computed(() => {
|
||||
return requestedPlatformId.value ? t("tracking.selectedPlatformUnauthorizedDescription") : t("tracking.noDetailPlatformsDescription");
|
||||
});
|
||||
const detailCitationAnalysis = computed<MonitoringQuestionCitationAnalysisItem[]>(() => detailQuery.data.value?.citation_analysis ?? []);
|
||||
const citationSourcesScrollRef = ref<HTMLElement | null>(null);
|
||||
const highlightedCitationIndex = ref<number | null>(null);
|
||||
@@ -919,7 +934,19 @@ const contentCitationColumns = computed(() => [
|
||||
|
||||
<a-spin :spinning="detailQuery.isLoading.value">
|
||||
<div class="tracking-question-page__content">
|
||||
<div class="tracking-question-page__tabs-wrapper">
|
||||
<a-alert
|
||||
v-if="shouldShowDetailUnavailableNotice"
|
||||
:type="detailUnavailableNoticeType"
|
||||
show-icon
|
||||
:message="detailUnavailableNoticeTitle"
|
||||
:description="detailUnavailableNoticeDescription"
|
||||
class="tracking-question-page__alert"
|
||||
/>
|
||||
|
||||
<div
|
||||
v-if="!shouldShowDetailUnavailableNotice"
|
||||
class="tracking-question-page__tabs-wrapper"
|
||||
>
|
||||
<a-tabs
|
||||
v-model:activeKey="activePlatformId"
|
||||
size="large"
|
||||
@@ -938,7 +965,10 @@ const contentCitationColumns = computed(() => [
|
||||
</a-tabs>
|
||||
</div>
|
||||
|
||||
<div class="tracking-question-grid">
|
||||
<div
|
||||
v-if="!shouldShowDetailUnavailableNotice"
|
||||
class="tracking-question-grid"
|
||||
>
|
||||
<section class="tracking-question-card tracking-question-card--answer">
|
||||
<div class="tracking-question-card__header">
|
||||
<div class="tracking-question-card__section-title">
|
||||
@@ -1035,7 +1065,7 @@ const contentCitationColumns = computed(() => [
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tracking-question-card__scroll-area custom-scrollbar" style="margin: 0; padding: 0;">
|
||||
<div class="tracking-question-card__scroll-area custom-scrollbar tracking-question-table-wrap">
|
||||
<a-table
|
||||
v-if="activeCitationAnalysis.length"
|
||||
row-key="site_key"
|
||||
@@ -1065,7 +1095,7 @@ const contentCitationColumns = computed(() => [
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
<a-empty v-else :description="t('tracking.noCitationAnalysis')" style="margin-top: 40px;" />
|
||||
<a-empty v-else :description="t('tracking.noCitationAnalysis')" class="tracking-question-empty" />
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -1078,7 +1108,7 @@ const contentCitationColumns = computed(() => [
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tracking-question-card__scroll-area custom-scrollbar" style="margin: 0; padding: 0;">
|
||||
<div class="tracking-question-card__scroll-area custom-scrollbar tracking-question-table-wrap">
|
||||
<a-table
|
||||
row-key="key"
|
||||
class="modern-table"
|
||||
@@ -1311,6 +1341,15 @@ const contentCitationColumns = computed(() => [
|
||||
padding-right: 12px;
|
||||
}
|
||||
|
||||
.tracking-question-table-wrap {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.tracking-question-empty {
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
.tracking-question-answer__headline {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
Reference in New Issue
Block a user