licence-center-v2.0
独立售卖的应用没有 PiiEngine 平台可退守,到期后的落脚点不同: - 新增 3.2「应用内授权中心」:授权信息 / 维保信息 / 授权历史 / 更新授权, 四项能力与平台版一致,随应用走,不受平台授权状态影响 - 3.3 明确未授权 / 已授权 / 即将到期三类与第二节完全一致, 基础平台授权状态不参与判定 - 3.4 明确已到期的唯一差异: 管理员可登录应用,仅「授权中心」可用,可更新授权; 普通用户无法登录,直接给出到期提示;数据 100% 保留 - 3.5.2 补齐按身份分开的文案:管理员(应用内顶栏)与普通用户(登录页) 各含正式版 / 试用版
Portal-Web
PIiPortal项目的运营管理后台部分, 基于Rancher extension、Vue2、Element-UI框架设计实现
本地开发使用
不支持windows系统,可以使用WSL2模拟linux开发环境,需要将代码clone到wsl文件系统目录
# 克隆代码
git clone https://git.piicloud.cn/portal/portal-web.git
# 切换目录
cd portal-web
# 下载依赖
yarn
# 拷贝.env.example文件为.env文件,修改API地址为rancher地址
# 启动开发环境项目
yarn dev
依赖更新注意事项
依赖更新后需要重新打包上传portal-web-builder容器镜像,需要在安装Docker的机器上执行以下命令
./deploy/builer.sh
打包builder报错:执行以下命令
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
如何通过打补丁的方式修改node_modules中依赖库的代码
1、在package.json中增加dev依赖patch-package,并执行yarn安装
"devDependencies": {
"patch-package": "^8.0.0"
},
2、在package.json中增加script,patch-package会在yarn install后执行打补丁操作
"scripts": {
"postinstall": "patch-package"
}
3、修改node_modules中的库文件,并执行以下命令,命令会在patches目录生成补丁文件
npx patch-package @rancher/shell
patch记录:
1、减少不必要的路由拦截
diff --git a/node_modules/@rancher/shell/config/router/navigation-guards/index.js b/node_modules/@rancher/shell/config/router/navigation-guards/index.js
index 99d7daa..e97e612 100644
--- a/node_modules/@rancher/shell/config/router/navigation-guards/index.js
+++ b/node_modules/@rancher/shell/config/router/navigation-guards/index.js
@@ -17,7 +17,8 @@ export function installNavigationGuards(router, context) {
// NOTE: the order of the installation matters.
// Be intentional when adding, removing or modifying the guards that are installed.
- const navigationGuardInstallers = [installLoadInitialSettings, installAttemptFirstLogin, installAuthentication, installProducts, installClusters, installRuntimeExtensionRoute, installI18N, installHandleInstallRedirect, installPageTitle, installRecordLastRoute, installServerUpgradeGrowl];
+ //const navigationGuardInstallers = [installLoadInitialSettings, installAttemptFirstLogin, installAuthentication, installProducts, installClusters, installRuntimeExtensionRoute, installI18N, installHandleInstallRedirect, installPageTitle, installRecordLastRoute, installServerUpgradeGrowl];
+ const navigationGuardInstallers = [installAuthentication, installClusters];
navigationGuardInstallers.forEach((installer) => installer(router, context));
}
2、正常使用路由嵌套,不修改的话没法自定义layout
diff --git a/node_modules/@rancher/shell/core/plugin.ts b/node_modules/@rancher/shell/core/plugin.ts
index b797e4e..afd33b0 100644
--- a/node_modules/@rancher/shell/core/plugin.ts
+++ b/node_modules/@rancher/shell/core/plugin.ts
@@ -151,9 +151,6 @@ export class Plugin implements IPlugin {
if (typelessRoute.component?.layout) {
console.warn(`Layouts have been deprecated. We still have parent routes which use the same name and styling as the previous layouts. \n\nFound a component ${ typelessRoute.component.name } with the '${ typelessRoute.component.layout }' layout specified `); // eslint-disable-line no-console
parentOverride = typelessRoute.component.layout.toLowerCase();
- } else {
- console.warn(`Layouts have been deprecated. We still have parent routes which use the same name and styling as the previous layouts. You should specify a parent, we're currently setting the parent to 'default'`); // eslint-disable-line no-console
- parentOverride = 'default';
}
}
3、引入element plus的按需引入,不需要声明组件
diff --git a/node_modules/@rancher/shell/vue.config.js b/node_modules/@rancher/shell/vue.config.js
index e99d05f..ec9ecf6 100644
--- a/node_modules/@rancher/shell/vue.config.js
+++ b/node_modules/@rancher/shell/vue.config.js
@@ -1,3 +1,5 @@
+const Components = require('unplugin-vue-components/webpack')
+const { ElementPlusResolver } = require('unplugin-vue-components/resolvers')
const fs = require('fs');
const path = require('path');
const webpack = require('webpack');
@@ -553,6 +555,11 @@ module.exports = function(dir, appConfig = {}) {
config.plugins.push(new webpack.IgnorePlugin({ resourceRegExp: /\/__tests__\// }));
+ config.plugins.push(Components({
+ resolvers: [ElementPlusResolver()],
+ }),);
+
+
config.resolve.extensions.push(...['.tsx', '.ts', '.js', '.vue', '.scss']);
config.watchOptions = {
...(config.watchOptions || {}),
Description
Languages
Vue
67.5%
JavaScript
24.3%
SCSS
3.7%
CSS
3.1%
HTML
0.9%
Other
0.4%