mirror of
https://github.com/Grasscutters/Meadow.git
synced 2024-11-30 07:40:28 +00:00
Lint with Prettier
This commit is contained in:
parent
2609912468
commit
6f851acc1d
12
.prettierrc
Normal file
12
.prettierrc
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"arrowParens": "always",
|
||||||
|
"bracketSpacing": true,
|
||||||
|
"endOfLine": "lf",
|
||||||
|
"jsxSingleQuote": false,
|
||||||
|
"jsxBracketSameLine": false,
|
||||||
|
"semi": true,
|
||||||
|
"singleQuote": false,
|
||||||
|
"tabWidth": 4,
|
||||||
|
"trailingComma": "none",
|
||||||
|
"useTabs": false
|
||||||
|
}
|
@ -6,6 +6,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Grasscutters</title>
|
<title>Grasscutters</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
<script type="module" src="/src/main.tsx"></script>
|
<script type="module" src="/src/main.tsx"></script>
|
||||||
|
@ -16,9 +16,10 @@
|
|||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-icons": "^4.8.0",
|
"react-icons": "^4.8.0",
|
||||||
|
"react-markdown": "^8.0.7",
|
||||||
"react-router-dom": "^6.11.1",
|
"react-router-dom": "^6.11.1",
|
||||||
"react-syntax-highlighter": "^15.5.0",
|
"react-syntax-highlighter": "^15.5.0",
|
||||||
"react-markdown": "^8.0.7",
|
|
||||||
"rehype-raw": "^6.1.1"
|
"rehype-raw": "^6.1.1"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -106,7 +106,8 @@
|
|||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Downloads_More_Grasscutter, .Downloads_More_Cultivation {
|
.Downloads_More_Grasscutter,
|
||||||
|
.Downloads_More_Cultivation {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -122,7 +123,8 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Downloads_More_Grasscutter h5, .Downloads_More_Cultivation h5 {
|
.Downloads_More_Grasscutter h5,
|
||||||
|
.Downloads_More_Cultivation h5 {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
@ -91,7 +91,7 @@
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
font-family: 'Roboto', sans-serif;
|
font-family: "Roboto", sans-serif;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
max-width: 1200px;
|
max-width: 1200px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -173,7 +173,7 @@
|
|||||||
padding: 5px;
|
padding: 5px;
|
||||||
background-color: rgba(26, 26, 26, 0.35);
|
background-color: rgba(26, 26, 26, 0.35);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
font-family: 'Roboto Mono', monospace;
|
font-family: "Roboto Mono", monospace;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,7 +185,7 @@
|
|||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-family: 'Roboto Mono', monospace;
|
font-family: "Roboto Mono", monospace;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Wiki_Markdown pre code {
|
.Wiki_Markdown pre code {
|
||||||
@ -194,7 +194,7 @@
|
|||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-family: 'Roboto Mono', monospace;
|
font-family: "Roboto Mono", monospace;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Wiki_Markdown table {
|
.Wiki_Markdown table {
|
||||||
@ -243,9 +243,8 @@
|
|||||||
transform: translateX(0);
|
transform: translateX(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
.Wiki_Markdown pre, .Wiki_Markdown pre code {
|
.Wiki_Markdown pre,
|
||||||
|
.Wiki_Markdown pre code {
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -166,5 +166,5 @@ export type DocsObject = {
|
|||||||
self: string;
|
self: string;
|
||||||
git: string;
|
git: string;
|
||||||
html: string;
|
html: string;
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
|
@ -20,7 +20,7 @@ class Header extends React.Component<{}, IState> {
|
|||||||
this.state = {
|
this.state = {
|
||||||
isOpaque: false,
|
isOpaque: false,
|
||||||
isMobile: window.innerWidth < 875,
|
isMobile: window.innerWidth < 875,
|
||||||
isMenuOpen: false,
|
isMenuOpen: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ class BasicButton extends React.Component<IProps> {
|
|||||||
backgroundColor: !this.props.outline
|
backgroundColor: !this.props.outline
|
||||||
? this.props.color
|
? this.props.color
|
||||||
: "transparent",
|
: "transparent",
|
||||||
border: this.props.outline ? `1px solid #fff` : "none",
|
border: this.props.outline ? `1px solid #fff` : "none"
|
||||||
}}
|
}}
|
||||||
onClick={this.props.onClick}
|
onClick={this.props.onClick}
|
||||||
>
|
>
|
||||||
|
@ -54,7 +54,7 @@ class Loader extends React.Component {
|
|||||||
"Downloading more RAM...",
|
"Downloading more RAM...",
|
||||||
"Optimizing the optimizer...",
|
"Optimizing the optimizer...",
|
||||||
"Never let a computer know you're in a hurry.",
|
"Never let a computer know you're in a hurry.",
|
||||||
"Deleting your \"homework\" folder...",
|
'Deleting your "homework" folder...',
|
||||||
"Discovering new ways of making you wait...",
|
"Discovering new ways of making you wait...",
|
||||||
"Your time is very important to us. Please wait while we ignore you...",
|
"Your time is very important to us. Please wait while we ignore you...",
|
||||||
"Sorry we are busy catching em' all, we'll be done soon",
|
"Sorry we are busy catching em' all, we'll be done soon",
|
||||||
@ -79,7 +79,9 @@ class Loader extends React.Component {
|
|||||||
];
|
];
|
||||||
|
|
||||||
private getRandomLoadingText(): string {
|
private getRandomLoadingText(): string {
|
||||||
return this.loadingText[Math.floor(Math.random() * this.loadingText.length)];
|
return this.loadingText[
|
||||||
|
Math.floor(Math.random() * this.loadingText.length)
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
@ -2,10 +2,10 @@ import React from "react";
|
|||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
|
|
||||||
const Router = (Children: React.ComponentClass<any>) => {
|
const Router = (Children: React.ComponentClass<any>) => {
|
||||||
return(props: any) => {
|
return (props: any) => {
|
||||||
const match = { params: useParams() };
|
const match = { params: useParams() };
|
||||||
return <Children {...props} match={match}/>
|
return <Children {...props} match={match} />;
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
|
|
||||||
export default Router;
|
export default Router;
|
||||||
|
@ -29,7 +29,7 @@ class TeamMember extends React.Component<IProps, never> {
|
|||||||
backgroundColor:
|
backgroundColor:
|
||||||
this.props.badge === "CREATOR"
|
this.props.badge === "CREATOR"
|
||||||
? "#ffe35a"
|
? "#ffe35a"
|
||||||
: "#f67d69",
|
: "#f67d69"
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{this.props.badge}
|
{this.props.badge}
|
||||||
|
@ -19,7 +19,7 @@ import {
|
|||||||
Config,
|
Config,
|
||||||
RunMode,
|
RunMode,
|
||||||
ServerDebugMode,
|
ServerDebugMode,
|
||||||
LogLevel,
|
LogLevel
|
||||||
} from "@app/types";
|
} from "@app/types";
|
||||||
import { getDefaultConfig } from "@app/utils";
|
import { getDefaultConfig } from "@app/utils";
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ class ConfigGen extends React.Component<{}, IState> {
|
|||||||
this.state = {
|
this.state = {
|
||||||
mailItems: [],
|
mailItems: [],
|
||||||
regions: [],
|
regions: [],
|
||||||
config: null,
|
config: null
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,9 +70,9 @@ class ConfigGen extends React.Component<{}, IState> {
|
|||||||
"config-add-item-level"
|
"config-add-item-level"
|
||||||
) as HTMLInputElement
|
) as HTMLInputElement
|
||||||
)?.value || "0"
|
)?.value || "0"
|
||||||
),
|
)
|
||||||
},
|
}
|
||||||
],
|
]
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.setState({
|
this.setState({
|
||||||
@ -103,9 +103,9 @@ class ConfigGen extends React.Component<{}, IState> {
|
|||||||
document.getElementById(
|
document.getElementById(
|
||||||
"config-add-region-ip"
|
"config-add-region-ip"
|
||||||
) as HTMLInputElement
|
) as HTMLInputElement
|
||||||
)?.value || "",
|
)?.value || ""
|
||||||
},
|
}
|
||||||
],
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -113,11 +113,11 @@ class ConfigGen extends React.Component<{}, IState> {
|
|||||||
private deleteListItem = (item: MailItem | Region) => {
|
private deleteListItem = (item: MailItem | Region) => {
|
||||||
if (item.hasOwnProperty("itemId")) {
|
if (item.hasOwnProperty("itemId")) {
|
||||||
this.setState({
|
this.setState({
|
||||||
mailItems: this.state.mailItems.filter((i) => i !== item),
|
mailItems: this.state.mailItems.filter((i) => i !== item)
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.setState({
|
this.setState({
|
||||||
regions: this.state.regions.filter((i) => i !== item),
|
regions: this.state.regions.filter((i) => i !== item)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -712,7 +712,7 @@ class ConfigGen extends React.Component<{}, IState> {
|
|||||||
private downloadConfig = () => {
|
private downloadConfig = () => {
|
||||||
const element = document.createElement("a");
|
const element = document.createElement("a");
|
||||||
const file = new Blob([JSON.stringify(this.state.config, null, 4)], {
|
const file = new Blob([JSON.stringify(this.state.config, null, 4)], {
|
||||||
type: "text/plain",
|
type: "text/plain"
|
||||||
});
|
});
|
||||||
element.href = URL.createObjectURL(file);
|
element.href = URL.createObjectURL(file);
|
||||||
element.download = "config.json";
|
element.download = "config.json";
|
||||||
|
@ -23,7 +23,7 @@ class Downloads extends React.Component<{}, IState> {
|
|||||||
grasscutterVersion: "",
|
grasscutterVersion: "",
|
||||||
grasscutterDownloadLink: "",
|
grasscutterDownloadLink: "",
|
||||||
cultivationVersion: "",
|
cultivationVersion: "",
|
||||||
cultivationDownloadLink: "",
|
cultivationDownloadLink: ""
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ class Downloads extends React.Component<{}, IState> {
|
|||||||
grasscutterVersion: data.grasscutter.version,
|
grasscutterVersion: data.grasscutter.version,
|
||||||
grasscutterDownloadLink: data.grasscutter.url,
|
grasscutterDownloadLink: data.grasscutter.url,
|
||||||
cultivationVersion: data.cultivation.version,
|
cultivationVersion: data.cultivation.version,
|
||||||
cultivationDownloadLink: data.cultivation.url,
|
cultivationDownloadLink: data.cultivation.url
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ class Home extends React.Component<{}, IState> {
|
|||||||
this.state = {
|
this.state = {
|
||||||
stars: 0,
|
stars: 0,
|
||||||
forks: 0,
|
forks: 0,
|
||||||
watchers: 0,
|
watchers: 0
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ class Home extends React.Component<{}, IState> {
|
|||||||
this.setState({
|
this.setState({
|
||||||
stars: stats.stars,
|
stars: stats.stars,
|
||||||
forks: stats.forks,
|
forks: stats.forks,
|
||||||
watchers: stats.watchers,
|
watchers: stats.watchers
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -13,8 +13,7 @@ import { getDocsAsync, getDocsContentAsync, getReadmeAsync } from "@app/utils";
|
|||||||
import "@css/pages/Wiki.css";
|
import "@css/pages/Wiki.css";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
match: { params: { page: string; } };
|
match: { params: { page: string } };
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IState {
|
interface IState {
|
||||||
@ -29,7 +28,7 @@ class Wiki extends React.Component<IProps, IState> {
|
|||||||
this.state = {
|
this.state = {
|
||||||
docs: [],
|
docs: [],
|
||||||
content: ""
|
content: ""
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private setDocPages = async () => {
|
private setDocPages = async () => {
|
||||||
@ -41,40 +40,52 @@ class Wiki extends React.Component<IProps, IState> {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.setState({ docs });
|
this.setState({ docs });
|
||||||
}
|
};
|
||||||
|
|
||||||
private loadDocContent = async () => {
|
private loadDocContent = async () => {
|
||||||
if (this.props.match.params.page === "Home") {
|
if (this.props.match.params.page === "Home") {
|
||||||
let content = await getReadmeAsync();
|
let content = await getReadmeAsync();
|
||||||
content = content.replaceAll("(docs/", "(https://github.com/Grasscutters/Grasscutter/tree/development/docs/");
|
content = content.replaceAll(
|
||||||
|
"(docs/",
|
||||||
|
"(https://github.com/Grasscutters/Grasscutter/tree/development/docs/"
|
||||||
|
);
|
||||||
this.setState({ content });
|
this.setState({ content });
|
||||||
} else {
|
} else {
|
||||||
const doc = this.state.docs.find(doc => doc.name === `${this.props.match.params.page}.md`);
|
const doc = this.state.docs.find(
|
||||||
|
(doc) => doc.name === `${this.props.match.params.page}.md`
|
||||||
|
);
|
||||||
if (doc) {
|
if (doc) {
|
||||||
const content = await getDocsContentAsync(doc.download_url);
|
const content = await getDocsContentAsync(doc.download_url);
|
||||||
this.setState({ content });
|
this.setState({ content });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
toggleOpaqueHeader = (opaque: boolean) => {
|
toggleOpaqueHeader = (opaque: boolean) => {
|
||||||
const header = document.getElementsByClassName("Header")[0] as HTMLElement;
|
const header = document.getElementsByClassName(
|
||||||
|
"Header"
|
||||||
|
)[0] as HTMLElement;
|
||||||
if (opaque) {
|
if (opaque) {
|
||||||
header.style.background = "#1186ce";
|
header.style.background = "#1186ce";
|
||||||
} else {
|
} else {
|
||||||
header.style.background = "linear-gradient(0deg, transparent, rgba(0, 0, 0, 0.7))";
|
header.style.background =
|
||||||
}
|
"linear-gradient(0deg, transparent, rgba(0, 0, 0, 0.7))";
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
openSidebar = () => {
|
openSidebar = () => {
|
||||||
const sidebar = document.getElementsByClassName("Wiki_Sidebar")[0] as HTMLElement;
|
const sidebar = document.getElementsByClassName(
|
||||||
|
"Wiki_Sidebar"
|
||||||
|
)[0] as HTMLElement;
|
||||||
sidebar.style.transform = "translateX(0)";
|
sidebar.style.transform = "translateX(0)";
|
||||||
}
|
};
|
||||||
|
|
||||||
closeSidebar = () => {
|
closeSidebar = () => {
|
||||||
const sidebar = document.getElementsByClassName("Wiki_Sidebar")[0] as HTMLElement;
|
const sidebar = document.getElementsByClassName(
|
||||||
|
"Wiki_Sidebar"
|
||||||
|
)[0] as HTMLElement;
|
||||||
sidebar.style.transform = "translateX(-100%)";
|
sidebar.style.transform = "translateX(-100%)";
|
||||||
}
|
};
|
||||||
|
|
||||||
async componentDidMount() {
|
async componentDidMount() {
|
||||||
this.toggleOpaqueHeader(true);
|
this.toggleOpaqueHeader(true);
|
||||||
@ -100,30 +111,46 @@ class Wiki extends React.Component<IProps, IState> {
|
|||||||
<BsChevronRight />
|
<BsChevronRight />
|
||||||
</div>
|
</div>
|
||||||
<div className={"Wiki_Sidebar"}>
|
<div className={"Wiki_Sidebar"}>
|
||||||
<BsChevronLeft className={"Wiki_Sidebar_Close"} onClick={this.closeSidebar} />
|
<BsChevronLeft
|
||||||
|
className={"Wiki_Sidebar_Close"}
|
||||||
|
onClick={this.closeSidebar}
|
||||||
|
/>
|
||||||
|
|
||||||
{
|
{this.state.docs.map((doc, index) => {
|
||||||
this.state.docs.map((doc, index) => {
|
|
||||||
return (
|
return (
|
||||||
<NavLink
|
<NavLink
|
||||||
key={index}
|
key={index}
|
||||||
to={`/wiki/${doc.path.substring(0, doc.path.length - 3)}`}
|
to={`/wiki/${doc.path.substring(
|
||||||
|
0,
|
||||||
|
doc.path.length - 3
|
||||||
|
)}`}
|
||||||
>
|
>
|
||||||
{({ isActive }) => {
|
{({ isActive }) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{isActive && (<div className={"Wiki_Sidebar_Item_Active"}/>)}
|
{isActive && (
|
||||||
{doc.name.substring(0, doc.name.length - 3)}
|
<div
|
||||||
|
className={
|
||||||
|
"Wiki_Sidebar_Item_Active"
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{doc.name.substring(
|
||||||
|
0,
|
||||||
|
doc.name.length - 3
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
</NavLink>
|
</NavLink>
|
||||||
);
|
);
|
||||||
})
|
})}
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
<div className={"Wiki_Content"}>
|
<div className={"Wiki_Content"}>
|
||||||
<ReactMarkdown className={"Wiki_Markdown"} rehypePlugins={[rehypeRaw]}>
|
<ReactMarkdown
|
||||||
|
className={"Wiki_Markdown"}
|
||||||
|
rehypePlugins={[rehypeRaw]}
|
||||||
|
>
|
||||||
{this.state.content}
|
{this.state.content}
|
||||||
</ReactMarkdown>
|
</ReactMarkdown>
|
||||||
</div>
|
</div>
|
||||||
|
72
src/utils.ts
72
src/utils.ts
@ -7,7 +7,7 @@ const gc_docs: string = "grasscutters/grasscutter-docs";
|
|||||||
*/
|
*/
|
||||||
export async function getStatsAsync() {
|
export async function getStatsAsync() {
|
||||||
const res = await fetch(`https://api.github.com/repos/${grasscutter}`, {
|
const res = await fetch(`https://api.github.com/repos/${grasscutter}`, {
|
||||||
headers: { Accept: "application/vnd.github.v3+json" },
|
headers: { Accept: "application/vnd.github.v3+json" }
|
||||||
});
|
});
|
||||||
|
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
@ -15,7 +15,7 @@ export async function getStatsAsync() {
|
|||||||
return {
|
return {
|
||||||
stars: data.stargazers_count,
|
stars: data.stargazers_count,
|
||||||
forks: data.forks_count,
|
forks: data.forks_count,
|
||||||
watchers: data.subscribers_count,
|
watchers: data.subscribers_count
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ export async function getLatestReleaseAsync() {
|
|||||||
const resGC = await fetch(
|
const resGC = await fetch(
|
||||||
`https://api.github.com/repos/${grasscutter}/releases/latest`,
|
`https://api.github.com/repos/${grasscutter}/releases/latest`,
|
||||||
{
|
{
|
||||||
headers: { Accept: "application/vnd.github.v3+json" },
|
headers: { Accept: "application/vnd.github.v3+json" }
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ export async function getLatestReleaseAsync() {
|
|||||||
const resC = await fetch(
|
const resC = await fetch(
|
||||||
`https://api.github.com/repos/${cultivation}/releases/latest`,
|
`https://api.github.com/repos/${cultivation}/releases/latest`,
|
||||||
{
|
{
|
||||||
headers: { Accept: "application/vnd.github.v3+json" },
|
headers: { Accept: "application/vnd.github.v3+json" }
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -51,12 +51,12 @@ export async function getLatestReleaseAsync() {
|
|||||||
return {
|
return {
|
||||||
grasscutter: {
|
grasscutter: {
|
||||||
version: dataGC.tag_name,
|
version: dataGC.tag_name,
|
||||||
url: dataGC.assets[0].browser_download_url,
|
url: dataGC.assets[0].browser_download_url
|
||||||
},
|
},
|
||||||
cultivation: {
|
cultivation: {
|
||||||
version: dataC.tag_name,
|
version: dataC.tag_name,
|
||||||
url: dataC.assets[0].browser_download_url,
|
url: dataC.assets[0].browser_download_url
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,28 +72,28 @@ export function getDefaultConfig(): Config {
|
|||||||
data: "./data/",
|
data: "./data/",
|
||||||
packets: "./packets/",
|
packets: "./packets/",
|
||||||
scripts: "resources:Scripts/",
|
scripts: "resources:Scripts/",
|
||||||
plugins: "./plugins/",
|
plugins: "./plugins/"
|
||||||
},
|
},
|
||||||
databaseInfo: {
|
databaseInfo: {
|
||||||
server: {
|
server: {
|
||||||
connectionUri: "mongodb://localhost:27017",
|
connectionUri: "mongodb://localhost:27017",
|
||||||
collection: "grasscutter",
|
collection: "grasscutter"
|
||||||
},
|
},
|
||||||
game: {
|
game: {
|
||||||
connectionUri: "mongodb://localhost:27017",
|
connectionUri: "mongodb://localhost:27017",
|
||||||
collection: "grasscutter",
|
collection: "grasscutter"
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
language: {
|
language: {
|
||||||
language: "en_US",
|
language: "en_US",
|
||||||
fallback: "en_US",
|
fallback: "en_US",
|
||||||
document: "EN",
|
document: "EN"
|
||||||
},
|
},
|
||||||
account: {
|
account: {
|
||||||
autoCreate: false,
|
autoCreate: false,
|
||||||
EXPERIMENTAL_RealPassword: false,
|
EXPERIMENTAL_RealPassword: false,
|
||||||
defaultPermissions: [],
|
defaultPermissions: [],
|
||||||
maxPlayers: -1,
|
maxPlayers: -1
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
debugWhitelist: [],
|
debugWhitelist: [],
|
||||||
@ -109,18 +109,18 @@ export function getDefaultConfig(): Config {
|
|||||||
useEncryption: true,
|
useEncryption: true,
|
||||||
useInRouting: true,
|
useInRouting: true,
|
||||||
keystore: "./keystore.p12",
|
keystore: "./keystore.p12",
|
||||||
keystorePassword: "123456",
|
keystorePassword: "123456"
|
||||||
},
|
},
|
||||||
policies: {
|
policies: {
|
||||||
cors: {
|
cors: {
|
||||||
enabled: false,
|
enabled: false,
|
||||||
allowedOrigins: ["*"],
|
allowedOrigins: ["*"]
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
files: {
|
files: {
|
||||||
indexFile: "./index.html",
|
indexFile: "./index.html",
|
||||||
errorFile: "./error.html",
|
errorFile: "./error.html"
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
game: {
|
game: {
|
||||||
bindAddress: "0.0.0.0",
|
bindAddress: "0.0.0.0",
|
||||||
@ -140,11 +140,11 @@ export function getDefaultConfig(): Config {
|
|||||||
relics: 2000,
|
relics: 2000,
|
||||||
materials: 2000,
|
materials: 2000,
|
||||||
furniture: 2000,
|
furniture: 2000,
|
||||||
all: 30000,
|
all: 30000
|
||||||
},
|
},
|
||||||
avatarLimits: {
|
avatarLimits: {
|
||||||
singlePlayerTeam: 4,
|
singlePlayerTeam: 4,
|
||||||
multiPlayerTeam: 4,
|
multiPlayerTeam: 4
|
||||||
},
|
},
|
||||||
sceneEntityLimit: 1000,
|
sceneEntityLimit: 1000,
|
||||||
watchGachaConfig: false,
|
watchGachaConfig: false,
|
||||||
@ -155,8 +155,8 @@ export function getDefaultConfig(): Config {
|
|||||||
resinOptions: {
|
resinOptions: {
|
||||||
resinUsage: false,
|
resinUsage: false,
|
||||||
cap: 160,
|
cap: 160,
|
||||||
rechargeTime: 480,
|
rechargeTime: 480
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
serverAccount: {
|
serverAccount: {
|
||||||
avatarId: 10000007,
|
avatarId: 10000007,
|
||||||
@ -164,7 +164,7 @@ export function getDefaultConfig(): Config {
|
|||||||
adventureRank: 1,
|
adventureRank: 1,
|
||||||
worldLevel: 0,
|
worldLevel: 0,
|
||||||
nickname: "Server",
|
nickname: "Server",
|
||||||
signature: "Welcome to Grasscutter!",
|
signature: "Welcome to Grasscutter!"
|
||||||
},
|
},
|
||||||
joinOptions: {
|
joinOptions: {
|
||||||
welcomeEmotes: [2007, 1002, 4010],
|
welcomeEmotes: [2007, 1002, 4010],
|
||||||
@ -178,21 +178,21 @@ export function getDefaultConfig(): Config {
|
|||||||
{
|
{
|
||||||
itemId: 13509,
|
itemId: 13509,
|
||||||
itemCount: 1,
|
itemCount: 1,
|
||||||
itemLevel: 1,
|
itemLevel: 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
itemId: 201,
|
itemId: 201,
|
||||||
itemCount: 99999,
|
itemCount: 99999,
|
||||||
itemLevel: 1,
|
itemLevel: 1
|
||||||
},
|
}
|
||||||
],
|
]
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
dispatch: {
|
dispatch: {
|
||||||
regions: [],
|
regions: [],
|
||||||
defaultName: "Grasscutter",
|
defaultName: "Grasscutter",
|
||||||
logRequests: "NONE",
|
logRequests: "NONE"
|
||||||
},
|
},
|
||||||
debugMode: {
|
debugMode: {
|
||||||
serverLoggerLevel: "DEBUG",
|
serverLoggerLevel: "DEBUG",
|
||||||
@ -200,9 +200,9 @@ export function getDefaultConfig(): Config {
|
|||||||
logPackets: "ALL",
|
logPackets: "ALL",
|
||||||
isShowPacketPayload: false,
|
isShowPacketPayload: false,
|
||||||
isShowLoopPackets: false,
|
isShowLoopPackets: false,
|
||||||
logRequests: "ALL",
|
logRequests: "ALL"
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,7 +215,7 @@ export async function getDocsAsync(): Promise<DocsObject[]> {
|
|||||||
const res = await fetch(
|
const res = await fetch(
|
||||||
`https://api.github.com/repos/${gc_docs}/contents/`,
|
`https://api.github.com/repos/${gc_docs}/contents/`,
|
||||||
{
|
{
|
||||||
headers: { Accept: "application/vnd.github.v3+json" },
|
headers: { Accept: "application/vnd.github.v3+json" }
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -226,7 +226,9 @@ export async function getDocsAsync(): Promise<DocsObject[]> {
|
|||||||
* Fetches the content of the docs file
|
* Fetches the content of the docs file
|
||||||
* @param download_url The download url of the file
|
* @param download_url The download url of the file
|
||||||
*/
|
*/
|
||||||
export async function getDocsContentAsync(download_url: string): Promise<string> {
|
export async function getDocsContentAsync(
|
||||||
|
download_url: string
|
||||||
|
): Promise<string> {
|
||||||
const res = await fetch(download_url);
|
const res = await fetch(download_url);
|
||||||
|
|
||||||
return await res.text();
|
return await res.text();
|
||||||
|
Loading…
Reference in New Issue
Block a user