diff --git a/src/components/AccountCreateUpdateForm/index.vue b/src/components/AccountCreateUpdateForm/index.vue
index 7f93aba22..d7f27c748 100644
--- a/src/components/AccountCreateUpdateForm/index.vue
+++ b/src/components/AccountCreateUpdateForm/index.vue
@@ -99,7 +99,7 @@ export default {
},
push_now: {
hidden: () => {
- return !this.platform.automation['push_account_enabled']
+ return !this.platform.automation?.['push_account_enabled']
}
}
},
@@ -112,7 +112,7 @@ export default {
afterGetRemoteMeta(meta) {
const choices = meta.secret_type.choices
const secretTypes = []
- this.platform.protocols.forEach(p => {
+ this.platform.protocols?.forEach(p => {
secretTypes.push(...p['secret_types'])
})
if (!this.form.secret_type) {
diff --git a/src/components/AccountListTable/AddAccount.vue b/src/components/AccountListTable/AddAccount.vue
index c1e9f4bf7..f91d263d9 100644
--- a/src/components/AccountListTable/AddAccount.vue
+++ b/src/components/AccountListTable/AddAccount.vue
@@ -72,11 +72,11 @@ export default {
},
methods: {
async getPlatform() {
- this.platform = await this.$axios.get(`/api/v1/assets/platforms/${this.asset.platform.id}/`)
- console.log('Platform: ', this.platform)
+ const platformId = this.asset?.platform?.id || this.asset?.platform_id
+ this.platform = await this.$axios.get(`/api/v1/assets/platforms/${platformId}/`)
},
addAccount(form) {
- const data = { asset: this.asset.id, ...form }
+ const data = { asset: this.asset?.id || '', ...form }
this.$axios.post(`/api/v1/assets/accounts/`, data).then(() => {
this.iVisible = false
this.$emit('add', true)
diff --git a/src/components/AccountListTable/PasswordHistoryDialog.vue b/src/components/AccountListTable/PasswordHistoryDialog.vue
new file mode 100644
index 000000000..eb66af16e
--- /dev/null
+++ b/src/components/AccountListTable/PasswordHistoryDialog.vue
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
diff --git a/src/components/AccountListTable/ViewSecret.vue b/src/components/AccountListTable/ViewSecret.vue
index 9c7b5d92e..238bd19cf 100644
--- a/src/components/AccountListTable/ViewSecret.vue
+++ b/src/components/AccountListTable/ViewSecret.vue
@@ -17,17 +17,26 @@
>
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+ {{ $moment(authInfo.date_created, 'YYYY-MM-DD HH:mm:ss').format('YYYY-MM-DD HH:mm:ss') }}
+
+
+ {{ $moment(authInfo.date_updated, 'YYYY-MM-DD HH:mm:ss').format('YYYY-MM-DD HH:mm:ss') }}
+
+
+ {{ authInfo.version }}
@@ -38,11 +47,14 @@
-
diff --git a/src/components/AccountListTable/index.vue b/src/components/AccountListTable/index.vue
index c4735f4f1..73f5b53f8 100644
--- a/src/components/AccountListTable/index.vue
+++ b/src/components/AccountListTable/index.vue
@@ -15,6 +15,11 @@
:account="account"
@add="addAccountSuccess"
/>
+
@@ -27,12 +32,14 @@ import AddAccount from './AddAccount'
import { connectivityMeta } from './const'
import { openTaskPage } from '@/utils/jms'
import { hasUUID } from '@/utils/common'
+import PasswordHistoryDialog from './PasswordHistoryDialog'
export default {
name: 'AccountListTable',
components: {
ListTable,
UpdateSecretInfo,
+ PasswordHistoryDialog,
ViewSecret,
AddAccount
},
@@ -61,7 +68,7 @@ export default {
},
asset: {
type: Object,
- default: null
+ default: () => ({})
},
columns: {
type: Array,
@@ -71,6 +78,7 @@ export default {
data() {
const vm = this
return {
+ showPasswordHistoryDialog: false,
showViewSecretDialog: false,
showUpdateSecretDialog: false,
showAddDialog: false,
@@ -171,11 +179,23 @@ export default {
can: this.$hasPerm('assets.change_account') && !this.$store.getters.currentOrgIsRoot,
callback: ({ row }) => {
vm.account = row
+ vm.$set(this.iAsset, 'platform_id', row.asset.platform_id)
vm.showAddDialog = false
setTimeout(() => {
vm.showAddDialog = true
})
}
+ },
+ {
+ title: this.$t('accounts.HistoryPassword'),
+ can: this.$hasPerm('assets.change_assetaccountsecret') && !this.$store.getters.currentOrgIsRoot,
+ callback: ({ row }) => {
+ vm.account = row
+ vm.showPasswordHistoryDialog = false
+ setTimeout(() => {
+ vm.showPasswordHistoryDialog = true
+ })
+ }
}
]
}
@@ -216,7 +236,7 @@ export default {
this.$set(this.tableConfig, 'url', iNew)
this.$set(this.headerActions.exportOptions, 'url', iNew.replace('/accounts/', '/account-secrets/'))
},
- '$route.query.assets': {
+ '$route.query.asset': {
immediate: true,
handler() {
this.hasAccountPermission()
@@ -233,8 +253,6 @@ export default {
actionColumn.formatterArgs.extraActions.push(item)
}
}
-
- console.log('Has perm: ', this.$hasPerm('assets.change_account'))
},
methods: {
onUpdateAuthDone(account) {
@@ -243,11 +261,15 @@ export default {
addAccountSuccess() {
this.$refs.ListTable.reloadTable()
},
+ async getAssetDetail() {
+ const { query: { asset }} = this.$route
+ this.iAsset = await this.$axios.get(`/api/v1/assets/assets/${asset}/`)
+ },
hasAccountPermission() {
- const { path, query } = this.$route
+ const { path, query: { asset }} = this.$route
if (!hasUUID(path)) {
- const hasPerm = this.$hasPerm('assets.add_account') && !!query.assets
- this.iAsset = { id: query.assets }
+ if (asset) this.getAssetDetail()
+ const hasPerm = this.$hasPerm('assets.add_account') && !!asset
this.$set(this.headerActions.extraActions[0], 'can', hasPerm)
}
}
diff --git a/src/components/AutoDataTable/index.vue b/src/components/AutoDataTable/index.vue
index 2d3ef2e76..0ca6faf40 100644
--- a/src/components/AutoDataTable/index.vue
+++ b/src/components/AutoDataTable/index.vue
@@ -27,7 +27,8 @@ import {
DisplayFormatter,
ActionsFormatter,
ChoicesFormatter,
- ObjectRelatedFormatter
+ ObjectRelatedFormatter,
+ ChoicesDisplayFormatter
} from '@/components/TableFormatters'
import i18n from '@/i18n/i18n'
import ColumnSettingPopover from './components/ColumnSettingPopover'
@@ -136,6 +137,10 @@ export default {
col.sortable = 'custom'
col.formatter = DisplayFormatter
break
+ case 'labeled_choice':
+ col.sortable = 'custom'
+ col.formatter = ChoicesDisplayFormatter
+ break
case 'boolean':
col.formatter = ChoicesFormatter
col.align = 'center'
diff --git a/src/components/Dialog/index.vue b/src/components/Dialog/index.vue
index ad9667a61..796fab487 100644
--- a/src/components/Dialog/index.vue
+++ b/src/components/Dialog/index.vue
@@ -83,12 +83,24 @@ export default {
diff --git a/src/components/ListTable/TableAction/ImportDialog.vue b/src/components/ListTable/TableAction/ImportDialog.vue
index d1e8d2fb3..58932b3b7 100644
--- a/src/components/ListTable/TableAction/ImportDialog.vue
+++ b/src/components/ListTable/TableAction/ImportDialog.vue
@@ -5,14 +5,14 @@
:destroy-on-close="true"
:close-on-click-modal="false"
:loading-status="loadStatus"
- width="80%"
+ width="60%"
class="importDialog"
:show-cancel="false"
:show-confirm="false"
@close="handleImportCancel"
>
-
-
+
+
{{ this.$t('common.Create') }}
@@ -22,12 +22,12 @@
{{ downloadTemplateTitle }}
- CSV
- XLSX
+ CSV
+ XLSX
-
+
- {{ $t('common.imExport.dragUploadFileInfo') }}
+
+ {{ $t('common.imExport.dragUploadFileInfo') }}
+
-
{{ $t('common.imExport.uploadCsvLth10MHelpText') }}
+
+ {{ $t('common.imExport.uploadCsvLth10MHelpText') }}
+
{{ renderError }}
@@ -168,7 +172,10 @@ export default {
this.$axios.post(
renderToJsonUrl,
file.raw,
- { headers: { 'Content-Type': isCsv ? 'text/csv' : 'text/xlsx' }, disableFlashErrorMsg: true }
+ {
+ headers: { 'Content-Type': isCsv ? 'text/csv' : 'text/xlsx' },
+ disableFlashErrorMsg: true
+ }
).then(data => {
this.jsonData = data
this.showTable = true
@@ -205,9 +212,8 @@ export default {
}
return this.url.indexOf('?') === -1 ? `${this.url}?${query}` : `${this.url}&${query}`
},
- // eslint-disable-next-line handle-callback-err
- catchError(error) {
- // debug(error)
+ catchError(err) {
+ console.log(err)
},
onSuccess(msg) {
this.errorMsg = ''
@@ -220,7 +226,7 @@ export default {
window.URL.revokeObjectURL(url)
},
async handleImportConfirm() {
- this.$refs['importTable'].performUpload()
+ await this.$refs['importTable'].performUpload()
},
handleImportCancel() {
this.showImportDialog = false
@@ -243,10 +249,6 @@ export default {
overflow: auto
}
- .importDialog >>> .el-form-item.file-uploader {
- padding-right: 150px;
- }
-
.file-uploader >>> .el-upload {
width: 100%;
//padding-right: 150px;
@@ -287,5 +289,9 @@ export default {
.el-upload__tip {
line-height: 1.5;
padding-top: 0;
+
+ .el-link {
+ margin-left: 10px;
+ }
}
diff --git a/src/components/TableFormatters/ShowKeyCopyFormatter.vue b/src/components/TableFormatters/ShowKeyCopyFormatter.vue
index 6ce047a24..9d533ea9f 100644
--- a/src/components/TableFormatters/ShowKeyCopyFormatter.vue
+++ b/src/components/TableFormatters/ShowKeyCopyFormatter.vue
@@ -3,6 +3,7 @@
{{ currentValue }}
-
-
diff --git a/src/views/myapps/KubernetesApp.vue b/src/views/myapps/KubernetesApp.vue
deleted file mode 100644
index d59db2a62..000000000
--- a/src/views/myapps/KubernetesApp.vue
+++ /dev/null
@@ -1,96 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/myapps/RemoteApp.vue b/src/views/myapps/RemoteApp.vue
deleted file mode 100644
index 381ccf65b..000000000
--- a/src/views/myapps/RemoteApp.vue
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/views/settings/Applet/AppletHosts/AppletHostCreateUpdate.vue b/src/views/settings/Applet/AppletHosts/AppletHostCreateUpdate.vue
new file mode 100644
index 000000000..b207c1335
--- /dev/null
+++ b/src/views/settings/Applet/AppletHosts/AppletHostCreateUpdate.vue
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
diff --git a/src/views/settings/Applet/AppletHosts/AppletHostList.vue b/src/views/settings/Applet/AppletHosts/AppletHostList.vue
new file mode 100644
index 000000000..3c53aaf64
--- /dev/null
+++ b/src/views/settings/Applet/AppletHosts/AppletHostList.vue
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
diff --git a/src/views/settings/Applet/Applets/AppletList.vue b/src/views/settings/Applet/Applets/AppletList.vue
new file mode 100644
index 000000000..9809d4bfd
--- /dev/null
+++ b/src/views/settings/Applet/Applets/AppletList.vue
@@ -0,0 +1,86 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/settings/Applet/Applets/UploadDialog.vue b/src/views/settings/Applet/Applets/UploadDialog.vue
new file mode 100644
index 000000000..be96eaa4f
--- /dev/null
+++ b/src/views/settings/Applet/Applets/UploadDialog.vue
@@ -0,0 +1,100 @@
+
+
+
+
+
+
+
diff --git a/src/views/settings/Applet/index.vue b/src/views/settings/Applet/index.vue
new file mode 100644
index 000000000..246d44572
--- /dev/null
+++ b/src/views/settings/Applet/index.vue
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/users/User/UserList.vue b/src/views/users/User/UserList.vue
index 34911cba1..3b0559636 100644
--- a/src/views/users/User/UserList.vue
+++ b/src/views/users/User/UserList.vue
@@ -140,7 +140,7 @@ export default {
return !this.currentOrgIsRoot && this.publicSettings.XPACK_LICENSE_IS_VALID
},
can: () => vm.$hasPerm('users.invite_user'),
- callback: function() { this.InviteDialogSetting.InviteDialogVisible = true }.bind(this)
+ callback: () => { this.InviteDialogSetting.InviteDialogVisible = true }
}
],
extraMoreActions: [