Skip to content

Commit

Permalink
Merge pull request #189 from tapdata/develop
Browse files Browse the repository at this point in the history
#75 Develop Merge
  • Loading branch information
cn-xufei authored Nov 7, 2023
2 parents 7aa7a3a + 4a81f0d commit 683f244
Show file tree
Hide file tree
Showing 87 changed files with 2,603 additions and 4,191 deletions.
4 changes: 2 additions & 2 deletions apps/daas/src/plugins/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const errorCallback = (error: AxiosError): Promise<AxiosError | string> => {
if (axios.isCancel(error)) {
// eslint-disable-next-line no-console
console.log('Request canceled', error.message)
return Promise.reject('Request canceled')
return Promise.reject(error)
}
if (error?.config || error?.response?.config) {
removePending(error.config || error.response.config)
Expand Down Expand Up @@ -114,7 +114,7 @@ axios.interceptors.request.use(function (config: AxiosRequestConfig): AxiosReque
cancelFunc = c
})
if (pending.includes(key)) {
console.log('Cancel request:', JSON.parse(key)) //eslint-disable-line
console.warn('Cancel request:', JSON.parse(key)) //eslint-disable-line
cancelFunc()
} else if (config.method !== 'get') {
pending.push(key)
Expand Down
11 changes: 6 additions & 5 deletions apps/daas/src/views/user/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
</el-table-column>
<el-table-column :label="$t('user_list_role')" prop="roleMappings">
<template slot-scope="scope">
{{ permissionsmethod(scope.row.roleMappings) }}
{{ permissionsmethod(scope.row.roleMappings, scope.row.roleusers) }}
</template>
</el-table-column>
<el-table-column :label="$t('user_list_change_time')" prop="last_updated" sortable="last_updated">
Expand Down Expand Up @@ -769,12 +769,13 @@ export default {
})
},
// 关联用户
permissionsmethod(data) {
permissionsmethod(data = [], roleusers = []) {
let html = ''
if (data && data.length) {
data.forEach(item => {
if (item.role && item.role.name) {
html += ' ' + item.role.name + ','
roleusers.forEach(item => {
const roleName = data.find(t => t.roleId === item)?.role?.name
if (roleName) {
html += ' ' + roleName + ','
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion apps/daas/vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const proxy = {

module.exports = {
assetsDir: 'static',
lintOnSave: process.env.NODE_ENV !== 'production', // 打包时关闭lint输出
lintOnSave: SERVE_ENV !== 'dev' && process.env.NODE_ENV !== 'production', // 打包时关闭lint输出
productionSourceMap: false,
publicPath: './',
devServer: {
Expand Down
23 changes: 5 additions & 18 deletions apps/dfs/src/components/guide/Spec.vue
Original file line number Diff line number Diff line change
Expand Up @@ -221,20 +221,17 @@ export default {
this.specificationItems = uniqBy(
paidPrice.map(t => {
const { cpu = 0, memory = 0 } = t.spec || {}
let desc = i18n.t('dfs_agent_download_subscriptionmodeldialog_renwushujianyi', {
val: this.getSuggestPipelineNumber(cpu, memory)
})
if (t.chargeProvider === 'FreeTier') {
desc = i18n.t('dfs_agent_download_subscriptionmodeldialog_mianfeishilizui')
}
return {
label: getSpec(t.spec),
value: getSpec(t.spec),
cpu,
memory,
name: t.spec.name.toUpperCase(),
chargeProvider: t.chargeProvider,
desc: desc
desc: i18n.t('dfs_agent_download_subscriptionmodeldialog_renwushujianyi', {
val: t.limitTask
})
}
}),
'value'
Expand Down Expand Up @@ -267,16 +264,7 @@ export default {
console.log('specificationItems', this.specificationItems) // eslint-disable-line
})
},
//查询定价列表
getSuggestPipelineNumber(cpu, memory) {
if (memory == 2) {
return 3
}
if (memory == 4) {
return 5
}
return memory / 0.8
},
//订购时长对应价格
loadPackageItems() {
const specification = this.specificationItems.find(t => t.value === this.specification)
Expand Down Expand Up @@ -359,7 +347,6 @@ export default {
updateAgentCap(cpu, memory) {
return {
mem: parseInt(memory * 1.1 + 2) + 'G',
pipeline: this.getSuggestPipelineNumber(cpu, memory),
tps: cpu * 2000
}
},
Expand Down
2 changes: 2 additions & 0 deletions apps/dfs/src/i18n/langs/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -1388,6 +1388,8 @@ export default {
'1. After 1 day expires, the Agent will be automatically stopped (the tasks running on the Agent will also be stopped)',
dfs_instance_expired_time_full_tip3:
'2. When the instance is stopped due to expiration, the instance can be resumed by renewal to continue running tasks',
dfs_instance_tapdata_agent_status_tip:
'The tapdata start/stop management service is offline. Please manually perform the start/stop operation in the installation directory.',
dfs_user_center_zhifufuwu: 'Payment Service',
dfs_user_center_ninjiangzhifur:
'You will pay for the "{val1}" service, and you will enjoy the service after payment. Are you sure whether to continue? ',
Expand Down
1 change: 1 addition & 0 deletions apps/dfs/src/i18n/langs/zh-CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -1288,6 +1288,7 @@ export default {
dfs_instance_expired_time_tip4: '3.实例因过期禁止调度时,可以通过续费恢复实例继续调度运行任务',
dfs_instance_expired_time_full_tip2: '1.过期1天后,将自动停止 Agent(Agent 上运行的任务也会停止)',
dfs_instance_expired_time_full_tip3: '2.实例因过期停止时,可以通过续费恢复实例继续运行任务',
dfs_instance_tapdata_agent_status_tip: 'tapdata启停管理服务已离线,请手动在安装目录执行启停操作',
dfs_user_center_zhifufuwu: '支付服务',
dfs_user_center_ninjiangzhifur: '您将支付“{val1}”业务,支付后您将享受该服务,确定是否继续?',
dfs_user_center_xudingfuwu: '续订服务',
Expand Down
1 change: 1 addition & 0 deletions apps/dfs/src/i18n/langs/zh-TW.js
Original file line number Diff line number Diff line change
Expand Up @@ -1259,6 +1259,7 @@ export default {
dfs_instance_expired_time_tip4: '3.实例因过期禁止调度时,可以通过续费恢复实例继续调度运行任务',
dfs_instance_expired_time_full_tip2: '1.过期1天后,将自动停止 Agent(Agent 上运行的任务也会停止)',
dfs_instance_expired_time_full_tip3: '2.实例因过期停止时,可以通过续费恢复实例继续运行任务',
dfs_instance_tapdata_agent_status_tip: 'tapdata啟停管理服務已離線,請手動在安裝目錄執行啟停操作。',
dfs_user_center_zhifufuwu: '支付服務',
dfs_user_center_ninjiangzhifur: '您將支付“{val1}”業務,支付後您將享受該服務,確定是否繼續? ',
dfs_user_center_xudingfuwu: '續訂服務',
Expand Down
4 changes: 2 additions & 2 deletions apps/dfs/src/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,10 @@ export default ({ routes }) => {

window.axios
.get('config/config.json', {
cache: false,
responseType: 'json',
headers: {
Accept: 'application/json'
Accept: 'application/json',
'Cache-Control': 'no-cache'
}
})
.then(res => {
Expand Down
6 changes: 2 additions & 4 deletions apps/dfs/src/plugins/axios.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ let skipErrorHandler = false
const errorCallback = error => {
let status = error?.response?.status
if (axios.isCancel(error)) {
// eslint-disable-next-line no-console
console.log('Request canceled', error.message)
return Promise.reject('Request canceled')
return Promise.reject(error)
}
// 从请求池清除掉错误请求
if (error?.response?.config || error?.config) {
Expand Down Expand Up @@ -122,7 +120,7 @@ const requestInterceptor = config => {
let key = getPendingKey(config)
// 判断请求池是否有相同请求,有则取消当前请求(后一条),没有则将请求注入请求池
if (pending.includes(key)) {
console.log('Cancel request:', config) //eslint-disable-line
console.warn('Cancel request:', config) //eslint-disable-line
cancelFunc('cancel')
} else if (config.method !== 'get') {
pending.push(key)
Expand Down
Loading

0 comments on commit 683f244

Please sign in to comment.