fix: generator add reviosn
diff --git a/ui/src/common/interface.ts b/ui/src/common/interface.ts
index cb6b63e..640efca 100644
--- a/ui/src/common/interface.ts
+++ b/ui/src/common/interface.ts
@@ -328,6 +328,7 @@
theme: AdminSettingsTheme;
site_seo: AdminSettingsSeo;
version: string;
+ revision: string;
}
export interface AdminSettingBranding {
diff --git a/ui/src/components/PageTags/index.tsx b/ui/src/components/PageTags/index.tsx
index 4f663ac..bd6d02a 100644
--- a/ui/src/components/PageTags/index.tsx
+++ b/ui/src/components/PageTags/index.tsx
@@ -11,6 +11,7 @@
(state) => state.items,
);
const appVersion = siteInfoStore((_) => _.version);
+ const hashVersion = siteInfoStore((_) => _.revision);
const setAppGenerator = () => {
if (!appVersion) {
return;
@@ -19,7 +20,7 @@
if (generatorMetaNode) {
generatorMetaNode.setAttribute(
'content',
- `Answer ${appVersion} - https://github.com/answerdev/answer`,
+ `Answer ${appVersion} - https://github.com/answerdev/answer version ${hashVersion}`,
);
}
};
diff --git a/ui/src/stores/siteInfo.ts b/ui/src/stores/siteInfo.ts
index 26c5321..1072501 100644
--- a/ui/src/stores/siteInfo.ts
+++ b/ui/src/stores/siteInfo.ts
@@ -6,8 +6,9 @@
interface SiteInfoType {
siteInfo: AdminSettingsGeneral;
version: string;
+ revision: string;
update: (params: AdminSettingsGeneral) => void;
- updateVersion: (ver: string) => void;
+ updateVersion: (ver: string, revision: string) => void;
}
const siteInfo = create<SiteInfoType>((set) => ({
@@ -20,6 +21,7 @@
permalink: 1,
},
version: '',
+ revision: '',
update: (params) =>
set((_) => {
const o = { ..._.siteInfo, ...params };
@@ -30,9 +32,9 @@
siteInfo: o,
};
}),
- updateVersion: (ver) => {
+ updateVersion: (ver, revision) => {
set(() => {
- return { version: ver };
+ return { version: ver, revision };
});
},
}));
diff --git a/ui/src/utils/guard.ts b/ui/src/utils/guard.ts
index 5ff081a..fee5509 100644
--- a/ui/src/utils/guard.ts
+++ b/ui/src/utils/guard.ts
@@ -302,7 +302,9 @@
const appSettings = await getAppSettings();
if (appSettings) {
siteInfoStore.getState().update(appSettings.general);
- siteInfoStore.getState().updateVersion(appSettings.version);
+ siteInfoStore
+ .getState()
+ .updateVersion(appSettings.version, appSettings.revision);
interfaceStore.getState().update(appSettings.interface);
brandingStore.getState().update(appSettings.branding);
loginSettingStore.getState().update(appSettings.login);