-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update plugin and update theme
- Loading branch information
1 parent
840c632
commit 0b122fa
Showing
16 changed files
with
165 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
packages/studio-importor/src/app/elements/arrow-marker/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,6 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom/client'; | ||
import Pages from './pages'; | ||
import { installSlot, unInstallSlot } from './slots'; | ||
|
||
import { Utils } from '@graphscope/studio-components'; | ||
|
||
import { ROUTES, SIDE_MENU } from '@graphscope/graphy-website'; | ||
|
||
if (Utils.storage.get('PORTAL_PLUGIN_GRAPHY')) { | ||
installSlot('SIDE_MEU', 'graphy', SIDE_MENU); | ||
installSlot('ROUTES', 'graphy', ROUTES); | ||
} else { | ||
unInstallSlot('SIDE_MEU', 'graphy'); | ||
unInstallSlot('ROUTES', 'graphy'); | ||
} | ||
import PortalSite from './index'; | ||
|
||
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement); | ||
root.render(<Pages />); | ||
root.render(<PortalSite />); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,29 @@ | ||
import GraphScopePortal from './pages'; | ||
export { installSlot, unInstallSlot, getSlots } from './slots'; | ||
|
||
import { installSlot, unInstallSlot } from './slots'; | ||
|
||
import { Utils } from '@graphscope/studio-components'; | ||
|
||
import { ROUTES as GRAPHY_ROUTES, SIDE_MENU as GRAPGY_SIDE_MENU } from '@graphscope/graphy-website'; | ||
import { ROUTES } from './pages/index'; | ||
import { SIDE_MENU } from './layouts/const'; | ||
import { togglePlugin } from './pages/explore/slot'; | ||
|
||
/** Portal 内置模块 */ | ||
installSlot('SIDE_MEU', 'studio', SIDE_MENU); | ||
installSlot('ROUTES', 'studio', ROUTES); | ||
|
||
/** Explore 模块 */ | ||
togglePlugin(); | ||
|
||
/** 实验性质的模块:Graphy */ | ||
if (Utils.storage.get('PORTAL_PLUGIN_GRAPHY')) { | ||
installSlot('SIDE_MEU', 'graphy', GRAPGY_SIDE_MENU); | ||
installSlot('ROUTES', 'graphy', GRAPHY_ROUTES); | ||
} else { | ||
unInstallSlot('SIDE_MEU', 'graphy'); | ||
unInstallSlot('ROUTES', 'graphy'); | ||
} | ||
|
||
export default GraphScopePortal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import React, { Suspense } from 'react'; | ||
import { FormattedMessage } from 'react-intl'; | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
import { faMagnifyingGlassChart } from '@fortawesome/free-solid-svg-icons'; | ||
import { installSlot, unInstallSlot } from '../../slots'; | ||
import { Utils } from '@graphscope/studio-components'; | ||
import { Route } from 'react-router-dom'; | ||
|
||
/** 实验性质的模块 */ | ||
export const SIDE_MENU = [ | ||
{ | ||
label: <FormattedMessage id="Explore" />, | ||
key: '/explore', | ||
value: '/explore', | ||
icon: <FontAwesomeIcon icon={faMagnifyingGlassChart} />, | ||
}, | ||
]; | ||
|
||
export const ROUTES = [{ path: '/explore', component: React.lazy(() => import('./index')) }].map((item, index) => { | ||
const { path, component: Component } = item; | ||
return ( | ||
<Route | ||
key={index} | ||
path={path} | ||
element={ | ||
<Suspense fallback={<></>}> | ||
{/** @ts-ignore */} | ||
<Component /> | ||
</Suspense> | ||
} | ||
/> | ||
); | ||
}); | ||
|
||
export const PLUGIN_ID = 'EXPLORE'; | ||
export const PLUGIN_LOCAL_STORAGE_KEY = `PORTAL_PLUGIN_${PLUGIN_ID}`; | ||
|
||
/** 实验性质的模块:Explore */ | ||
|
||
export function togglePlugin(enable?: boolean) { | ||
let _enable = enable; | ||
if (enable === undefined) { | ||
_enable = Utils.storage.get(PLUGIN_LOCAL_STORAGE_KEY) || false; | ||
} | ||
|
||
if (_enable) { | ||
installSlot('SIDE_MEU', PLUGIN_ID, SIDE_MENU); | ||
installSlot('ROUTES', PLUGIN_ID, ROUTES); | ||
} else { | ||
unInstallSlot('SIDE_MEU', PLUGIN_ID); | ||
unInstallSlot('ROUTES', PLUGIN_ID); | ||
} | ||
Utils.storage.set(PLUGIN_LOCAL_STORAGE_KEY, _enable); | ||
return _enable; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.