| @@ -22,9 +22,9 @@ | ||
| 22 | 22 | translate |
| 23 | 23 | } from "@/utils/helpers"; |
| 24 | 24 | import {toast} from "vue3-toastify"; |
| 25 | 25 | |
| 26 | -const { fetchSettingsData, updateSettingsData, regenerateByPassCode } = | |
| 26 | +const { fetchSettingsData, updateSettingsData, regenerateByPassCode, clearCache } = | |
| 27 | 27 | useSettingsStore(); |
| 28 | 28 | |
| 29 | 29 | const { settingsData } = storeToRefs(useSettingsStore()); |
| 30 | 30 | const { |
| @@ -40,8 +40,10 @@ | ||
| 40 | 40 | const HOSTINGER_FREE_DOMAINS = /hostingersite\.com|hostinger\.dev/; |
| 41 | 41 | |
| 42 | 42 | const llmMasterToggle = ref(false); |
| 43 | 43 | |
| 44 | +const isClearingCache = ref(false); | |
| 45 | + | |
| 44 | 46 | const isLLMSSectionDisabled = computed( |
| 45 | 47 | () => isFreeDomain.value || !isHostingerPlatform.value |
| 46 | 48 | ); |
| 47 | 49 | |
| @@ -77,8 +79,25 @@ | ||
| 77 | 79 | : undefined |
| 78 | 80 | } |
| 79 | 81 | ]); |
| 80 | 82 | |
| 83 | +const isCacheSectionDisabled = computed(() => !isHostingerPlatform.value); | |
| 84 | + | |
| 85 | +const performanceSection = computed(() => [ | |
| 86 | + { | |
| 87 | + id: SECTION_ID.CLEAR_CACHE, | |
| 88 | + title: translate("hostinger_tools_clear_cache"), | |
| 89 | + description: translate("hostinger_tools_clear_cache_description"), | |
| 90 | + isVisible: true, | |
| 91 | + sideButton: { | |
| 92 | + text: translate("hostinger_tools_clear_cache_cta"), | |
| 93 | + isLoading: isClearingCache.value, | |
| 94 | + isDisabled: isCacheSectionDisabled.value, | |
| 95 | + onClick: onClearCache | |
| 96 | + } | |
| 97 | + } | |
| 98 | +]); | |
| 99 | + | |
| 81 | 100 | const securitySection = computed(() => |
| 82 | 101 | [ |
| 83 | 102 | { |
| 84 | 103 | id: SECTION_ID.DISABLE_XML_RPC, |
| @@ -354,8 +373,16 @@ | ||
| 354 | 373 | settingsData.value[id] = value; |
| 355 | 374 | } |
| 356 | 375 | }; |
| 357 | 376 | |
| 377 | +const onClearCache = async () => { | |
| 378 | + if (isClearingCache.value) return; | |
| 379 | + | |
| 380 | + isClearingCache.value = true; | |
| 381 | + await clearCache(); | |
| 382 | + isClearingCache.value = false; | |
| 383 | +}; | |
| 384 | + | |
| 358 | 385 | const copyAgentUrl = () => { |
| 359 | 386 | const domain = location.host; |
| 360 | 387 | const agentUrl = `websites-agents.hostinger.com/${domain}/mcp`; |
| 361 | 388 | navigator.clipboard.writeText(agentUrl); |
| @@ -455,8 +482,15 @@ | ||
| 455 | 482 | :is-loading="isPageLoading" |
| 456 | 483 | :title="translate('hostinger_tools_redirects')" |
| 457 | 484 | :section-items="redirectsSection" |
| 458 | 485 | @save-section="onSaveSection" |
| 486 | + /> | |
| 487 | + | |
| 488 | + <SectionCard | |
| 489 | + :is-loading="isPageLoading" | |
| 490 | + :title="translate('hostinger_tools_performance')" | |
| 491 | + :section-items="performanceSection" | |
| 492 | + :is-disabled="isCacheSectionDisabled" | |
| 459 | 493 | /> |
| 460 | 494 | </div> |
| 461 | 495 | </div> |
| 462 | 496 | </template> |