This commit is contained in:
Darren Clarke 2024-03-17 12:58:25 +01:00
parent f62c9f064d
commit b8c6e893ff
43 changed files with 4721 additions and 1807 deletions

View file

@ -1,6 +1,11 @@
"use client";
import { FC } from "react";
import { ZammadWrapper } from "./ZammadWrapper";
import { OpenSearchWrapper } from "leafcutter-common";
export const Home: FC = () => <ZammadWrapper path="#dashboard" hideSidebar />;
export const Home: FC = () => (
<OpenSearchWrapper
url="/app/dashboards#/view/c39012d0-eb7a-11ed-8e00-17d7d50cd7b2?embed=true&tenant=global"
marginTop="0"
/>
);

View file

@ -6,10 +6,5 @@ export const metadata: Metadata = {
};
export default function Page() {
return (
<iframe src="/opensearch/app/dashboards?security_tenant=global#/view/722b74f0-b882-11e8-a6d9-e546fe2bba5f?embed=true&_g=(filters%3A!()%2CrefreshInterval%3A(pause%3A!f%2Cvalue%3A900000)%2Ctime%3A(from%3Anow-7d%2Cto%3Anow))&hide-filter-bar=true"
height="1000"
width="1200"
></iframe>
);
return <Home />;
}

View file

@ -29,32 +29,16 @@ const checkRewrites = async (request: NextRequestWithAuth) => {
const labelStudioURL = process.env.LABEL_STUDIO_URL ?? "http://label-studio:8080";
const { token } = request.nextauth;
const headers = { 'X-Forwarded-User': token?.email?.toLowerCase() };
console.log ({ pathname: request.nextUrl.pathname});
console.log({ pathname: request.nextUrl.pathname });
if (request.nextUrl.pathname.startsWith('/api/v1/configuration/account') ||
request.nextUrl.pathname.startsWith('/api/v1/restapiinfo') ||
request.nextUrl.pathname.startsWith('/api/v1/auth') ||
request.nextUrl.pathname.startsWith('/api/core') ||
request.nextUrl.pathname.startsWith('/api/dataconnections') ||
request.nextUrl.pathname.startsWith('/api/v1/multitenancy') ||
request.nextUrl.pathname.startsWith('/api/ism') ||
request.nextUrl.pathname.startsWith('/node_modules') ||
request.nextUrl.pathname.startsWith('/translations') || request.nextUrl.pathname.startsWith('/6867') || request.nextUrl.pathname.startsWith('/ui') || request.nextUrl.pathname.startsWith('/bootstrap')) {
const headers = {
'x-proxy-user': "admin",
'x-proxy-roles': "all_access",
// 'X-Forwarded-For': "link"
};
return rewriteURL(request, `${linkBaseURL}`, opensearchURL, headers);
}
else if (request.nextUrl.pathname.startsWith('/opensearch')) {
if (request.nextUrl.pathname.startsWith('/opensearch')) {
const headers = {
'x-proxy-user': "admin",
'x-proxy-roles': "all_access",
// 'X-Forwarded-For': "link"
};
return rewriteURL(request, `${linkBaseURL}/opensearch`, opensearchURL, headers);
}else if (request.nextUrl.pathname.startsWith('/metamigo')) {
} else if (request.nextUrl.pathname.startsWith('/metamigo')) {
return rewriteURL(request, `${linkBaseURL}/metamigo`, metamigoURL);
} else if (request.nextUrl.pathname.startsWith('/label-studio')) {
return rewriteURL(request, `${linkBaseURL}/label-studio`, labelStudioURL);

View file

@ -39,7 +39,8 @@
"sharp": "^0.33.2",
"swr": "^2.2.5",
"tss-react": "^4.9.4",
"twilio-client": "^1.15.1"
"twilio-client": "^1.15.1",
"ui": "*"
},
"devDependencies": {
"@babel/core": "^7.24.0",