Commit d3da042261399e9b9a1a8946f9f7b9f6bf37b7dd
Merge branch 'feat/about-software-version-number' into 'main_dev'
feat: 关于软件新增版本号 See merge request yunteng/thingskit-front!617
Showing
8 changed files
with
37 additions
and
9 deletions
| @@ -42,3 +42,6 @@ VITE_GLOB_ALARM_NOTIFY_DURATION = 5 | @@ -42,3 +42,6 @@ VITE_GLOB_ALARM_NOTIFY_DURATION = 5 | ||
| 42 | 42 | ||
| 43 | # Should Disabled Task Center Execute Interval Unit (Second) | 43 | # Should Disabled Task Center Execute Interval Unit (Second) |
| 44 | VITE_GLOB_DISABLED_TASK_CENTER_EXECUTE_INTERVAL_UNIT_SECOND = false | 44 | VITE_GLOB_DISABLED_TASK_CENTER_EXECUTE_INTERVAL_UNIT_SECOND = false |
| 45 | + | ||
| 46 | +# Software version number | ||
| 47 | +VITE_GLOB_SOFTWARE_VERSION_NUMBER = 123 |
| @@ -54,3 +54,6 @@ VITE_GLOB_ALARM_NOTIFY_DURATION = 5 | @@ -54,3 +54,6 @@ VITE_GLOB_ALARM_NOTIFY_DURATION = 5 | ||
| 54 | 54 | ||
| 55 | # Should Disabled Task Center Execute Interval Unit (Second) | 55 | # Should Disabled Task Center Execute Interval Unit (Second) |
| 56 | VITE_GLOB_DISABLED_TASK_CENTER_EXECUTE_INTERVAL_UNIT_SECOND = false | 56 | VITE_GLOB_DISABLED_TASK_CENTER_EXECUTE_INTERVAL_UNIT_SECOND = false |
| 57 | + | ||
| 58 | +# software version number | ||
| 59 | +VITE_GLOB_SOFTWARE_VERSION_NUMBER = 123 |
| @@ -17,6 +17,7 @@ export const useGlobSetting = (): Readonly<GlobConfig> => { | @@ -17,6 +17,7 @@ export const useGlobSetting = (): Readonly<GlobConfig> => { | ||
| 17 | VITE_GLOB_ALARM_NOTIFY_DURATION, | 17 | VITE_GLOB_ALARM_NOTIFY_DURATION, |
| 18 | VITE_GLOB_LARGE_DESIGNER, | 18 | VITE_GLOB_LARGE_DESIGNER, |
| 19 | VITE_GLOB_DISABLED_TASK_CENTER_EXECUTE_INTERVAL_UNIT_SECOND, | 19 | VITE_GLOB_DISABLED_TASK_CENTER_EXECUTE_INTERVAL_UNIT_SECOND, |
| 20 | + VITE_GLOB_SOFTWARE_VERSION_NUMBER, | ||
| 20 | } = getAppEnvConfig(); | 21 | } = getAppEnvConfig(); |
| 21 | 22 | ||
| 22 | if (!/[a-zA-Z\_]*/.test(VITE_GLOB_APP_SHORT_NAME)) { | 23 | if (!/[a-zA-Z\_]*/.test(VITE_GLOB_APP_SHORT_NAME)) { |
| @@ -40,6 +41,7 @@ export const useGlobSetting = (): Readonly<GlobConfig> => { | @@ -40,6 +41,7 @@ export const useGlobSetting = (): Readonly<GlobConfig> => { | ||
| 40 | alarmPollingInterval: VITE_GLOB_ALARM_NOTIFY_POLLING_INTERVAL_TIME, | 41 | alarmPollingInterval: VITE_GLOB_ALARM_NOTIFY_POLLING_INTERVAL_TIME, |
| 41 | disabledTaskCenterExecuteIntervalUnitSecond: | 42 | disabledTaskCenterExecuteIntervalUnitSecond: |
| 42 | VITE_GLOB_DISABLED_TASK_CENTER_EXECUTE_INTERVAL_UNIT_SECOND, | 43 | VITE_GLOB_DISABLED_TASK_CENTER_EXECUTE_INTERVAL_UNIT_SECOND, |
| 44 | + softwareVersionNumber: VITE_GLOB_SOFTWARE_VERSION_NUMBER, | ||
| 43 | }; | 45 | }; |
| 44 | return glob as Readonly<GlobConfig>; | 46 | return glob as Readonly<GlobConfig>; |
| 45 | }; | 47 | }; |
| @@ -5,15 +5,17 @@ | @@ -5,15 +5,17 @@ | ||
| 5 | import { BasicModal, useModal } from '/@/components/Modal'; | 5 | import { BasicModal, useModal } from '/@/components/Modal'; |
| 6 | import { cacheCipher } from '/@/settings/encryptionSetting'; | 6 | import { cacheCipher } from '/@/settings/encryptionSetting'; |
| 7 | import { AesEncryption } from '/@/utils/cipher'; | 7 | import { AesEncryption } from '/@/utils/cipher'; |
| 8 | + import { useGlobSetting } from '/@/hooks/setting'; | ||
| 8 | 9 | ||
| 9 | const encryption = new AesEncryption(cacheCipher); | 10 | const encryption = new AesEncryption(cacheCipher); |
| 10 | 11 | ||
| 11 | const { t } = useI18n(); | 12 | const { t } = useI18n(); |
| 12 | 13 | ||
| 13 | enum FiledKey { | 14 | enum FiledKey { |
| 14 | - copyright = 'field1', | ||
| 15 | - website = 'filed2', | ||
| 16 | - authorization = 'field3', | 15 | + COPYRIGHT = 'field1', |
| 16 | + WEBSITE = 'filed2', | ||
| 17 | + AUTHORIZATION = 'field3', | ||
| 18 | + VERSION = 'field4', | ||
| 17 | } | 19 | } |
| 18 | 20 | ||
| 19 | // const handleEncode = (string: string) => { | 21 | // const handleEncode = (string: string) => { |
| @@ -26,6 +28,8 @@ | @@ -26,6 +28,8 @@ | ||
| 26 | 28 | ||
| 27 | const [register] = useModal(); | 29 | const [register] = useModal(); |
| 28 | 30 | ||
| 31 | + const { softwareVersionNumber } = useGlobSetting(); | ||
| 32 | + | ||
| 29 | const [registerDes] = useDescription({ | 33 | const [registerDes] = useDescription({ |
| 30 | bordered: false, | 34 | bordered: false, |
| 31 | column: 1, | 35 | column: 1, |
| @@ -36,17 +40,18 @@ | @@ -36,17 +40,18 @@ | ||
| 36 | paddingRight: '20px', | 40 | paddingRight: '20px', |
| 37 | }, | 41 | }, |
| 38 | data: { | 42 | data: { |
| 39 | - [FiledKey.copyright]: handleDecode(t('routes.aboutSoftware.copyright')), | ||
| 40 | - [FiledKey.website]: handleDecode(t('routes.aboutSoftware.website')), | ||
| 41 | - [FiledKey.authorization]: handleDecode(t('routes.aboutSoftware.authorization')), | 43 | + [FiledKey.COPYRIGHT]: handleDecode(t('routes.aboutSoftware.copyright')), |
| 44 | + [FiledKey.WEBSITE]: handleDecode(t('routes.aboutSoftware.website')), | ||
| 45 | + [FiledKey.AUTHORIZATION]: handleDecode(t('routes.aboutSoftware.authorization')), | ||
| 46 | + [FiledKey.VERSION]: softwareVersionNumber, | ||
| 42 | }, | 47 | }, |
| 43 | schema: [ | 48 | schema: [ |
| 44 | { | 49 | { |
| 45 | - field: FiledKey.copyright, | 50 | + field: FiledKey.COPYRIGHT, |
| 46 | label: handleDecode(t('routes.aboutSoftware.copyrightLabel')), | 51 | label: handleDecode(t('routes.aboutSoftware.copyrightLabel')), |
| 47 | }, | 52 | }, |
| 48 | { | 53 | { |
| 49 | - field: FiledKey.website, | 54 | + field: FiledKey.WEBSITE, |
| 50 | label: handleDecode(t('routes.aboutSoftware.websiteLabel')), | 55 | label: handleDecode(t('routes.aboutSoftware.websiteLabel')), |
| 51 | render: (val: string) => { | 56 | render: (val: string) => { |
| 52 | return h( | 57 | return h( |
| @@ -57,7 +62,7 @@ | @@ -57,7 +62,7 @@ | ||
| 57 | }, | 62 | }, |
| 58 | }, | 63 | }, |
| 59 | { | 64 | { |
| 60 | - field: FiledKey.authorization, | 65 | + field: FiledKey.AUTHORIZATION, |
| 61 | label: handleDecode(t('routes.aboutSoftware.authorizationLabel')), | 66 | label: handleDecode(t('routes.aboutSoftware.authorizationLabel')), |
| 62 | render: (val: string) => { | 67 | render: (val: string) => { |
| 63 | // https://community.thingskit.com/question/20.html | 68 | // https://community.thingskit.com/question/20.html |
| @@ -74,6 +79,13 @@ | @@ -74,6 +79,13 @@ | ||
| 74 | ]); | 79 | ]); |
| 75 | }, | 80 | }, |
| 76 | }, | 81 | }, |
| 82 | + { | ||
| 83 | + field: FiledKey.VERSION, | ||
| 84 | + label: handleDecode(t('routes.aboutSoftware.versionLabel')), | ||
| 85 | + render: () => { | ||
| 86 | + return softwareVersionNumber; | ||
| 87 | + }, | ||
| 88 | + }, | ||
| 77 | ], | 89 | ], |
| 78 | }); | 90 | }); |
| 79 | </script> | 91 | </script> |
| @@ -3,6 +3,7 @@ export default { | @@ -3,6 +3,7 @@ export default { | ||
| 3 | copyrightLabel: 'euVkVv2k+9lAoBFk2/IcAg==', | 3 | copyrightLabel: 'euVkVv2k+9lAoBFk2/IcAg==', |
| 4 | websiteLabel: 'Lg18XskCEQMA57HJp/kFSg==', | 4 | websiteLabel: 'Lg18XskCEQMA57HJp/kFSg==', |
| 5 | authorizationLabel: 'RgtDsxIoA+6FMp4Ani+utw==', | 5 | authorizationLabel: 'RgtDsxIoA+6FMp4Ani+utw==', |
| 6 | + versionLabel: 'H7gVdiVRLf4+LjmM3sBcww==', | ||
| 6 | copyright: | 7 | copyright: |
| 7 | '5ZZv6QlLvd5rrVAubQbHxCb2HrJoY+efYpnto5GHh4Diz5PVne8rb1Ao/L+kLUrgeJe5BGIepGMuyURKaDeSPURtCLInlllTNHKjGbnJOm8BZRFm2DUWcHktj20z4WgPf2eu4deeGr1S+i62lLZwj9o9Ynf30T5W500YBzFCnb65cXA7tXGG35JhOy3fe7oo', | 8 | '5ZZv6QlLvd5rrVAubQbHxCb2HrJoY+efYpnto5GHh4Diz5PVne8rb1Ao/L+kLUrgeJe5BGIepGMuyURKaDeSPURtCLInlllTNHKjGbnJOm8BZRFm2DUWcHktj20z4WgPf2eu4deeGr1S+i62lLZwj9o9Ynf30T5W500YBzFCnb65cXA7tXGG35JhOy3fe7oo', |
| 8 | website: 'GJahLAezazanWODyf7QEGjU3xfvz1GEKW0OTFhG9m+U=', | 9 | website: 'GJahLAezazanWODyf7QEGjU3xfvz1GEKW0OTFhG9m+U=', |
| @@ -3,6 +3,7 @@ export default { | @@ -3,6 +3,7 @@ export default { | ||
| 3 | copyrightLabel: 'euVkVv2k+9lAoBFk2/IcAg==', | 3 | copyrightLabel: 'euVkVv2k+9lAoBFk2/IcAg==', |
| 4 | websiteLabel: 'Lg18XskCEQMA57HJp/kFSg==', | 4 | websiteLabel: 'Lg18XskCEQMA57HJp/kFSg==', |
| 5 | authorizationLabel: 'RgtDsxIoA+6FMp4Ani+utw==', | 5 | authorizationLabel: 'RgtDsxIoA+6FMp4Ani+utw==', |
| 6 | + versionLabel: 'H7gVdiVRLf4+LjmM3sBcww==', | ||
| 6 | copyright: | 7 | copyright: |
| 7 | '5ZZv6QlLvd5rrVAubQbHxCb2HrJoY+efYpnto5GHh4Diz5PVne8rb1Ao/L+kLUrgeJe5BGIepGMuyURKaDeSPURtCLInlllTNHKjGbnJOm8BZRFm2DUWcHktj20z4WgPf2eu4deeGr1S+i62lLZwj9o9Ynf30T5W500YBzFCnb65cXA7tXGG35JhOy3fe7oo', | 8 | '5ZZv6QlLvd5rrVAubQbHxCb2HrJoY+efYpnto5GHh4Diz5PVne8rb1Ao/L+kLUrgeJe5BGIepGMuyURKaDeSPURtCLInlllTNHKjGbnJOm8BZRFm2DUWcHktj20z4WgPf2eu4deeGr1S+i62lLZwj9o9Ynf30T5W500YBzFCnb65cXA7tXGG35JhOy3fe7oo', |
| 8 | website: 'GJahLAezazanWODyf7QEGjU3xfvz1GEKW0OTFhG9m+U=', | 9 | website: 'GJahLAezazanWODyf7QEGjU3xfvz1GEKW0OTFhG9m+U=', |
| @@ -34,6 +34,7 @@ export function getAppEnvConfig() { | @@ -34,6 +34,7 @@ export function getAppEnvConfig() { | ||
| 34 | VITE_GLOB_ALARM_NOTIFY_DURATION, | 34 | VITE_GLOB_ALARM_NOTIFY_DURATION, |
| 35 | VITE_GLOB_LARGE_DESIGNER, | 35 | VITE_GLOB_LARGE_DESIGNER, |
| 36 | VITE_GLOB_DISABLED_TASK_CENTER_EXECUTE_INTERVAL_UNIT_SECOND, | 36 | VITE_GLOB_DISABLED_TASK_CENTER_EXECUTE_INTERVAL_UNIT_SECOND, |
| 37 | + VITE_GLOB_SOFTWARE_VERSION_NUMBER, | ||
| 37 | } = ENV; | 38 | } = ENV; |
| 38 | 39 | ||
| 39 | if (!/^[a-zA-Z\_]*$/.test(VITE_GLOB_APP_SHORT_NAME)) { | 40 | if (!/^[a-zA-Z\_]*$/.test(VITE_GLOB_APP_SHORT_NAME)) { |
| @@ -55,6 +56,7 @@ export function getAppEnvConfig() { | @@ -55,6 +56,7 @@ export function getAppEnvConfig() { | ||
| 55 | VITE_GLOB_ALARM_NOTIFY_DURATION, | 56 | VITE_GLOB_ALARM_NOTIFY_DURATION, |
| 56 | VITE_GLOB_LARGE_DESIGNER, | 57 | VITE_GLOB_LARGE_DESIGNER, |
| 57 | VITE_GLOB_DISABLED_TASK_CENTER_EXECUTE_INTERVAL_UNIT_SECOND, | 58 | VITE_GLOB_DISABLED_TASK_CENTER_EXECUTE_INTERVAL_UNIT_SECOND, |
| 59 | + VITE_GLOB_SOFTWARE_VERSION_NUMBER, | ||
| 58 | }; | 60 | }; |
| 59 | } | 61 | } |
| 60 | 62 |
| @@ -160,6 +160,8 @@ export interface GlobConfig { | @@ -160,6 +160,8 @@ export interface GlobConfig { | ||
| 160 | securityPolicy: string; | 160 | securityPolicy: string; |
| 161 | // Should Disabled Task Center Execute Interval Unit (Second) | 161 | // Should Disabled Task Center Execute Interval Unit (Second) |
| 162 | disabledTaskCenterExecuteIntervalUnitSecond: string; | 162 | disabledTaskCenterExecuteIntervalUnitSecond: string; |
| 163 | + // Software version number | ||
| 164 | + softwareVersionNumber: string; | ||
| 163 | } | 165 | } |
| 164 | export interface GlobEnvConfig { | 166 | export interface GlobEnvConfig { |
| 165 | // Site title | 167 | // Site title |
| @@ -186,4 +188,6 @@ export interface GlobEnvConfig { | @@ -186,4 +188,6 @@ export interface GlobEnvConfig { | ||
| 186 | VITE_GLOB_ALARM_NOTIFY_DURATION: string; | 188 | VITE_GLOB_ALARM_NOTIFY_DURATION: string; |
| 187 | // Should Disabled Task Center Execute Interval Unit (Second) | 189 | // Should Disabled Task Center Execute Interval Unit (Second) |
| 188 | VITE_GLOB_DISABLED_TASK_CENTER_EXECUTE_INTERVAL_UNIT_SECOND: string; | 190 | VITE_GLOB_DISABLED_TASK_CENTER_EXECUTE_INTERVAL_UNIT_SECOND: string; |
| 191 | + // Software version number | ||
| 192 | + VITE_GLOB_SOFTWARE_VERSION_NUMBER: string; | ||
| 189 | } | 193 | } |