mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-30 07:06:39 +08:00
feat: display the version and backend service status on the page (#848)
### What problem does this PR solve? #643 feat: display the version and backend service status on the page ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -77,4 +77,8 @@ export default {
|
||||
createFolder: `${api_host}/file/create`,
|
||||
connectFileToKnowledge: `${api_host}/file2document/convert`,
|
||||
getFile: `${api_host}/file/get`,
|
||||
|
||||
// system
|
||||
getSystemVersion: `${api_host}/system/version`,
|
||||
getSystemStatus: `${api_host}/system/status`,
|
||||
};
|
||||
|
||||
@ -65,3 +65,10 @@ export const filterOptionsByInput = (
|
||||
input: string,
|
||||
option: { label: string; value: string } | undefined,
|
||||
) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase());
|
||||
|
||||
export const toFixed = (value: unknown, fixed = 2) => {
|
||||
if (typeof value === 'number') {
|
||||
return value.toFixed(fixed);
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
||||
@ -9,7 +9,7 @@ const registerServer = <T extends string>(
|
||||
) => {
|
||||
const server: Service<T> = {} as Service<T>;
|
||||
for (let key in opt) {
|
||||
server[key] = (params: any, urlAppendix?: string) => {
|
||||
server[key] = (params?: any, urlAppendix?: string) => {
|
||||
let url = opt[key].url;
|
||||
const requestOptions = opt[key];
|
||||
if (urlAppendix) {
|
||||
|
||||
Reference in New Issue
Block a user