Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #5 from ilworkcn/v1.9.0_official
Browse files Browse the repository at this point in the history
V1.9.0 official userpanel update  
confirmed
  • Loading branch information
Ice-Ling authored Jun 27, 2022
2 parents 00750c8 + c97da45 commit 005b056
Show file tree
Hide file tree
Showing 47 changed files with 301 additions and 301 deletions.
11 changes: 10 additions & 1 deletion resources/scripts/components/elements/PageContentBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,16 @@ const PageContentBlock: React.FC<PageContentBlockProps> = ({ title, showFlashKey
target={'_blank'}
css={tw`no-underline text-neutral-500 hover:text-neutral-300`}
>
Pterodactyl which Sinicizated by iLwork.CN STUDIO &reg;
Pterodactyl
</a>
which Sinicizated by
<a
rel={'noopener nofollow noreferrer'}
href={'https://ilwork.cn'}
target={'_blank'}
css={tw`no-underline text-neutral-500 hover:text-neutral-300`}
>
iLwork.CN STUDIO &reg;
</a>
&nbsp;&copy; 2015 - {new Date().getFullYear()}
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export default ({ activity, children }: Props) => {
<div className={'col-span-10 sm:col-span-9 flex'}>
<div className={'flex-1 px-4 sm:px-0'}>
<div className={'flex items-center text-gray-50'}>
<Tooltip placement={'top'} content={actor?.email || 'System User'}>
<span>{actor?.username || 'System'}</span>
<Tooltip placement={'top'} content={actor?.email || '系统用户'}>
<span>{actor?.username || '系统'}</span>
</Tooltip>
<span className={'text-gray-400'}>&nbsp;&mdash;&nbsp;</span>
<Link
Expand All @@ -62,7 +62,7 @@ export default ({ activity, children }: Props) => {
</Link>
<div className={classNames(style.icons, 'group-hover:text-gray-300')}>
{activity.isApi && (
<Tooltip placement={'top'} content={'Performed using API Key'}>
<Tooltip placement={'top'} content={'使用 API 进行的操作'}>
<span>
<TerminalIcon />
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ export default ({ meta }: { meta: Record<string, unknown> }) => {

return (
<div className={'self-center md:px-4'}>
<Dialog open={open} onClose={() => setOpen(false)} hideCloseIcon title={'Metadata'}>
<Dialog open={open} onClose={() => setOpen(false)} hideCloseIcon title={'元数据'}>
<pre className={'bg-gray-900 rounded p-2 overflow-x-scroll font-mono text-sm leading-relaxed'}>
{JSON.stringify(meta, null, 2)}
</pre>
<Dialog.Buttons>
<Button.Text onClick={() => setOpen(false)}>Close</Button.Text>
<Button.Text onClick={() => setOpen(false)}>关闭</Button.Text>
</Dialog.Buttons>
</Dialog>
<button
aria-describedby={'View additional event metadata'}
aria-describedby={'查看其他事件元数据'}
className={
'p-2 transition-colors duration-100 text-gray-400 group-hover:text-gray-300 group-hover:hover:text-gray-50'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default () => {
}, [error]);

return (
<ServerContentBlock title={'Activity Log'}>
<ServerContentBlock title={'操作日志'}>
<FlashMessageRender byKey={'server:activity'} />
{(filters.filters?.event || filters.filters?.ip) && (
<div className={'flex justify-end mb-2'}>
Expand All @@ -41,14 +41,14 @@ export default () => {
className={classNames(btnStyles.button, btnStyles.text, 'w-full sm:w-auto')}
onClick={() => setFilters((value) => ({ ...value, filters: {} }))}
>
Clear Filters <XCircleIcon className={'w-4 h-4 ml-2'} />
清除过滤器 <XCircleIcon className={'w-4 h-4 ml-2'} />
</Link>
</div>
)}
{!data && isValidating ? (
<Spinner centered />
) : !data?.items.length ? (
<p className={'text-sm text-center text-gray-400'}>No activity logs available for this server.</p>
<p className={'text-sm text-center text-gray-400'}>服务器目前无可用操作日志.</p>
) : (
<div className={'bg-gray-700'}>
{data?.items.map((activity) => (
Expand Down
10 changes: 5 additions & 5 deletions resources/scripts/components/server/console/Console.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ export default () => {
switch (status) {
// Sent by either the source or target node if a failure occurs.
case 'failure':
terminal.writeln(TERMINAL_PRELUDE + 'Transfer has failed.\u001b[0m');
terminal.writeln(TERMINAL_PRELUDE + '转移失败.\u001b[0m');
return;

// Sent by the source node whenever the server was archived successfully.
case 'archive':
terminal.writeln(
TERMINAL_PRELUDE +
'Server has been archived successfully, attempting connection to target node..\u001b[0m'
'服务器文件已成功压缩打包,正在尝试连接到目标节点服务器..\u001b[0m'
);
}
};
Expand All @@ -91,7 +91,7 @@ export default () => {
);

const handlePowerChangeEvent = (state: string) =>
terminal.writeln(TERMINAL_PRELUDE + 'Server marked as ' + state + '...\u001b[0m');
terminal.writeln(TERMINAL_PRELUDE + '服务器运行状态已更新为 ' + state + '...\u001b[0m');

const handleCommandKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
if (e.key === 'ArrowUp') {
Expand Down Expand Up @@ -204,8 +204,8 @@ export default () => {
<input
className={classNames('peer', styles.command_input)}
type={'text'}
placeholder={'Type a command...'}
aria-label={'Console command input.'}
placeholder={'在这输入指令...'}
aria-label={'控制台指令输入.'}
disabled={!instance || !connected}
onKeyDown={handleCommandKeyDown}
autoCorrect={'off'}
Expand Down
12 changes: 6 additions & 6 deletions resources/scripts/components/server/console/PowerButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ export default ({ className }: PowerButtonProps) => {
open={open}
hideCloseIcon
onClose={() => setOpen(false)}
title={'Forcibly Stop Process'}
confirm={'Continue'}
title={'强制停止进程'}
confirm={'继续'}
onConfirmed={onButtonClick.bind(this, 'kill-confirmed')}
>
Forcibly stopping a server can lead to data corruption.
强行停止服务器会导致数据损坏。
</Dialog.Confirm>
<Can action={'control.start'}>
<Button
className={'w-full sm:w-24'}
disabled={status !== 'offline'}
onClick={onButtonClick.bind(this, 'start')}
>
Start
启动
</Button>
</Can>
<Can action={'control.restart'}>
Expand All @@ -63,7 +63,7 @@ export default ({ className }: PowerButtonProps) => {
disabled={!status}
onClick={onButtonClick.bind(this, 'restart')}
>
Restart
重启
</Button.Text>
</Can>
<Can action={'control.stop'}>
Expand All @@ -72,7 +72,7 @@ export default ({ className }: PowerButtonProps) => {
disabled={status === 'offline'}
onClick={onButtonClick.bind(this, killable ? 'kill' : 'stop')}
>
{killable ? 'Kill' : 'Stop'}
{killable ? '强制停止' : '停止'}
</Button.Danger>
</Can>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const ServerConsoleContainer = () => {
const eggFeatures = ServerContext.useStoreState((state) => state.server.data!.eggFeatures, isEqual);

return (
<ServerContentBlock title={'Console'} className={'flex flex-col gap-2 sm:gap-4'}>
<ServerContentBlock title={'控制台'} className={'flex flex-col gap-2 sm:gap-4'}>
<div className={'flex gap-4 items-end'}>
<div className={'hidden sm:block flex-1'}>
<h1 className={'font-header text-2xl text-gray-50 leading-relaxed line-clamp-1'}>{name}</h1>
Expand All @@ -45,17 +45,17 @@ const ServerConsoleContainer = () => {
<div css={tw`mt-4 rounded bg-yellow-500 p-3`}>
<ContentContainer>
<p css={tw`text-sm text-yellow-900`}>
This server is currently running its installation process and most actions are
unavailable.
此服务器实例当前正在运行其安装过程,大多数操作都是
不可用的。
</p>
</ContentContainer>
</div>
) : isTransferring ? (
<div css={tw`mt-4 rounded bg-yellow-500 p-3`}>
<ContentContainer>
<p css={tw`text-sm text-yellow-900`}>
This server is currently being transferred to another node and all actions are
unavailable.
此服务器实例当前正在转移到另一个节点服务器,所有操作
都不可用。
</p>
</ContentContainer>
</div>
Expand Down
40 changes: 20 additions & 20 deletions resources/scripts/components/server/console/ServerDetailsBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,67 +72,67 @@ const ServerDetailsBlock = ({ className }: { className?: string }) => {

return (
<div className={classNames('grid grid-cols-6 gap-2 md:gap-4', className)}>
<StatBlock icon={faWifi} title={'Address'}>
<StatBlock icon={faWifi} title={'连接地址'}>
{allocation}
</StatBlock>
<StatBlock
icon={faClock}
title={'Uptime'}
title={'运行时间'}
color={getBackgroundColor(status === 'running' ? 0 : status !== 'offline' ? 9 : 10, 10)}
>
{stats.uptime > 0 ? <UptimeDuration uptime={stats.uptime / 1000} /> : 'Offline'}
{stats.uptime > 0 ? <UptimeDuration uptime={stats.uptime / 1000} /> : '离线'}
</StatBlock>
<StatBlock
icon={faMicrochip}
title={'CPU Load'}
title={'CPU 负载'}
color={getBackgroundColor(stats.cpu, limits.cpu)}
description={
limits.cpu
? `This server is allowed to use up to ${limits.cpu}% of the host's available CPU resources.`
: 'No CPU limit has been configured for this server.'
? `此服务器允许使用 ${limits.cpu}% CPU 处理资源.`
: '此服务器可无限制使用 CPU 处理资源.'
}
>
{status === 'offline' ? <span className={'text-gray-400'}>Offline</span> : `${stats.cpu.toFixed(2)}%`}
{status === 'offline' ? <span className={'text-gray-400'}>离线</span> : `${stats.cpu.toFixed(2)}%`}
</StatBlock>
<StatBlock
icon={faMemory}
title={'Memory'}
title={'运行内存'}
color={getBackgroundColor(stats.memory / 1024, limits.memory * 1024)}
description={
limits.memory
? `This server is allowed to use up to ${bytesToString(mbToBytes(limits.memory))} of memory.`
: 'No memory limit has been configured for this server.'
? `此服务器允许使用 ${bytesToString(mbToBytes(limits.memory))} 的运行内存.`
: '此服务器可无限制使用运行内存资源.'
}
>
{status === 'offline' ? <span className={'text-gray-400'}>Offline</span> : bytesToString(stats.memory)}
{status === 'offline' ? <span className={'text-gray-400'}>离线</span> : bytesToString(stats.memory)}
</StatBlock>
<StatBlock
icon={faHdd}
title={'Disk'}
title={'存储空间'}
color={getBackgroundColor(stats.disk / 1024, limits.disk * 1024)}
description={
limits.disk
? `This server is allowed to use up to ${bytesToString(mbToBytes(limits.disk))} of disk space.`
: 'No disk space limit has been configured for this server.'
? `此服务器允许使用 ${bytesToString(mbToBytes(limits.disk))} 的存储空间.`
: '此服务器可无限制使用存储空间资源.'
}
>
{bytesToString(stats.disk)}
</StatBlock>
<StatBlock
icon={faCloudDownloadAlt}
title={'Network (Inbound)'}
description={'The total amount of network traffic that your server has recieved since it was started.'}
title={'网络流量 (接收)'}
description={'您的服务器自启动以来收到的网络流量总量.'}
>
{status === 'offline' ? <span className={'text-gray-400'}>Offline</span> : bytesToString(stats.tx)}
{status === 'offline' ? <span className={'text-gray-400'}>离线</span> : bytesToString(stats.tx)}
</StatBlock>
<StatBlock
icon={faCloudUploadAlt}
title={'Network (Outbound)'}
title={'网络流量 (发送)'}
description={
'The total amount of traffic your server has sent across the internet since it was started.'
'您的服务器自启动以来向广域网发送的总流量.'
}
>
{status === 'offline' ? <span className={'text-gray-400'}>Offline</span> : bytesToString(stats.rx)}
{status === 'offline' ? <span className={'text-gray-400'}>离线</span> : bytesToString(stats.rx)}
</StatBlock>
</div>
);
Expand Down
12 changes: 6 additions & 6 deletions resources/scripts/components/server/console/StatGraphs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default () => {
callback(opts, index) {
return {
...opts,
label: !index ? 'Network In' : 'Network Out',
label: !index ? '接收网络流量' : '发送网络流量',
borderColor: !index ? theme('colors.cyan.400') : theme('colors.yellow.400'),
backgroundColor: hexToRgba(!index ? theme('colors.cyan.700') : theme('colors.yellow.700'), 0.5),
};
Expand Down Expand Up @@ -69,20 +69,20 @@ export default () => {

return (
<>
<ChartBlock title={'CPU Load'}>
<ChartBlock title={'CPU 负载'}>
<Line {...cpu.props} />
</ChartBlock>
<ChartBlock title={'Memory'}>
<ChartBlock title={'运行内存'}>
<Line {...memory.props} />
</ChartBlock>
<ChartBlock
title={'Network'}
title={'网络流量'}
legend={
<>
<Tooltip arrow content={'Inbound'}>
<Tooltip arrow content={'接收'}>
<CloudDownloadIcon className={'mr-2 w-4 h-4 text-yellow-400'} />
</Tooltip>
<Tooltip arrow content={'Outbound'}>
<Tooltip arrow content={'发送'}>
<CloudUploadIcon className={'w-4 h-4 text-cyan-400'} />
</Tooltip>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,25 +75,24 @@ const GSLTokenModalFeature = () => {
>
<FlashMessageRender key={'feature:gslToken'} css={tw`mb-4`} />
<Form>
<h2 css={tw`text-2xl mb-4 text-neutral-100`}>Invalid GSL token!</h2>
<h2 css={tw`text-2xl mb-4 text-neutral-100`}>GSL 令牌无效!</h2>
<p css={tw`mt-4`}>
It seems like your Gameserver Login Token (GSL token) is invalid or has expired.
您的游戏服务器登录令牌(GSL 令牌)似乎无效或已过期。
</p>
<p css={tw`mt-4`}>
You can either generate a new one and enter it below or leave the field blank to remove it
completely.
您可以生成一个新的并在下面输入,也可以将该字段留空以将其完全删除.
</p>
<div css={tw`sm:flex items-center mt-4`}>
<Field
name={'gslToken'}
label={'GSL Token'}
description={'Visit https://steamcommunity.com/dev/managegameservers to generate a token.'}
label={'GSL 令牌'}
description={'访问 https://steamcommunity.com/dev/managegameservers 以生成令牌.'}
autoFocus
/>
</div>
<div css={tw`mt-8 sm:flex items-center justify-end`}>
<Button type={'submit'} css={tw`mt-4 sm:mt-0 sm:ml-4 w-full sm:w-auto`}>
Update GSL Token
更新 GSL 令牌
</Button>
</div>
</Form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ const JavaVersionModalFeature = () => {
showSpinnerOverlay={loading}
>
<FlashMessageRender key={'feature:javaVersion'} css={tw`mb-4`} />
<h2 css={tw`text-2xl mb-4 text-neutral-100`}>Unsupported Java Version</h2>
<h2 css={tw`text-2xl mb-4 text-neutral-100`}>此服务端程序不兼容该 Java 版本,更换 Docker 镜像吗?</h2>
<p css={tw`mt-4`}>
This server is currently running an unsupported version of Java and cannot be started.
由于未满足所需的 Java 版本,此服务器无法启动.
<Can action={'startup.docker-image'}>
&nbsp;Please select a supported version from the list below to continue starting the server.
&nbsp;请在下方选择合适的 JDK 版本 Docker 镜像以启动服务端程序.
</Can>
</p>
<Can action={'startup.docker-image'}>
Expand All @@ -102,11 +102,11 @@ const JavaVersionModalFeature = () => {
</Can>
<div css={tw`mt-8 flex flex-col sm:flex-row justify-end sm:space-x-4 space-y-4 sm:space-y-0`}>
<Button isSecondary onClick={() => setVisible(false)} css={tw`w-full sm:w-auto`}>
Cancel
取消
</Button>
<Can action={'startup.docker-image'}>
<Button onClick={updateJava} css={tw`w-full sm:w-auto`}>
Update Docker Image
更新 Docker 镜像
</Button>
</Can>
</div>
Expand Down
Loading

0 comments on commit 005b056

Please sign in to comment.