web推理后自动下载变成一个选项,默认不自动下载,增加一个按钮手动下载,禁止网页缓存

This commit is contained in:
admin 2024-08-12 09:13:25 +08:00
parent 692746b9d1
commit a211be75c0
6 changed files with 83 additions and 50 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html lang="" style="min-width: 900px;min-height: 100%;"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href=""><title>server</title><link href="css/batchRunViews.ede7eef0.css" rel="preload" as="style"><link href="css/chunk-vendors.06c3b195.css" rel="preload" as="style"><link href="js/batchRunViews.0f57b26f.js" rel="preload" as="script"><link href="js/chunk-vendors.acb23df5.js" rel="preload" as="script"><link href="css/chunk-vendors.06c3b195.css" rel="stylesheet"><link href="css/batchRunViews.ede7eef0.css" rel="stylesheet"></head><body style="min-height: 100%;"><noscript><strong>We're sorry but server doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="index" style="min-height: 100%;"></div><script src="js/chunk-vendors.acb23df5.js"></script><script src="js/batchRunViews.0f57b26f.js"></script></body></html><style>body,html{
<!DOCTYPE html><html lang="" style="min-width: 900px;min-height: 100%;"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta http-equiv="cache-control" content="no-cache, must-revalidate"><meta http-equiv="pragma" content="no-cache"><meta http-equiv="expires" content="0"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href=""><title>server</title><link href="css/batchRunViews.09ebafbd.css" rel="preload" as="style"><link href="css/chunk-vendors.06c3b195.css" rel="preload" as="style"><link href="js/batchRunViews.e8876cf9.js" rel="preload" as="script"><link href="js/chunk-vendors.acb23df5.js" rel="preload" as="script"><link href="css/chunk-vendors.06c3b195.css" rel="stylesheet"><link href="css/batchRunViews.09ebafbd.css" rel="stylesheet"></head><body style="min-height: 100%;"><noscript><strong>We're sorry but server doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="index" style="min-height: 100%;"></div><script src="js/chunk-vendors.acb23df5.js"></script><script src="js/batchRunViews.e8876cf9.js"></script></body></html><style>body,html{
padding: 0;
margin: 0;
font-size: 14px;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -3,6 +3,9 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="cache-control" content="no-cache, must-revalidate">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="0">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="">
<title><%= htmlWebpackPlugin.options.title %></title>

View File

@ -165,6 +165,12 @@
<el-button type="primary" class="outFileBtn pageBtn" @click="inference_subfunc()" icon="el-icon-upload2">
推理
</el-button>
<el-button type="primary" class="outFileBtn pageBtn" style='margin-top: 15px' @click='on_download_dat();return false;' icon="el-icon-download">
下载推理结果
</el-button>
<el-checkbox style='margin-top: 15px;' v-model="auto_download_checked" label="推理后自动下载结果" />
</el-form-item>
</el-form>
</div>
@ -355,6 +361,8 @@ export default {
preprocess_switch: '1',
postprocess_switch: '1',
dump_switch: '0',
auto_download_checked: false,
infer_obj: {},
};
},
watch: {
@ -363,6 +371,10 @@ export default {
this.nb_list_show = false;
this.$nextTick(() => {this.nb_list_show = true;});
},
/*auto_download_checked()
{
console.log('auto_download_checked:', this.auto_download_checked);
},*/
},
mounted() {
this.detail_all_resp = this.get_data_to_var('detail?obj=all');
@ -480,30 +492,42 @@ export default {
xmlhttp.send(data);
console.info(xmlhttp.responseText);
var obj = JSON.parse(xmlhttp.responseText);
console.log(obj);
for(var [key, value] of Object.entries(obj))
this.infer_obj = JSON.parse(xmlhttp.responseText);
console.log(this.infer_obj);
for(var [key, value] of Object.entries(this.infer_obj))
{
console.log('key:', key, 'value:', value);
}
document.getElementById('inference_result').innerHTML = 'msg:\n' + ' ' + obj.msg + '\n';
document.getElementById('inference_result').innerHTML += 'time:\n' + ' ' + obj.obj.time + '\n';
document.getElementById('inference_result').innerHTML = 'msg:\n' + ' ' + this.infer_obj.msg + '\n';
document.getElementById('inference_result').innerHTML += 'time:\n' + ' ' + this.infer_obj.obj.time + '\n';
document.getElementById('inference_result').innerHTML += 'data:\n';
for(let value of obj.obj.data)
for(let value of this.infer_obj.obj.data)
{
console.log('value:', value, 'index:', value.indexOf('.dat'));
document.getElementById('inference_result').innerHTML += ' ' + value + '\n';
if(value.indexOf('.dat') != -1)
if(this.auto_download_checked == true && value.indexOf('.dat') != -1)
{
this.download(value);
this.download(value);
}
}
return false;
},
on_download_dat()
{
for(let value of this.infer_obj.obj.data)
{
console.log('value:', value, 'index:', value.indexOf('.dat'));
if(value.indexOf('.dat') != -1)
{
this.download(value);
}
}
},
add_nb_subfunc()
{
Message.info('上传完成');
@ -568,6 +592,8 @@ export default {
{
var xhr = new XMLHttpRequest();
xhr.open('get', '/' + filename, true);
xhr.setRequestHeader("If-Modified-Since", "0");
xhr.setRequestHeader("Cache-Control", "no-cache");
xhr.responseType = 'blob';
xhr.onload = function() {
var blob = this.response;
@ -760,7 +786,6 @@ export default {
color: #fff;
font-size: 12px;
}
.btn {
/* background-color: #fff; */
border-radius: 4px;
@ -794,7 +819,6 @@ export default {
color: #fff;
margin-right: 15px;
}
/deep/.el-input {
//width: 100%;
.el-input__inner {
@ -909,53 +933,55 @@ export default {
display: block;
margin-bottom: 10px;
}
/deep/.el-checkbox__inner {
background: rgba( #000000, 0)!important;/* 透明 */
border: 1px solid #606266;
}
}
body.vscode-light .container {
background: #fff;
color: #333;
/deep/.el-input {
//width: 100%;
.el-input__inner {
color: #333;
background-color: #fff;
border: 1px solid #333;
}
.el-input__inner::placeholder {
color: #999;
}
background: #fff;
color: #333;
/deep/.el-input {
//width: 100%;
.el-input__inner {
color: #333;
background-color: #fff;
border: 1px solid #333;
}
.scrollContentBox {
.infoTableBox {
.mainIndexContainer {
.debugLoadFileBox{
.el-input__inner::placeholder {
color: #999;
}
}
.scrollContentBox {
.infoTableBox {
.mainIndexContainer {
.debugLoadFileBox{
color: #333;
.debugLoadFileBoxTitle{
color: #333;
.debugLoadFileBoxTitle{
color: #333;
}
.batchRunLog{
color: #333;
background: #d8d8d8;
}
}
.batchRunLog{
color: #333;
background: #d8d8d8;
}
}
}
}
.mainContentContainer
.mainContentBox
.scrollContentBox
.scrollBoxWrap
.scrollBox {
padding-right: 24px;
}
/deep/.el-checkbox__input.is-checked .el-checkbox__inner, /deep/.el-checkbox__input.is-indeterminate .el-checkbox__inner {
background-color: #4f84ff;
border-color: #4f84ff;
}
/deep/.el-checkbox__input.is-checked+.el-checkbox__label {
color: #4f84ff;
}
}
.mainContentContainer
.mainContentBox
.scrollContentBox
.scrollBoxWrap
.scrollBox {
padding-right: 24px;
}
/deep/.el-checkbox__input.is-checked .el-checkbox__inner, /deep/.el-checkbox__input.is-indeterminate .el-checkbox__inner {
background-color: #4f84ff;
border-color: #4f84ff;
}
/deep/.el-checkbox__input.is-checked+.el-checkbox__label {
color: #4f84ff;
}
}
</style>