Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Package Only

on:
workflow_dispatch:
inputs:
upload_artifact:
description: 'Upload the packaged tar.gz as a GitHub Actions artifact'
required: false
default: true
type: boolean

permissions:
contents: read

jobs:
package:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 16.15.0
cache: npm

- name: Install dependencies and build
run: |
npm ci
npm run build

- name: Get version from package.json
id: pkg_version
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT

- name: Package files to tar.gz
run: tar -czf n9e-fe-${{ steps.pkg_version.outputs.version }}.tar.gz pub

- name: Upload packaged artifact
if: ${{ inputs.upload_artifact }}
uses: actions/upload-artifact@v4
with:
name: n9e-fe-${{ steps.pkg_version.outputs.version }}-tar-gz
path: n9e-fe-${{ steps.pkg_version.outputs.version }}.tar.gz
if-no-files-found: error
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT

- name: Package files to tar.gz
run: tar -C pub -czf n9e-fe-${{ steps.pkg_version.outputs.version }}.tar.gz .
run: tar -czf n9e-fe-${{ steps.pkg_version.outputs.version }}.tar.gz pub

- name: Upload workflow artifact
uses: actions/upload-artifact@v4
Expand Down
19 changes: 18 additions & 1 deletion src/components/pageLayout/PageLayoutWithTabs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,24 @@ interface IPageLayoutProps {
productDocLink?: string;
tabGroup?: string;
docButtonText?: string;
headerCenter?: ReactNode;
}

const PageLayout: React.FC<IPageLayoutProps> = ({ icon, title, rightArea, introIcon, children, customArea, showBack, backPath, doc, productDocLink, tabGroup, docButtonText }) => {
const PageLayout: React.FC<IPageLayoutProps> = ({
icon,
title,
rightArea,
introIcon,
children,
customArea,
showBack,
backPath,
doc,
productDocLink,
tabGroup,
docButtonText,
headerCenter,
}) => {
const { t, i18n } = useTranslation('pageLayout');
const history = useHistory();
const location = useLocation();
Expand Down Expand Up @@ -128,6 +143,8 @@ const PageLayout: React.FC<IPageLayoutProps> = ({ icon, title, rightArea, introI
{shouldShowPageDocLink(doc) && <PageDocLink link={doc} buttonText={docButtonText} />}
</div>

{headerCenter}

<div className={'page-header-right-area flex-shrink-0'} style={{ display: sessionStorage.getItem('menuHide') === '1' ? 'none' : undefined }}>
<span className='page-layout-intro-container'>{introIcon}</span>
<div className='page-header-action-group'>
Expand Down
1 change: 1 addition & 0 deletions src/components/pageLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ interface IPageLayoutProps {
showBack?: Boolean;
backPath?: string;
docFn?: Function;
headerCenter?: ReactNode;
}

export const i18nMap = {
Expand Down
3 changes: 2 additions & 1 deletion src/pages/aiConfig/agents/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import _ from 'lodash';

import request from '@/utils/request';
import { RequestMethod } from '@/store/common';
import { N9E_PATHNAME } from '@/utils/constant';

import { Item, FormValues } from './types';

Expand Down Expand Up @@ -40,7 +41,7 @@ export const deleteItem = function (id: number) {
};

export const getMCPServers = function (): Promise<{ id: number; name: string }[]> {
return request('/api/n9e/mcp-servers', {
return request(`/api/${N9E_PATHNAME}/mcp-servers`, {
method: RequestMethod.Get,
}).then((res) => res.dat ?? []);
};
10 changes: 9 additions & 1 deletion src/pages/hosts/pages/List/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import { CommonStateContext } from '@/App';
import PageLayout from '@/components/pageLayout';
import BusinessGroup2, { getCleanBusinessGroupIds } from '@/components/BusinessGroup';
import { getTargetsCompatibleGids } from '@/components/BusinessGroup/presetFilters';
import { IS_ENT } from '@/utils/constant';

// @ts-ignore — ObsLoop HostEntry(srm-fe parcel;开源/plus 源仓不挂此依赖)
import ObsLoopHostEntry from 'plus:/parcels/ObsLoop/HostEntry';

import { NS, STATS_COLLAPSED_KEY } from '../../constants';
import { Item, OperateType } from '../../types';
Expand Down Expand Up @@ -43,7 +47,11 @@ export default function index() {
}, [businessGroup.ids]);

return (
<PageLayout title={t('title')} doc='https://flashcat.cloud/docs/content/flashcat-monitor/nightingale-v9/usage/infrastructure/server-list/'>
<PageLayout
title={t('title')}
doc='https://flashcat.cloud/docs/content/flashcat-monitor/nightingale-v9/usage/infrastructure/server-list/'
headerCenter={IS_ENT ? <ObsLoopHostEntry gids={gids} /> : undefined}
>
<div className='n9e n9e-hosts-ng-list overflow-hidden'>
<div className='flex gap-[6px] h-full'>
<BusinessGroup2
Expand Down
3 changes: 2 additions & 1 deletion src/pages/oauthConsent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { ApiOutlined } from '@ant-design/icons';
import request from '@/utils/request';
import { RequestMethod } from '@/store/common';
import { CommonStateContext } from '@/App';
import { N9E_PATHNAME } from '@/utils/constant';

import { NAME_SPACE } from './constants';

Expand Down Expand Up @@ -102,7 +103,7 @@ export default function OAuthConsent() {
const decide = (decision: 'allow' | 'deny') => {
setSubmitting(decision);
setError(null);
request('/api/n9e/mcp/oauth/authorize', {
request(`/api/${N9E_PATHNAME}/mcp/oauth/authorize`, {
method: RequestMethod.Post,
data: { req, decision },
})
Expand Down