Skip to content

Commit

Permalink
feat: microService to msp (#407)
Browse files Browse the repository at this point in the history
  • Loading branch information
laojun authored Jun 28, 2021
1 parent bd76f8d commit d79f4c4
Show file tree
Hide file tree
Showing 531 changed files with 1,546 additions and 1,599 deletions.
2 changes: 1 addition & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
"metadatas",
"metadatum",
"methd",
"microservice",
"msp",
"mindmap",
"minio",
"mochawesome",
Expand Down
5 changes: 5 additions & 0 deletions nginx.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ server {
rewrite ^/([^/]*)/workBench/(.*) /$1/dop/$2 permanent;
}

# 301 redirect url with replace microService to msp
location ~ ^/[^/]*/microService/ {
rewrite ^/([^/]*)/microService/(.*) /$1/msp/$2 permanent;
}

location /api/dice-env {
default_type application/javascript;
return 200 'window.diceEnv={
Expand Down
2 changes: 1 addition & 1 deletion shell/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const start = (userData: ILoginUser) => {
import('publisher/entry'),
import('project/entry'),
import('apiManagePlatform/entry'),
import('microService/entry'),
import('msp/entry'),
import('app/modules/edge/entry'),
import('application/entry'),
import('dataCenter/entry'),
Expand Down
2 changes: 1 addition & 1 deletion shell/app/common/stores/monitorCommon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const defaultHandler = (data: any) => {
moduleMap.label = k;
moduleMap.value = k;
moduleMap.children = v.map((item: any, i: number) => {
return { value: item, label: `${i18n.t('microService:instance')}${i + 1}` };
return { value: item, label: `${i18n.t('msp:instance')}${i + 1}` };
});
});
return moduleMap;
Expand Down
36 changes: 18 additions & 18 deletions shell/app/common/utils/go-to.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,13 @@ export enum pages {
jvmProfiler = '/{orgName}/dop/addonsManage/{projectId}/{instanceId}/jvm-profiler',
appSetting_config = '/{orgName}/dop/projects/{projectId}/apps/{appId}/setting?tabKey=appConfig',
buildDetailConfig = '/{orgName}/dop/projects/{projectId}/config/apps/{appId}/runtimes/{branch}/{env}',
microServiceRoot = '/{orgName}/microService/microServiceManage',
microServiceOverviewRoot = '/{orgName}/microService/{projectId}/{env}/{tenantGroup}',
microServiceOverview = '/{orgName}/microService/{projectId}/{env}/{tenantGroup}?appId={appId}&runtimeId={runtimeId}',
microServiceApiStrategy = '/{orgName}/microService/{projectId}/{env}/{tenantGroup}/gateway/api-package/{packageId}/detail/api-policies/safety-policy',
microServiceTopology = '/{orgName}/microService/{projectId}/{env}/{tenantGroup}/topology/{terminusKey}?appId={appId}',
monitorAPIOverview = '/{orgName}/microService/{projectId}/{env}/{tenantGroup}/gateway/apis/api-monitor?appId={appId}&runtimeId={runtimeId}',
microTraceSearch = '/{orgName}/microService/{projectId}/{env}/{tenantGroup}/monitor/{terminusKey}/trace/search?appId={appId}&timeFrom={timeFrom}&timeTo={timeTo}&status={status}',
mspRoot = '/{orgName}/msp/mspManage',
mspOverviewRoot = '/{orgName}/msp/{projectId}/{env}/{tenantGroup}',
mspOverview = '/{orgName}/msp/{projectId}/{env}/{tenantGroup}?appId={appId}&runtimeId={runtimeId}',
mspApiStrategy = '/{orgName}/msp/{projectId}/{env}/{tenantGroup}/gateway/api-package/{packageId}/detail/api-policies/safety-policy',
mspTopology = '/{orgName}/msp/{projectId}/{env}/{tenantGroup}/topology/{terminusKey}?appId={appId}',
monitorAPIOverview = '/{orgName}/msp/{projectId}/{env}/{tenantGroup}/gateway/apis/api-monitor?appId={appId}&runtimeId={runtimeId}',
microTraceSearch = '/{orgName}/msp/{projectId}/{env}/{tenantGroup}/monitor/{terminusKey}/trace/search?appId={appId}&timeFrom={timeFrom}&timeTo={timeTo}&status={status}',
dataCenterRoot = '/{orgName}/dataCenter/overview',

createProject = '/{orgName}/orgCenter/projects/createProject',
Expand All @@ -216,16 +216,16 @@ export enum pages {
project_test_spaceDetail_scenes = '/{orgName}/dop/projects/{projectId}/testCase/auto/{id}/scenes',

// 微服务
apiStrategy = '/{orgName}/microService/{projectId}/{env}/{tenantGroup}/gateway/api-package/{packageId}/detail/api-policies/safety-policy?apiId={apiId}',
apiManageQuery = '/{orgName}/microService/{projectId}/{env}/{tenantGroup}/gateway/apis?redirectApp={redirectApp}&redirectService={redirectService}&redirectRuntimeId={redirectRuntimeId}',
apiManage = '/{orgName}/microService/{projectId}/{env}/{tenantGroup}/gateway/apis',
apiStrategy = '/{orgName}/msp/{projectId}/{env}/{tenantGroup}/gateway/api-package/{packageId}/detail/api-policies/safety-policy?apiId={apiId}',
apiManageQuery = '/{orgName}/msp/{projectId}/{env}/{tenantGroup}/gateway/apis?redirectApp={redirectApp}&redirectService={redirectService}&redirectRuntimeId={redirectRuntimeId}',
apiManage = '/{orgName}/msp/{projectId}/{env}/{tenantGroup}/gateway/apis',

// 微服务日志分析规则
ms_addLogAnalyzeRule = '/{orgName}/microService/{projectId}/{env}/{tenantGroup}/log/{addonId}/rule/add?source={source}',
ms_addLogAnalyzeRule = '/{orgName}/msp/{projectId}/{env}/{tenantGroup}/log/{addonId}/rule/add?source={source}',

// 网关“入口流量管理”
getwayDetail = '/{orgName}/microService/{projectId}/{env}/{tenantGroup}/gateway/api-package/{packageId}/detail',
gatewayList = '/{orgName}/microService/{projectId}/{env}/{tenantGroup}/gateway/api-package?domain={domain}',
getwayDetail = '/{orgName}/msp/{projectId}/{env}/{tenantGroup}/gateway/api-package/{packageId}/detail',
gatewayList = '/{orgName}/msp/{projectId}/{env}/{tenantGroup}/gateway/api-package?domain={domain}',

// fdp
fdpIndex = '/{orgName}/fdp/__cluster__/__workspace__/data-source',
Expand All @@ -239,12 +239,12 @@ export enum pages {
orgCustomDashboardDetail = '/{orgName}/dataCenter/customDashboard/{customDashboardId}',

// 微服务监控自定义大盘
micro_serviceCustomDashboard = '/{orgName}/microService/{projectId}/{env}/{tenantGroup}/monitor/{terminusKey}/custom-dashboard',
micro_serviceAddCustomDashboard = '/{orgName}/microService/{projectId}/{env}/{tenantGroup}/monitor/{terminusKey}/custom-dashboard/add',
micro_serviceCustomDashboardDetail = '/{orgName}/microService/{projectId}/{env}/{tenantGroup}/monitor/{terminusKey}/custom-dashboard/{customDashboardId}',
micro_serviceCustomDashboard = '/{orgName}/msp/{projectId}/{env}/{tenantGroup}/monitor/{terminusKey}/custom-dashboard',
micro_serviceAddCustomDashboard = '/{orgName}/msp/{projectId}/{env}/{tenantGroup}/monitor/{terminusKey}/custom-dashboard/add',
micro_serviceCustomDashboardDetail = '/{orgName}/msp/{projectId}/{env}/{tenantGroup}/monitor/{terminusKey}/custom-dashboard/{customDashboardId}',

// 微服务-服务分析页
microServiceServiceAnalyze = '/{orgName}/microService/{projectId}/{env}/{tenantGroup}/monitor/{terminusKey}/service-list/{applicationId}/{serviceId}/{serviceName}',
mspServiceAnalyze = '/{orgName}/msp/{projectId}/{env}/{tenantGroup}/monitor/{terminusKey}/service-list/{applicationId}/{serviceId}/{serviceName}',

// 企业日志分析规则
addLogAnalyzeRule = '/{orgName}/dataCenter/log/rule/add?source={source}',
Expand All @@ -253,7 +253,7 @@ export enum pages {
orgAlarmRecordDetail = '/{orgName}/dataCenter/alarm/record/{id}',

// 微服务告警记录详情
micro_serviceAlarmRecordDetail = '/{orgName}/microService/{projectId}/{env}/{tenantGroup}/monitor/{terminusKey}/alarm-record/{id}',
micro_serviceAlarmRecordDetail = '/{orgName}/msp/{projectId}/{env}/{tenantGroup}/monitor/{terminusKey}/alarm-record/{id}',

// 云资源管理
cloudSource = '/{orgName}/dataCenter/cloudSource',
Expand Down
8 changes: 6 additions & 2 deletions shell/app/config-page/components/card/card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import classnames from 'classnames';
import './card.scss';

const fakeClick = 'fake-click';
const noop = () => { };
const noop = () => {};

export const Card = (props: CP_CARD.Props) => {
const { props: configProps, execOperation = noop, customProps = {} } = props;
Expand Down Expand Up @@ -93,7 +93,11 @@ export const Card = (props: CP_CARD.Props) => {
<div className={`${className} ${cls}`} onClick={() => clickNode(data)}>
<div className="info-card-content px12 pt4 pb8" key={id} ref={drag}>
<div className={'flex-box mb12'}>
{isString(titleIcon) ? <CustomIcon type={titleIcon} color className="head-icon mr4 pt4" /> : titleIcon || null}
{isString(titleIcon) ? (
<CustomIcon type={titleIcon} color className="head-icon mr4 pt4" />
) : (
titleIcon || null
)}
<div className="flex-1 fz14 color-text break-word pt4">{title}</div>
{isEmpty(menuOperations) ? (
<CustomIcon className="op-icon hide-icon" onClick={(e) => e.stopPropagation()} type="more" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { isFunction } from 'lodash';
import './menu-head.scss';
import devopsSvg from 'app/images/devops.svg';
import dataCenterSvg from 'app/images/qyzx.svg';
import microServiceSvg from 'app/images/wfwzl.svg';
import mspSvg from 'app/images/wfwzl.svg';
import fdpSvg from 'app/images/ksj.svg';
import apiManageSvg from 'app/images/fwsc.svg';
import edgeSvg from 'app/images/edge.svg';
Expand Down Expand Up @@ -54,8 +54,8 @@ const MenuHead = ({ siderInfo, routeMarks }: IProps) => {
case 'orgCenter':
sideIcon = <img className="big-icon" src={orgCenterSvg} />;
break;
case 'microService':
sideIcon = <img className="big-icon" src={microServiceSvg} />;
case 'msp':
sideIcon = <img className="big-icon" src={mspSvg} />;
break;
case 'fdp':
sideIcon = <img className="big-icon" src={fdpSvg} />;
Expand Down
4 changes: 2 additions & 2 deletions shell/app/layout/pages/page-container/components/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const AppCenterEl = () => {
dop: 'devops1',
sysAdmin: 'guanli',
dataCenter: 'duoyun',
microService: 'weifuwu1',
msp: 'weifuwu1',
orgCenter: 'guanli',
diceFdp: 'kuaishuju',
edge: 'bianyuanjisuan',
Expand All @@ -55,7 +55,7 @@ const AppCenterEl = () => {
dataCenter: permMap.dataCenter.showApp.pass,
dop: permMap.dop.read.pass,
diceFdp: permMap.entryFastData.pass && currentOrg.openFdp,
microService: permMap.entryMicroService.pass,
msp: permMap.entryMicroService.pass,
edge: permMap.edge.view.pass,
// apiManage: permMap.entryApiManage.pass,
};
Expand Down
6 changes: 3 additions & 3 deletions shell/app/layout/stores/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ const layout = createStore({
switchToApp('dataCenter');
} else if (isIn('dop')) {
switchToApp('dop');
} else if (isIn('microService')) {
switchToApp('microService');
} else if (isIn('msp')) {
switchToApp('msp');
} else if (isIn('edge')) {
switchToApp('edge');
// } else if (isIn('sysAdmin')) {
Expand All @@ -114,7 +114,7 @@ const layout = createStore({
isEntering('orgCenter') ||
isEntering('dataCenter') ||
isEntering('dop') ||
isEntering('microService') ||
isEntering('msp') ||
isEntering('edge') ||
isEntering('sysAdmin')
) {
Expand Down
6 changes: 3 additions & 3 deletions shell/app/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@
"restart": "restart",
"rollback": "rollback",
"running resources": "running resources",
"runtime-resource-config-form-tip": "after the configuration is saved successfully, it will take effect when the application is deployed again. If you want to save to the code, please manually sync to dice.yml",
"runtime-resource-config-form-tip": "The modification of this expansion configuration will take effect immediately. Note: But it will cause the resource configuration in erda.yml to become invalid (the expansion configuration has a higher priority)",
"save": "save",
"search by application name": "search by application name",
"search by chinese/english name of attribute": "search by chinese/english name of attribute",
Expand Down Expand Up @@ -1133,7 +1133,7 @@
"Members under the project/application associated with the current API can view it.": "members under the project/application associated with the current API can view",
"Memory allocation": "Memory allocation",
"Memory usage": "Memory usage",
"Microservice": "Microservice",
"msp": "Microservice platform",
"Middle-east & India": "Middle-east & India",
"Monday": "Monday",
"Mumbai": "Mumbai",
Expand Down Expand Up @@ -1950,7 +1950,7 @@
"it is getting offline and it will take a effect later": "it is getting offline and it will take a effect later",
"site management": "site management"
},
"microService": {
"msp": {
"32 digits letters and numbers": "32 digits letters and numbers",
"API analysis": "API analysis",
"API path": "API path",
Expand Down
6 changes: 3 additions & 3 deletions shell/app/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@
"restart": "重启",
"rollback": "回滚",
"running resources": "运行资源",
"runtime-resource-config-form-tip": "本次配置保存成功后,会在应用再次部署时生效,如要保存到代码,请手动同步到 dice.yml ",
"runtime-resource-config-form-tip": "本次扩缩容配置的修改会立即生效,注意:但会导致 erda.yml 中的资源配置会失效(扩缩容配置优先级更高)",
"save": "保存",
"search by application name": "通过应用名称搜索",
"search by chinese/english name of attribute": "输入属性的中文/英文名搜索",
Expand Down Expand Up @@ -1133,7 +1133,7 @@
"Members under the project/application associated with the current API can view it.": "当前API关联的项目/应用下的成员可以查看",
"Memory allocation": "内存分配",
"Memory usage": "内存使用",
"Microservice": "微服务治理平台",
"msp": "微服务治理平台",
"Middle-east & India": "中东与印度",
"Monday": "周一",
"Mumbai": "孟买",
Expand Down Expand Up @@ -1950,7 +1950,7 @@
"it is getting offline and it will take a effect later": "正在下线,稍后生效",
"site management": "站点管理"
},
"microService": {
"msp": {
"32 digits letters and numbers": "32位英文数字",
"API analysis": "API分析",
"API path": "API路径",
Expand Down
8 changes: 4 additions & 4 deletions shell/app/menus/appCenter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ export const appList: () => LAYOUT.IApp[] = () =>
href: goTo.resolve.dopRoot(),
},
{
key: 'microService',
name: i18n.t('Microservice'),
breadcrumbName: i18n.t('Microservice'),
href: goTo.resolve.microServiceRoot(),
key: 'msp',
name: i18n.t('msp'),
breadcrumbName: i18n.t('msp'),
href: goTo.resolve.mspRoot(),
},
{
key: 'apiManage',
Expand Down
18 changes: 5 additions & 13 deletions shell/app/menus/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import { getOrgCenterMenu } from './orgCenter';
import { getDataCenterMenu } from './dataCenter';
import { getDopMenu } from './dop';
import { getMicroServiceMenu } from './microService';
import { getMspMenu } from './msp';
import { getProjectMenu } from './project';
import { getAppMenu } from './application';
import { getEdgeMenu } from './edge';
Expand All @@ -23,15 +23,7 @@ import { produce } from 'immer';
import { filter, map } from 'lodash';
import { appList } from './appCenter';

export {
getProjectMenu,
getAppMenu,
getOrgCenterMenu,
getDataCenterMenu,
getDopMenu,
getMicroServiceMenu,
getEdgeMenu,
};
export { getProjectMenu, getAppMenu, getOrgCenterMenu, getDataCenterMenu, getDopMenu, getMspMenu, getEdgeMenu };

export const getAppCenterAppList = appList;

Expand All @@ -55,10 +47,10 @@ export const getSubSiderInfoMap = () => {
displayName: i18n.t('dop'),
},
},
microService: {
menu: getMicroServiceMenu(),
msp: {
menu: getMspMenu(),
detail: {
displayName: i18n.t('Microservice'),
displayName: i18n.t('msp'),
},
},
edge: {
Expand Down
6 changes: 3 additions & 3 deletions shell/app/menus/microService.tsx → shell/app/menus/msp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ import i18n from 'i18n';
import { Server as IconServer } from '@icon-park/react';
import React from 'react';

export const getMicroServiceMenu = () => {
export const getMspMenu = () => {
return [
{
href: goTo.resolve.microServiceRoot(),
href: goTo.resolve.mspRoot(),
icon: <IconServer />,
text: i18n.t('microService:microService governance'),
text: i18n.t('msp:microService governance'),
},
];
};
2 changes: 1 addition & 1 deletion shell/app/menus/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const menuFilterMap = {
appCenter: {
// 应用中心
dop: hiddenWhenOnlyFDP,
microService: hiddenWhenOnlyFDP,
msp: hiddenWhenOnlyFDP,
edge: hiddenWhenOnlyFDP,
apiManage: hiddenWhenOnlyFDP,
dataCenter: (item: IMenuItem) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { Icon as CustomIcon, CardsLayout, Holder, IF, useUpdate } from 'common';
import { goTo, ossImg } from 'common/utils';
import { AddonDetailDrawer } from './addon-detail-drawer';
import { PLAN_NAME, ENV_NAME } from '../configs';
import { getMSFrontPathByKey } from 'app/modules/microService/config';
import { getMSFrontPathByKey } from 'app/modules/msp/config';
import CreateLog from './create-log';
import addon_png from 'app/images/resources/addon.png';
import './addon-cards.scss';
Expand Down Expand Up @@ -157,7 +157,7 @@ export const AddonCards = (props: IProps) => {
const frontPath = getMSFrontPathByKey(key, pathParams);
// 大礼包拿不到terminusKey,跳过去后从menu里取
if (addonName === 'micro-service') {
goTo(goTo.pages.microServiceOverview, { jumpOut: true, ...pathParams });
goTo(goTo.pages.mspOverview, { jumpOut: true, ...pathParams });
}
goTo(frontPath, { jumpOut });
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import i18n from 'i18n';
export const authenticationMap: { [k in API_ACCESS.AuthenticationEnum]: { name: string; value: k } } = {
'key-auth': {
value: 'key-auth',
name: i18n.t('microService:key authentication'),
name: i18n.t('msp:key authentication'),
},
'sign-auth': {
value: 'sign-auth',
name: i18n.t('microService:parameter signature authentication'),
name: i18n.t('msp:parameter signature authentication'),
},
};

Expand Down Expand Up @@ -112,10 +112,10 @@ export const envMap = {
};

export const slaUnitMap: { [k in API_ACCESS.SlaLimitUnit]: string } = {
s: i18n.t('microService:times/second'),
m: i18n.t('microService:times/minute'),
h: i18n.t('microService:times/hour'),
d: i18n.t('microService:times/day'),
s: i18n.t('msp:times/second'),
m: i18n.t('msp:times/minute'),
h: i18n.t('msp:times/hour'),
d: i18n.t('msp:times/day'),
};

export const slaAuthorizationMap: { [k in API_ACCESS.SlaApproval]: { name: string; value: k } } = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.

import React from 'react';
import { SafetyPolicy } from 'microService/pages/gateway/containers/safety-policy';
import { BusinessPolicy } from 'microService/pages/gateway/containers/business-policy';
import { SafetyPolicy } from 'msp/pages/gateway/containers/safety-policy';
import { BusinessPolicy } from 'msp/pages/gateway/containers/business-policy';
import { Tabs } from 'app/nusi';

const { TabPane } = Tabs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import AuthorizationUser from 'apiManagePlatform/pages/access-manage/detail/auth
import Sla from 'apiManagePlatform/pages/access-manage/detail/sla';
import SlaEditor from 'apiManagePlatform/pages/access-manage/detail/sla-editor';
import { goTo } from 'common/utils';
import { envMap } from 'microService/config';
import { envMap } from 'msp/config';
import { useLoading } from 'common/stores/loading';
import { WithAuth } from 'user/common';
import OverviewChart from 'apiManagePlatform/pages/access-manage/detail/overview-chart';
Expand Down Expand Up @@ -63,7 +63,7 @@ const AccessDetail = () => {
if (!(projectID && endpointID && workspace && TenantGroupID)) {
return '';
}
return goTo.resolve.microServiceApiStrategy({
return goTo.resolve.mspApiStrategy({
projectId: projectID,
env: workspace,
tenantGroup: TenantGroupID,
Expand Down
Loading

0 comments on commit d79f4c4

Please sign in to comment.