fix: 账号备份详情页显示sftp服务器信息

This commit is contained in:
wangruidong
2023-11-13 14:39:52 +08:00
committed by Bryan
parent 1fd29e13f8
commit 5a664f8c2c
7 changed files with 39 additions and 17 deletions

View File

@@ -1813,7 +1813,8 @@
"Applets": "リモート アプリケーション",
"sync": "同期",
"AccountStorage": "アカウントストレージ",
"Passkey": "パスキー"
"Passkey": "パスキー",
"ReplayStorageCreateUpdateHelpMessage": "注: 現在、SFTP ストレージはアカウントのバックアップのみをサポートしており、ビデオ ストレージはサポートしていません。"
},
"tickets": {
"BatchApproval": "大量承認です",

View File

@@ -1790,7 +1790,8 @@
"TestParam": "参数",
"sync": "同步",
"testHelpText": "请输入目的地址进行测试",
"Storage": "存储设置"
"Storage": "存储设置",
"ReplayStorageCreateUpdateHelpMessage": "注意:目前 SFTP 存储仅支持账号备份,暂不支持录像存储。"
},
"tickets": {
"BatchApproval": "批量审批",

View File

@@ -79,6 +79,20 @@ export default {
formatter: (item, val) => {
return <span>{val.map(item => item.name).join(', ')}</span>
}
},
{
key: this.$t('accounts.AccountBackup.RecipientServer') + ' A',
value: this.object.obj_recipients_part_one,
formatter: (item, val) => {
return <span>{val.map(item => item.name).join(', ')}</span>
}
},
{
key: this.$t('accounts.AccountBackup.RecipientServer') + ' B',
value: this.object.obj_recipients_part_two,
formatter: (item, val) => {
return <span>{val.map(item => item.name).join(', ')}</span>
}
}
]
}

View File

@@ -49,16 +49,3 @@ export const STORAGE_TYPE_META_MAP = {
meta: ['SFTP_HOST', 'SFTP_PORT', 'SFTP_USERNAME', 'STP_SECRET_TYPE', 'SFTP_PASSWORD', 'STP_PRIVATE_KEY', 'STP_PASSPHRASE', 'SFTP_ROOT_PATH']
}
}
export function getReplayStorageOptions() {
const options = []
const storages = Object.values(STORAGE_TYPE_META_MAP)
for (const s of storages) {
const option = {
name: s.name,
title: s.title
}
options.push(option)
}
return options
}

View File

@@ -4,7 +4,7 @@
<script>
import ListTable from '@/components/Table/ListTable/index.vue'
import { SetToDefaultReplayStorage, TestReplayStorage } from '@/api/sessions'
import { getReplayStorageOptions } from '@/views/sessions/const'
import { STORAGE_TYPE_META_MAP } from '@/views/sessions/const'
export default {
name: 'ReplayStorage',
@@ -13,7 +13,7 @@ export default {
},
data() {
const vm = this
const storageOptions = getReplayStorageOptions()
const storageOptions = this.getReplayStorageOptions()
return {
replayActions: {
canCreate: this.$hasPerm('terminal.add_replaystorage'),
@@ -110,6 +110,19 @@ export default {
}
},
methods: {
getReplayStorageOptions() {
const options = []
const storages = Object.values(STORAGE_TYPE_META_MAP)
for (const s of storages) {
if (s.name === 'sftp' && !this.$hasLicense()) continue
const option = {
name: s.name,
title: s.title
}
options.push(option)
}
return options
}
}
}
</script>

View File

@@ -3,6 +3,7 @@
:create-success-next-route="successUrl"
:update-success-next-route="successUrl"
v-bind="$data"
:help-message="getHelpMessage()"
/>
</template>
@@ -79,6 +80,10 @@ export default {
}
},
mounted() {
if (this.$route.query.type === 'sftp' && !this.$hasLicense()) this.$router.push({ name: '404' })
},
methods: {
getHelpMessage() { if (!this.$hasLicense()) return ''; else return this.$t('setting.ReplayStorageCreateUpdateHelpMessage') }
}
}
</script>

View File

@@ -56,6 +56,7 @@ export default {
})
const replayOptions = await getAllReplayStorage()
replayOptions.forEach(item => {
if (item.type.value === 'sftp') return
this.fieldsMeta.replay_storage.options.push({ label: item.name, value: item.name })
})
}