forked from JointCloud/JCC-RIP
delete chinese
This commit is contained in:
parent
f3d972ca90
commit
74f8768a35
|
@ -1,20 +1,20 @@
|
||||||
# JCCE
|
# JCCE
|
||||||
Thanks to KubeSphere and Harvester for providing back-end support for this system.
|
Thanks to KubeSphere and Harvester for providing back-end support for this system.
|
||||||
## 电脑需要安装 node 环境
|
## need node environment
|
||||||
|
|
||||||
## 安装依赖命令
|
## install dependencies
|
||||||
|
|
||||||
```
|
```
|
||||||
npm install
|
npm install
|
||||||
```
|
```
|
||||||
|
|
||||||
### 编译及热加载命令
|
### Commands for Compilation and Hot Reloading
|
||||||
|
|
||||||
```
|
```
|
||||||
npm run dev
|
npm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
### 生产环境打包命令
|
### Production Environment Build Commands
|
||||||
|
|
||||||
```
|
```
|
||||||
npm run build
|
npm run build
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
"message": {
|
"message": {
|
||||||
"hello": "中",
|
"hello": "中",
|
||||||
"back": "Back",
|
"back": "Back",
|
||||||
"cancel": "Cancel"
|
"cancel": "Cancel",
|
||||||
|
"to": "To",
|
||||||
|
"startDate": "Start Date",
|
||||||
|
"endDate": "End Date",
|
||||||
|
"search": "Search",
|
||||||
|
"reset": "Reset"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -2,6 +2,11 @@
|
||||||
"message": {
|
"message": {
|
||||||
"hello": "En",
|
"hello": "En",
|
||||||
"back": "返回",
|
"back": "返回",
|
||||||
"cancel": "取消"
|
"cancel": "取消",
|
||||||
|
"to": "至",
|
||||||
|
"startDate": "开始日期",
|
||||||
|
"endDate": "结束日期",
|
||||||
|
"search": "搜索",
|
||||||
|
"reset": "重置"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -18,7 +18,7 @@ export default {
|
||||||
localStorage.setItem('jcceTheme', jcceTheme)
|
localStorage.setItem('jcceTheme', jcceTheme)
|
||||||
|
|
||||||
if (jcceTheme === 'jcceDark') {
|
if (jcceTheme === 'jcceDark') {
|
||||||
console.log('深色系样式')
|
console.log('dark theme')
|
||||||
require('./styles/dark-theme/dark.scss')
|
require('./styles/dark-theme/dark.scss')
|
||||||
document.body.className = jcceTheme
|
document.body.className = jcceTheme
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,19 +2,19 @@ import request from '@/utils/request'
|
||||||
// import moment from 'moment'
|
// import moment from 'moment'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
// pod删除 工作负载删除
|
// pod delete
|
||||||
deleteCurrent(clusterName, namespace, name, classification) {
|
deleteCurrent(clusterName, namespace, name, classification) {
|
||||||
if (classification === 'userProject') { // 用户项目
|
if (classification === 'userProject') {
|
||||||
return request({
|
return request({
|
||||||
url: `/jcc-schedule/api/v1/namespace/delete/${clusterName}/${namespace}/false`,
|
url: `/jcc-schedule/api/v1/namespace/delete/${clusterName}/${namespace}/false`,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
} else if (classification === 'storage') { // 存储卷
|
} else if (classification === 'storage') {
|
||||||
return request({
|
return request({
|
||||||
url: `/jcc-schedule/api/v1/storage/pvc/${clusterName}/${namespace}/${name}/false`,
|
url: `/jcc-schedule/api/v1/storage/pvc/${clusterName}/${namespace}/${name}/false`,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
} else if (classification === 'pods') { // 容器节点
|
} else if (classification === 'pods') {
|
||||||
return request({
|
return request({
|
||||||
url: `/jcc-schedule/api/v1/pod/delete/${clusterName}/${namespace}/${name}/false`,
|
url: `/jcc-schedule/api/v1/pod/delete/${clusterName}/${namespace}/${name}/false`,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
|
@ -25,7 +25,6 @@ export default {
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// 工作负载 部署 有状态副本集 守护进程集
|
|
||||||
return request({
|
return request({
|
||||||
url: `/jcc-schedule/api/v1/${classification}/delete/${clusterName}/${namespace}/${name}/false`,
|
url: `/jcc-schedule/api/v1/${classification}/delete/${clusterName}/${namespace}/${name}/false`,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
|
@ -46,9 +45,6 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 区块链
|
|
||||||
// 鉴权
|
|
||||||
|
|
||||||
// 通道hash查询接口
|
// 通道hash查询接口
|
||||||
getCurrentChannel() {
|
getCurrentChannel() {
|
||||||
return request({
|
return request({
|
||||||
|
|
|
@ -32,9 +32,9 @@
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="filterData[key]"
|
v-model="filterData[key]"
|
||||||
type="daterange"
|
type="daterange"
|
||||||
range-separator="至"
|
:range-separator="$t('message.to')"
|
||||||
start-placeholder="开始日期"
|
:start-placeholder="$t('message.startDate')"
|
||||||
end-placeholder="结束日期"
|
:end-placeholder="$t('message.endDate')"
|
||||||
/>
|
/>
|
||||||
<!-- <el-datepicker
|
<!-- <el-datepicker
|
||||||
v-model="filterData[item.key1]"
|
v-model="filterData[item.key1]"
|
||||||
|
@ -64,13 +64,13 @@
|
||||||
type="info"
|
type="info"
|
||||||
@click="onSearchClick"
|
@click="onSearchClick"
|
||||||
>
|
>
|
||||||
查询
|
{{ $t('message.search') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="medium"
|
size="medium"
|
||||||
@click="resetSearch"
|
@click="resetSearch"
|
||||||
>
|
>
|
||||||
重置
|
{{ $t('message.reset') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
@ -154,20 +154,20 @@ export default {
|
||||||
getListAction: {
|
getListAction: {
|
||||||
type: Function,
|
type: Function,
|
||||||
default: undefined
|
default: undefined
|
||||||
}, // 数据返回api
|
},
|
||||||
map: {
|
map: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: undefined
|
default: undefined
|
||||||
}, // 数据
|
},
|
||||||
columns: {
|
columns: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => []
|
default: () => []
|
||||||
}, // 表头
|
},
|
||||||
pagination: { // 分页
|
pagination: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
paginationAuto: { // 自动分页,不含搜索的功能
|
paginationAuto: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
|
@ -175,7 +175,7 @@ export default {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: undefined
|
default: undefined
|
||||||
}, // api query
|
}, // api query
|
||||||
filterMap: { // 列表筛选
|
filterMap: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {}
|
default: () => {}
|
||||||
},
|
},
|
||||||
|
@ -184,11 +184,11 @@ export default {
|
||||||
default: () => {
|
default: () => {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
funcName: { // 选择方法
|
funcName: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
isRefresh: { // 是否定时刷新
|
isRefresh: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
|
@ -216,14 +216,14 @@ export default {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'limit'
|
default: 'limit'
|
||||||
},
|
},
|
||||||
small: { // 分页器的样式 小型分页器
|
small: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
height: {
|
height: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'auto'
|
default: 'auto'
|
||||||
}, // 固定表头 表内高度
|
},
|
||||||
border: {
|
border: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
|
|
|
@ -6,7 +6,6 @@ import 'normalize.css/normalize.css' // a modern alternative to CSS resets
|
||||||
|
|
||||||
import Element from 'element-ui'
|
import Element from 'element-ui'
|
||||||
import './styles/element-variables.scss'
|
import './styles/element-variables.scss'
|
||||||
// import enLang from 'element-ui/lib/locale/lang/en'// 如果使用中文语言包请默认支持,无需额外引入,请删除该依赖
|
|
||||||
import enLocale from 'element-ui/lib/locale/lang/en'
|
import enLocale from 'element-ui/lib/locale/lang/en'
|
||||||
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
|
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
|
||||||
import ElementLocale from 'element-ui/lib/locale'
|
import ElementLocale from 'element-ui/lib/locale'
|
||||||
|
|
|
@ -38,7 +38,7 @@ router.beforeEach(async(to, from, next) => {
|
||||||
try {
|
try {
|
||||||
store.dispatch('user/setRouteType', to.path.split('/')[1])
|
store.dispatch('user/setRouteType', to.path.split('/')[1])
|
||||||
if (store.getters.routesType === 'cluster') {
|
if (store.getters.routesType === 'cluster') {
|
||||||
// 获取集群列表并获取是否有边缘节点
|
// get cluster list to check is it an edge node
|
||||||
store.dispatch('cluster/setCluster', to.path.split('/')[2])
|
store.dispatch('cluster/setCluster', to.path.split('/')[2])
|
||||||
await store.dispatch('cluster/getClusterList')
|
await store.dispatch('cluster/getClusterList')
|
||||||
}
|
}
|
||||||
|
|
107
vue.config.js
107
vue.config.js
|
@ -40,18 +40,6 @@ module.exports = {
|
||||||
errors: true
|
errors: true
|
||||||
},
|
},
|
||||||
proxy: {
|
proxy: {
|
||||||
// '^/login': {
|
|
||||||
// ws: false,
|
|
||||||
// target: 'https://10.101.15.6/prod-api/'/* 测试环境 */
|
|
||||||
// // target: 'https://jointcloud.net/prod-api/'/* 演示环境 */
|
|
||||||
// },
|
|
||||||
'^/dockerhub/api/': {
|
|
||||||
target: 'http://10.105.20.3:30880/'
|
|
||||||
// pathRewrite: {
|
|
||||||
// '^/dockerhub': '/api'
|
|
||||||
// },
|
|
||||||
// secure: false
|
|
||||||
},
|
|
||||||
'^/blockChain': {
|
'^/blockChain': {
|
||||||
ws: false,
|
ws: false,
|
||||||
target: 'https://10.101.15.6/apis',
|
target: 'https://10.101.15.6/apis',
|
||||||
|
@ -60,52 +48,28 @@ module.exports = {
|
||||||
},
|
},
|
||||||
'^/jcc-': {
|
'^/jcc-': {
|
||||||
ws: false,
|
ws: false,
|
||||||
target: 'https://dev.jointcloud.net/apis', /* 测试环境 */
|
target: 'https://dev.jointcloud.net/apis',
|
||||||
// target: 'https://jointcloud.net/apis', /* 演示环境 */
|
// target: 'https://jointcloud.net/apis',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
secure: false
|
secure: false
|
||||||
},
|
},
|
||||||
'^/pcm': {
|
'^/pcm': {
|
||||||
ws: false,
|
ws: false,
|
||||||
// target: 'https://dev.jointcloud.net/apis', /* 测试环境 */
|
target: 'https://mock.apifox.com/m1/4000164-0-default/',
|
||||||
target: 'https://mock.apifox.com/m1/4000164-0-default/', /* 测试环境 */
|
// target: 'https://jointcloud.net/apis',
|
||||||
// target: 'https://jointcloud.net/apis', /* 演示环境 */
|
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
secure: false
|
secure: false
|
||||||
},
|
|
||||||
// '/kapis/terminal.kubesphere.io': {
|
|
||||||
// ws: true,
|
|
||||||
// changeOrigin: true,
|
|
||||||
// target: 'ws://jointcloud.net/prod-api/' /* 测试环境 */
|
|
||||||
// // target: 'ws://jointcloud.net/prod-api/' /* 演示环境 */
|
|
||||||
// },
|
|
||||||
'/monitoringscreen/': {
|
|
||||||
ws: false,
|
|
||||||
target: 'https://10.101.15.6/apis',
|
|
||||||
// target: 'https://jointcloud.net/apis', /* 演示环境 */
|
|
||||||
changeOrigin: true
|
|
||||||
},
|
|
||||||
'/openapi': {
|
|
||||||
ws: false,
|
|
||||||
target: 'http://grampus.openi.org.cn/',
|
|
||||||
// target: 'https://10.101.15.6/apis',
|
|
||||||
changeOrigin: true
|
|
||||||
}
|
}
|
||||||
// '^/edgex': {
|
|
||||||
// ws: false,
|
|
||||||
// target: 'https://10.101.15.6/apis' /* 测试环境 */
|
|
||||||
// // target: 'https://jointcloud.net/prod-api/' /* 演示环境 */
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
// before: require('./mock/mock-server.js')
|
// before: require('./mock/mock-server.js')
|
||||||
},
|
},
|
||||||
chainWebpack: config => {
|
chainWebpack: config => {
|
||||||
// hmr fix
|
// hmr fix
|
||||||
config.resolve.symlinks(true)
|
config.resolve.symlinks(true)
|
||||||
// 添加别名
|
// add alias
|
||||||
config.resolve.alias.set('@', resolve('src'))
|
config.resolve.alias.set('@', resolve('src'))
|
||||||
const cdn = {
|
const cdn = {
|
||||||
// 访问https://unpkg.com/element-ui/lib/theme-chalk/index.css获取最新版本
|
// visit https://unpkg.com/element-ui/lib/theme-chalk/index.css to get new version
|
||||||
css: ['https://unpkg.com/element-ui@2.13.2/lib/theme-chalk/index.css'],
|
css: ['https://unpkg.com/element-ui@2.13.2/lib/theme-chalk/index.css'],
|
||||||
js: [
|
js: [
|
||||||
'https://cdn.staticfile.org/vue/2.6.10/vue.min.js',
|
'https://cdn.staticfile.org/vue/2.6.10/vue.min.js',
|
||||||
|
@ -149,64 +113,13 @@ module.exports = {
|
||||||
})
|
})
|
||||||
.end()
|
.end()
|
||||||
|
|
||||||
// 如果使用多页面打包,使用vue inspect --plugins查看html是否在结果数组中
|
|
||||||
config.plugin('html').tap(args => {
|
config.plugin('html').tap(args => {
|
||||||
// html中添加cdn
|
// html add cdn
|
||||||
args[0].cdn = process.env.NODE_ENV === 'production' ? cdn : []
|
args[0].cdn = process.env.NODE_ENV === 'production' ? cdn : []
|
||||||
return args
|
return args
|
||||||
})
|
})
|
||||||
// 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
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// // https:// webpack.js.org/configuration/optimization/#optimizationruntimechunk
|
|
||||||
// config.optimization.runtimeChunk('single')
|
|
||||||
// }
|
|
||||||
// )
|
|
||||||
},
|
},
|
||||||
configureWebpack: config => {
|
configureWebpack: config => {
|
||||||
// config = {
|
|
||||||
// config.name = name
|
|
||||||
// config.resolve = {
|
|
||||||
// alias: {
|
|
||||||
// '@': resolve('src')
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// config.module = {
|
|
||||||
// unknownContextCritical: false
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
config.name = name
|
config.name = name
|
||||||
if (process.env.NODE_ENV === 'production') {
|
if (process.env.NODE_ENV === 'production') {
|
||||||
config.externals = {
|
config.externals = {
|
||||||
|
@ -217,18 +130,18 @@ module.exports = {
|
||||||
axios: 'axios',
|
axios: 'axios',
|
||||||
echarts: 'echarts'
|
echarts: 'echarts'
|
||||||
}
|
}
|
||||||
// 去掉注释
|
// delete comments
|
||||||
config.optimization.minimizer.push(
|
config.optimization.minimizer.push(
|
||||||
new UglifyJsPlugin({
|
new UglifyJsPlugin({
|
||||||
uglifyOptions: {
|
uglifyOptions: {
|
||||||
output: {
|
output: {
|
||||||
comments: false // 去掉注释
|
comments: false
|
||||||
},
|
},
|
||||||
compress: {
|
compress: {
|
||||||
// warnings: false,
|
// warnings: false,
|
||||||
drop_console: true,
|
drop_console: true,
|
||||||
drop_debugger: false,
|
drop_debugger: false,
|
||||||
pure_funcs: ['console.log'] // 移除console
|
pure_funcs: ['console.log'] // delete console
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue