update code

main
haha 2024-08-20 20:39:44 +08:00
parent 86faa6878b
commit f43647068d
5 changed files with 633 additions and 550 deletions

View File

@ -13,6 +13,13 @@ const userOperationNotice=()=>{
});
}
const userRunning=()=>{
return request({
url:`/logs/user_operation/running`,
method:"get"
})
}
//获取用户操作详情
const userOperation=(operation_id)=>{
return request({
@ -33,6 +40,7 @@ export default {
serverState,
userOperationNotice,
userOperation,
compileDeploy
compileDeploy,
userRunning
}

View File

@ -1,5 +1,5 @@
<template>
<div class="model-flow">
<div class="model-flow">{{ info }}
<el-row class="row-1">
<div class="card-item">
<div class="title-text">算法上传</div>
@ -11,9 +11,9 @@
</div>
<div class="line line-right">
</div>
<div class="card-item is-active" >
<div class="title-text">算子检查</div>
<el-badge :value="10" class="item">
<div class="card-item ">
<div class="title-text">算子互联</div>
<el-badge :value="0" class="item">
<div class="div-img">
<img class="img-150" src="./flow/suanzijiancha.png" />
@ -24,20 +24,19 @@
<div class="line line-right">
</div>
<div class="card-item" >
<div class="card-item" :class="info.cnt1 > 0 ? 'is-active' : ''">
<div class="title-text">编译部署</div>
<el-badge :value="0" class="item">
<el-badge :value="info.cnt1" class="item">
<div class="div-img">
<img class="img-150" src="./flow/bybs.png" />
</div>
</el-badge>
</div>
<div class="line line-right">
</div>
<div class="card-item">
<div class="card-item" :class="info.cnt2 > 0 ? 'is-active' : ''">
<div class="title-text">推理评估</div>
<el-badge :value="0" class="item">
<el-badge :value="info.cnt2" class="item">
<div class="div-img">
<img class="img-150" src="./flow/tlpg.png" />
</div>
@ -47,9 +46,9 @@
<div class="line line-right">
</div>
<div class="card-item">
<div class="card-item" :class="info.cnt3 > 0 ? 'is-active' : ''">
<div class="title-text">评估报告</div>
<el-badge :value="0" class="item">
<el-badge :value="info.cnt3" class="item">
<div class="div-img">
<img class="img-150" src="./flow/pgbg.png" />
</div>
@ -110,6 +109,27 @@
</template>
<script lang='ts' setup>
import LogApi from '@/api/log'
let info = reactive({
cnt1: 0,
cnt2: 0,
cnt3: 0
})
const loadData = () => {
LogApi.userRunning().then(d => {
let tmps = d.data?.data?.running_operation_list || [];
const findCnt = t => {
let objs = tmps.filter(it => it.logs_operation_type == t);
return objs.length > 0 ? objs[0].operation_count : 0;
}
info.cnt1 = findCnt("model_compile");
info.cnt2 = findCnt("model_infer");
info.cnt3 = findCnt("model_report");
});
}
onMounted(() => {
loadData();
});
</script>
<style lang='scss'>
@media screen and (max-width:1440px) {
@ -117,19 +137,23 @@
padding-left: 10px;
}
}
@media screen and (min-width:1440px) {
.model-flow {
padding-left: 60px;
}
}
.model-flow {
.row-1 {
.title-text {
margin-bottom: 10px;
}
.line {
position: relative;
width: calc(20% - 120px);
&::before {
display: inline-block;
height: 1px;
@ -140,6 +164,7 @@
top: 40%;
left: 10px;
}
&::after {
display: inline-block;
content: " ";
@ -155,28 +180,35 @@
.row-3 {
margin-top: 60px;
.line {
position: relative;
width: calc(20% - 120px);
text-align: center;
img {
position: relative;
top: 30px;
}
}
.title-text {
margin-top: 10px;
}
.card-center {
position: relative;
width: 120px;
.card-center-item {
position: absolute;
width: 120px;
top: 24px;
z-index: 9;
&:first-child {
left: -90px;
&::after {
display: inline-block;
content: " ";
@ -187,6 +219,7 @@
top: -175px;
left: 60px;
}
&::before {
display: inline-block;
content: " ";
@ -198,8 +231,10 @@
left: 60px;
}
}
&:last-child {
left: 90px;
&::after {
display: inline-block;
content: " ";
@ -210,6 +245,7 @@
top: -175px;
left: -10px;
}
&::before {
display: inline-block;
content: " ";
@ -223,6 +259,7 @@
}
}
}
.card-item {
&.line-top {
&::after {
@ -234,6 +271,7 @@
top: -170px;
left: 60px;
}
&::before {
display: inline-block;
content: " ";
@ -251,43 +289,53 @@
.card-item {
width: 120px;
.el-badge__content {
display: none;
}
&.is-active {
.div-img {
background: #3399ff;
box-shadow: var(--el-box-shadow-light);
&:hover {
background: #3399ff88;
}
}
.el-badge__content {
display: inline-block;
}
}
.title-text {
text-align: center;
font-weight: bold;
font-size: 14px;
}
.el-badge {
width: auto;
display: block;
}
.div-img {
background: #fff;
text-align: center;
padding: 10px 0px 0px;
border-radius: 8px;
&:hover {
box-shadow: var(--el-box-shadow-light);
}
img {
&.img-150 {
width: 80px;
height: 44px;
}
&.img-120 {
width: 80px;
height: 55px;

View File

@ -12,8 +12,8 @@
<div class="line line-right">
</div>
<div class="card-item is-active">
<div class="title-text">算子检查</div>
<el-badge :value="10" class="item">
<div class="title-text">算子互联</div>
<el-badge :value="0" class="item">
<div class="div-img">
<img class="img-150" src="./flow/suanzijiancha.png" />
@ -117,19 +117,23 @@
padding-left: 10px;
}
}
@media screen and (min-width:1440px) {
.model-flow {
padding-left: 60px;
}
}
.model-flow {
.row-1 {
.title-text {
margin-bottom: 10px;
}
.line {
position: relative;
width: calc(20% - 120px);
&::before {
display: inline-block;
height: 1px;
@ -140,6 +144,7 @@
top: 40%;
left: 10px;
}
&::after {
display: inline-block;
content: " ";
@ -155,28 +160,35 @@
.row-3 {
margin-top: 60px;
.line {
position: relative;
width: calc(20% - 120px);
text-align: center;
img {
position: relative;
top: 30px;
}
}
.title-text {
margin-top: 10px;
}
.card-center {
position: relative;
width: 120px;
.card-center-item {
position: absolute;
width: 120px;
top: 24px;
z-index: 9;
&:first-child {
left: -90px;
&::after {
display: inline-block;
content: " ";
@ -187,6 +199,7 @@
top: -175px;
left: 60px;
}
&::before {
display: inline-block;
content: " ";
@ -198,8 +211,10 @@
left: 60px;
}
}
&:last-child {
left: 90px;
&::after {
display: inline-block;
content: " ";
@ -210,6 +225,7 @@
top: -175px;
left: -10px;
}
&::before {
display: inline-block;
content: " ";
@ -223,6 +239,7 @@
}
}
}
.card-item {
&.line-top {
&::after {
@ -234,6 +251,7 @@
top: -170px;
left: 60px;
}
&::before {
display: inline-block;
content: " ";
@ -251,43 +269,53 @@
.card-item {
width: 120px;
.el-badge__content {
display: none;
}
&.is-active {
.div-img {
background: #3399ff;
box-shadow: var(--el-box-shadow-light);
&:hover {
background: #3399ff88;
}
}
.el-badge__content {
display: inline-block;
}
}
.title-text {
text-align: center;
font-weight: bold;
font-size: 14px;
}
.el-badge {
width: auto;
display: block;
}
.div-img {
background: #fff;
text-align: center;
padding: 10px 0px 0px;
border-radius: 8px;
&:hover {
box-shadow: var(--el-box-shadow-light);
}
img {
&.img-150 {
width: 80px;
height: 44px;
}
&.img-120 {
width: 80px;
height: 55px;

View File

@ -278,9 +278,9 @@ function uploadFile(file) {
//
function handleFileChange(file, b) {
if (file.file.size > 10 * 1024 * 1024) {
ElMessage.warning("文件大小不能超10M");
file.onError("文件大小不能超10M")
if (file.file.size > 500 * 1024 * 1024) {
ElMessage.warning("文件大小不能超500M");
file.onError("文件大小不能超500M")
return;
}
let ext = file.file.name.split(".").pop().toLowerCase();

View File

@ -47,8 +47,7 @@
<el-table-column label="量化和编译参数" align="left" prop="tool_params_name" width="160">
<template #default="scope">
<span class="args-state state-2 command" @click.stop="doChoice(scope.row)" v-if="scope.row.available">{{
scope.row.tool_params_name ? scope.row.tool_params_name : "请选择"
}}</span>
scope.row.tool_params_name ? scope.row.tool_params_name : "请选择" }}</span>
</template>
</el-table-column>
<el-table-column label="设备状态" align="center" width="100">