Commit 1c305b7b authored by 刘殿昕's avatar 刘殿昕

数据展示

parent c20f9be2
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
:list_arr="now_service == 0?list_arr:servicead_arr :list_arr="now_service == 0?list_arr:servicead_arr
" "
> >
<mavon-editor v-model="appcode" slot="app_code" :boxShadow="false" :toolbarsFlag="false" :subfield="false" defaultOpen="preview" :editable="false"/> <div slot="app_code" style="white-space: pre-wrap;background-color:rgb(251,251,251);padding:15px;border-radius:5px;">{{appcode}}</div>
<process-card :data="approval_arr3" slot="approval"></process-card> <process-card :data="approval_arr3" slot="approval"></process-card>
</info-list> </info-list>
......
...@@ -3,34 +3,19 @@ ...@@ -3,34 +3,19 @@
<p class="now_page_title"> <p class="now_page_title">
我的应用 / 部署的应用 / 我的应用 / 部署的应用 /
<span>应用详情</span> <span>应用详情</span>
</p> </p>
<div class="info_contain"> <div class="info_contain">
<service-header :data="service_header_arr" @debuggerfunc="debuggerfunc"></service-header> <service-header :data="service_header_arr" @debuggerfunc="debuggerfunc"></service-header>
<div class="type_box"> <div class="type_box">
<div class="type_title"> <div class="type_title">
<div <div v-for="(item, index) in service_arr[now_user]" :key="index + 1000" class="type_select" @click="now_service = index" :style="
v-for="(item, index) in service_arr[now_user]"
:key="index + 1000"
class="type_select"
@click="now_service = index"
:style="
now_service == index ? { borderBottom: '4px solid #f5ab4c' } : {} now_service == index ? { borderBottom: '4px solid #f5ab4c' } : {}
" ">{{ item }}</div>
>{{ item }}</div>
</div> </div>
<div class="type_box_select"> <div class="type_box_select">
<info-list v-if="now_service == 0" :list_arr="introductionArr"> <info-list v-if="now_service == 0" :list_arr="introductionArr">
<mavon-editor <div slot="markdown" style="white-space: pre-wrap;background-color:rgb(251,251,251);padding:15px;border-radius:5px;">{{markdown}}</div>
slot="markdown"
v-model="markdown"
:boxShadow="false"
:toolbarsFlag="false"
:subfield="false"
defaultOpen="preview"
:editable="false"
v-if="now_service == 0"
/>
</info-list> </info-list>
<div class="apaas_button" v-if="now_service == 0&&public_flag"> <div class="apaas_button" v-if="now_service == 0&&public_flag">
<el-button type="primary" @click="public_service">服务发布</el-button> <el-button type="primary" @click="public_service">服务发布</el-button>
...@@ -38,14 +23,7 @@ ...@@ -38,14 +23,7 @@
<div v-if="now_service==2" class="info_contain2"> <div v-if="now_service==2" class="info_contain2">
<info-list :list_arr="fwfw_arr"> <info-list :list_arr="fwfw_arr">
<div class="appcode" v-html="appcode" slot="app_code"></div> <div class="appcode" v-html="appcode" slot="app_code"></div>
<table-um <table-um slot="fw_table" :headers="header_fw_arr" :datas="fw_data" :stripe="true" :paginationShow="true" @detail="detail"></table-um>
slot="fw_table"
:headers="header_fw_arr"
:datas="fw_data"
:stripe="true"
:paginationShow="true"
@detail="detail"
></table-um>
</info-list> </info-list>
<!-- <div <!-- <div
...@@ -99,9 +77,7 @@ ...@@ -99,9 +77,7 @@
<template> <template>
<div style="height:115px;padding-top:10px;"> <div style="height:115px;padding-top:10px;">
<waveIcon :state="yx_state.state=='running'?'运行中':'停止'" style="margin:10px auto;"></waveIcon> <waveIcon :state="yx_state.state=='running'?'运行中':'停止'" style="margin:10px auto;"></waveIcon>
<p <p style="color: #58617a;font-size: 16px;text-align:center;">{{ yx_state.state=='running'?'运行中':'停止' }}</p>
style="color: #58617a;font-size: 16px;text-align:center;"
>{{ yx_state.state=='running'?'运行中':'停止' }}</p>
</div> </div>
</template> </template>
</nor-card> </nor-card>
...@@ -134,20 +110,18 @@ ...@@ -134,20 +110,18 @@
</p> </p>
<div style="overflow:hidden;height:700px;" class="limit-elscroll"> <div style="overflow:hidden;height:700px;" class="limit-elscroll">
<el-scrollbar class="service_list"> <el-scrollbar class="service_list">
<div class="service_box" @click="change_micor(index)" :style="now_micor_service==index?{paddingLeft:'30px',borderLeft:'8px solid #515fe7',backgroundColor:'#fbfcfe'}:''" v-for="(item,index) in service_list_arr" :key="index+60000">{{item.service}} <span v-if="item.is_unhealth" class="service_tips">故障</span> </div> <div class="service_box" @click="change_micor(index)" :style="now_micor_service==index?{paddingLeft:'30px',borderLeft:'8px solid #515fe7',backgroundColor:'#fbfcfe'}:''" v-for="(item,index) in service_list_arr" :key="index+60000">{{item.service}}
<span v-if="item.is_unhealth" class="service_tips">故障</span>
</div>
</el-scrollbar> </el-scrollbar>
<div class="service_detail"> <div class="service_detail">
<nor-card title="服务概况" flag="true"> <nor-card title="服务概况" flag="true">
<template> <template>
<div style="overflow:hidden;height:160px;padding-top:10px;"> <div style="overflow:hidden;height:160px;padding-top:10px;">
<div style="height:115px;padding-top:10px;" class="service_card_box"> <div style="height:115px;padding-top:10px;" class="service_card_box">
<p <p style="color: #707693;font-size: 16px;text-align:center;">服务状态</p>
style="color: #707693;font-size: 16px;text-align:center;"
>服务状态</p>
<waveIcon :state="micor_state.state=='running'?'运行中':'停止'" style="margin:10px auto;"></waveIcon> <waveIcon :state="micor_state.state=='running'?'运行中':'停止'" style="margin:10px auto;"></waveIcon>
<p <p style="color: #58617a;font-size: 16px;text-align:center;">{{ micor_state.state=='running'?'运行中':'停止' }}</p>
style="color: #58617a;font-size: 16px;text-align:center;"
>{{ micor_state.state=='running'?'运行中':'停止' }}</p>
</div> </div>
<div style="height:115px;" class="service_num service_card_box"> <div style="height:115px;" class="service_num service_card_box">
...@@ -174,48 +148,23 @@ ...@@ -174,48 +148,23 @@
<nor-card title="服务设置" flag="true" v-show="is_current_user"> <nor-card title="服务设置" flag="true" v-show="is_current_user">
<div class="addimage"> <div class="addimage">
<el-select v-model="mesh_value" placeholder="请选择"> <el-select v-model="mesh_value" placeholder="请选择">
<el-option <el-option v-for="item in mesh_options" :key="item.value" :label="item.label" :value="item.value">
v-for="item in mesh_options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
<p class="imagebox"> <p class="imagebox">
<span <span @click="image_select = index;getImageInfo()" :style="
@click="image_select = index;getImageInfo()"
:style="
image_select == index image_select == index
? { backgroundColor: '#8390ee', color: '#f8f9fd' } ? { backgroundColor: '#8390ee', color: '#f8f9fd' }
: {} : {}
" " v-for="(item, index) in image_arr" :key="index + 6000">{{ item.name }}</span>
v-for="(item, index) in image_arr"
:key="index + 6000"
>{{ item.name }}</span>
</p> </p>
<el-table <el-table :data="image_arr[index].data" v-for="(item, index) in image_arr" :key="index+7000" v-show="image_select == index" stripe height="376" style="width: 100%">
:data="image_arr[index].data" <el-table-column prop="tag" align="center" label="版本号">
v-for="(item, index) in image_arr"
:key="index+7000"
v-show="image_select == index"
stripe
height="376"
style="width: 100%">
<el-table-column
prop="tag"
align="center"
label="版本号">
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="date" align="center" label="在线日期">
prop="date"
align="center"
label="在线日期">
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="操作" align="center" width="300">
label="操作"
align="center"
width="300">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button @click="update(scope.row)" type="text" size="small" :disabled="up_flag" v-if="(!scope.row.subsets)&&scope.$index<Math.min(...now_image_version)">升级</el-button> <el-button @click="update(scope.row)" type="text" size="small" :disabled="up_flag" v-if="(!scope.row.subsets)&&scope.$index<Math.min(...now_image_version)">升级</el-button>
<el-button @click="update(scope.row)" type="text" size="small" :disabled="up_flag" v-if="(!scope.row.subsets)&&scope.$index>Math.max(...now_image_version)">回滚</el-button> <el-button @click="update(scope.row)" type="text" size="small" :disabled="up_flag" v-if="(!scope.row.subsets)&&scope.$index>Math.max(...now_image_version)">回滚</el-button>
...@@ -224,7 +173,7 @@ ...@@ -224,7 +173,7 @@
<el-button @click="delete_ver(scope.row)" style="color:#830f53;font-weight:600;" type="text" size="small" :disabled="up_flag" v-if="scope.row.subsets&&now_image_version.length>=2">删除</el-button> <el-button @click="delete_ver(scope.row)" style="color:#830f53;font-weight:600;" type="text" size="small" :disabled="up_flag" v-if="scope.row.subsets&&now_image_version.length>=2">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</nor-card> </nor-card>
</div> </div>
...@@ -232,23 +181,14 @@ ...@@ -232,23 +181,14 @@
</div> </div>
</div> </div>
</div> </div>
<apass-dialog <apass-dialog ref="actiondialog" title="综合应用服务发布" width="520px">
ref="actiondialog"
title="综合应用服务发布"
width="520px"
>
<template slot="content"> <template slot="content">
<div class="dialog-content"> <div class="dialog-content">
<el-form :model="publicForm" :rules="public_rules" ref="publicForm" class="demo-ruleForm"> <el-form :model="publicForm" :rules="public_rules" ref="publicForm" class="demo-ruleForm">
<p class="formname">服务领域:</p> <p class="formname">服务领域:</p>
<el-form-item prop="area"> <el-form-item prop="area">
<el-select v-model="publicForm.area" placeholder="请选择服务领域"> <el-select v-model="publicForm.area" placeholder="请选择服务领域">
<el-option <el-option v-for="item in area_arr" :key="item.id" :label="item.name" :value="item.id"></el-option>
v-for="item in area_arr"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<p class="formname">开放程度:</p> <p class="formname">开放程度:</p>
...@@ -263,24 +203,15 @@ ...@@ -263,24 +203,15 @@
</div> </div>
</template> </template>
<template slot="action"> <template slot="action">
<el-button <el-button size="mini" v-text="'取消'" @click="dialogCancel">
size="mini" </el-button>
v-text="'取消'" <el-button type="primary" size="mini" v-text="'发布'" @click="save_file">
@click="dialogCancel" </el-button>
>
</el-button>
<el-button
type="primary"
size="mini"
v-text="'发布'"
@click="save_file"
>
</el-button>
</template> </template>
</apass-dialog> </apass-dialog>
</div> </div>
<dialog-action ref="myConfirm" :confirmOptions="tipsOptions"></dialog-action> <dialog-action ref="myConfirm" :confirmOptions="tipsOptions"></dialog-action>
</div> </div>
</template> </template>
...@@ -292,8 +223,8 @@ import uploadFile from "@/components/general/upload_file"; ...@@ -292,8 +223,8 @@ import uploadFile from "@/components/general/upload_file";
import norCard from "@/components/card"; import norCard from "@/components/card";
import waveIcon from "@/components/general/wave_icon"; import waveIcon from "@/components/general/wave_icon";
import Topology from "@/components/topology.vue"; import Topology from "@/components/topology.vue";
import apassDialog from '@/components/apass-dialog' import apassDialog from "@/components/apass-dialog";
import tableUm from '@/components/table/table-um' import tableUm from "@/components/table/table-um";
import { getRole } from "@/utils/common"; import { getRole } from "@/utils/common";
import { mapGetters, mapState } from "vuex"; import { mapGetters, mapState } from "vuex";
export default { export default {
...@@ -310,37 +241,39 @@ export default { ...@@ -310,37 +241,39 @@ export default {
}, },
data() { data() {
return { return {
mesh_value:0, mesh_value: 0,
mesh_options:[ mesh_options: [
{ {
value:0, value: 0,
label:'多版本回滚' label: "多版本回滚"
}, },
{ {
value:1, value: 1,
label:'AB测试' label: "AB测试"
}, },
{ {
value:2, value: 2,
label:'权重管理' label: "权重管理"
}, }
], ],
now_user: 0, //0:普通用户,1:组织管理员,2:超级管理员 now_user: 0, //0:普通用户,1:组织管理员,2:超级管理员
buy_style: 0, buy_style: 0,
image_select: 0, image_select: 0,
oldpag_name: "镜像文件002.rar", oldpag_name: "镜像文件002.rar",
fw_data:[], fw_data: [],
imgList: [], imgList: [],
imgList1: [], imgList1: [],
header_data:"", header_data: "",
service_list_arr:[], service_list_arr: [],
publicForm:{ publicForm: {
area:'', area: "",
open:'' open: ""
}, },
public_rules:{ public_rules: {
area:[{ required: true, message: '请选择服务领域', trigger: 'change' }], area: [
open:[{ required: true, message: '请选择开放程度', trigger: 'change' }], { required: true, message: "请选择服务领域", trigger: "change" }
],
open: [{ required: true, message: "请选择开放程度", trigger: "change" }]
}, },
yx_state: { yx_state: {
state: "", state: "",
...@@ -358,11 +291,11 @@ export default { ...@@ -358,11 +291,11 @@ export default {
maxTraffic: "", maxTraffic: "",
memory: "" memory: ""
}, },
public_flag:false, public_flag: false,
now_micor_service:0, now_micor_service: 0,
image_arr: [], image_arr: [],
area_arr: [], area_arr: [],
now_image_version:[], now_image_version: [],
form: { form: {
name: "", name: "",
fileList: "", fileList: "",
...@@ -470,7 +403,7 @@ export default { ...@@ -470,7 +403,7 @@ export default {
} }
], ],
yydebugger: false, yydebugger: false,
yydev:false, yydev: false,
url: "" url: ""
}, },
now_service: 0, now_service: 0,
...@@ -521,8 +454,8 @@ export default { ...@@ -521,8 +454,8 @@ export default {
}, },
{ {
title: "使用说明:", title: "使用说明:",
info: "" info: "\n访问地址:\nhttp://tomcat.wodcloud.com/"
}, }
], ],
markdown: "", markdown: "",
fwfw_arr: [ fwfw_arr: [
...@@ -538,9 +471,9 @@ export default { ...@@ -538,9 +471,9 @@ export default {
showPass: false, showPass: false,
public: false, public: false,
public_form: false, public_form: false,
now_tag:'', now_tag: "",
up_flag:false, up_flag: false,
is_current_user:0, is_current_user: 0
}; };
}, },
computed: { computed: {
...@@ -564,68 +497,68 @@ export default { ...@@ -564,68 +497,68 @@ export default {
this.now_service = 1; this.now_service = 1;
} }
}, },
mounted() { mounted() {},
},
methods: { methods: {
get_service_arae(){ get_service_arae() {
this.$http this.$http
.get('/apaas/service/v3/service/manager/servarea') .get("/apaas/service/v3/service/manager/servarea")
.then(response => { .then(response => {
let data = response.data.data let data = response.data.data;
this.area_arr = data this.area_arr = data;
}) })
.catch(function(response) { .catch(function(response) {});
});
}, },
public_service(){ public_service() {
this.$refs.actiondialog.show(); this.$refs.actiondialog.show();
}, },
dialogCancel(){ dialogCancel() {
this.$refs.actiondialog.hide(); this.$refs.actiondialog.hide();
}, },
service_public(){ service_public() {
this.$http this.$http
.post(`/apaas/service/v3/service/manager/apptoserv`,{ .post(`/apaas/service/v3/service/manager/apptoserv`, {
sectors:this.publicForm.area, sectors: this.publicForm.area,
deply_id:parseInt(this.$route.params.deploy_id), deply_id: parseInt(this.$route.params.deploy_id),
openness:this.publicForm.open openness: this.publicForm.open
}) })
.then(response => { .then(response => {
if(response.data.success){ if (response.data.success) {
this.$message.success(response.data.errMsg) this.$message.success(response.data.errMsg);
}else{
this.$message.error(response.data.errMsg)
}
})
},
save_file(){
this.$refs['publicForm'].validate((valid) => {
if (valid) {
this.$refs.actiondialog.hide();
this.service_public()
} else { } else {
console.log('error submit!!'); this.$message.error(response.data.errMsg);
return false;
} }
}); });
}, },
event_source(){ save_file() {
this.$refs["publicForm"].validate(valid => {
if (valid) {
this.$refs.actiondialog.hide();
this.service_public();
} else {
console.log("error submit!!");
return false;
}
});
},
event_source() {
//更新版本时请求版本状态 //更新版本时请求版本状态
var _this = this var _this = this;
const se = new EventSource(`/apaas/istio/service/${this.header_data.namespace}/versions/events/${this.service_list_arr[this.now_micor_service].service}/${this.now_tag}/subscribe`, { withCredentials: true }) // 后端接口,要配置允许跨域属性 const se = new EventSource(
se.onopen=function(e){} `/apaas/istio/service/${this.header_data.namespace}/versions/events/${
se.onmessage=function(e){ this.service_list_arr[this.now_micor_service].service
console.log(e.data) }/${this.now_tag}/subscribe`,
se.close() { withCredentials: true }
setTimeout(() => { ); // 后端接口,要配置允许跨域属性
_this.get_micro_service() se.onopen = function(e) {};
_this.$message.success('更新完成') se.onmessage = function(e) {
}, 100); console.log(e.data);
se.close();
} setTimeout(() => {
se.onerror=function(e){} _this.get_micro_service();
_this.$message.success("更新完成");
}, 100);
};
se.onerror = function(e) {};
}, },
getCurrentUser() { getCurrentUser() {
this.$api.user.getNowUser().then(({ data }) => { this.$api.user.getNowUser().then(({ data }) => {
...@@ -643,39 +576,56 @@ export default { ...@@ -643,39 +576,56 @@ export default {
}, },
//更新 //更新
update(val) { update(val) {
this.up_flag = true this.up_flag = true;
this.$message.success('开始更新版本') this.$message.success("开始更新版本");
this.$http this.$http
.post(`/apaas/istio/service/${this.header_data.namespace}/image/${this.service_list_arr[this.now_micor_service].service}/${this.image_arr[this.image_select].name}/update`,{ .post(
tag:val.tag `/apaas/istio/service/${this.header_data.namespace}/image/${
}) this.service_list_arr[this.now_micor_service].service
}/${this.image_arr[this.image_select].name}/update`,
{
tag: val.tag
}
)
.then(response => { .then(response => {
if(response.data.success){ if (response.data.success) {
this.get_micro_service(true) this.get_micro_service(true);
} }
}) });
}, },
//蓝绿发布 //蓝绿发布
together(val){ together(val) {
this.up_flag = true this.up_flag = true;
this.$http this.$http
.post(`/apaas/istio/service/${this.header_data.namespace}/image/${this.service_list_arr[this.now_micor_service].service}/${this.image_arr[this.image_select].name}/publish`,{ .post(
tag:val.tag `/apaas/istio/service/${this.header_data.namespace}/image/${
}).then(response => { this.service_list_arr[this.now_micor_service].service
this.up_flag = false }/${this.image_arr[this.image_select].name}/publish`,
this.get_micro_service() {
}) tag: val.tag
}
)
.then(response => {
this.up_flag = false;
this.get_micro_service();
});
}, },
//删除 //删除
delete_ver(val){ delete_ver(val) {
this.up_flag = true this.up_flag = true;
this.$http this.$http
.post(`/apaas/istio/service/${this.header_data.namespace}/image/${this.service_list_arr[this.now_micor_service].service}/${this.image_arr[this.image_select].name}/unpublish`,{ .post(
tag:val.tag `/apaas/istio/service/${this.header_data.namespace}/image/${
}).then(response => { this.service_list_arr[this.now_micor_service].service
this.up_flag = false }/${this.image_arr[this.image_select].name}/unpublish`,
this.get_micro_service(true,val.subsets) {
}) tag: val.tag
}
)
.then(response => {
this.up_flag = false;
this.get_micro_service(true, val.subsets);
});
}, },
rollback(val) { rollback(val) {
console.log(val); console.log(val);
...@@ -686,112 +636,134 @@ export default { ...@@ -686,112 +636,134 @@ export default {
online(val) { online(val) {
console.log(val); console.log(val);
}, },
debuggerfunc(){ debuggerfunc() {
this.$router.push(`/yygl/${this.$route.params.level}/${this.$route.params.type}/appdebugger/${this.$route.params.deploy_id}?namespace=${this.header_data.namespace}&app=${this.header_data.deploy_name}`) this.$router.push(
`/yygl/${this.$route.params.level}/${
this.$route.params.type
}/appdebugger/${this.$route.params.deploy_id}?namespace=${
this.header_data.namespace
}&app=${this.header_data.deploy_name}`
);
}, },
get_app_generl(){ get_app_generl() {
this.$http this.$http
.get(`/apaas/hubApi/market/status/overview/${this.$route.params.deploy_id}`) .get(
`/apaas/hubApi/market/status/overview/${this.$route.params.deploy_id}`
)
.then(response => { .then(response => {
let data = response.data.data let data = response.data.data;
this.yx_state= { this.yx_state = {
state: data.appState, state: data.appState,
averageTime: data.respTime.avg, averageTime: data.respTime.avg,
maxTime: data.respTime.max, maxTime: data.respTime.max,
averageTraffic: data.throughput.avg, averageTraffic: data.throughput.avg,
maxTraffic: data.throughput.max, maxTraffic: data.throughput.max,
memory: data.resource.memory memory: data.resource.memory
} };
}) });
}, },
get_micro_service(val,type){ get_micro_service(val, type) {
this.$http this.$http
.get(`/apaas/istio/service/${this.header_data.namespace}/overview/${this.service_list_arr[this.now_micor_service].service}`) .get(
`/apaas/istio/service/${this.header_data.namespace}/overview/${
this.service_list_arr[this.now_micor_service].service
}`
)
.then(response => { .then(response => {
if(response.data.success){ if (response.data.success) {
let data = response.data.data let data = response.data.data;
this.image_arr = [] this.image_arr = [];
data.imageNames.forEach(e => { data.imageNames.forEach(e => {
this.image_arr.push({ this.image_arr.push({
name:e, name: e,
data:[] data: []
}) });
}); });
this.micor_state= { this.micor_state = {
state: data.appState, state: data.appState,
averageTime: data.respTime.avg, averageTime: data.respTime.avg,
maxTime: data.respTime.max, maxTime: data.respTime.max,
averageTraffic: data.throughput.avg, averageTraffic: data.throughput.avg,
maxTraffic: data.throughput.max, maxTraffic: data.throughput.max,
memory: data.resource.memory memory: data.resource.memory
} };
this.getImageInfo(val,type) this.getImageInfo(val, type);
} }
}) });
},
change_micor(n){
this.now_micor_service = n
this.get_micro_service()
}, },
compare(property){ change_micor(n) {
return function(a,b){ this.now_micor_service = n;
var value1 = a[property]; this.get_micro_service();
var value2 = b[property];
return value2 - value1;
// return value1 - value2;
}
}, },
getImageInfo(val,type) { compare(property) {
return function(a, b) {
var value1 = a[property];
var value2 = b[property];
return value2 - value1;
// return value1 - value2;
};
},
getImageInfo(val, type) {
this.$http this.$http
.get(`/apaas/istio/service/${this.header_data.namespace}/image/${this.service_list_arr[this.now_micor_service].service}/${this.image_arr[this.image_select].name}/versions`) .get(
`/apaas/istio/service/${this.header_data.namespace}/image/${
this.service_list_arr[this.now_micor_service].service
}/${this.image_arr[this.image_select].name}/versions`
)
.then(response => { .then(response => {
console.log(response); console.log(response);
var _this = this var _this = this;
let data = response.data.data; let data = response.data.data;
data.list.forEach(e => { data.list.forEach(e => {
data.runnings.forEach(el => { data.runnings.forEach(el => {
if(e.tag==el.tag){ if (e.tag == el.tag) {
e['subsets'] = el.subsets e["subsets"] = el.subsets;
} }
}); });
}); });
data.list.forEach(e => { data.list.forEach(e => {
e['num']=parseInt(e.date.replace(/-/g,'').replace(/:/g,'').replace(' ','')) e["num"] = parseInt(
e.date
.replace(/-/g, "")
.replace(/:/g, "")
.replace(" ", "")
);
}); });
var temp_arr = data.list.sort(this.compare('num')) var temp_arr = data.list.sort(this.compare("num"));
console.log(temp_arr); console.log(temp_arr);
this.$set(this.image_arr[this.image_select],'data',temp_arr) this.$set(this.image_arr[this.image_select], "data", temp_arr);
this.now_image_version = [] this.now_image_version = [];
this.image_arr[this.image_select].data.forEach((e,idx)=> { this.image_arr[this.image_select].data.forEach((e, idx) => {
if(e.subsets){ if (e.subsets) {
this.now_image_version.push(idx) this.now_image_version.push(idx);
} }
}); });
if(val){ if (val) {
//删除 //删除
if(type){ if (type) {
var temp = '' var temp = "";
this.now_tag.forEach(e => { this.now_tag.forEach(e => {
if(type==e){ if (type == e) {
} else {
}else{ temp = e;
temp = e
} }
}); });
this.now_tag = temp this.now_tag = temp;
} }
//调用监听 //调用监听
this.event_source() this.event_source();
}else{ } else {
if(data.runnings.length==1){ if (data.runnings.length == 1) {
this.now_tag = data.runnings[0].subsets this.now_tag = data.runnings[0].subsets;
}else{ } else {
this.now_tag = [data.runnings[0].subsets,data.runnings[1].subsets] this.now_tag = [
data.runnings[0].subsets,
data.runnings[1].subsets
];
} }
this.up_flag = false this.up_flag = false;
} }
// console.log(Math.min(...now_image_version)) // console.log(Math.min(...now_image_version))
}) })
.catch(function(response) {}); .catch(function(response) {});
}, },
...@@ -885,11 +857,11 @@ export default { ...@@ -885,11 +857,11 @@ export default {
.get(`/apaas/hubApi/market/deployInfo/${this.$route.params.deploy_id}`) .get(`/apaas/hubApi/market/deployInfo/${this.$route.params.deploy_id}`)
.then(response => { .then(response => {
let data = response.data.data; let data = response.data.data;
this.header_data = data this.header_data = data;
this.public_flag = false this.public_flag = false;
this.is_current_user = data.is_current_user this.is_current_user = data.is_current_user;
if(data.is_apply==0&&(data.type==2||data.type==3)){ if (data.is_apply == 0 && (data.type == 2 || data.type == 3)) {
this.public_flag = true this.public_flag = true;
} }
this.$set( this.$set(
this.service_header_arr, this.service_header_arr,
...@@ -915,20 +887,20 @@ export default { ...@@ -915,20 +887,20 @@ export default {
this.$set( this.$set(
this.service_header_arr["second"][1], this.service_header_arr["second"][1],
"text", "text",
data.namespace+'('+data.workplace+')' data.namespace + "(" + data.workplace + ")"
); );
this.$set(this.service_header_arr["second"][2], "text", data.created); this.$set(this.service_header_arr["second"][2], "text", data.created);
//应用开发调试按钮显示 //应用开发调试按钮显示
if(this.now_user==0||this.now_user==2){ if (this.now_user == 0 || this.now_user == 2) {
this.service_header_arr.yydebugger = true this.service_header_arr.yydebugger = true;
}else{ } else {
this.service_header_arr.yydebugger = false this.service_header_arr.yydebugger = false;
} }
if(this.now_user==0){ if (this.now_user == 0) {
this.service_header_arr.yydev = true this.service_header_arr.yydev = true;
}else{ } else {
this.service_header_arr.yydev = false this.service_header_arr.yydev = false;
} }
}) })
.catch(function(response) {}); .catch(function(response) {});
...@@ -944,7 +916,13 @@ export default { ...@@ -944,7 +916,13 @@ export default {
this.introductionArr[0].info = data.yyjj; this.introductionArr[0].info = data.yyjj;
this.introductionArr[1].info = data.gnjj; this.introductionArr[1].info = data.gnjj;
this.introductionArr[2].info = data.cjsl; this.introductionArr[2].info = data.cjsl;
this.introductionArr[4].info = data.sysm; let sysm = data.sysm;
if (String(sysm).slice(0, 1) == "\n") {
this.introductionArr[4].info = sysm.slice(1);
} else {
this.introductionArr[4].info = sysm;
}
console.log(this.introductionArr[4].info);
}); });
this.$api.workbench this.$api.workbench
.getAppParams({ .getAppParams({
...@@ -955,17 +933,17 @@ export default { ...@@ -955,17 +933,17 @@ export default {
this.markdown = data; this.markdown = data;
}); });
}, },
get_service_list(){ get_service_list() {
this.$http this.$http
.get(`/apaas/hubApi/market/services/${this.$route.params.deploy_id}`) .get(`/apaas/hubApi/market/services/${this.$route.params.deploy_id}`)
.then(response => { .then(response => {
if(response.data.success){ if (response.data.success) {
this.service_list_arr = response.data.data this.service_list_arr = response.data.data;
if(this.service_list_arr&&this.service_list_arr.length){ if (this.service_list_arr && this.service_list_arr.length) {
this.get_micro_service() this.get_micro_service();
} }
} }
}) });
} }
} }
}; };
...@@ -991,58 +969,56 @@ export default { ...@@ -991,58 +969,56 @@ export default {
.info_contain2 .el-input__inner { .info_contain2 .el-input__inner {
background-color: #f7f8f9; background-color: #f7f8f9;
width: 1022px; width: 1022px;
} }
.dialog-content .el-input__inner{ .dialog-content .el-input__inner {
background-color: #f7f8f9; background-color: #f7f8f9;
width: 460px; width: 460px;
} }
.dialog-content .el-form-item{ .dialog-content .el-form-item {
margin-top: 15px; margin-top: 15px;
margin-bottom: 0; margin-bottom: 0;
} }
.service_list ::-webkit-scrollbar { .service_list ::-webkit-scrollbar {
width: 0px; /*对垂直流动条有效*/ width: 0px; /*对垂直流动条有效*/
height: 0px; /*对水平流动条有效*/ height: 0px; /*对水平流动条有效*/
} }
/*定义滚动条的轨道颜色、内阴影及圆角*/ /*定义滚动条的轨道颜色、内阴影及圆角*/
.service_list ::-webkit-scrollbar-track{ .service_list ::-webkit-scrollbar-track {
background-color: rosybrown; background-color: rosybrown;
border-radius: 3px; border-radius: 3px;
} }
/*定义滑块颜色、内阴影及圆角*/ /*定义滑块颜色、内阴影及圆角*/
.service_list ::-webkit-scrollbar-thumb{ .service_list ::-webkit-scrollbar-thumb {
border-radius: 7px; border-radius: 7px;
background-color: #E8E8E8; background-color: #e8e8e8;
} }
/*定义两端按钮的样式*/ /*定义两端按钮的样式*/
.service_list ::-webkit-scrollbar-button { .service_list ::-webkit-scrollbar-button {
background-color:cyan; background-color: cyan;
} }
/*定义右下角汇合处的样式*/ /*定义右下角汇合处的样式*/
.service_list ::-webkit-scrollbar-corner { .service_list ::-webkit-scrollbar-corner {
background:khaki; background: khaki;
} }
.addimage .el-input__inner{ .addimage .el-input__inner {
width: 110px; width: 110px;
height: 28px; height: 28px;
line-height: 28px; line-height: 28px;
font-size: 12px; font-size: 12px;
color: #707693; color: #707693;
} }
.addimage .el-input__icon{ .addimage .el-input__icon {
line-height: 28px; line-height: 28px;
} }
</style> </style>
<style scoped> <style scoped>
.info_contain >>> .apass_dialog .el-dialog__footer{ .info_contain >>> .apass_dialog .el-dialog__footer {
padding-top: 0; padding-top: 0;
} }
.detail_contain { .detail_contain {
...@@ -1120,8 +1096,8 @@ background:khaki; ...@@ -1120,8 +1096,8 @@ background:khaki;
} }
.addimage { .addimage {
position: absolute; position: absolute;
right:20px; right: 20px;
top:-36px; top: -36px;
} }
.use_know p { .use_know p {
height: 44px; height: 44px;
...@@ -1232,7 +1208,7 @@ background:khaki; ...@@ -1232,7 +1208,7 @@ background:khaki;
overflow: hidden; overflow: hidden;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
.service_list{ .service_list {
float: left; float: left;
width: 400px; width: 400px;
height: 100%; height: 100%;
...@@ -1240,9 +1216,9 @@ background:khaki; ...@@ -1240,9 +1216,9 @@ background:khaki;
border: 1px solid #e5f0ff; border: 1px solid #e5f0ff;
border-radius: 12px 0px 0px 12px; border-radius: 12px 0px 0px 12px;
} }
.service_box{ .service_box {
width: 398px; width: 398px;
height: 48px; height: 48px;
line-height: 48px; line-height: 48px;
text-align: left; text-align: left;
padding-left: 38px; padding-left: 38px;
...@@ -1250,43 +1226,43 @@ background:khaki; ...@@ -1250,43 +1226,43 @@ background:khaki;
position: relative; position: relative;
cursor: pointer; cursor: pointer;
} }
.service_tips{ .service_tips {
display: inline-block; display: inline-block;
position: absolute; position: absolute;
font-size: 12px; font-size: 12px;
color: #e15260; color: #e15260;
width: 42px; width: 42px;
height: 20px; height: 20px;
line-height: 20px; line-height: 20px;
text-align: center; text-align: center;
background-color: #ffefef; background-color: #ffefef;
border-radius: 4px; border-radius: 4px;
border: solid 1px #d7a4a9; border: solid 1px #d7a4a9;
top:13px; top: 13px;
right:50px; right: 50px;
} }
.service_detail{ .service_detail {
float: left; float: left;
height: 270px; height: 270px;
width: calc(100% - 425px); width: calc(100% - 425px);
} }
.service_card_box{ .service_card_box {
float: left; float: left;
border-right: 1px solid #e5f0ff; border-right: 1px solid #e5f0ff;
width: calc(25%); width: calc(25%);
} }
.card_contain .service_card_box:nth-last-of-type(1){ .card_contain .service_card_box:nth-last-of-type(1) {
border-right:0; border-right: 0;
} }
.dialog-content{ .dialog-content {
text-align: left; text-align: left;
} }
.dialog-content .formname{ .dialog-content .formname {
font-size: 14px; font-size: 14px;
color: #8890a7; color: #8890a7;
margin-top: 25px; margin-top: 25px;
} }
.dialog-content .formname:nth-of-type(1){ .dialog-content .formname:nth-of-type(1) {
margin-top: 0px; margin-top: 0px;
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment