mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 12:19:06 +00:00
NextJS 14 experimental upgrade
This commit is contained in:
@@ -24,6 +24,11 @@ It also uses https://github.com/fief-dev for authentication, and Vercel for depl
|
||||
- [Back-End](#back-end)
|
||||
- [Installation](#installation-1)
|
||||
- [Start the API/Backend](#start-the-apibackend)
|
||||
- [Redis (Mac)](#redis-mac)
|
||||
- [Redis (Windows)](#redis-windows)
|
||||
- [Update the database schema (run on first install, and after each pull containing a migration)](#update-the-database-schema-run-on-first-install-and-after-each-pull-containing-a-migration)
|
||||
- [Main Server](#main-server)
|
||||
- [Crontab (optional)](#crontab-optional)
|
||||
- [Using docker](#using-docker)
|
||||
- [Using local GPT4All](#using-local-gpt4all)
|
||||
- [Using local files](#using-local-files)
|
||||
@@ -152,7 +157,7 @@ redis-server
|
||||
## Update the database schema (run on first install, and after each pull containing a migration)
|
||||
|
||||
```bash
|
||||
poetry run python alembic head
|
||||
poetry run alembic heads
|
||||
```
|
||||
|
||||
## Main Server
|
||||
|
||||
@@ -3,7 +3,6 @@ import { useError } from "../../(errors)/errorContext";
|
||||
import { GetTranscript, CreateTranscript } from "../../api";
|
||||
import useApi from "../../lib/useApi";
|
||||
|
||||
|
||||
type UseTranscript = {
|
||||
transcript: GetTranscript | null;
|
||||
loading: boolean;
|
||||
@@ -23,26 +22,16 @@ const useCreateTranscript = (): UseTranscript => {
|
||||
|
||||
setLoading(true);
|
||||
|
||||
console.debug(
|
||||
console.log(
|
||||
"POST - /v1/transcripts/ - Requesting new transcription creation",
|
||||
transcriptCreationDetails,
|
||||
api
|
||||
api,
|
||||
);
|
||||
|
||||
const aaa = async () => {
|
||||
console.log("Calling API...");
|
||||
console.log("START");
|
||||
|
||||
await new Promise((res) => setTimeout(res, 500));
|
||||
|
||||
console.log("500 ms elapsed - calling api");
|
||||
|
||||
const test = await api.v1TranscriptsCreate(transcriptCreationDetails);
|
||||
console.log(test);
|
||||
};
|
||||
|
||||
aaa();
|
||||
|
||||
api.v1TranscriptsCreate(transcriptCreationDetails)
|
||||
api
|
||||
.v1TranscriptsCreate(transcriptCreationDetails)
|
||||
.then((transcript) => {
|
||||
console.debug("New transcript created:", transcript);
|
||||
setTranscript(transcript);
|
||||
@@ -55,6 +44,9 @@ const useCreateTranscript = (): UseTranscript => {
|
||||
);
|
||||
setErrorState(err);
|
||||
setLoading(false);
|
||||
})
|
||||
.finally(() => {
|
||||
console.log("At least this should display?");
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import Markdown from "react-markdown";
|
||||
import "../../styles/markdown.css";
|
||||
import { featureEnabled } from "../domainContext";
|
||||
import { UpdateTranscript } from "../../api";
|
||||
import useApi from "../../lib/useApi";
|
||||
import useApi from "../../lib/useApi";
|
||||
|
||||
type FinalSummaryProps = {
|
||||
summary: string;
|
||||
|
||||
@@ -89,29 +89,30 @@ const ShareLink = (props: ShareLinkProps) => {
|
||||
<p>This transcript is public. Everyone can access it.</p>
|
||||
)}
|
||||
|
||||
{isOwner && apiReady (
|
||||
<div className="relative">
|
||||
<SelectSearch
|
||||
className="select-search--top select-search"
|
||||
options={[
|
||||
{ name: "Private", value: "private" },
|
||||
{ name: "Secure", value: "semi-private" },
|
||||
{ name: "Public", value: "public" },
|
||||
]}
|
||||
value={shareMode?.toString()}
|
||||
onChange={updateShareMode}
|
||||
closeOnSelect={true}
|
||||
/>
|
||||
{shareLoading && (
|
||||
<div className="h-4 w-4 absolute top-1/3 right-3 z-10">
|
||||
<FontAwesomeIcon
|
||||
icon={faSpinner}
|
||||
className="animate-spin-slow text-gray-600 flex-grow rounded-lg md:rounded-xl h-4 w-4"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{isOwner &&
|
||||
apiReady(
|
||||
<div className="relative">
|
||||
<SelectSearch
|
||||
className="select-search--top select-search"
|
||||
options={[
|
||||
{ name: "Private", value: "private" },
|
||||
{ name: "Secure", value: "semi-private" },
|
||||
{ name: "Public", value: "public" },
|
||||
]}
|
||||
value={shareMode?.toString()}
|
||||
onChange={updateShareMode}
|
||||
closeOnSelect={true}
|
||||
/>
|
||||
{shareLoading && (
|
||||
<div className="h-4 w-4 absolute top-1/3 right-3 z-10">
|
||||
<FontAwesomeIcon
|
||||
icon={faSpinner}
|
||||
className="animate-spin-slow text-gray-600 flex-grow rounded-lg md:rounded-xl h-4 w-4"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>,
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{!requireLogin && (
|
||||
|
||||
@@ -21,7 +21,8 @@ const useTopics = (id: string): TranscriptTopics => {
|
||||
if (!id || !api) return;
|
||||
|
||||
setLoading(true);
|
||||
api.v1TranscriptGetTopics(id)
|
||||
api
|
||||
.v1TranscriptGetTopics(id)
|
||||
.then((result) => {
|
||||
setTopics(result);
|
||||
setLoading(false);
|
||||
|
||||
@@ -36,7 +36,8 @@ const useTranscript = (
|
||||
|
||||
setLoading(true);
|
||||
|
||||
api.v1TranscriptGet(id)
|
||||
api
|
||||
.v1TranscriptGet(id)
|
||||
.then((result) => {
|
||||
setResponse(result);
|
||||
setLoading(false);
|
||||
|
||||
@@ -19,10 +19,9 @@ const useTranscriptList = (page: number): TranscriptList => {
|
||||
|
||||
useEffect(() => {
|
||||
setLoading(true);
|
||||
if (!api)
|
||||
|
||||
return;
|
||||
api.v1TranscriptsList(page)
|
||||
if (!api) return;
|
||||
api
|
||||
.v1TranscriptsList(page)
|
||||
.then((response) => {
|
||||
setResponse(response);
|
||||
setLoading(false);
|
||||
|
||||
@@ -35,10 +35,10 @@ const useWebRTC = (
|
||||
p.on("signal", (data: any) => {
|
||||
if (!api) return;
|
||||
if ("sdp" in data) {
|
||||
const rtcOffer : RtcOffer = {
|
||||
sdp: data.sdp,
|
||||
type: data.type,
|
||||
};
|
||||
const rtcOffer: RtcOffer = {
|
||||
sdp: data.sdp,
|
||||
type: data.type,
|
||||
};
|
||||
|
||||
api
|
||||
.v1TranscriptRecordWebrtc(transcriptId, rtcOffer)
|
||||
|
||||
@@ -19,14 +19,13 @@ export default function useApi(): DefaultService | null {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!accessTokenInfo)
|
||||
return;
|
||||
if (!accessTokenInfo) return;
|
||||
|
||||
const openApi = new OpenApi({
|
||||
BASE: api_url,
|
||||
TOKEN: accessTokenInfo?.access_token
|
||||
TOKEN: accessTokenInfo?.access_token,
|
||||
});
|
||||
|
||||
|
||||
setApi(openApi);
|
||||
}, [!accessTokenInfo, hasAuthCookie]);
|
||||
|
||||
|
||||
@@ -20,10 +20,12 @@
|
||||
"@vercel/edge-config": "^0.4.1",
|
||||
"autoprefixer": "10.4.14",
|
||||
"axios": "^1.6.2",
|
||||
"eslint-config-next": "^14.0.4",
|
||||
"fontawesome": "^5.6.3",
|
||||
"jest-worker": "^29.6.2",
|
||||
"next": "^13.4.9",
|
||||
"next": "^14.0.4",
|
||||
"postcss": "8.4.25",
|
||||
"prop-types": "^15.8.1",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-dropdown": "^1.11.0",
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
}
|
||||
],
|
||||
"strictNullChecks": true,
|
||||
"downlevelIteration": true
|
||||
"downlevelIteration": true,
|
||||
"target": "ES2020"
|
||||
},
|
||||
"include": ["next-env.d.ts", ".next/types/**/*.ts", "**/*.ts", "**/*.tsx"],
|
||||
"exclude": ["node_modules"]
|
||||
|
||||
1274
www/yarn.lock
1274
www/yarn.lock
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user