lina/vue.config.js
fit2bot b891be3607
v3.0.0-rc1 (#2400)
* feat: 资产选择优化

* perf: 修改用户列表显示字段

* perf: 修改 改密 收集账号名字

* perf: 添加AssetTreeTable组件;资产列表、资产选择、资产账号、资产授权使用AssetTreeTable组件

* perf: 修改资产列表 tab

* perf: 修改路径

* perf: 修改 tree

* perf: 修改 tab icon

* fix: 修复资产列表点击创建按钮页面空白问题

* feat: 支持超时时间设置

* perf: 改密去除tab

* perf: table column添加属性showFullContent: 折行显示全部内容

* perf: 添加 account push

* perf: 修改 asset select padding

* perf: 账号收集

* feat: terminal 页面增加padding

* perf: account list source

* perf: AssetTreeTable配置默认不显示右键菜单

* perf: 修改账号

* fix: 修复用户登录规则动作是审批时没有显示审批人选项

* refactor: 修改列表显示字段1 (#2309)

* refactor: 修改列表显示字段(用户组列表)

* refactor: 修改列表显示字段(角色列表)

* perf: 修改列表显示字段(资产列表); 修改DataTable showOverflowTooltip 参数默认为 true;  优化 ArrayFormatter 组件, 支持传递 delimiter 参数;

* perf: 修改列表显示字段(主机列表、网络设备、数据库、云服务、Web)

* perf: 修改列表字段显示(云同步,同步实例任务列表,云账号列表)

* perf: 修改列表字段显示(网域列表,网关列表)

* perf: 修改列表字段显示(平台列表)

* perf: 修改列表字段显示(标签列表)

* perf: 修改 SyncInstanceTask 组件; 删除 GatheredUserList.vue 页面;

Co-authored-by: Bai <baijiangjie@gmail.com>

* feat: 修复一些页面上的问题

* fix: 修复资产详情协议修改端口不生效问题

* perf: 用户组详情不显示授权的资产

* fix: 修复账号收集详情key相同控制台报错问题

* fix: 修复显示密码组件样式布局问题

* feat: 增加 terminal 滚动控制和清屏按钮

* feat: 增加 terminal 滚动控制和清屏按钮

* perf: 调整terminal 按钮样式

* feat: 优化detail 字段

* perf: 资产批量更新去掉特权用户

* feat: 修改按钮样式

* fix: 修复节点选择错误的问题

* perf: 修改账号推送

* perf: 优化列表显示字段2 (#2322)

* perf: 优化表格字段允许显示 ID 列

* perf: 修改列表字段显示(账号列表)

* perf: 修改列表字段显示(账号模版)

* perf: 修改列表字段显示(收集账号)

* perf: 修改列表字段显示(账号改密)

* perf: 修改列表字段显示(账号备份)

* perf: 修改列表字段显示(授权列表)

* perf: 修改列表字段显示(授权详情页面-用户/用户组,资产/节点,授权账号)

* perf: 修改权限位

* perf: 修改账号地址

* feat: 防止xss攻击;可以自定义配置xss

* perf: 修改账号

* perf: 修改列表字段显示(资产登录ACL, 命令过滤ACL)

* perf: 优化xss过滤规则判断

* fix: 远程应用修改操作选项

* perf: 修改对应权限位 各种

* perf: 修改账号

* perf: 优化TreeTable组件布局

* perf: 远程应用不进入详情页

* perf: 修改列表字段显示(命令过滤, 命令组)

* perf: 修改列表字段显示(用户详情, 授权的资产, 资产授权规则, 用户登录规则)

* perf: 修改列表字段显示(任务列表,任务执行历史列表)

* perf: 上传远程应用接口报错时给出提示

* perf: 修改 applet host

* perf: 修改 accounts 添加

* feat: ops增加rbac

* perf: 修改 assets 结构

* perf: 修改列表字段显示(会话列表, 在线会话, 历史会话)

* perf: 修改列表字段显示(命令列表)

* perf: 修改列表字段显示(文件传输)

* perf: 修改列表字段显示(登录日志,操作日志,改密日志,作业日志)

* perf: 优化PageHeading组件标题对齐

* perf: 修改列表字段显示(工作台,概览,我的资产,作业中心,作业管理,模版管理,执行历史)

* perf: 修改翻译

* perf: 修改 tag search

* fix: 修复账号改密更新、克隆页面空白问题

* perf: 修改列表字段显示(系统设置,终端列表,命令存储,录像存储,终端端点,终端规则)

* perf: 修改列表字段显示(工单管理,我的申请,待我审批,流程设置)

* perf: 修改列表字段显示(个人信息,API Key,连接令牌)

* perf: 修改列表字段显示(远程应用,应用发布机)

* perf: 修改 tableConfig 字段 excludes -> columnsExclude, extraColumns -> columnsExtra

* perf: 修改 ConnectionToken 组件

* perf: 修改 AutoDataTable 组件

* perf: 修改 AssetAclCreateUpdate 组件 reviewers 字段

* feat: 修改字段

* perf: 优化table组件表头高度对齐

* fix: 修复资产列表-所有列表不能导入问题

* perf: 我的资产收藏资产添加提示

* feat: 修改列顺序

* perf: automation

* merge: v3

* perf: 修改账号自创建

* perf: 快捷命令select组件筛选功能

* perf: select参数兼容

* feat: 修改选择用户样式

* perf: 修改账号自动化路由

* perf: 修改 form json editor

* perf: account gather 翻译

* fix: 修复平台列表上传功能

* feat: 支持账号、资产在详情页查看活动(Activities)时间线

* fix: 修复 powershell 不能选择问题

* fix: 修复 powershell 不能选择问题

* perf: 优化云资产同步

* perf: account 翻译

* fix: 修复账号列表导出报错问题

* fix: 修复账号列表测试功能权限位

* fix: 修复角色列表权限位不准确问题

* feat: 增加快捷命令页面刷新后续接功能

* fix: 应用发布机的测试

* fix: 修复账号列表不能批量删除问题

* perf: 修改 form tree

* perf: account 翻译

* fix: 修复资产树组件搜索后关闭搜索框无法显示搜索框问题

* perf: 移除发布机和应用的导入导出

* perf: 树组件关闭按钮增加刷新树功能

* fix: 修复资产树显示当前节点资产报错问题

* perf: 优化资产树组件关闭按钮执行事件顺序

* perf: upload applet and reload table list

* perf: 优化显示发布机的远程应用

* perf: 修改 settings 组织

* perf: 系统设置-远程应用详情资产不能跳转

* perf: 修改 applet status

* perf: 修改 applet status

* perf: account

* perf: account backup

* perf: verify code ttl

* perf: 修改菜单

* perf: 修改网关创建

* perf: asset ping api

* perf: 再次优化 menu

* perf: 优化菜单

* perf: menu 去掉一下 css

* perf: 资产创建、更新标签支持自定义输入创建

* perf: 修改 gateway

* perf: account change secret

* fix: 修复资产详情标签不显示问题

* perf: 修改 accounts 路由

* perf: gateway test perm

* fix: 修复账号备份-创建、更新、删除跳转到空白页面问题

* fix: 修复账号收集创建、删除后跳转到空白页面问题

* perf: 修改 choices formattor

* fix: 修改资产详情页面字段 spec_info

* fix: 修复资产详情-授权用户-查看授权字段显示不全问题

* fix: 修复工作台列表字段显示

* perf: gateways

* feat: ops 修改一些交互细节

* feat: 删除模版执行的功能

* perf: 修改 endpoint 端口监听

* perf: gateway ui

* perf: 优化字段显示

* feat: 支持资源用户在详情页查看活动(Activities)时间线

* perf: 细化权限

* fix: 修改审计日志列

* Merge remote-tracking branch 'origin/v3' into v3

# Conflicts:
#	src/views/assets/Domain/DomainDetail/GatewayList.vue

* perf: 控制台仪表盘资产类型占比取消hover效果

* perf: gateway

* fix: 修改工单详情 type.value 参数

* perf: gateway dialog

* perf: 优化ProtoSelector组件逻辑

* fix: 修改 terminal 颜色,修复文字被背景色覆盖的问题

* feat: 增加检测命令长度

* fix: 修复账号收集-执行列表详情报错问题

* fix: 修复资产列表-数据库克隆没有协议问题

* perf: push_account_enabled

* fix: 修复资产授权详情用户、资产不能删除问题

* feat: Redis/MongoDB 支持SSL

* perf: push account

* fix: 修复命令过滤-命令组克隆页面跳转不准确问题

* fix: 修改授权规则列表过滤字段 asset_name,node_name;

* fix: 修复测试连接报错问题

* perf: account platform

* perf: 调整平台详情展示字段

* perf: account push

* fix: 修复detail 详情页面 404

* pref: 修改 assets 布局

* pref: 去掉页面滚动

* pref: 暂时修改 choice left align

* perf: account template access_key

* perf: 优化activity记录都保存至operatelog中

* perf: 优化页面布局

* perf: asset add account template

* fix: 修复table搜索项重复问题

* perf: 账号收集详情

* pref: table -

* perf: 创建资产-模版添加列表增加刷新按钮

* fix: 修复任务列表操作内容显示

* perf: 先去掉自动创建

* perf: change secret

* perf: 优化账号列表资产树数量按照账号进行计算

* perf: account change secret

* pref: 修改 select hover 效果

* pref: 去掉视图 icon

* perf: executed amount

* pref: 修改 set pre org,避免回到 system

* perf: 创建资产-创建账号模版弹窗显示

* perf: account task 修改

* perf: account trigger

* perf: user reset password

* fix: 修复平台克隆失败问题

* fix: 修复资产授权批量更新报错问题

* perf: 优化账号列表资产树数量按照账号进行计算增加默认值 asset

* fix: 修复用户详情-资产授权规则跳转页面报错问题

* perf: 资产树-类型树关闭搜索功能

* fix: 修复执行窗口有空白问题

* fix: 修复账号改密详情权限不准确问题

* fix: 文件传输列表不显示操作

Co-authored-by: Aaron3S <chenyang@fit2cloud.com>
Co-authored-by: Bai <baijiangjie@gmail.com>
Co-authored-by: feng <1304903146@qq.com>
Co-authored-by: feng626 <57284900+feng626@users.noreply.github.com>
Co-authored-by: “huailei000” <2280131253@qq.com>
Co-authored-by: ibuler <ibuler@qq.com>
Co-authored-by: Jiangjie.Bai <bugatti_it@163.com>
Co-authored-by: jiangweidong <weidong.jiang@fit2cloud.com>
Co-authored-by: Eric <xplzv@126.com>
Co-authored-by: huailei <31801270+huailei000@users.noreply.github.com>
2023-01-16 18:57:40 +08:00

191 lines
5.9 KiB
JavaScript

'use strict'
const path = require('path')
const CompressionWebpackPlugin = require('compression-webpack-plugin')
const productionGzipExtensions = /\.(js|css|json|txt|ico|svg)(\?.*)?$/i
function resolve(dir) {
return path.join(__dirname, dir)
}
const name = '' // page title
// If your port is set to 80,
// use administrator privileges to execute the command line.
// For example, Mac: sudo npm run
// You can change the port by the following methods:
// port = 9528 npm run dev OR npm run dev --port = 9528
const port = process.env.port || process.env.npm_config_port || 9528 // dev port
// All configuration item explanations can be find in https://cli.vuejs.org/config/
module.exports = {
/**
* You will need to set publicPath if you plan to deploy your site under a sub path,
* for example GitHub Pages. If you plan to deploy your site to https://foo.github.io/bar/,
* then publicPath should be set to "/bar/".
* In most cases please use '/' !!!
* Detail: https://cli.vuejs.org/config/#publicpath
*/
transpileDependencies: [
/\/node_modules\/vue-echarts\//,
/\/node_modules\/resize-detector\//
],
publicPath: '/ui/',
outputDir: 'lina',
assetsDir: 'assets',
lintOnSave: process.env.NODE_ENV === 'development',
productionSourceMap: false,
devServer: {
port: port,
host: '0.0.0.0',
open: false,
disableHostCheck: true,
overlay: {
warnings: false,
errors: true
},
proxy: {
// change xxx-api/login => mock/login
// detail: https://cli.vuejs.org/config/#devserver-proxy
'/api/': {
target: process.env.VUE_APP_CORE_HOST,
changeOrigin: true
},
'/ws/': {
target: process.env.VUE_APP_CORE_WS,
changeOrigin: true,
ws: true
},
'/koko/': {
target: 'http://127.0.0.1:5000',
changeOrigin: true,
ws: true
},
'/guacamole/': {
target: 'http://127.0.0.1:8081',
changeOrigin: true,
ws: true
},
'/luna/': {
target: 'http://127.0.0.1:4200/luna/',
changeOrigin: true
},
'^/(core|static|media)/': {
target: process.env.VUE_APP_CORE_HOST,
changeOrigin: true
}
},
after: require('./mock/mock-server.js')
},
css: {
},
configureWebpack: {
// provide the app's title in webpack's name field, so that
// it can be accessed in index.html to inject the correct title.
name: name,
resolve: {
alias: {
'@': resolve('src'),
elementCss: resolve('node_modules/element-ui/lib/theme-chalk/index.css'),
elementLocale: resolve('node_modules/element-ui/lib/locale/lang/en.js')
},
extensions: ['.vue', '.js', '.json']
},
plugins: [
new CompressionWebpackPlugin({
algorithm: 'gzip',
test: productionGzipExtensions, // 处理所有匹配此 {RegExp} 的资源
threshold: 10240, // 只处理比这个值大的资源。按字节计算(楼主设置10K以上进行压缩)
minRatio: 0.8 // 只有压缩率比这个值小的资源才会被处理
})
]
},
chainWebpack(config) {
// it can improve the speed of the first screen, it is recommended to turn on preload
config.plugins.delete('preload')
// when there are many pages, it will cause too many meaningless requests
config.plugins.delete('prefetch')
// set svg-sprite-loader
config.module
.rule('svg')
.exclude.add(resolve('src/icons'))
.end()
config.module
.rule('icons')
.test(/\.svg$/)
.include.add(resolve('src/icons'))
.end()
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.options({
symbolId: 'icon-[name]'
})
.end()
// set preserveWhitespace
config.module
.rule('vue')
.use('vue-loader')
.loader('vue-loader')
.tap(options => {
options.compilerOptions.preserveWhitespace = true
options.compilerOptions.directives = {
html(node, directiveMeta) {
(node.props || (node.props = [])).push({
name: 'innerHTML',
value: `$xss.process(_s(${directiveMeta.value}))`
})
}
}
return options
})
.end()
config
// https://webpack.js.org/configuration/devtool/#development
.when(process.env.NODE_ENV === 'development',
config => config.devtool('cheap-source-map')
)
config
.when(process.env.NODE_ENV !== 'development',
config => {
config
.plugin('ScriptExtHtmlWebpackPlugin')
.after('html')
.use('script-ext-html-webpack-plugin', [{
// `runtime` must same as runtimeChunk name. default is `runtime`
inline: /runtime\..*\.js$/
}])
.end()
config
.optimization.splitChunks({
chunks: 'all',
cacheGroups: {
libs: {
name: 'chunk-libs',
test: /[\\/]node_modules[\\/]/,
priority: 10,
chunks: 'initial' // only package third parties that are initially dependent
},
elementUI: {
name: 'chunk-elementUI', // split elementUI into a single package
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
},
commons: {
name: 'chunk-commons',
test: resolve('src/components'), // can customize your rules
minChunks: 3, // minimum common number
priority: 5,
reuseExistingChunk: true
}
}
})
config.optimization.runtimeChunk('single')
}
)
}
}