Commit 223cb2d2 authored by 张俊's avatar 张俊

应用调试

parent c9d95096
......@@ -72,7 +72,7 @@ export default {
default: () => false,
},
submit: {
type: Function,
type: [Function,String],
default: () => null,
},
},
......
......@@ -92,8 +92,7 @@ export default {
},
mounted() {},
methods: {
subevent(val){
debugger
subevent(val){
if(val == 0){
// this.$emit('deploy',this.data)
this.$router.push(`/yygl/${this.$route.params.level}/${this.$route.params.type}/deployment/${this.$route.params.id}`)
......
......@@ -352,7 +352,6 @@ export default {
this.$set(this.list_arr[5], "info", data.service_apply_info.business_url);
this.$set(this.list_arr[6], "info", data.service_apply_info.apply_file.split('/')[data.service_apply_info.apply_file.split('/').length - 1]);
this.$set(this.list_arr[6], "url", data.service_apply_info.apply_file);
debugger
this.$set(this.list_arr[8], "info", data.service_apply_info.duration+(data.service_apply_info.duration_unit==1?'':''));
this.$set(this.list_arr[9], "info", "访问次数:"+data.service_apply_info.request_spcs.pv+"/日 访问量:"+data.service_apply_info.request_spcs.count+"/日");
this.id = data.service_apply_info.id
......
......@@ -53,7 +53,8 @@
<div class="tips">
<i class="el-icon-warning-outline"></i><span>此操作相当于:kubectl apply -f {{'<'+'spec.yaml'+'>'}}</span>
</div>
<v-apaas-code :datas="code_arr"></v-apaas-code>
<v-apaas-code :datas="code_arr" v-show="now_yaml==1"></v-apaas-code>
<v-apaas-code :datas="yaml_arr" v-show="now_yaml==0"></v-apaas-code>
</div>
</div>
......@@ -93,6 +94,7 @@ export default {
now_yaml:0,
pod_name:'',
code_arr:'',
yaml_arr:'',
area_arr:[],
app_arr:[],
tableData:[],
......@@ -126,14 +128,12 @@ export default {
{
prop: "name",
label: "名称",
minWidth: "40%",
align: "left",
type: "button"
},
{
prop: "tag",
label: "标签",
minWidth: "60%",
align: "left",
type: "tag",
},
......@@ -206,13 +206,6 @@ export default {
methods: {
changyaml(n){
this.now_yaml = n
if(n==0){
this.code_arr = yaml.stringify(this.code_arr)
}else{
console.log(json.load(this.code_arr));
console.log(JSON.stringify(json.load(this.code_arr), null, 2));
this.code_arr = JSON.stringify(json.load(this.code_arr), null, 2);
}
},
get_namespace_list(){
this.$http
......@@ -232,11 +225,20 @@ export default {
}
})
},
gotopage(){
this.$router.push(`/yygl/${this.$route.params.level}/${this.$route.params.type}/appdebuggerdetail/${this.$route.params.deploy_id}?content=0`)
gotopage(val){
this.$http
.get(`/awecloud/rest/kubernetes/api/v1/_raw/pod/namespace/${val.namespace}/name/${val.name}`)
.then(response => {
this.$router.push(`/yygl/${this.$route.params.level}/${this.$route.params.type}/appdebuggerdetail/${this.$route.params.deploy_id}?content=0&namespace=${val.namespace}&name=${val.name}&container=${response.data.spec.containers[0].name}`)
})
},
gotopage1(){
this.$router.push(`/yygl/${this.$route.params.level}/${this.$route.params.type}/appdebuggerdetail/${this.$route.params.deploy_id}?content=1`)
gotopage1(val){
this.$http
.get(`/awecloud/rest/kubernetes/api/v1/_raw/pod/namespace/${val.namespace}/name/${val.name}`)
.then(response => {
this.$router.push(`/yygl/${this.$route.params.level}/${this.$route.params.type}/appdebuggerdetail/${this.$route.params.deploy_id}?content=1&namespace=${val.namespace}&name=${val.name}&container=${response.data.spec.containers[0].name}`)
})
},
get_list_pod(){
this.$http
......@@ -301,8 +303,8 @@ export default {
.get(`/awecloud/rest/kubernetes/api/v1/_raw/pod/namespace/${val.namespace}/name/${val.name}`)
.then(response => {
console.log(response.data);
debugger
this.code_arr = yaml.stringify(response.data)
this.yaml_arr = yaml.stringify(response.data)
this.code_arr = JSON.stringify(json.load(this.yaml_arr), null, 2);
this.$refs.actiondialog.show();
})
......
......@@ -77,4 +77,11 @@ module.exports.numberFormat = function (num, decimals) {
} else {
return num;
}
}
module.exports.CreationDateDesc = function (timestamp) {
let date = new Date(timestamp);
return date.toLocaleDateString("zh-CN", {
timeZone: "Asia/Shanghai"
});
}
\ No newline at end of file
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