File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66import { useLoaderData } from '@remix-run/react'
77import { asyncForEach } from '@arcath/utils'
88import semver from 'semver'
9+ import fs from 'fs'
10+ import path from 'path'
11+ import { nl2br } from '@arcath/utils'
912
1013import { pageTitle } from '~/lib/utils'
1114import { Page } from '~/lib/ui'
@@ -14,6 +17,8 @@ import {getRedis} from '~/lib/redis.server.mjs'
1417import { getPrisma } from '~/lib/prisma.server'
1518import { checkSession } from '~/lib/session'
1619
20+ const { readFile} = fs . promises
21+
1722export const loader = async ( { request} : LoaderFunctionArgs ) => {
1823 const result = await checkSession ( request )
1924
@@ -108,13 +113,18 @@ export const loader = async ({request}: LoaderFunctionArgs) => {
108113 sounderVersions [ id ] = version ? version : '0.0.0'
109114 } )
110115
116+ const license = (
117+ await readFile ( path . join ( process . cwd ( ) , 'LICENSE' ) )
118+ ) . toString ( )
119+
111120 return {
112121 piperData,
113122 sounders,
114123 sounderVersions,
115124 sounderLatest,
116125 ttsLatest,
117- controllerLatest
126+ controllerLatest,
127+ license
118128 }
119129}
120130
@@ -129,7 +139,8 @@ const About = () => {
129139 sounderVersions,
130140 sounderLatest,
131141 ttsLatest,
132- controllerLatest
142+ controllerLatest,
143+ license
133144 } = useLoaderData < typeof loader > ( )
134145
135146 return (
@@ -202,6 +213,11 @@ const About = () => {
202213 } ) }
203214 </ tbody >
204215 </ table >
216+
217+ < div
218+ className = "box text-gray-600"
219+ dangerouslySetInnerHTML = { { __html : nl2br ( license ) } }
220+ />
205221 </ Page >
206222 )
207223}
You can’t perform that action at this time.
0 commit comments