feat: added commit short sha
This commit is contained in:
		
							parent
							
								
									f544928402
								
							
						
					
					
						commit
						668625c6da
					
				
							
								
								
									
										20
									
								
								env.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										20
									
								
								env.d.ts
									
									
									
									
										vendored
									
									
								
							| @ -2,13 +2,13 @@ | |||||||
| /// <reference types="vite-svg-loader" />
 | /// <reference types="vite-svg-loader" />
 | ||||||
| 
 | 
 | ||||||
| interface ImportMetaEnv { | interface ImportMetaEnv { | ||||||
|     VITE_PLAUSIBLE_API_HOST: string; |   VITE_PLAUSIBLE_API_HOST: string; | ||||||
|     VITE_PLAUSIBLE_DOMAIN: string; |   VITE_PLAUSIBLE_DOMAIN: string; | ||||||
|     PACKAGE_VERSION: string; |   PACKAGE_VERSION: string; | ||||||
|     PROD: boolean; |   GIT_SHORT_SHA: string; | ||||||
|   } |   PROD: boolean; | ||||||
|    | } | ||||||
|   interface ImportMeta { | 
 | ||||||
|     readonly env: ImportMetaEnv; | interface ImportMeta { | ||||||
|   } |   readonly env: ImportMetaEnv; | ||||||
|    | } | ||||||
|  | |||||||
| @ -16,6 +16,7 @@ const activeKey = ref(null) | |||||||
| const route = useRoute() | const route = useRoute() | ||||||
| const styleStore = useStyleStore() | const styleStore = useStyleStore() | ||||||
| const version = import.meta.env.PACKAGE_VERSION; | const version = import.meta.env.PACKAGE_VERSION; | ||||||
|  | const commitSha = import.meta.env.GIT_SHORT_SHA; | ||||||
| 
 | 
 | ||||||
| const makeLabel = (text: string, to: string) => () => h(RouterLink, { to }, { default: () => text }) | const makeLabel = (text: string, to: string) => () => h(RouterLink, { to }, { default: () => text }) | ||||||
| const makeIcon = (icon: Component) => () => h(NIcon, null, { default: () => h(icon) }) | const makeIcon = (icon: Component) => () => h(NIcon, null, { default: () => h(icon) }) | ||||||
| @ -75,8 +76,8 @@ const m = toolsByCategory.map(category => ({ | |||||||
| 
 | 
 | ||||||
|         <div class="footer"> |         <div class="footer"> | ||||||
|           <div> |           <div> | ||||||
|             IT-Tools  |             IT-Tools | ||||||
|              | 
 | ||||||
|             <n-button |             <n-button | ||||||
|               text |               text | ||||||
|               tag="a" |               tag="a" | ||||||
| @ -88,6 +89,21 @@ const m = toolsByCategory.map(category => ({ | |||||||
|             > |             > | ||||||
|               v{{ version }} |               v{{ version }} | ||||||
|             </n-button> |             </n-button> | ||||||
|  | 
 | ||||||
|  |             <template v-if="commitSha && commitSha.length > 0"> | ||||||
|  |               - | ||||||
|  |               <n-button | ||||||
|  |                 text | ||||||
|  |                 tag="a" | ||||||
|  |                 target="_blank" | ||||||
|  |                 rel="noopener" | ||||||
|  |                 type="primary" | ||||||
|  |                 depth="3" | ||||||
|  |                 :href="`https://github.com/CorentinTh/it-tools/tree/v${commitSha}`" | ||||||
|  |               > | ||||||
|  |                 {{ commitSha }} | ||||||
|  |               </n-button> | ||||||
|  |             </template> | ||||||
|           </div> |           </div> | ||||||
|           <div> |           <div> | ||||||
|             © {{ new Date().getFullYear() }} |             © {{ new Date().getFullYear() }} | ||||||
| @ -123,7 +139,7 @@ const m = toolsByCategory.map(category => ({ | |||||||
|                 size="25" |                 size="25" | ||||||
|                 :component="Menu2" |                 :component="Menu2" | ||||||
|               /> |               /> | ||||||
|             </n-button> |             </n-button>  | ||||||
|           </template> |           </template> | ||||||
|           Toggle menu |           Toggle menu | ||||||
|         </n-tooltip> |         </n-tooltip> | ||||||
| @ -173,7 +189,7 @@ const m = toolsByCategory.map(category => ({ | |||||||
|               Sponsor |               Sponsor | ||||||
|             </n-button> |             </n-button> | ||||||
|           </template> |           </template> | ||||||
|           ❤ Support IT Tools developement !  |           ❤ Support IT Tools developement ! | ||||||
|         </n-tooltip> |         </n-tooltip> | ||||||
| 
 | 
 | ||||||
|         <navbar-buttons v-if="!styleStore.isSmallScreen" /> |         <navbar-buttons v-if="!styleStore.isSmallScreen" /> | ||||||
|  | |||||||
| @ -61,5 +61,6 @@ export default defineConfig({ | |||||||
|   }, |   }, | ||||||
|   define: { |   define: { | ||||||
|     'import.meta.env.PACKAGE_VERSION': JSON.stringify(process.env.npm_package_version), |     'import.meta.env.PACKAGE_VERSION': JSON.stringify(process.env.npm_package_version), | ||||||
|  |     'import.meta.env.GIT_SHORT_SHA': JSON.stringify((process?.env?.VITE_VERCEL_GIT_COMMIT_SHA ?? '').slice(0, 7)), | ||||||
|   }, |   }, | ||||||
| }); | }); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user