mirror of
https://gitlab.com/MrFry/qmining-data-editor
synced 2025-04-01 20:24:01 +02:00
removed some domain dependencies
This commit is contained in:
parent
f8d423f162
commit
b854b035c7
3 changed files with 9 additions and 41 deletions
18
make.sh
18
make.sh
|
@ -1,18 +1,2 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
scriptPath=$(dirname -- "${0}")
|
npm run export
|
||||||
domainPath="${scriptPath}/../../data/domain"
|
|
||||||
|
|
||||||
domain="${DOMAIN}"
|
|
||||||
|
|
||||||
if [ -z "${domain}" ] && [ -f "${domainPath}" ]; then
|
|
||||||
domain=$(cat "${domainPath}")
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "${domain}" ]; then
|
|
||||||
echo -e "\033[0;41mDOMAIN is not set, and ${domainPath} does not exist!\033[0m"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
NEXT_PUBLIC_DOMAIN="${domain}" npm run export
|
|
||||||
|
|
||||||
echo "Exported with domain: '${domain}'"
|
|
||||||
|
|
|
@ -1,20 +1,9 @@
|
||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
const useLocalhost = process && process.env.NODE_ENV === 'development'
|
const useLocalhost = process && process.env.NODE_ENV === 'development'
|
||||||
// eslint-disable-next-line no-undef
|
|
||||||
const domain = process && process.env.NEXT_PUBLIC_DOMAIN
|
|
||||||
|
|
||||||
if (!domain && !useLocalhost) {
|
|
||||||
throw new Error(
|
|
||||||
'Domain is not defined! Please set NEXT_PUBLIC_DOMAIN env variable!'
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const constants = {
|
const constants = {
|
||||||
domain: domain || 'localhost',
|
siteUrl: useLocalhost ? 'http://localhost:8080/' : '/',
|
||||||
siteUrl: useLocalhost ? 'http://localhost:8080/' : `https://${domain}/`,
|
apiUrl: useLocalhost ? 'http://localhost:8080/api/' : '/',
|
||||||
apiUrl: useLocalhost
|
|
||||||
? 'http://localhost:8080/api/'
|
|
||||||
: `https://${domain}/api/`,
|
|
||||||
maxQuestionsToRender: 250,
|
maxQuestionsToRender: 250,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,8 @@ import styles from './index.module.css'
|
||||||
import commonStyles from '../commonStyles.module.css'
|
import commonStyles from '../commonStyles.module.css'
|
||||||
import constants from '../constants.js'
|
import constants from '../constants.js'
|
||||||
|
|
||||||
|
const domain = typeof window !== 'undefined' ? window.location.domain : ''
|
||||||
|
|
||||||
const Infos = ({ onClick, renderOKButton }) => {
|
const Infos = ({ onClick, renderOKButton }) => {
|
||||||
return (
|
return (
|
||||||
<div className={commonStyles.infoContainer}>
|
<div className={commonStyles.infoContainer}>
|
||||||
|
@ -168,9 +170,7 @@ export default function Index({ router }) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Head>
|
<Head>
|
||||||
<title>
|
<title>Tárgyak - Data Editor | {domain}</title>
|
||||||
Tárgyak - Data Editor | {constants.domain}
|
|
||||||
</title>
|
|
||||||
</Head>
|
</Head>
|
||||||
<DbSelector
|
<DbSelector
|
||||||
qdbs={qdbs}
|
qdbs={qdbs}
|
||||||
|
@ -186,9 +186,7 @@ export default function Index({ router }) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Head>
|
<Head>
|
||||||
<title>
|
<title>Kérdések - Data Editor | {domain}</title>
|
||||||
Kérdések - Data Editor | {constants.domain}
|
|
||||||
</title>
|
|
||||||
</Head>
|
</Head>
|
||||||
<DbSelector
|
<DbSelector
|
||||||
qdbs={qdbs}
|
qdbs={qdbs}
|
||||||
|
@ -204,9 +202,7 @@ export default function Index({ router }) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Head>
|
<Head>
|
||||||
<title>
|
<title>Kérdés beküldés - Data Editor | {domain}</title>
|
||||||
Kérdés beküldés - Data Editor | {constants.domain}
|
|
||||||
</title>
|
|
||||||
</Head>
|
</Head>
|
||||||
<DbSelector
|
<DbSelector
|
||||||
hideLockedDbs
|
hideLockedDbs
|
||||||
|
@ -226,8 +222,7 @@ export default function Index({ router }) {
|
||||||
<>
|
<>
|
||||||
<Head>
|
<Head>
|
||||||
<title>
|
<title>
|
||||||
Kitöltetlen tesztek - Data Editor |{' '}
|
Kitöltetlen tesztek - Data Editor | {domain}
|
||||||
{constants.domain}
|
|
||||||
</title>
|
</title>
|
||||||
</Head>
|
</Head>
|
||||||
<PossibleAnswers refetchDbs={refetchDbs} router={router} />
|
<PossibleAnswers refetchDbs={refetchDbs} router={router} />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue