feat: 跳转天翼云容器

develop
时启龙 2024-09-02 11:12:53 +08:00
parent 8afcee943a
commit cca73a0672
49 changed files with 679 additions and 293 deletions

View File

@ -22,7 +22,7 @@
<script>
/* global $ */
import { modifyInstance, getTKERegions } from 'views/tce/services/tke.js'
import { modifyInstance, getTKERegions } from 'views/resource/ctstack/services/tke.js'
export default {
props: {
addData: {
@ -57,7 +57,6 @@ export default {
getRegionList() {
this.regions = []
getTKERegions({
tenantUuid: this.platformObject.tceTenantUuid,
vendorId: this.vendorId
}).then(data => {
if (data.success) {

View File

@ -20,8 +20,8 @@
<script>
/* global $ */
import { floatIpPorts } from 'views/tce/services/floatips.js'
import { getVm } from 'views/tce/services/vms.js'
import { floatIpPorts } from 'views/resource/ctstack/services/floatips.js'
import { getVm } from 'views/resource/ctstack/services/vm.js'
export default {
props: {
addData: {

View File

@ -37,9 +37,9 @@
<script>
/* global $ */
import bind from './bind.vue'
import { getClusterList } from 'views/tce/services/tke.js'
import { removeFloatIp, detailFloatIp } from 'views/tce/services/floatips.js'
import { getRegion } from 'views/tce/services/regions.js'
import { getClusterList } from 'views/resource/ctstack/services/tke.js'
import { removeFloatIp, detailFloatIp } from 'views/resource/ctstack/services/floatips.js'
import { getRegion } from 'views/resource/ctstack/services/regions.js'
import service from './service/index.vue'
import modifyCluster from './modifyCluster.vue'
import deleteCluster from './deleteCluster.vue'
@ -169,13 +169,13 @@ export default {
},
methods: {
onmessage(data) {
const arr = ['tke.modify.cluster', 'tke.delete.instance', 'tke.add.instance', 'tce.sync', 'tce.cluster', 'tke.create.cluster', 'tke.delete.cluster']
const arr = ['tke.modify.cluster', 'tke.delete.instance', 'tke.add.instance', 'ctstack.sync', 'ctstack.cluster', 'tke.create.cluster', 'tke.delete.cluster']
if (arr.includes(data.operate)) {
this.getClusterData()
}
},
addCluster() {
this.$router.push({ name: 'tceCreateCluster', query: { vendorId: this.platformObject.vendorId } })
this.$router.push({ name: 'ctstackCreateCluster', query: { vendorId: this.platformObject.vendorId } })
},
handleCellClick(data) {
this.clusterInfo = data
@ -262,24 +262,22 @@ export default {
params: JSON.stringify([
{
param: {
vendorId: this.platformObject.vendorId,
tenantUuid: this.platformObject.tecTenantUuid,
regionId: this.platformObject.tceRegionId
vendorId: this.platformObject.vendorId
},
sign: 'EQ'
}
])
}
getClusterList(params).then(data => {
getClusterList(params)
.then(data => {
if (data.success) {
this.loading = false
this.clusterTableData = data.data.rows
this.total = data.data.total
}
})
},
createCluster() {
this.$router.push({ name: 'tceClusterAdd', params: { id: this.platformObject.vendorId } })
.finally(() => {
this.loading = false
})
},
//
getDetail(row) {

View File

@ -16,7 +16,7 @@
</template>
<script>
import { conditionSubnet } from 'views/tce/services/subnets.js'
import { conditionSubnet } from 'views/resource/ctstack/services/subnet.js'
export default {
props: {
dialog: {

View File

@ -87,7 +87,7 @@
</template>
<script>
import { ref, computed } from 'vue'
import { getSubnet } from 'views/tce/services/subnets.js'
import { getSubnet } from 'views/resource/ctstack/services/subnet.js'
import HostDialog from './hostDialog.vue'
import DiskDialog from './diskDialog.vue'
import AssignIp from './AssignIpItem.vue'

View File

@ -3,8 +3,8 @@
<el-row>
<el-col :span="12">
<cb-form-item label="地域:">
<el-select v-model="region" @change="changeRegion">
<el-option v-for="(item, index) in platformObject.tceRegionList" :label="item.name" :value="item.regionId" :key="index"></el-option>
<el-select v-model="addData.region" @change="changeRegion">
<el-option v-for="item in regionList" :key="item.id" :label="item.name" :value="item.code"></el-option>
</el-select>
</cb-form-item>
</el-col>
@ -25,15 +25,6 @@
</cb-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<cb-form-item label="容器集群地域:" prop="regionId" validate="required" required-message="">
<el-select v-model="addData.regionId" @change="region">
<el-option v-for="(item, index) in regionList" :label="item.regionName" :value="item.alias" :key="index"></el-option>
</el-select>
</cb-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<cb-form-item label="集群网络:" prop="vpcId" validate="required" required-message="">
@ -175,9 +166,9 @@
</template>
<script>
import { getDescribeVersions, getTKERegions, createCluterImages, checkCIDR } from 'views/tce/services/tke.js'
import { getVpc } from 'views/tce/services/vpcs.js'
import { getSubnet } from 'views/tce/services/subnets.js'
import { getDescribeVersions, getTKERegions, createCluterImages, checkCIDR } from 'views/resource/ctstack/services/tke.js'
import { getVpc } from 'views/resource/ctstack/services/vpcs.js'
import { getSubnet } from 'views/resource/ctstack/services/subnet.js'
const subnetColumns = [
{
@ -255,7 +246,6 @@ export default {
getKubernetesList() {
this.kubernetesList = []
getDescribeVersions({
tenantUuid: this.platformObject.tceTenantUuid,
regionId: this.region
}).then(data => {
if (data.success) {
@ -348,7 +338,6 @@ export default {
this.CIDRIndex++
const index = this.CIDRIndex
params.region = this.addData.regionId
params.tenantUuid = this.platformObject.tceTenantUuid
this.addData.checkLoading = true
checkCIDR(params).then(data => {
this.addData.checkLoading = false
@ -374,7 +363,6 @@ export default {
getImages() {
this.systemList = []
createCluterImages({
tenantUuid: this.platformObject.tceTenantUuid,
vendorId: this.vendorId,
regionId: this.region
}).then(data => {
@ -437,14 +425,9 @@ export default {
this.addData.selectionSubnet = []
},
getRegionList() {
this.regionList = []
getTKERegions({
tenantUuid: this.platformObject.tceTenantUuid,
vendorId: this.vendorId,
regionId: this.region
}).then(data => {
getRegion({ vendorId: this.vendorId }).then(data => {
if (data.success) {
this.regionList = data.data.regionInstanceSet
this.regionList = data.data
}
})
},
@ -467,13 +450,16 @@ export default {
sign: 'EQ'
}
])
}).then(data => {
})
.then(data => {
if (data.success) {
this.loading = false
this.subnetList = data.data.rows
this.initClick()
}
})
.finally(() => {
this.loading = false
})
},
initClick() {
this.subnetList.forEach((item, index) => {
@ -493,14 +479,13 @@ export default {
})
},
changeRegion() {
this.getRegionList()
this.getImages()
this.getKubernetesList()
}
},
created() {
this.handleOne(1)
// this.getRegionList()
this.getRegionList()
this.getVpc()
// this.getImages()
// this.getKubernetesList()

View File

@ -30,8 +30,8 @@
</template>
<script>
import { getCategoriesByCode } from 'views/tce/services/cloud.js'
import { queryAvailable } from 'views/tce/services/cbs.js'
import { getCategoriesByCode } from 'views/resource/ctstack/services/cloud.js'
import { queryAvailable } from 'views/resource/ctstack/services/cbs.js'
export default {
props: {
diskDialog: {
@ -68,11 +68,11 @@ export default {
vendorId,
regionId,
diskChargeType: 'POSTPAID_BY_HOUR',
zones: [zoneId],
tenantUuid: this.platformObject.tceTenantUuid
zones: [zoneId]
}).finally(() => {
this.loading = false
})
if (!res.success) {
this.loading = false
return
}
const map = {}
@ -80,7 +80,7 @@ export default {
const { diskType } = item
map[diskType] = item
})
const result = await getCategoriesByCode('tce.standard.volume')
const result = await getCategoriesByCode('ctstack.standard.volume')
console.log(result)
this.diskTypeList = result.data.map(item => {
const { available, maxDiskSize, minDiskSize, stepSize } = map[item.code]

View File

@ -122,8 +122,8 @@
</template>
<script>
import { getGroup } from 'views/tce/services/sgroups.js'
import { getKey } from 'views/tce/services/keypairs.js'
import { getGroup } from 'views/resource/ctstack/services/sgroups.js'
import { getKey } from 'views/resource/ctstack/services/keypairs.js'
import { computed } from 'vue'
const mountList = [
{ name: '/var/lib/docker', value: '/var/lib/docker' },

View File

@ -25,8 +25,8 @@
</template>
<script>
import { getFlavor, getFlavorType } from 'views/tce/services/flavors.js'
import { getDictChildrenTree } from 'views/tce/services/dictionaries.js'
import { getFlavor, getFlavorType } from 'views/resource/ctstack/services/flavors.js'
import { getDictChildrenTree } from 'views/resource/ctstack/services/dictionaries.js'
const searchConfigs = [
{

View File

@ -44,7 +44,7 @@ import clusterItem from './clusterItem.vue'
import typeItem from './typeItem.vue'
import infoItem from './infoItem.vue'
import hostConfigItem from './hostConfigItem.vue'
import { createCluter } from 'views/tce/services/tke.js'
import { createCluter } from 'views/resource/ctstack/services/tke.js'
import { instanceParams } from './data'
export default {

View File

@ -67,11 +67,11 @@
</template>
<script>
import { getTKERegions } from 'views/tce/services/tke.js'
import { getZone } from 'views/tce/services/regions.js'
import { getVpc } from 'views/tce/services/vpcs.js'
import { getSubnet } from 'views/tce/services/subnets.js'
import { getFlavor } from 'views/tce/services/flavors.js'
import { getTKERegions } from 'views/resource/ctstack/services/tke.js'
import { getZone } from 'views/resource/ctstack/services/regions.js'
import { getVpc } from 'views/resource/ctstack/services/vpcs.js'
import { getSubnet } from 'views/resource/ctstack/services/subnet.js'
import { getFlavor } from 'views/resource/ctstack/services/flavors.js'
import hostDialog from './hostDialog.vue'
import diskDialog from './diskDialog.vue'
import publicIpDialog from './publicIpDialog.vue'

View File

@ -22,7 +22,7 @@
<script>
/* global $ */
import { getInstanceList, deleteCluster } from 'views/tce/services/tke.js'
import { getInstanceList, deleteCluster } from 'views/resource/ctstack/services/tke.js'
const instanceColumns = [
{
label: '节点ID',
@ -94,13 +94,16 @@ export default {
rows: 9999999,
params: JSON.stringify([{ param: { vendorId: this.vendorId, clusterId: this.clusterInfo.clusterId }, sign: 'EQ' }])
}
getInstanceList(params).then(data => {
getInstanceList(params)
.then(data => {
if (data.success) {
this.loading = false
this.instanceList = data.data.rows
this.total = data.data.total
}
})
.finally(() => {
this.loading = false
})
}
},
created() {},

View File

@ -18,7 +18,7 @@
</template>
<script>
import { addAsByCluster } from 'views/tce/services/as.js'
import { addAsByCluster } from 'views/resource/ctstack/services/as.js'
import addConfig from './components/addConfig'
import addAs from './components/addAs'
export default {

View File

@ -45,8 +45,8 @@
</template>
<script>
import { getVpc } from 'views/tce/services/vpcs.js'
import { getSubnet } from 'views/tce/services/subnets.js'
import { getVpc } from 'views/resource/ctstack/services/vpcs.js'
import { getSubnet } from 'views/resource/ctstack/services/subnet.js'
const retryPolicyList = [
{ name: '立即重试', value: 'IMMEDIATE_RETRY' },
{ name: '间隔递增重试', value: 'INCREMENTAL_INTERVALS' }

View File

@ -135,11 +135,11 @@
</template>
<script>
import { getRegion, getZone } from 'views/tce/services/regions.js'
import { getGroup } from 'views/tce/services/sgroups.js'
import { getKey } from 'views/tce/services/keypairs.js'
import { conditionImage } from 'views/tce/services/images.js'
import { queryAvailable } from 'views/tce/services/cbs.js'
import { getRegion, getZone } from 'views/resource/ctstack/services/regions.js'
import { getGroup } from 'views/resource/ctstack/services/sgroups.js'
import { getKey } from 'views/resource/ctstack/services/keypairs.js'
import { conditionImage } from 'views/resource/ctstack/services/image.js'
import { queryAvailable } from 'views/resource/ctstack/services/cbs.js'
// import flavor from '../../../components/flavor'
export default {
// components: { flavor },
@ -227,8 +227,7 @@ export default {
vendorId: this.vendorId,
regionId: this.addData.regionId,
diskChargeType: 'POSTPAID_BY_HOUR',
zones: [this.addData.zoneId],
tenantUuid: this.platformObject.tceTenantUuid
zones: [this.addData.zoneId]
}).then(data => {
if (data.success) {
this.diskTypeList = data.data

View File

@ -24,7 +24,7 @@
<script>
/* global $ */
import { postAddInstance, getExistInstance } from 'views/tce/services/tke.js'
import { postAddInstance, getExistInstance } from 'views/resource/ctstack/services/tke.js'
export default {
props: {
addData: {
@ -69,12 +69,15 @@ export default {
vendorId: this.vendorId,
id: this.clusterInfo.id
}
getExistInstance(param, this.clusterInfo.id).then(data => {
getExistInstance(param, this.clusterInfo.id)
.then(data => {
if (data.success) {
this.loading = false
this.instanceList = data.data
}
})
.finally(() => {
this.loading = false
})
},
ok() {
this.$refs.data.validate(async valid => {

View File

@ -173,9 +173,9 @@
</template>
<script>
import { getGroup } from 'views/tce/services/sgroups.js'
import { getKey } from 'views/tce/services/keypairs.js'
import { queryAvailable } from 'views/tce/services/cbs.js'
import { getGroup } from 'views/resource/ctstack/services/sgroups.js'
import { getKey } from 'views/resource/ctstack/services/keypairs.js'
import { queryAvailable } from 'views/resource/ctstack/services/cbs.js'
import { computed } from 'vue'
const mountList = [
@ -266,8 +266,7 @@ export default {
vendorId: this.vendorId,
diskChargeType: 'POSTPAID_BY_HOUR',
zones: [az],
regionId: this.addData.data.regionId,
tenantUuid: this.platformObject.tceTenantUuid
regionId: this.addData.data.regionId
}).then(data => {
if (data.success) {
this.diskTypeList = data.data

View File

@ -37,8 +37,8 @@
<script>
import typeItem from './typeItem.vue'
import { getTKERegions, createInstance, getClusterDetail } from 'views/tce/services/tke.js'
import { getVpc } from 'views/tce/services/vpcs.js'
import { getTKERegions, createInstance, getClusterDetail } from 'views/resource/ctstack/services/tke.js'
import { getVpc } from 'views/resource/ctstack/services/vpcs.js'
import hostConfigItem from './hostConfigItem.vue'
import infoItem from './infoItem.vue'
@ -112,7 +112,6 @@ export default {
methods: {
async getRegionName(regionId) {
const res = await getTKERegions({
tenantUuid: this.platformObject.tceTenantUuid,
vendorId: this.vendorId
})
if (res.success) {
@ -154,7 +153,7 @@ export default {
},
goBack() {
this.$router.push({
name: 'tceContainer'
name: 'ctstackContainer'
})
},
ok() {
@ -239,7 +238,7 @@ export default {
message: data.message
})
this.$router.push({
name: 'tceContainer'
name: 'ctstackContainer'
})
}
})

View File

@ -93,8 +93,8 @@
<script>
import SpecList from 'views/platform/components/abcstack/flavor.vue'
import AssignIp from '../../creatCluster/AssignIpItem.vue'
import { getSubnet } from 'views/tce/services/subnets.js'
import { getZone } from 'views/tce/services/regions.js'
import { getSubnet } from 'views/resource/ctstack/services/subnet.js'
import { getZone } from 'views/resource/ctstack/services/regions.js'
export default {
components: { SpecList, AssignIp },

View File

@ -13,7 +13,7 @@
<script>
/* global $ */
import { deleteInstance } from 'views/tce/services/tke.js'
import { deleteInstance } from 'views/resource/ctstack/services/tke.js'
export default {
props: {
vendorId: {

View File

@ -14,7 +14,7 @@
<script>
/* global $ */
import { drain } from 'views/tce/services/tke.js'
import { drain } from 'views/resource/ctstack/services/tke.js'
export default {
props: {
vendorId: {

View File

@ -27,7 +27,7 @@
<script>
import drainInstance from './drainInstance.vue'
import deleteInstance from './deleteInstance.vue'
import { getInstanceList, operateInstance } from 'views/tce/services/tke.js'
import { getInstanceList, operateInstance } from 'views/resource/ctstack/services/tke.js'
import addExistInstance from './addExistInstance.vue'
const columns = [
@ -219,13 +219,16 @@ export default {
rows: this.params.rows,
params: JSON.stringify([{ param: { vendorId: this.detail.vendorId, clusterId: this.detail.clusterId }, sign: 'EQ' }])
}
getInstanceList(params).then(data => {
getInstanceList(params)
.then(data => {
if (data.success) {
this.loading = false
this.tableData = data.data.rows
this.total = data.data.total
}
})
.finally(() => {
this.loading = false
})
}
},
watch: {

View File

@ -5,7 +5,7 @@
</template>
<script>
import { getLogList } from 'views/tce/services/tke.js'
import { getLogList } from 'views/resource/ctstack/services/tke.js'
const columns = [
{
label: 'ID',
@ -53,13 +53,16 @@ export default {
methods: {
getList() {
this.loading = true
getLogList(this.params).then(res => {
this.loading = false
getLogList(this.params)
.then(res => {
if (res.success) {
this.data = res.data.rows
this.total = res.data.total
}
})
.finally(() => {
this.loading = false
})
}
},
watch: {

View File

@ -20,7 +20,7 @@
<script>
/* global $ */
import { modifyInstance } from 'views/tce/services/tke.js'
import { modifyInstance } from 'views/resource/ctstack/services/tke.js'
export default {
props: {
addData: {

View File

@ -10,7 +10,7 @@
</template>
<script>
import { getTKERegions } from 'views/tce/services/tke.js'
import { getTKERegions } from 'views/resource/ctstack/services/tke.js'
const columns = [
{
label: '名称',
@ -45,7 +45,6 @@ export default {
},
getData() {
getTKERegions({
tenantUuid: this.platformObject.tceTenantUuid,
vendorId: this.detail.vendorId
}).then(data => {
if (data.success) {

View File

@ -9,7 +9,7 @@
</template>
<script>
import { getsecrectList } from 'views/tce/services/tke.js'
import { getsecrectList } from 'views/resource/ctstack/services/tke.js'
const columns = [
{
label: '名称',
@ -57,13 +57,16 @@ export default {
rows: this.params.rows,
params: JSON.stringify([{ param: { vendorId: this.detail.vendorId, clusterId: this.detail.clusterId }, sign: 'EQ' }])
}
getsecrectList(params).then(data => {
getsecrectList(params)
.then(data => {
if (data.success) {
this.loading = false
this.tableData = data.data.rows
this.total = data.data.total
}
})
.finally(() => {
this.loading = false
})
}
},
watch: {

View File

@ -19,7 +19,7 @@
</template>
<script>
import { getServiceList } from 'views/tce/services/tke.js'
import { getServiceList } from 'views/resource/ctstack/services/tke.js'
const columns = [
{
label: '名称',
@ -67,13 +67,16 @@ export default {
rows: this.params.rows,
params: JSON.stringify([{ param: { vendorId: this.vendorId, clusterId: this.clusterInfo.clusterId }, sign: 'EQ' }])
}
getServiceList(params).then(data => {
getServiceList(params)
.then(data => {
if (data.success) {
this.loading = false
this.tableData = data.data.rows
this.total = data.data.total
}
})
.finally(() => {
this.loading = false
})
}
},
watch: {

View File

@ -57,7 +57,8 @@ export default {
this.$refs.data.validate(valid => {
if (valid) {
this.loading = true
createFloatIp(this.addData.data).then(data => {
createFloatIp(this.addData.data)
.then(data => {
if (data.success) {
this.$message({
type: 'success',
@ -66,6 +67,8 @@ export default {
this.addData.dialog = false
this.$parent.$parent.getData()
}
})
.finally(() => {
this.loading = false
})
}

View File

@ -197,11 +197,12 @@ export default {
},
getData() {
this.loading = true
getFloatIp(this.params).then(data => {
getFloatIp(this.params)
.then(data => {
if (data.success) {
this.secretData = data.data.rows
this.total = data.data.total
this.loading = false
this.secretData.forEach(item => {
if (item.projectVisibility && item.projectVisibility != 'GLOBAL_PROJECT') {
item.disabled = true
@ -209,6 +210,9 @@ export default {
})
}
})
.finally(() => {
this.loading = false
})
},
handleSizeChange(val) {
this.params.rows = val

View File

@ -313,11 +313,12 @@ export default {
},
getData() {
this.loading = true
getVolume(this.params).then(data => {
getVolume(this.params)
.then(data => {
if (data.success) {
this.tableData = data.data.rows
this.total = data.data.total
this.loading = false
this.tableData.forEach(data => {
if ((data.projectVisibility && data.projectVisibility != 'GLOBAL_PROJECT') || data.tenantId || data.tenantIds || data.tenantName) {
data.disabled = true
@ -328,6 +329,9 @@ export default {
})
}
})
.finally(() => {
this.loading = false
})
},
dropdownClick(command) {
switch (command.index) {

View File

@ -269,7 +269,8 @@ export default {
if (valid) {
this.addData.vendorId = this.platformObject.vendorId
this.loading = true
createImage(this.addData).then(data => {
createImage(this.addData)
.then(data => {
if (data.success) {
this.$message({
type: 'success',
@ -278,6 +279,8 @@ export default {
this.getData()
this.addDialogVisible = false
}
})
.finally(() => {
this.loading = false
})
} else {
@ -287,11 +290,12 @@ export default {
},
getData() {
this.loading = true
getImage(this.params).then(data => {
getImage(this.params)
.then(data => {
if (data.success) {
this.imageData = data.data.rows
this.selectList = []
this.loading = false
this.imageData.forEach(data => {
if ((data.projectVisibility && data.projectVisibility != 'GLOBAL_PROJECT') || data.tenantId || data.tenantIds || data.tenantName) {
data.disabled = true
@ -300,6 +304,9 @@ export default {
this.total = data.data.total
}
})
.finally(() => {
this.loading = false
})
},
handleModify(id) {
detailImage(id).then(data => {

View File

@ -369,10 +369,11 @@ export default {
},
getData() {
this.loading = true
getKey(this.params).then(data => {
getKey(this.params)
.then(data => {
if (data.success) {
this.list = data.data.rows
this.loading = false
this.selectList = []
this.total = data.data.total
this.list.forEach(item => {
@ -382,6 +383,9 @@ export default {
})
}
})
.finally(() => {
this.loading = false
})
},
handleSizeChange(val) {
this.params.rows = val

View File

@ -393,12 +393,13 @@ export default {
},
getData() {
this.loading = true
getGroup(this.params).then(data => {
getGroup(this.params)
.then(data => {
if (data.success) {
this.tableData = data.data.rows
this.total = data.data.total
this.selectList = []
this.loading = false
this.refreshId()
this.tableData.forEach(data => {
if ((data.projectVisibility && data.projectVisibility != 'GLOBAL_PROJECT') || data.tenantId || data.tenantIds || data.tenantName) {
@ -411,6 +412,9 @@ export default {
})
}
})
.finally(() => {
this.loading = false
})
},
handleSizeChange(val) {
this.params.rows = val

View File

@ -60,7 +60,8 @@ export default {
if (data.password) data.password = encrypt(data.password)
if (data.endPassword) data.endPassword = encrypt(data.endPassword)
this.loading = true
createVm('create', data).then(data => {
createVm('create', data)
.then(data => {
if (data.success) {
this.$message({
type: 'success',
@ -68,6 +69,8 @@ export default {
})
this.goBack()
}
})
.finally(() => {
this.loading = false
})
}

View File

@ -103,8 +103,7 @@ export default {
rows: 10
},
searchData: {
name: '',
tenantUuid: ''
name: ''
},
snapshotList: [],
// addData: {

View File

@ -198,12 +198,12 @@ export default {
getData() {
this.refreshId()
this.loading = true
getFlavor(this.params).then(data => {
getFlavor(this.params)
.then(data => {
if (data.success) {
this.specificationData = data.data.rows
this.total = data.data.total
this.selectList = []
this.loading = false
this.refreshId()
this.specificationData.forEach(item => {
const self = this
@ -213,6 +213,9 @@ export default {
})
}
})
.finally(() => {
this.loading = false
})
},
handleSizeChange(val) {
this.params.rows = val

View File

@ -42,14 +42,15 @@ export default {
this.$refs.data.validate(async valid => {
if (valid) {
this.loading = true
const data = await modifyVpc(this.addData)
const data = await modifyVpc(this.addData).finally(() => {
this.loading = false
})
if (data.success) {
this.$message({
type: 'success',
message: data.message
})
this.dialog.visible = false
this.loading = false
this.$emit('get-data')
}
}

View File

@ -94,7 +94,8 @@ export default {
this.addData.dnsNames = DnsFilter(this.addData.dnsName)
}
this.loading = true
createSubnet(this.addData.data).then(data => {
createSubnet(this.addData.data)
.then(data => {
if (data.success) {
this.$message({
type: 'success',
@ -103,6 +104,8 @@ export default {
this.addData.dialog = false
this.$parent.$parent.getData()
}
})
.finally(() => {
this.loading = false
})
}

View File

@ -357,11 +357,11 @@ export default {
},
getData() {
this.loading = true
getVpc(this.params).then(data => {
getVpc(this.params)
.then(data => {
if (data.success) {
this.list = data.data.rows
this.total = data.data.total
this.loading = false
this.list.forEach(data => {
if ((data.projectVisibility && data.projectVisibility != 'GLOBAL_PROJECT') || data.tenantId || data.tenantIds || data.tenantName) {
data.disabled = true
@ -369,6 +369,9 @@ export default {
})
}
})
.finally(() => {
this.loading = false
})
},
handleSizeChange(val) {
this.params.rows = val

View File

@ -13,5 +13,7 @@ export default {
ctstackFloatIp: () => import('views/resource/ctstack/page/floatIp/index.vue'),
ctstackSnapshot: () => import('views/resource/ctstack/page/snapshot/index.vue'),
ctstackContainer: () => import('views/resource/ctstack/page/container/index.vue'),
ctstackCreateCluster: () => import('views/resource/ctstack/page/container/creatCluster/index.vue')
ctstackClusterAdd: () => import('views/resource/ctstack/page/container/addCluster.vue'),
ctstackCreateCluster: () => import('views/resource/ctstack/page/container/creatCluster/index.vue'),
ctstackInstanceAdd: () => import('views/resource/ctstack/page/container/instance/create/index.vue')
}

View File

@ -0,0 +1,184 @@
import { request } from '@cmp/cmp-element'
import { wrapperParams } from 'utils'
export function getScheduledActionList(params) {
return request.get('/cmp/plugins/ctstack/v1/as/scheduledAction', { params })
}
export function addScheduledAction(params) {
return request.post('/cmp/plugins/ctstack/v1/as/scheduledAction', wrapperParams(params))
}
export function editScheduledAction(params) {
return request.put(`/cmp/plugins/ctstack/v1/as/scheduledAction/${params.id}`, wrapperParams(params))
}
export function delScheduledAction(params) {
return request.delete(`/cmp/plugins/ctstack/v1/as/scheduledAction/${params.id}`, { data: wrapperParams(params) })
}
// 通知列表
export function getNotifyList(params) {
return request.get('/cmp/plugins/ctstack/v1/autoscaling/listNotification', { params })
}
export function delNotify(params) {
return request.delete(`/cmp/plugins/ctstack/v1/autoscaling/deleteNotificationConfiguration/${params.id}`)
}
// 伸缩组列表
export function getTelescopicGroupList(params) {
return request.get('/cmp/plugins/ctstack/v1/autoscalings', { params })
}
// 伸缩组列表 查询用户账户在弹性伸缩中的资源限制
export function getDescribeAccount(params) {
return request.get('/cmp/plugins/ctstack/v1/autoscalings/describeAccount', { params })
}
// 告警策略列表
export function getAlertList(params) {
return request.get('/cmp/plugins/ctstack/v1/as/policies/list', { params })
}
// 添加
export function addAlert(params) {
return request.post('/cmp/plugins/ctstack/v1/as/policies/add', wrapperParams(params))
}
// 修改
export function editAlert(params) {
return request.post(`/cmp/plugins/ctstack/v1/as/policies/update/${params.id}`, wrapperParams(params))
}
// 删除
export function delAlert(params) {
return request.get(`/cmp/plugins/ctstack/v1/as/policies/del/${params.id}`)
}
// 执行
export function runAlert(params) {
return request.get(`/cmp/plugins/ctstack/v1/as/policies/off/${params.id}`)
}
// 伸缩活动列表
export function getActivityList(params) {
return request.get('/cmp/plugins/ctstack/v1/as/activites/list', { params })
}
export function getLifecycleList(params) {
return request.get('/cmp/plugins/ctstack/v1/as/lifecycleHook', { params })
}
export function addLifecycle(params) {
return request.post('/cmp/plugins/ctstack/v1/as/lifecycleHook', wrapperParams(params))
}
export function editLifecycle(params) {
return request.put(`/cmp/plugins/ctstack/v1/as/lifecycleHook/${params.id}`, wrapperParams(params))
}
export function delLifecycle(params) {
return request.delete(`/cmp/plugins/ctstack/v1/as/lifecycleHook/${params.id}`, { data: wrapperParams(params) })
}
// 移除保护
export function setInstancesProtection(params) {
return request.put('/cmp/plugins/ctstack/v1/as/instances/setInstancesProtection', wrapperParams(params))
}
export function getInstancesList(params) {
return request.get('/cmp/plugins/ctstack/v1/as/instances', { params })
}
export function delInstances(id, params) {
return request.post(`/cmp/plugins/ctstack/v1/autoscalings/delCase/${id}`, params)
}
export function addInstances(id, params) {
return request.post(`/cmp/plugins/ctstack/v1/autoscalings/attachInstances/${id}`, wrapperParams(params))
}
export function updateStretchGroup(params) {
return request.put('/cmp/plugins/ctstack/v1/autoscalings/updateStretchGroup', wrapperParams(params))
}
export function createStretchGroup(params) {
return request.post('/cmp/plugins/ctstack/v1/autoscalings/createStretchGroup', wrapperParams(params))
}
export function modifyLoadBalancers(params) {
return request.put('/cmp/plugins/ctstack/v1/autoscalings/modifyLoadBalancers', wrapperParams(params))
}
export function setTelescopicGroupState(params) {
return request.put('/cmp/plugins/ctstack/v1/autoscalings/updateGroupEnableState', wrapperParams(params))
}
export function delTelescopicGroup(params) {
return request.delete('/cmp/plugins/ctstack/v1/autoscalings/removeStretchGroup', { data: wrapperParams(params) })
}
export function getCloudServer(params) {
return request.get('/cmp/plugins/ctstack/v1/vms/getCloudServer', { params })
}
export function getConfiguration(params) {
return request.get('/cmp/plugins/ctstack/v1/as/launchConfiguration', { params })
}
export function createConfiguration(params) {
return request.post('/cmp/plugins/ctstack/v1/as/launchConfiguration/create', wrapperParams(params))
}
export function editConfiguration(params) {
return request.put('/cmp/plugins/ctstack/v1/as/launchConfiguration/update', wrapperParams(params))
}
export function upgradeConfiguration(params) {
return request.post('/cmp/plugins/ctstack/v1/as/launchConfiguration/upgrade', wrapperParams(params))
}
export function delConfiguration(params) {
return request.delete(
'/cmp/plugins/ctstack/v1/as/launchConfiguration',
{ data: wrapperParams(params) },
{
headers: { 'Content-Type': 'multipart/form-data', BsmAjaxHeader: true, options: { noSeri: true } }
}
)
}
// 获取用户组
export function getUserList(params) {
return request.get(`/cmp/plugins/ctstack/v1/autoscaling/listGroups/${params.vendorId}`, { params })
}
// 添加通知
export function addNotify(params) {
return request.post('/cmp/plugins/ctstack/v1/autoscaling/createNotificationConfiguration', wrapperParams(params))
}
// 修改通知
export function editNotify(params) {
return request.put('/cmp/plugins/ctstack/v1/autoscaling/modifyNotificationConfiguration', wrapperParams(params))
}
export function addAsByCluster(params) {
return request.post('/cmp/plugins/ctstack/v1/tke/group/add', wrapperParams(params))
}
const lbsListUrl = '/cmp/plugins/ctstack/v1/lbs'
export function getLbsList(params) {
return request.get(lbsListUrl, {
params
})
}
export function setImage(params) {
return request.post('/cmp/plugins/ctstack/v1/as/launchConfiguration/imageconfig', wrapperParams(params))
}
export function getConfigDetail(params) {
return request.get(`/cmp/plugins/ctstack/v1/as/launchConfiguration/${params.launchConfigurationId}`, { params })
}
export function getFlavorsMulti(params) {
return request.post('/cmp/plugins/ctstack/v1/flavors/multimodel', wrapperParams(params))
}

View File

@ -0,0 +1,31 @@
import { request } from '@cmp/cmp-element'
import { wrapperParams, downloadFile } from 'utils'
export function queryAvailable(params) {
return request.post('/cmp/plugins/ctstack/v1/cbs/policy/disk/queryAvailable', wrapperParams(params))
}
// 获取掩码
export function getQueryMask(params) {
return request.post('/cmp/plugins/ctstack/v1/cbs/policy/disk/denied', wrapperParams(params))
}
// 产品支持特性
export function getSupportFeatures(params) {
return request.post('/cmp/plugins/ctstack/v1/cbs/policy/disk/support', wrapperParams(params))
}
// 修改
export function editCloudDisk(params) {
return request.post('/cmp/plugins/ctstack/v1/cbs/policy/disk/attribute', wrapperParams(params))
}
// 查询用户资源
export function getUserResources(params) {
return request.post('/cmp/plugins/ctstack/v1/cbs/policy/userdisk', wrapperParams(params))
}
// 查询云硬盘配额
export function getCloudDiskQuota(params) {
return request.post('/cmp/plugins/ctstack/v1/cbs/policy/disk/config', wrapperParams(params))
}

View File

@ -0,0 +1,6 @@
import { request } from '@cmp/cmp-element'
import { wrapperParams } from 'utils/index'
export function getCategoriesByCode(serviceCode) {
return request.get(`/cos/v1/cloud/services/${serviceCode}/categories`)
}

View File

@ -0,0 +1,26 @@
import { request } from '@cmp/cmp-element'
import { wrapperParams, downloadFile } from 'utils'
// 字典
const dictUrl = '/sms/v1/dictionaries'
export function getDictChildrenTree(params) {
return request.get(`${dictUrl}/children/tree`, {
params: wrapperParams(params)
})
}
export function getDictionariesTree(params) {
return request.get('/sms/v1/dictionaries/children/tree', {
params
})
}
export function getDictionaries(params) {
return request.get('/sms/v1/dictionaries/children', {
params
})
}
export function getDictChildren(params) {
return request.get(`${dictUrl}/children`, { params })
}

View File

@ -27,3 +27,21 @@ export function removeFlavor(id) {
export function removeFlavors(params) {
return request.delete(url, { data: params })
}
export function getFlavorType(params) {
return request.get(`${url}/type`, {
params
})
}
export function bindFlavor(params) {
return request.post(`${url}/binding`, wrapperParams(params))
}
export function unbindFlavor(params) {
return request.post(`${url}/unbind`, wrapperParams(params))
}
export function getFlavorListZone(id) {
return request.get(`${url}/listZone/${id}`)
}

View File

@ -0,0 +1,27 @@
import { request } from '@cmp/cmp-element'
import { wrapperParams, downloadFile } from 'utils'
const url = '/cmp/plugins/ctstack/v1/keypairs'
export function getKey(params) {
return request.get(url, { params })
}
export function removeKey(id) {
return request.delete(`${url}/${id}`)
}
export function createKey(params) {
return request.post(url, wrapperParams(params))
}
export function detailKey(id) {
return request.get(`${url}/${id}`)
}
export function modifyKey(params) {
return request.put(`${url}/${params.id}`, wrapperParams(params))
}
export function keyBindVm(params) {
return request.patch(`${url}/${params.keypairId}`, wrapperParams(params))
}

View File

@ -0,0 +1,21 @@
import { request } from '@cmp/cmp-element'
import { wrapperParams, downloadFile } from 'utils'
const url = '/cmp/plugins/ctstack/v1/regions'
export function getRegion(params) {
return request.get(url, { params })
}
export function getZone(params) {
return request.get(`${url}/zones`, { params: wrapperParams(params) })
}
export function getAllRegion() {
return request.get('/cmp/plugins/ctstack/v1/regions/distinct')
}
export function getAllZone(params) {
return request.get('/cmp/plugins/ctstack/v1/regions/zones/distinct', {
params: wrapperParams(params)
})
}

View File

@ -0,0 +1,37 @@
import { request } from '@cmp/cmp-element'
import { wrapperParams, downloadFile } from 'utils'
const url = '/cmp/plugins/ctstack/v1/sgroups'
export function getGroup(params) {
return request.get(url, { params })
}
export function removeGroup(id) {
return request.delete(`${url}/${id}`)
}
export function createGroup(params) {
return request.post(url, wrapperParams(params))
}
export function detailGroup(id) {
return request.get(`${url}/${id}`)
}
export function getGroupRule(params) {
return request.get(`${url}/rules`, {
params
})
}
export function createGroupRule(params) {
return request.post(`${url}/rules`, wrapperParams(params))
}
export function removeGroupRule(id) {
return request.delete(`${url}/rules/${id}`)
}
export function getSgroupsTemplateList(params) {
return request.get('/cmp/plugins/ctstack/v1/sgroups/template', { params })
}

View File

@ -1,18 +1,18 @@
import { request } from '@cmp/cmp-element'
import { wrapperParams, downloadFile } from 'utils'
const createCluterUrl = '/cmp/plugins/tce/v1/tke'
const createCluterUrl = '/cmp/plugins/ctstack/v1/tke'
export function createCluter(params) {
return request.post(createCluterUrl, wrapperParams(params))
}
const describeVersionsUrl = '/cmp/plugins/tce/v1/tke/describeVersions'
const describeVersionsUrl = '/cmp/plugins/ctstack/v1/tke/describeVersions'
export function getDescribeVersions(params) {
return request.get(`${describeVersionsUrl}`, { params })
}
// 集群 查询地域
const regionsUrl = '/cmp/plugins/tce/v1/tke/describe/regions'
const regionsUrl = '/cmp/plugins/ctstack/v1/tke/describe/regions'
export function getTKERegions(params) {
return request.get(regionsUrl, {
params
@ -20,7 +20,7 @@ export function getTKERegions(params) {
}
// 集群 创建 查询镜像信息
const createCluterImagesUrl = '/cmp/plugins/tce/v1/tke/describe/images'
const createCluterImagesUrl = '/cmp/plugins/ctstack/v1/tke/describe/images'
export function createCluterImages(params) {
return request.get(createCluterImagesUrl, {
params
@ -28,14 +28,14 @@ export function createCluterImages(params) {
}
// 集群 创建 校验CIDR
const checkCIDRUrl = '/cmp/plugins/tce/v1/tke/check/CIDR'
const checkCIDRUrl = '/cmp/plugins/ctstack/v1/tke/check/CIDR'
export function checkCIDR(params) {
return request.get(checkCIDRUrl, {
params
})
}
const clusterListUrl = '/cmp/plugins/tce/v1/tke'
const clusterListUrl = '/cmp/plugins/ctstack/v1/tke'
// 获取伸缩组
export function getFlexibleList(params) {
return request.get(`${clusterListUrl}/group/list`, {
@ -75,13 +75,13 @@ export function postAddInstance(params) {
}
// 集群 节点 创建
const createInstanceUrl = '/cmp/plugins/tce/v1/tke/instance '
const createInstanceUrl = '/cmp/plugins/ctstack/v1/tke/instance '
export function createInstance(params) {
return request.post(createInstanceUrl, wrapperParams(params))
}
// 集群 已存在节点
const existInstanceUrl = '/cmp/plugins/tce/v1/tke/exist/instance'
const existInstanceUrl = '/cmp/plugins/ctstack/v1/tke/exist/instance'
export function getExistInstance(params, id) {
return request.get(`${existInstanceUrl}/${params.vendorId}/${id}`, {
params
@ -89,7 +89,7 @@ export function getExistInstance(params, id) {
}
// 集群 节点
const instanceListUrl = '/cmp/plugins/tce/v1/tke/instance'
const instanceListUrl = '/cmp/plugins/ctstack/v1/tke/instance'
export function getInstanceList(params) {
return request.get(instanceListUrl, {
@ -105,7 +105,7 @@ export function deleteInstance(params, data) {
}
// 集群 节点 驱逐
const drainUrl = '/cmp/plugins/tce/v1/tke/drain'
const drainUrl = '/cmp/plugins/ctstack/v1/tke/drain'
export function drain(params) {
return request.delete(`${drainUrl}/${params.vendorId}/${params.id}`, {
data: { instanceId: params.instanceId }
@ -113,10 +113,10 @@ export function drain(params) {
}
export function operateInstance(params) {
return request.post('/cmp/plugins/tce/v1/tke/block/operation', wrapperParams(params))
return request.post('/cmp/plugins/ctstack/v1/tke/block/operation', wrapperParams(params))
}
const secrectListUrl = '/cmp/plugins/tce/v1/tke/cluster'
const secrectListUrl = '/cmp/plugins/ctstack/v1/tke/cluster'
export function getsecrectList(params) {
return request.get(secrectListUrl, {
params
@ -124,7 +124,7 @@ export function getsecrectList(params) {
}
// 集群 服务
const serviceListUrl = '/cmp/plugins/tce/v1/tke/service'
const serviceListUrl = '/cmp/plugins/ctstack/v1/tke/service'
export function getServiceList(params) {
return request.get(serviceListUrl, {
params
@ -149,7 +149,7 @@ export function deleteCluster(params, mode) {
// 容器服务 日志列表
export function getLogList(params) {
return request.get('/cmp/plugins/tce/v1/tke/logCollectorController', { params })
return request.get('/cmp/plugins/ctstack/v1/tke/logCollectorController', { params })
}
export function getClusterList(params) {