-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
551705a
commit 602f9c4
Showing
10 changed files
with
61 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import os | ||
|
||
# Pulls the version from the environment variable DANSWER_VERSION, or defaults to 0.1.0dev. | ||
__version__ = os.environ.get("DANSWER_VERSION", "") or "0.1.0dev" | ||
__version__ = os.environ.get("DANSWER_VERSION", "") or "0.2-dev" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "qa", | ||
"version": "0.1.0dev", | ||
"version": "0.2-dev", | ||
"private": true, | ||
"scripts": { | ||
"dev": "next dev", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,42 @@ | ||
import { NotebookIcon } from "@/components/icons/icons"; | ||
import { getWebVersion, getBackendVersion } from "@/lib/version" | ||
import { getWebVersion, getBackendVersion } from "@/lib/version"; | ||
|
||
const Page = async () => { | ||
let web_version: string | null = null; | ||
let backend_version: string | null = null; | ||
try { | ||
[web_version, backend_version] = await Promise.all([ | ||
getWebVersion(), | ||
getBackendVersion(), | ||
]); | ||
} catch (e) { | ||
console.log(`Version info fetch failed for system info page - ${e}`); | ||
} | ||
|
||
let web_version: string | null = null; | ||
let backend_version: string | null = null; | ||
try { | ||
[web_version, backend_version] = await Promise.all([ | ||
getWebVersion(), | ||
getBackendVersion(), | ||
]); | ||
} catch (e) { | ||
console.log(`Version info fetch failed for system info page - ${e}`); | ||
} | ||
|
||
return ( | ||
<div> | ||
<div className="border-solid border-gray-600 border-b pb-2 mb-4 flex"> | ||
<NotebookIcon size={32} /> | ||
<h1 className="text-3xl font-bold pl-2">System Information</h1> | ||
</div> | ||
|
||
<div> | ||
<p className="font-bold text-lg my-auto mb-2">Danswer MIT</p> | ||
<div className="flex mb-2"> | ||
<p className="my-auto mr-1">Backend Version: </p> | ||
<p className="text-base my-auto text-slate-400 italic">{backend_version}</p> | ||
</div> | ||
<div className="flex mb-2"> | ||
<p className="my-auto mr-1">Web Version: </p> | ||
<p className="text-base my-auto text-slate-400 italic">{web_version}</p> | ||
</div> | ||
</div> | ||
return ( | ||
<div> | ||
<div className="border-solid border-gray-600 border-b pb-2 mb-4 flex"> | ||
<NotebookIcon size={32} /> | ||
<h1 className="text-3xl font-bold pl-2">Version</h1> | ||
</div> | ||
|
||
<div> | ||
<p className="font-bold text-lg my-auto mb-2">Danswer MIT</p> | ||
<div className="flex mb-2"> | ||
<p className="my-auto mr-1">Backend Version: </p> | ||
<p className="text-base my-auto text-slate-400 italic"> | ||
{backend_version} | ||
</p> | ||
</div> | ||
<div className="flex mb-2"> | ||
<p className="my-auto mr-1">Web Version: </p> | ||
<p className="text-base my-auto text-slate-400 italic"> | ||
{web_version} | ||
</p> | ||
</div> | ||
); | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Page; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
import { buildUrl } from "./utilsSS"; | ||
import getConfig from 'next/config'; | ||
import getConfig from "next/config"; | ||
|
||
const { publicRuntimeConfig } = getConfig(); | ||
const version = publicRuntimeConfig?.version; | ||
|
||
// Maybe improve type-safety by creating a 'VersionType' instead of generic string | ||
export const getBackendVersion = async (): Promise<string | null> => { | ||
try { | ||
const res = await fetch(buildUrl("/version")); | ||
if (!res.ok) { | ||
//throw new Error("Failed to fetch data"); | ||
return null; | ||
} | ||
|
||
const data: { backend_version: string } = await res.json(); | ||
return data.backend_version as string; | ||
} catch (e) { | ||
console.log(`Error fetching backend version info: ${e}`); | ||
return null; | ||
try { | ||
const res = await fetch(buildUrl("/version")); | ||
if (!res.ok) { | ||
//throw new Error("Failed to fetch data"); | ||
return null; | ||
} | ||
|
||
const data: { backend_version: string } = await res.json(); | ||
return data.backend_version as string; | ||
} catch (e) { | ||
console.log(`Error fetching backend version info: ${e}`); | ||
return null; | ||
} | ||
}; | ||
|
||
// Frontend? | ||
export const getWebVersion = (): string | null => { | ||
return version; | ||
return version; | ||
}; |
602f9c4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
internal-search – ./
internal-search-danswer.vercel.app
danswer.dev
internal-search.vercel.app
internal-search-git-main-danswer.vercel.app
www.danswer.dev