pref: 修改 applet host

This commit is contained in:
ibuler
2022-11-01 11:48:23 +08:00
parent 32ec05e04c
commit 357daf2756
6 changed files with 119 additions and 6 deletions

View File

@@ -47,7 +47,7 @@ export default {
computed: {
iType() {
switch (this.action.type) {
case 'switch':
case 'switcher':
return 'Switcher'
default:
return 'el-button'

View File

@@ -98,6 +98,7 @@
"NoSQLProtocol": "非关系数据库"
},
"assets": {
"InitialDeploy": "初始化部署",
"Address": "地址",
"PrivateKey": "密钥",
"Secret": "密码",
@@ -284,6 +285,9 @@
"ReLoginErr": "登录时长已超过 5 分钟,请重新登录"
},
"common": {
"Sync": "同步",
"Deploy": "部署",
"Detail": "详情",
"Selector": "选择器",
"NeedAddAppsOrSystemUserErrMsg": "需要添加应用或系统用户",
"VerificationCodeSent": "验证码已发送",
@@ -711,6 +715,7 @@
},
"route": {
"": "",
"AppletHostDetail": "远程应用发布机详情",
"AppletHostCreate": "添加远程应用发布机",
"AppletHostUpdate": "更新远程应用发布机",
"AppletCreate": "创建远程应用",
@@ -897,7 +902,8 @@
"terminal": {
"Applets": "远程应用",
"AppletHosts": "应用发布机",
"uploadZipTips": "请上传zip格式的文件"
"uploadZipTips": "请上传zip格式的文件",
"HostDeployment": "发布机部署"
},
"sessions": {
"SetToDefaultStorage": "设置为默认存储",

View File

@@ -179,6 +179,10 @@ export default {
&>>> .el-input__icon {
color: #606266;
}
&>>> .el-input .el-select__caret {
color: #8d8f93;
}
}
.option-group >>> .el-select-group__title {

View File

@@ -0,0 +1,90 @@
<template>
<el-row :gutter="20">
<el-col :md="16" :sm="24">
<ListTable :table-config="config" />
</el-col>
<el-col :md="8" :sm="24">
<QuickActions type="primary" :actions="quickActions" />
</el-col>
</el-row>
</template>
<script>
import { ListTable, QuickActions } from '@/components'
import { openTaskPage } from '@/utils/jms'
export default {
name: 'Publications',
components: {
ListTable,
QuickActions
},
props: {
object: {
type: Object,
default: () => {}
}
},
data() {
return {
config: {
url: `/api/v1/terminal/applet-publications/?host=${this.object.id}`,
columns: [
'name', 'applet', 'comment', 'date_created', 'date_updated', 'actions'
],
columnsMeta: {
applet: {
formatter: (row) => {
return row.applet.name
}
},
actions: {
formatterArgs: {
updateRoute: 'AppletPublicationUpdate'
}
}
}
},
quickActions: [
{
title: this.$t('assets.InitialDeploy'),
attrs: {
type: 'primary',
label: this.$t('common.Deploy')
},
callbacks: {
click: function() {
this.$axios.post(
`/api/v1/terminal/applet-host-deployments/`,
{ host: this.object.id }
).then(res => {
openTaskPage(res['task'])
})
}.bind(this)
}
},
{
title: '同步所有应用',
attrs: {
type: 'primary',
label: this.$t('common.Sync')
},
callbacks: {
click: function() {
this.$axios.post(
`/api/v1/assets/assets/${this.object.id}/tasks/`,
{ action: 'refresh' }
).then(res => {
openTaskPage(res['task'])
})
}.bind(this)
}
}
]
}
}
}
</script>
<style scoped>
</style>

View File

@@ -13,14 +13,18 @@
<script>
import { GenericDetailPage, TabPage } from '@/layout/components'
import Account from '@/views/assets/Asset/AssetDetail/Account'
import Detail from './Detail'
import Applets from './Applets'
export default {
name: 'AssetListDetail',
components: {
GenericDetailPage,
Applets,
TabPage,
Detail
Detail,
Account
},
data() {
return {
@@ -30,8 +34,16 @@ export default {
activeMenu: 'Detail',
submenu: [
{
'title': 'AppletHostDetail',
'title': this.$t('common.Detail'),
'name': 'Detail'
},
{
title: this.$t('assets.Account'),
name: 'Account'
},
{
'title': this.$t('terminal.Applets'),
'name': 'Applets'
}
],
hasRightSide: true,
@@ -48,6 +60,9 @@ export default {
}
}
}
},
mounted() {
this.$route.query.oid = 'SYSTEM'
}
}
</script>

View File

@@ -28,7 +28,6 @@ export default {
name: {
formatterArgs: {
getRoute: ({ row }) => {
console.log('Row: ', row)
return {
name: 'AppletHostDetail',
params: { id: row.id }
@@ -54,7 +53,6 @@ export default {
}
}
}
}
</script>