show documentation in the iframe by default

This commit is contained in:
MaysWind
2026-01-02 00:10:08 +08:00
parent ee7e98bb00
commit c276f261f9
19 changed files with 79 additions and 3 deletions
+1
View File
@@ -2461,6 +2461,7 @@
"Official Website": "Offizielle Website",
"Report Issue": "Problem melden",
"Getting help": "Getting help",
"Documentation": "Documentation",
"License": "Lizenz",
"Are you sure you want to open this link?": "Are you sure you want to open this link?",
"An error occurred": "Ein Fehler ist aufgetreten",
+1
View File
@@ -2461,6 +2461,7 @@
"Official Website": "Official Website",
"Report Issue": "Report Issue",
"Getting help": "Getting help",
"Documentation": "Documentation",
"License": "License",
"Are you sure you want to open this link?": "Are you sure you want to open this link?",
"An error occurred": "An error occurred",
+1
View File
@@ -2461,6 +2461,7 @@
"Official Website": "Web Oficial",
"Report Issue": "Informar Problema",
"Getting help": "Obtener ayuda",
"Documentation": "Documentation",
"License": "Licencia",
"Are you sure you want to open this link?": "¿Seguro que quieres abrir este enlace?",
"An error occurred": "Se produjo un error",
+1
View File
@@ -2461,6 +2461,7 @@
"Official Website": "Site officiel",
"Report Issue": "Signaler un problème",
"Getting help": "Obtenir de l'aide",
"Documentation": "Documentation",
"License": "Licence",
"Are you sure you want to open this link?": "Are you sure you want to open this link?",
"An error occurred": "Une erreur s'est produite",
+1
View File
@@ -2461,6 +2461,7 @@
"Official Website": "Sito ufficiale",
"Report Issue": "Segnala problema",
"Getting help": "Ottenere aiuto",
"Documentation": "Documentation",
"License": "Licenza",
"Are you sure you want to open this link?": "Are you sure you want to open this link?",
"An error occurred": "Si è verificato un errore",
+1
View File
@@ -2461,6 +2461,7 @@
"Official Website": "公式ウェブサイト",
"Report Issue": "問題を報告",
"Getting help": "Getting help",
"Documentation": "Documentation",
"License": "ライセンス",
"Are you sure you want to open this link?": "Are you sure you want to open this link?",
"An error occurred": "エラーが発生しました",
+1
View File
@@ -2461,6 +2461,7 @@
"Official Website": "ಅಧಿಕೃತ ವೆಬ್‌ಸೈಟ್",
"Report Issue": "ಸಮಸ್ಯೆ ವರದಿ ಮಾಡಿ",
"Getting help": "ಸಹಾಯ ಪಡೆಯುವುದು",
"Documentation": "Documentation",
"License": "ಲೈಸೆನ್ಸ್",
"Are you sure you want to open this link?": "ಈ ಲಿಂಕ್ ತೆರೆಯಲು ನೀವು ಖಚಿತವೇ?",
"An error occurred": "ದೋಷ ಸಂಭವಿಸಿದೆ",
+1
View File
@@ -2461,6 +2461,7 @@
"Official Website": "공식 웹사이트",
"Report Issue": "문제 보고",
"Getting help": "도움 받기",
"Documentation": "Documentation",
"License": "라이선스",
"Are you sure you want to open this link?": "Are you sure you want to open this link?",
"An error occurred": "오류가 발생했습니다.",
+1
View File
@@ -2461,6 +2461,7 @@
"Official Website": "Officiële website",
"Report Issue": "Probleem melden",
"Getting help": "Hulp krijgen",
"Documentation": "Documentation",
"License": "Licentie",
"Are you sure you want to open this link?": "Are you sure you want to open this link?",
"An error occurred": "Er is een fout opgetreden",
+1
View File
@@ -2461,6 +2461,7 @@
"Official Website": "Site oficial",
"Report Issue": "Relatar problema",
"Getting help": "Obtendo ajuda",
"Documentation": "Documentation",
"License": "Licença",
"Are you sure you want to open this link?": "Are you sure you want to open this link?",
"An error occurred": "Ocorreu um erro",
+1
View File
@@ -2461,6 +2461,7 @@
"Official Website": "Официальный сайт",
"Report Issue": "Сообщить о проблеме",
"Getting help": "Getting help",
"Documentation": "Documentation",
"License": "Лицензия",
"Are you sure you want to open this link?": "Are you sure you want to open this link?",
"An error occurred": "Произошла ошибка",
+1
View File
@@ -2461,6 +2461,7 @@
"Official Website": "Uradna spletna stran",
"Report Issue": "Prijavi težavo",
"Getting help": "Pomoč",
"Documentation": "Documentation",
"License": "Licenca",
"Are you sure you want to open this link?": "Ali ste prepričani, da želite odpreti to povezavo?",
"An error occurred": "Prišlo je do napake",
+1
View File
@@ -2461,6 +2461,7 @@
"Official Website": "เว็บไซต์ทางการ",
"Report Issue": "รายงานปัญหา",
"Getting help": "ขอความช่วยเหลือ",
"Documentation": "Documentation",
"License": "สิทธิ์การใช้งาน",
"Are you sure you want to open this link?": "Are you sure you want to open this link?",
"An error occurred": "เกิดข้อผิดพลาด",
+1
View File
@@ -2461,6 +2461,7 @@
"Official Website": "Resmi Web Sitesi",
"Report Issue": "Sorun Bildir",
"Getting help": "Yardım Al",
"Documentation": "Documentation",
"License": "Lisans",
"Are you sure you want to open this link?": "Bu bağlantıyı açmak istediğinize emin misiniz?",
"An error occurred": "Bir hata oluştu",
+1
View File
@@ -2461,6 +2461,7 @@
"Official Website": "Офіційний сайт",
"Report Issue": "Повідомити про проблему",
"Getting help": "Getting help",
"Documentation": "Documentation",
"License": "Ліцензія",
"Are you sure you want to open this link?": "Are you sure you want to open this link?",
"An error occurred": "Сталася помилка",
+1
View File
@@ -2461,6 +2461,7 @@
"Official Website": "Trang web chính thức",
"Report Issue": "Báo cáo sự cố",
"Getting help": "Getting help",
"Documentation": "Documentation",
"License": "Giấy phép",
"Are you sure you want to open this link?": "Are you sure you want to open this link?",
"An error occurred": "Đã xảy ra lỗi",
+1
View File
@@ -2461,6 +2461,7 @@
"Official Website": "官方网站",
"Report Issue": "报告问题",
"Getting help": "获取帮助",
"Documentation": "文档",
"License": "许可协议",
"Are you sure you want to open this link?": "您确定要打开该链接?",
"An error occurred": "发生错误",
+1
View File
@@ -2461,6 +2461,7 @@
"Official Website": "官方網站",
"Report Issue": "回報問題",
"Getting help": "取得協助",
"Documentation": "文件",
"License": "授權條款",
"Are you sure you want to open this link?": "您確定要開啟此連結?",
"An error occurred": "發生錯誤",
+61 -3
View File
@@ -16,7 +16,7 @@
<f7-list-item :title="tt('Build Time')" :after="clientBuildTime" v-if="clientBuildTime"></f7-list-item>
<f7-list-item :title="tt('Official Website')" link="#" @click="openExternalUrl('https://github.com/mayswind/ezbookkeeping')"></f7-list-item>
<f7-list-item :title="tt('Report Issue')" link="#" @click="openExternalUrl('https://github.com/mayswind/ezbookkeeping/issues')"></f7-list-item>
<f7-list-item :title="tt('Getting help')" link="#" @click="openExternalUrl('https://ezbookkeeping.mayswind.net')"></f7-list-item>
<f7-list-item :title="tt('Getting help')" link="#" popup-open=".document-popup"></f7-list-item>
<f7-list-item :title="tt('License')" link="#" popup-open=".license-popup"></f7-list-item>
</f7-list>
@@ -118,6 +118,23 @@
</f7-page>
</f7-popup>
<f7-popup push swipe-to-close swipe-handler=".swipe-handler" class="document-popup" @popup:open="onDocumentPopupOpen">
<f7-page>
<f7-navbar>
<div class="swipe-handler"></div>
<f7-nav-left>
<f7-link popup-close icon-f7="xmark"></f7-link>
</f7-nav-left>
<f7-nav-title class="license-title">{{ tt('Documentation') }}</f7-nav-title>
<f7-nav-right class="navbar-compact-icons">
<f7-link icon-f7="globe" @click="openExternalUrl(documentIframe?.src || documentUrl)"></f7-link>
</f7-nav-right>
</f7-navbar>
<iframe ref="documentIframe" class="document-iframe" src="about:blank" :style="documentLoading ? 'display: none' : ''"></iframe>
<f7-preloader class="document-preloader" size="36" v-if="documentLoading"></f7-preloader>
</f7-page>
</f7-popup>
<f7-actions close-by-outside-click close-on-escape :opened="showRefreshBrowserCacheSheet" @actions:closed="showRefreshBrowserCacheSheet = false">
<f7-actions-group>
<f7-actions-button @click="refreshBrowserCache">{{ tt('Refresh Browser Cache') }}</f7-actions-button>
@@ -130,14 +147,14 @@
</template>
<script setup lang="ts">
import { ref, computed } from 'vue';
import { ref, computed, useTemplateRef, onMounted } from 'vue';
import type { LanguageOption } from '@/locales/index.ts';
import { useI18n } from '@/locales/helpers.ts';
import { useI18nUIComponents } from '@/lib/ui/mobile.ts';
import { useAboutPageBase } from '@/views/base/AboutPageBase.ts';
const { tt, getAllLanguageOptions } = useI18n();
const { tt, getCurrentLanguageTag, getAllLanguageOptions } = useI18n();
const { showAlert, openExternalUrl } = useI18nUIComponents();
const {
clientVersion,
@@ -155,12 +172,23 @@ const {
init
} = useAboutPageBase();
const documentIframe = useTemplateRef<HTMLIFrameElement>('documentIframe');
const showRefreshBrowserCacheSheet = ref<boolean>(false);
const versionClickCount = ref<number>(0);
const documentLoading = ref<boolean>(true);
const allLanguages = computed<LanguageOption[]>(() => getAllLanguageOptions(false));
const forceShowRefreshBrowserCacheMenu = computed<boolean>(() => versionClickCount.value >= 5);
const documentUrl = computed<string>(() => {
if (getCurrentLanguageTag() === 'zh-Hans' || getCurrentLanguageTag() === 'zh-Hant') {
return 'https://ezbookkeeping.mayswind.net/zh_Hans/faq/';
} else {
return 'https://ezbookkeeping.mayswind.net/faq/';
}
});
function showVersion(): void {
let versionMessage = `${tt('Frontend Version')}: ${clientVersion}`;
@@ -175,6 +203,23 @@ function showVersion(): void {
}
}
function onDocumentPopupOpen(): void {
documentLoading.value = true;
if (documentIframe.value) {
documentIframe.value.src = documentUrl.value;
}
}
onMounted(() => {
if (documentIframe.value) {
documentIframe.value.onload = () => {
documentLoading.value = false;
documentIframe.value?.contentWindow?.scrollTo(0, 0);
};
}
});
init();
</script>
@@ -188,6 +233,19 @@ init();
font-size: var(--ebk-license-content-font-size);
}
.document-iframe {
width: 100%;
height: 100%;
border: none;
}
.document-preloader {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.contributors-table {
border-collapse: collapse;