域名解析

This commit is contained in:
xj
2024-03-04 23:20:41 +08:00
parent aca5fb847b
commit be4e3b4bae
2 changed files with 62 additions and 15 deletions
+56
View File
@@ -7,3 +7,59 @@ export function domainNameBindInfo(query) {
params: query
})
}
export function fetchList(query) {
return request({
url: '/domain/page',
method: 'get',
params: query
})
}
export function mappingModify(data) {
return request({
url: '/port-mapping/update',
method: 'post',
data
})
}
export function deleteMapping(id) {
return request({
url: '/port-mapping/delete',
method: 'post',
params: {
id: id
}
})
}
export function updateEnableStatus(id, enable) {
return request({
url: '/port-mapping/update/enable-status',
method: 'post',
data: {
id: id,
enable: enable
}
})
}
export function portMappingBindSecurityGroup(id, securityGroupId) {
return request({
url: '/port-mapping/bind/security-group',
method: 'post',
data: {
id: id,
securityGroupId: securityGroupId
}
})
}
export function portMappingUnbindSecurityGroup(id) {
return request({
url: `/port-mapping/unbind/security-group?id=${id}`,
method: 'post'
})
}
@@ -132,11 +132,11 @@
</el-form-item>
<el-form-item :label="$t('域名')" prop="domain">
<el-input v-model="temp.domain">
<template slot="prepend">http(s):</template>
<template slot="prepend">http(s)://</template>
</el-input>
</el-form-item>
<el-form-item :label="$t('目标地址')" prop="targetPath">
<el-input v-model="temp.targetPath"></el-input>
<el-input type="textarea" v-model="temp.targetPath" placeholder="请输入目标地址,"></el-input>
</el-form-item>
<el-form-item :label="$t('客户端端口')" prop="clientPort">
<el-input v-model="temp.clientPort"></el-input>
@@ -180,7 +180,7 @@
</template>
<script>
import { fetchList, createUserPortMapping, updateUserPortMapping, updateEnableStatus, deletePortMapping } from '@/api/portMapping'
import { fetchList, mappingModify, updateEnableStatus, deleteMapping } from '@/api/domain'
import { fetchGroupList } from '@/api/securityGroup'
import { availablePortList, portAvailable } from '@/api/portPool'
import { licenseList, licenseAuthList } from '@/api/license'
@@ -233,16 +233,13 @@ export default {
userList: [],
licenseList: [],
licenseAuthList: [],
domainName: '',
showReviewer: false,
temp: {
id: undefined,
licenseId: undefined,
licenseName: undefined,
clientIp: undefined,
clientPort: undefined,
proxyResponses: undefined,
proxyTimeoutMs: undefined
domain: undefined,
targetPath: undefined,
},
statusOptions: {
1: '启用',
@@ -279,7 +276,6 @@ export default {
// filters: {
// },
created() {
this.getDomainNameBindInfo()
this.getDataList()
this.getLicenseList()
this.getLicenseAuthList()
@@ -312,11 +308,6 @@ export default {
}
})
},
getDomainNameBindInfo() {
domainNameBindInfo().then(response => {
this.domainName = response.data.data
})
},
getAllUserList() {
userList().then(response => {
this.userList = response.data.data
@@ -442,7 +433,7 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deletePortMapping(row.id).then(response => {
deleteMapping(row.id).then(response => {
if (response.data.code === 0) {
this.$notify({
title: '成功',