feat: add build date in footer
This commit is contained in:
@@ -1,15 +1,23 @@
|
||||
<script lang="ts" setup>
|
||||
import { isClient } from '@vueuse/core'
|
||||
|
||||
const displayICP = ref(true)
|
||||
|
||||
onBeforeMount(() => {
|
||||
if (isClient)
|
||||
displayICP.value = ['cook.yunyoujun.cn', 'localhost'].includes(window.location.hostname)
|
||||
displayICP.value = ['cook.yunyoujun.cn', 'localhost', '127.0.0.1'].includes(window.location.hostname)
|
||||
})
|
||||
|
||||
const commitSha = import.meta.env.CF_PAGES_COMMIT_SHA || ''
|
||||
const now = import.meta.env.VITE_APP_BUILD_TIME
|
||||
const buildDate = (new Date(parseInt(now) * 1000)).toLocaleDateString()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div p="4" class="flex flex-col justify-center items-center" text="sm">
|
||||
<div v-if="commitSha && buildDate" mb-2>
|
||||
当前版本( {{ buildDate }} ): {{ commitSha }}
|
||||
</div>
|
||||
<a v-if="displayICP" opacity="80" class="flex" href="https://beian.miit.gov.cn/" target="_blank">
|
||||
苏ICP备17038157号
|
||||
</a>
|
||||
|
||||
@@ -161,7 +161,7 @@ const randomRecipe = ref<RecipeItem>(generateRandomRecipe())
|
||||
|
||||
<!-- <Switch /> -->
|
||||
<div class="cook-recipes" p="2">
|
||||
<SearchFood />
|
||||
<SearchFoodInput />
|
||||
|
||||
<Transition mode="out-in">
|
||||
<div class="cook-filter-recipes">
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
<script lang="ts" setup>
|
||||
import { useRecipeStore } from '~/store/recipe'
|
||||
const rStore = useRecipeStore()
|
||||
|
||||
const clearKeyword = () => {
|
||||
rStore.keyword = ''
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div m="auto b-2" max-w="500px">
|
||||
<div relative text-xs>
|
||||
<div v-show="rStore.keyword" cursor="pointer" absolute right-2 inline-flex justify="center" items-center h="full" opacity="70" @click="clearKeyword">
|
||||
<div
|
||||
v-if="rStore.keyword" cursor="pointer"
|
||||
absolute right-2 inline-flex justify="center" items-center h="full" opacity="70"
|
||||
@click="rStore.clearKeyWord()"
|
||||
>
|
||||
<div i-ri-close-line />
|
||||
</div>
|
||||
<input
|
||||
Reference in New Issue
Block a user