mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 05:29:26 +08:00
* feat: supports subdirectory deployment * feat: auto publicPath * fix: buildIndexHtml * fix: format * fix: regexp * fix: test error * fix: nocobase.conf * fix: path * fix: nocobase.conf * fix: bugs * fix: resourcer prefix * fix: cas
33 lines
835 B
TypeScript
33 lines
835 B
TypeScript
import { SchemaComponent, useApp, useRecord } from '@nocobase/client';
|
|
import { Card } from 'antd';
|
|
import React from 'react';
|
|
import { schema } from './settings/schemas/applications';
|
|
import { usePluginUtils } from './utils';
|
|
|
|
const useLink = () => {
|
|
const record = useRecord();
|
|
const app = useApp();
|
|
if (record.options?.standaloneDeployment && record.cname) {
|
|
return `//${record.cname}`;
|
|
}
|
|
return app.getRouteUrl(`/apps/${record.name}/admin/`);
|
|
};
|
|
|
|
const AppVisitor = () => {
|
|
const { t } = usePluginUtils();
|
|
const link = useLink();
|
|
return (
|
|
<a href={link} target={'_blank'} rel="noreferrer">
|
|
{t('View', { ns: 'client' })}
|
|
</a>
|
|
);
|
|
};
|
|
|
|
export const AppManager = () => {
|
|
return (
|
|
<Card bordered={false}>
|
|
<SchemaComponent schema={schema} components={{ AppVisitor }} />
|
|
</Card>
|
|
);
|
|
};
|