mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-25 14:25:23 +00:00
perf: 修改支持 date filter
This commit is contained in:
@@ -16,31 +16,31 @@
|
|||||||
v-on="$listeners"
|
v-on="$listeners"
|
||||||
>
|
>
|
||||||
<el-form class="password-form" label-position="right" label-width="80px" :model="authInfo">
|
<el-form class="password-form" label-position="right" label-width="80px" :model="authInfo">
|
||||||
<el-form-item :label="this.$t('assets.Name')">
|
<el-form-item :label="this.$tc('assets.Name')">
|
||||||
<ShowKeyCopyFormatter v-model="account.asset.name" />
|
<span>{{ account['name'] }}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$tc('assets.Username')">
|
<el-form-item :label="this.$tc('assets.Username')">
|
||||||
<ShowKeyCopyFormatter v-model="account.username" />
|
<span>{{ account['username'] }}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="secretTypePassword" :label="this.$t('assets.Password')">
|
<el-form-item v-if="secretTypePassword" :label="this.$tc('assets.Password')">
|
||||||
<ShowKeyCopyFormatter v-model="authInfo.secret" />
|
<ShowKeyCopyFormatter v-model="authInfo.secret" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<el-form-item :label="this.$t('assets.SSHSecretKey')">
|
<el-form-item :label="this.$tc('assets.SSHSecretKey')">
|
||||||
<ShowKeyCopyFormatter v-model="authInfo.secret" :has-show="false" />
|
<ShowKeyCopyFormatter v-model="authInfo.secret" :has-show="false" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('assets.sshKeyFingerprint')">
|
<el-form-item :label="this.$tc('assets.sshKeyFingerprint')">
|
||||||
<span>{{ sshKeyFingerprint }}</span>
|
<span>{{ sshKeyFingerprint }}</span>
|
||||||
<el-button type="text" @click="onDownload">{{ $t('common.Download') }}</el-button>
|
<el-button type="text" @click="onDownload">{{ $t('common.Download') }}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
<el-form-item :label="this.$t('common.DateCreated')">
|
<el-form-item :label="this.$tc('common.DateCreated')">
|
||||||
<span>{{ $moment(authInfo.date_created, 'YYYY-MM-DD HH:mm:ss').format('YYYY-MM-DD HH:mm:ss') }}</span>
|
<span>{{ account['date_created'] | date }}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('common.DateUpdated')">
|
<el-form-item :label="this.$tc('common.DateUpdated')">
|
||||||
<span>{{ $moment(authInfo.date_updated, 'YYYY-MM-DD HH:mm:ss').format('YYYY-MM-DD HH:mm:ss') }}</span>
|
<span>{{ account['date_updated'] | date }}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('accounts.PasswordRecord')">
|
<el-form-item :label="this.$tc('accounts.PasswordRecord')">
|
||||||
<el-button type="text" @click="onShowPasswordHistory">{{ authInfo.version }}</el-button>
|
<el-button type="text" @click="onShowPasswordHistory">{{ authInfo.version }}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
@@ -80,7 +80,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialogTitle: this.$tc('common.ViewSecret'),
|
dialogTitle: this.$tc('assets.AccountDetail'),
|
||||||
authInfo: {},
|
authInfo: {},
|
||||||
showAuthInfo: false,
|
showAuthInfo: false,
|
||||||
sshKeyFingerprint: '',
|
sshKeyFingerprint: '',
|
||||||
@@ -119,9 +119,19 @@ export default {
|
|||||||
.item-textarea >>> .el-textarea__inner {
|
.item-textarea >>> .el-textarea__inner {
|
||||||
height: 110px;
|
height: 110px;
|
||||||
}
|
}
|
||||||
|
.el-form-item {
|
||||||
|
border-bottom: 1px solid #EBEEF5;
|
||||||
|
padding: 3px 0;
|
||||||
|
margin-bottom: 0;
|
||||||
|
&:hover {
|
||||||
|
background-color: #F5F7FA;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
li {
|
li {
|
||||||
display: block;
|
display: block;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
@@ -134,7 +144,4 @@ export default {
|
|||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.password-form >>> .el-form-item {
|
|
||||||
margin-bottom: 4px;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
7
src/filters/datetime.js
Normal file
7
src/filters/datetime.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import Vue from 'vue'
|
||||||
|
import moment from 'moment'
|
||||||
|
|
||||||
|
Vue.filter('date', function(value) {
|
||||||
|
return moment(value, 'YYYY-MM-DD HH:mm:ss').format('YYYY-MM-DD HH:mm:ss')
|
||||||
|
})
|
||||||
|
|
1
src/filters/index.js
Normal file
1
src/filters/index.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
import './datetime'
|
@@ -97,6 +97,7 @@
|
|||||||
"NoSQLProtocol": "非关系数据库"
|
"NoSQLProtocol": "非关系数据库"
|
||||||
},
|
},
|
||||||
"assets": {
|
"assets": {
|
||||||
|
"AccountDetail": "账号详情",
|
||||||
"Accounts": "账号列表",
|
"Accounts": "账号列表",
|
||||||
"SelectTemplate": "选择模版",
|
"SelectTemplate": "选择模版",
|
||||||
"InAssetDetail": "在资产详情中更新账号信息",
|
"InAssetDetail": "在资产详情中更新账号信息",
|
||||||
|
@@ -14,6 +14,7 @@ import i18n from './i18n/i18n'
|
|||||||
import '@/icons' // icon
|
import '@/icons' // icon
|
||||||
import '@/guards' // permission control
|
import '@/guards' // permission control
|
||||||
import '@/directive'
|
import '@/directive'
|
||||||
|
import '@/filters'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If you don't want to use mock-server
|
* If you don't want to use mock-server
|
||||||
|
@@ -38,7 +38,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
columns: [
|
columns: [
|
||||||
'username', 'version', 'privileged', 'connectivity',
|
'username', 'version', 'privileged', 'connectivity',
|
||||||
'date_created', 'date_updated', 'actions'
|
'is_active', 'date_created', 'date_updated', 'actions'
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user