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

应用调试

parent c9d95096
...@@ -72,7 +72,7 @@ export default { ...@@ -72,7 +72,7 @@ export default {
default: () => false, default: () => false,
}, },
submit: { submit: {
type: Function, type: [Function,String],
default: () => null, default: () => null,
}, },
}, },
......
...@@ -93,7 +93,6 @@ export default { ...@@ -93,7 +93,6 @@ export default {
mounted() {}, mounted() {},
methods: { methods: {
subevent(val){ subevent(val){
debugger
if(val == 0){ if(val == 0){
// this.$emit('deploy',this.data) // this.$emit('deploy',this.data)
this.$router.push(`/yygl/${this.$route.params.level}/${this.$route.params.type}/deployment/${this.$route.params.id}`) this.$router.push(`/yygl/${this.$route.params.level}/${this.$route.params.type}/deployment/${this.$route.params.id}`)
......
...@@ -352,7 +352,6 @@ export default { ...@@ -352,7 +352,6 @@ export default {
this.$set(this.list_arr[5], "info", data.service_apply_info.business_url); 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], "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); 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[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.$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 this.id = data.service_apply_info.id
......
...@@ -53,7 +53,8 @@ ...@@ -53,7 +53,8 @@
<div class="tips"> <div class="tips">
<i class="el-icon-warning-outline"></i><span>此操作相当于:kubectl apply -f {{'<'+'spec.yaml'+'>'}}</span> <i class="el-icon-warning-outline"></i><span>此操作相当于:kubectl apply -f {{'<'+'spec.yaml'+'>'}}</span>
</div> </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>
</div> </div>
...@@ -93,6 +94,7 @@ export default { ...@@ -93,6 +94,7 @@ export default {
now_yaml:0, now_yaml:0,
pod_name:'', pod_name:'',
code_arr:'', code_arr:'',
yaml_arr:'',
area_arr:[], area_arr:[],
app_arr:[], app_arr:[],
tableData:[], tableData:[],
...@@ -126,14 +128,12 @@ export default { ...@@ -126,14 +128,12 @@ export default {
{ {
prop: "name", prop: "name",
label: "名称", label: "名称",
minWidth: "40%",
align: "left", align: "left",
type: "button" type: "button"
}, },
{ {
prop: "tag", prop: "tag",
label: "标签", label: "标签",
minWidth: "60%",
align: "left", align: "left",
type: "tag", type: "tag",
}, },
...@@ -206,13 +206,6 @@ export default { ...@@ -206,13 +206,6 @@ export default {
methods: { methods: {
changyaml(n){ changyaml(n){
this.now_yaml = 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(){ get_namespace_list(){
this.$http this.$http
...@@ -232,11 +225,20 @@ export default { ...@@ -232,11 +225,20 @@ export default {
} }
}) })
}, },
gotopage(){ gotopage(val){
this.$router.push(`/yygl/${this.$route.params.level}/${this.$route.params.type}/appdebuggerdetail/${this.$route.params.deploy_id}?content=0`) 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(){ gotopage1(val){
this.$router.push(`/yygl/${this.$route.params.level}/${this.$route.params.type}/appdebuggerdetail/${this.$route.params.deploy_id}?content=1`) 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(){ get_list_pod(){
this.$http this.$http
...@@ -301,8 +303,8 @@ export default { ...@@ -301,8 +303,8 @@ export default {
.get(`/awecloud/rest/kubernetes/api/v1/_raw/pod/namespace/${val.namespace}/name/${val.name}`) .get(`/awecloud/rest/kubernetes/api/v1/_raw/pod/namespace/${val.namespace}/name/${val.name}`)
.then(response => { .then(response => {
console.log(response.data); console.log(response.data);
debugger this.yaml_arr = yaml.stringify(response.data)
this.code_arr = yaml.stringify(response.data) this.code_arr = JSON.stringify(json.load(this.yaml_arr), null, 2);
this.$refs.actiondialog.show(); this.$refs.actiondialog.show();
}) })
......
...@@ -78,3 +78,10 @@ module.exports.numberFormat = function (num, decimals) { ...@@ -78,3 +78,10 @@ module.exports.numberFormat = function (num, decimals) {
return num; 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