|
|
export default {
|
|
|
name: 'license',
|
|
|
template: '',
|
|
|
components: {
|
|
|
},
|
|
|
props: [],
|
|
|
setup(props, {attrs, slots, emit}) {
|
|
|
const {proxy} = Vue.getCurrentInstance();
|
|
|
let height = Vue.ref(window.innerHeight);
|
|
|
//导入或者详细信息
|
|
|
let isExport=Vue.ref(false);
|
|
|
//表格字段
|
|
|
let tableData = Vue.ref({
|
|
|
count: 0,
|
|
|
dataList: [],
|
|
|
authorizeStats: '',
|
|
|
authorizeTime:'',
|
|
|
timeLeft:'',
|
|
|
columns: [
|
|
|
{
|
|
|
prop: 'usage',
|
|
|
label: '使用情况',
|
|
|
sortable: true,
|
|
|
align: 'center',
|
|
|
width: '100'
|
|
|
},
|
|
|
{
|
|
|
prop: 'resNum',
|
|
|
label: '资源数量',
|
|
|
sortable: true,
|
|
|
align: 'center',
|
|
|
width: '100',
|
|
|
},
|
|
|
{
|
|
|
prop: 'protocolCate',
|
|
|
label: '协议(只统计已挂载任务的资源)',
|
|
|
align: 'center',
|
|
|
columns:[]
|
|
|
}
|
|
|
]
|
|
|
})
|
|
|
|
|
|
// license分类详细协议
|
|
|
let licenseCateData=Vue.ref([
|
|
|
{license:'SSH',protocolCode:'SSH'},
|
|
|
{license:'SSH',protocolCode:'SSHPUBKEY'},
|
|
|
{license:'SSH',protocolCode:'SSHLocalShellPlugin'},
|
|
|
{license:'SSH',protocolCode:'LOCALSSH'},
|
|
|
{license:'SSH',protocolCode:'ShellCommandPlugin'},
|
|
|
{license:'SNMP',protocolCode:'SNMP'},
|
|
|
{license:'SNMP',protocolCode:'SNMP V3'},
|
|
|
{license:'SNMP',protocolCode:'SNMP TRAP'},
|
|
|
{license:'SDK',protocolCode:'SDK'},
|
|
|
{license:'SDK',protocolCode:'SDK'},
|
|
|
{license:'SDK',protocolCode:'SDK'},
|
|
|
{license:'DB',protocolCode:'JDBC'},
|
|
|
{license:'DB',protocolCode:'MONGODB'},
|
|
|
{license:'DB',protocolCode:'REDISX_CLI'},
|
|
|
{license:'JMX',protocolCode:'TOMCAT_JMX'},
|
|
|
{license:'JMX',protocolCode:'ZOOKEEPER_JMX'},
|
|
|
{license:'JMX',protocolCode:'KAFKA_JMX'},
|
|
|
{license:'SYSLOG',protocolCode:'SYSLOG'},
|
|
|
{license:'SYSLOG',protocolCode:'SYSLOGD'},
|
|
|
{license:'HTTP',protocolCode:'HTTP'},
|
|
|
{license:'HTTP',protocolCode:'HTTPS'},
|
|
|
{license:'HTTP',protocolCode:'HUAWEI_CLOUD'},
|
|
|
{license:'HTTP',protocolCode:'ALI_CLOUD'},
|
|
|
{license:'HTTP',protocolCode:'HTTP-电子税务局大屏'},
|
|
|
{license:'HTTP',protocolCode:'HTTP-阿里回迁云'},
|
|
|
{license:'HTTP',protocolCode:'tongwebHttp'},
|
|
|
{license:'HTTP',protocolCode:'QuantumPlugin'},
|
|
|
{license:'HTTP',protocolCode:'CollHuaweiE9000Plugin'},
|
|
|
{license:'HTTP',protocolCode:'CollHuaweiCloudStackPlugin'},
|
|
|
{license:'HTTP',protocolCode:'Coll360'},
|
|
|
{license:'HTTP',protocolCode:'Ezsonar'},
|
|
|
{license:'HTTP',protocolCode:'RongcuoLibraryPlugin'},
|
|
|
{license:'HTTP',protocolCode:'AnGuanPinTaiPlugin'},
|
|
|
{license:'HTTP',protocolCode:'nginxPlugin'},
|
|
|
{license:'IPMI',protocolCode:'IPMI'},
|
|
|
])
|
|
|
|
|
|
//获取license分类下的字段
|
|
|
let cateColumn=Vue.ref([]);
|
|
|
let getLicenseColumn=()=>{
|
|
|
cateColumn.value=[
|
|
|
{
|
|
|
prop: 'ssh',
|
|
|
label: 'SSH',
|
|
|
sortable: true,
|
|
|
align: 'center',
|
|
|
},
|
|
|
{
|
|
|
prop: 'snmp',
|
|
|
label: 'SNMP',
|
|
|
sortable: true,
|
|
|
align: 'center',
|
|
|
},
|
|
|
{
|
|
|
prop: 'sdk',
|
|
|
label: 'SDK',
|
|
|
sortable: true,
|
|
|
align: 'center',
|
|
|
},
|
|
|
{
|
|
|
prop: 'db',
|
|
|
label: 'DB',
|
|
|
sortable: true,
|
|
|
align: 'center',
|
|
|
},
|
|
|
{
|
|
|
prop: 'jmx',
|
|
|
label: 'JMX',
|
|
|
sortable: true,
|
|
|
align: 'center',
|
|
|
},
|
|
|
{
|
|
|
prop: 'syslog',
|
|
|
label: 'SYSLOG',
|
|
|
sortable: true,
|
|
|
align: 'center',
|
|
|
},
|
|
|
{
|
|
|
prop: 'http',
|
|
|
label: 'HTTP',
|
|
|
sortable: true,
|
|
|
align: 'center',
|
|
|
},
|
|
|
{
|
|
|
prop: 'ipmi',
|
|
|
label: 'IPMI',
|
|
|
sortable: true,
|
|
|
align: 'center',
|
|
|
}
|
|
|
]
|
|
|
tableData.value.columns.map(item=>{
|
|
|
if(item.prop=='protocolCate'){
|
|
|
item.columns=cateColumn.value;
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
// 获取列表
|
|
|
let getDataList = () => {
|
|
|
proxy.$http.get(`/api-web/license/getList`, {}, function (res) {
|
|
|
if (res && res.success) {
|
|
|
let dataList = res.object;
|
|
|
dataList.license.usage='已授权';
|
|
|
dataList.local.usage='已使用';
|
|
|
tableData.value.dataList[0] = dataList.license;
|
|
|
tableData.value.dataList[1] = dataList.local;
|
|
|
if (dataList.authorizeStats){
|
|
|
tableData.value.authorizeStats = '已授权';
|
|
|
}else {
|
|
|
tableData.value.authorizeStats = '未授权';
|
|
|
}
|
|
|
tableData.value.authorizeTime = dataList.authorizeTime;
|
|
|
tableData.value.timeLeft = dataList.timeLeft;
|
|
|
|
|
|
} else {
|
|
|
tableData.value.dataList = [];
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
//拆分详细协议数组
|
|
|
let splitDetail=(propkey)=>{
|
|
|
let arr=[];
|
|
|
licenseCateData.value.map(v=>{
|
|
|
if(propkey==v.license){
|
|
|
arr.push(v.protocolCode)
|
|
|
}
|
|
|
})
|
|
|
let str='';
|
|
|
if(arr && arr.length>0){
|
|
|
str=arr.join(',')
|
|
|
}
|
|
|
return str;
|
|
|
}
|
|
|
|
|
|
|
|
|
let getFile = (param) => {
|
|
|
let fileObj = param.file
|
|
|
let params = {
|
|
|
file: fileObj,
|
|
|
}
|
|
|
// 上传文件
|
|
|
proxy.$http.uploadFile("/api-web/license/uploadZip", params, function (res) {
|
|
|
if (res && res.success) {
|
|
|
proxy.$global.showMsg("上传成功!");
|
|
|
getDataList();
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
|
|
|
// 挂载完
|
|
|
Vue.onMounted(() => {
|
|
|
getLicenseColumn();
|
|
|
getDataList();
|
|
|
})
|
|
|
|
|
|
|
|
|
return {
|
|
|
isExport,
|
|
|
getFile,
|
|
|
licenseCateData,
|
|
|
getLicenseColumn,
|
|
|
cateColumn,
|
|
|
splitDetail,
|
|
|
height,
|
|
|
tableData,
|
|
|
getDataList,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|