-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore(ui): added scan list * fix(ui): pipeline nodejs version * fix(ui): pipeline nodejs version * fix(ui): pipeline nodejs version * fix(ui): ci pipeline
- Loading branch information
1 parent
afaa997
commit 8eaa773
Showing
20 changed files
with
684 additions
and
127 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,34 @@ | ||
name: Generate Documentation for the frontend | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
pull_request: | ||
branches: | ||
- '**' | ||
push: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
generate-docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone project | ||
uses: actions/checkout@v3 | ||
generate-docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone project | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies | ||
run: yarn install | ||
- name: Use Node.js 22.x | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 22.x | ||
cache: 'yarn' | ||
|
||
- name: Generate docs in markdown | ||
run: yarn run typedoc | ||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile --silent | ||
|
||
- name: Convert md to pdf files | ||
run: yarn run convert-md-to-pdf | ||
- name: Generate docs in markdown | ||
run: yarn run typedoc | ||
|
||
- name: Upload PDF artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: documentations | ||
path: ./docs/**/*.pdf | ||
- name: Convert md to pdf files | ||
run: yarn run convert-md-to-pdf | ||
|
||
- name: Upload PDF artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: documentations | ||
path: ./docs/**/*.pdf |
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 |
---|---|---|
|
@@ -128,5 +128,6 @@ docs/gen | |
*.sln | ||
*.sw? | ||
|
||
#API codegen files | ||
./src/store/LynxScannerApi.ts | ||
# API codegen files | ||
*.gen.* | ||
gen |
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,12 +1,22 @@ | ||
import type { ConfigFile } from '@rtk-query/codegen-openapi' | ||
import type { ConfigFile } from '@rtk-query/codegen-openapi'; | ||
|
||
const baseDir = process.env.GEN_FOLDER!; | ||
|
||
const config: ConfigFile = { | ||
schemaFile: './openapi.yaml', | ||
apiFile: './src/store/emptyApi.ts', | ||
apiImport: 'emptySplitApi', | ||
outputFile: './src/store/LynxScannerApi.ts', | ||
exportName: 'LynxScannerApi', | ||
hooks: true, | ||
} | ||
outputFiles: { | ||
[`${baseDir}/scans.api.gen.ts`]: { | ||
filterEndpoints: /scan/i, | ||
exportName: 'ScansApi', | ||
}, | ||
[`${baseDir}/files.api.gen.ts`]: { | ||
filterEndpoints: [/file/i], | ||
exportName: 'FilesApi', | ||
}, | ||
}, | ||
}; | ||
|
||
export default config | ||
export default config; |
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
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { useEffect, useMemo } from 'react'; | ||
import { Alert } from 'react-daisyui'; | ||
|
||
export interface ErrorDumpProps { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
error: any; | ||
} | ||
|
||
export function ErrorDump({ error }: ErrorDumpProps) { | ||
useEffect(() => { | ||
console.error(error); | ||
}, [error]); | ||
|
||
const errorMessage = useMemo(() => { | ||
if (error?.response?.data?.message) { | ||
return error.response.data.message; | ||
} | ||
if (typeof error === 'string') { | ||
return error; | ||
} | ||
if ('error' in error) { | ||
return error.error; | ||
} | ||
return JSON.stringify(error); | ||
}, [error]); | ||
|
||
return <Alert status="error">{errorMessage}</Alert>; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import type { Scan } from '@api/scans.api.gen.ts'; | ||
import { Button, Pagination } from 'react-daisyui'; | ||
import { ArrowLeft, ArrowRight } from 'react-feather'; | ||
|
||
export interface ScanListDumpProps { | ||
scans: Scan[]; | ||
page: number; | ||
onNext: () => void; | ||
onPrev: () => void; | ||
} | ||
|
||
export function ScanListDump({ | ||
scans, | ||
onPrev, | ||
onNext, | ||
page, | ||
}: ScanListDumpProps) { | ||
return ( | ||
<div> | ||
{scans.map((scan) => ( | ||
<div key={scan.id} className="p-4 border border-gray-300 rounded-md"> | ||
<h3 className="font-bold">{scan.title}</h3> | ||
<pre>{JSON.stringify(scan.meta_data, null, 4)}</pre> | ||
</div> | ||
))} | ||
|
||
<Pagination> | ||
<Button onClick={onPrev} className="join-item"> | ||
<ArrowLeft /> | ||
</Button> | ||
<Button className="join-item">Page {page}</Button> | ||
<Button onClick={onNext} className="join-item"> | ||
<ArrowRight /> | ||
</Button> | ||
</Pagination> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.