feat: 用户端算力分配交互更新完成

dev-deviceSetting
donghao 1 year ago
parent 74582fe407
commit b2538ee9ef

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 11 KiB

@ -2,14 +2,16 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-02-23 11:38:23
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-02-27 13:52:18
* @LastEditTime: 2024-03-08 13:54:01
* @FilePath: \General-AI-Platform-Web-Client\src\components\DsBox\index.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import dsBox1 from "./src/dsBox1";
import dsBox2 from "./src/dsBox2";
import dsTag1 from "./src/dsTag1";
import dsTag2 from "./src/dsTag2";
export const DsBox1 = dsBox1;
export const DsBox2 = dsBox2;
export const DsTag1 = dsTag1;
export const DsTag2 = dsTag2;

@ -33,6 +33,7 @@
background: url("@/assets/dataScreen/computePower/bgTitleSide.svg")
no-repeat left center;
}
.title_right {
transform: rotateY(180deg);
}

@ -2,12 +2,12 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-01-19 09:22:30
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-03-07 17:38:56
* @LastEditTime: 2024-03-08 11:33:54
* @FilePath: \General-AI-Platform-Web-Client\src\views\computePowerAllocation\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<script setup lang="ts">
import { onMounted, ref } from "vue"; //api/json
import { onMounted, ref } from "vue";
import ComputePowerCube from "./components/computePowerCube.vue";
import ComputePowerType from "./components/computePowerType.vue";
import { ComputePowerPoolItem } from "./typing";
@ -34,7 +34,6 @@ async function fetchGroupData() {
console.log("fetchGroupData_res", res);
groupList.value = res.data;
}
// getPowerGroupList
onMounted(() => {
fetchGroupData();

@ -2,13 +2,14 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-01-19 09:38:33
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-01-23 14:51:05
* @LastEditTime: 2024-03-08 14:53:53
* @FilePath: \General-AI-Platform-Web-Client\src\views\demo\cube.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<script setup lang="ts">
import { computed } from "vue";
import { computed, ref } from "vue";
import { DsTag2 } from "@/components/DsBox";
import { ComputePowerPoolItem } from "../typing";
defineOptions({
@ -22,11 +23,13 @@ const props = defineProps({
}
});
const cubeBoxRefs = ref(null);
const listData = computed(() => {
let finalList = [];
const totalHeight = 262;
const totalWidth = cubeBoxRefs.value?.clientWidth + 6 || 1062;
finalList = props.list.map(item => {
item.value = Math.floor((item.proportion / 100) * totalHeight);
item.value = Math.floor((item.proportion / 100) * totalWidth);
return item;
});
return finalList.reverse();
@ -39,41 +42,14 @@ const fetchPathValByHeight = val => {
<template>
<div class="computePowerCube_wrap">
<div class="flex justify-start des_wrap pb-[16px]">
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
>
<path
d="M12 22C14.7614 22 17.2614 20.8807 19.0711 19.0711C20.8807 17.2614 22 14.7614 22 12C22 9.2386 20.8807 6.7386 19.0711 4.92893C17.2614 3.11929 14.7614 2 12 2C9.2386 2 6.7386 3.11929 4.92893 4.92893C3.11929 6.7386 2 9.2386 2 12C2 14.7614 3.11929 17.2614 4.92893 19.0711C6.7386 20.8807 9.2386 22 12 22Z"
stroke="#FAAD14"
stroke-width="2"
stroke-linejoin="round"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M12 18.5C12.6904 18.5 13.25 17.9404 13.25 17.25C13.25 16.5597 12.6904 16 12 16C11.3097 16 10.75 16.5597 10.75 17.25C10.75 17.9404 11.3097 18.5 12 18.5Z"
fill="#FAAD14"
/>
<path
d="M12 6V14"
stroke="#FAAD14"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
<p class="pf-1 w-[196px] pl-[8px]">
可根据检测项重要性调整滑块以 配置各算法所占用的算力比例
达到目标运算需求
<div class="tip_icon" />
<p class="text-sm pl-[8px]">
可根据检测项重要性在管理端配置各算法所占用的算力比例达到目标运算需求
</p>
</div>
<div class="cube_body">
<ul class="cube_info">
<ul class="flex cube_info" ref="cubeBoxRefs">
<li
v-for="(v, k) in listData"
:key="k"
@ -81,52 +57,13 @@ const fetchPathValByHeight = val => {
>
<div
class="bg_cube"
:style="{ height: v.value + 'px', background: v.bgColor }"
:style="{ width: v.value + 'px', background: v.bgColor }"
>
<div class="flex items-center cube_tag" v-if="v.type === 2">
<div class="bg-black h-[2px] w-[34px]"></div>
<svg
xmlns="http://www.w3.org/2000/svg"
width="20"
height="16"
viewBox="0 0 20 16"
fill="none"
>
<path
d="M18 1C18.8284 1 19.5 1.67157 19.5 2.5V13.5C19.5 14.3284 18.8284 15 18 15H7.74624C7.32544 15 6.924 14.8233 6.63986 14.5129L1.60508 9.01334C1.08028 8.4401 1.08025 7.56095 1.605 6.98766L6.63987 1.4872C6.92402 1.17678 7.32549 1 7.74633 1H18Z"
fill="#FFBD5C"
stroke="#FA8916"
/>
</svg>
<p class="pf-1 w-[140px] h-[20px] single-line">
<span class="px-[8px]">{{ v.proportion }}%</span
><span>{{ v.name }}</span>
</p>
</div>
<div class="flex items-center cube_tag" v-if="v.type === 1">
<div class="bg-black h-[2px] w-[34px]"></div>
<svg
xmlns="http://www.w3.org/2000/svg"
width="20"
height="16"
viewBox="0 0 20 16"
fill="none"
>
<path
d="M18 1C18.8284 1 19.5 1.67157 19.5 2.5V13.5C19.5 14.3284 18.8284 15 18 15H7.74624C7.32544 15 6.924 14.8233 6.63986 14.5129L1.60508 9.01334C1.08028 8.4401 1.08025 7.56095 1.605 6.98766L6.63987 1.4872C6.92402 1.17678 7.32549 1 7.74633 1H18Z"
fill="#74A5FB"
stroke="#3778F2"
/>
</svg>
<p class="pf-1 w-[140px] h-[20px] single-line">
<span class="px-[8px]">{{ v.proportion }}%</span
><span>{{ v.name }}</span>
</p>
</div>
<div class="bg-black w-[2px] h-[56px] bg_line" v-if="k !== 0" />
</div>
</li>
<li>
<div class="cube_info_line"></div>
<div class="cube_info_line" />
</li>
</ul>
</div>
@ -139,6 +76,14 @@ const fetchPathValByHeight = val => {
.computePowerCube_wrap {
position: relative;
overflow: hidden;
.tip_icon {
width: 20px;
height: 20px;
background: url("@/assets/computePower/tipIcon.svg") no-repeat;
background-size: cover;
// tipIcon.svg
}
.bg_body_logo {
/* width: 358.886px;
height: 343.026px;
@ -151,55 +96,32 @@ const fetchPathValByHeight = val => {
.cube_info {
position: relative;
margin: 0 auto;
width: 42px;
border-radius: 4px;
border: 4px solid rgba(21, 77, 221, 0.4);
background: #fff;
width: 100%;
border-radius: 2px;
/* background-color: red; */
border: 2px solid rgba(21, 77, 221, 0.4);
& > li {
.bg_cube {
width: 100%;
height: 100%;
position: relative;
}
.cube_tag {
position: absolute;
left: 0px;
top: -8px;
width: 200px;
}
}
}
.cube_info_line {
position: absolute;
left: 12px;
top: 13px;
width: 6px;
height: 233px;
background: rgba(255, 255, 255, 0.8);
left: 18px;
bottom: 14px;
height: 4px;
width: calc(100% - 36px);
/* height: 401px; */
background: rgba(255, 255, 255, 1);
filter: blur(4px);
}
.cube_body {
margin-left: 34px;
width: 45px;
/* margin-left: 30px; */
width: 100%;
border: 2px solid #b8b8b8;
border-radius: 6px;
.cube_btn {
position: relative;
width: 40px;
margin: 0 auto;
& > li {
width: 20px;
height: 20px;
position: absolute;
left: 40px;
top: 69px;
}
& > li:nth-child(2) {
top: 159px;
}
}
}
}
</style>

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-01-19 09:38:33
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-01-23 11:37:11
* @LastEditTime: 2024-03-08 15:15:12
* @FilePath: \General-AI-Platform-Web-Client\src\views\demo\cube.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
@ -26,67 +26,7 @@ const currentInfo = computed(() => props.info);
</script>
<template>
<div class="flex items-center computePowerType_wrap">
<svg
style="padding-top: 4px"
xmlns="http://www.w3.org/2000/svg"
width="24"
height="28"
viewBox="0 0 24 28"
fill="none"
>
<path
d="M12 10.9102L24 17.4556L12 24.0011L0 17.4556L12 10.9102Z"
:fill="currentInfo.color"
/>
<path
d="M24 6.54545L12 0V10.9091L24 17.4545V6.54545Z"
:fill="currentInfo.color"
/>
<path
d="M12 0L0 6.54546V17.4545L12 10.9091V0Z"
:fill="currentInfo.color"
/>
<path
d="M12 13.0923L24 6.54688V17.456L12 24.0014V13.0923Z"
:fill="currentInfo.color"
/>
<path
d="M0 6.54688L12 13.0923V24.0014L0 17.456V6.54688Z"
:fill="currentInfo.color"
/>
<rect
width="13.669"
height="13.669"
transform="matrix(0.877895 0.478853 -0.877895 0.478853 12 0)"
:fill="currentInfo.color"
/>
<g filter="url(#filter0_f_7277_81321)">
<rect x="10.8452" y="12" width="1.1547" height="12" fill="white" />
</g>
<defs>
<filter
id="filter0_f_7277_81321"
x="6.84521"
y="8"
width="9.15479"
height="20"
filterUnits="userSpaceOnUse"
color-interpolation-filters="sRGB"
>
<feFlood flood-opacity="0" result="BackgroundImageFix" />
<feBlend
mode="normal"
in="SourceGraphic"
in2="BackgroundImageFix"
result="shape"
/>
<feGaussianBlur
stdDeviation="2"
result="effect1_foregroundBlur_7277_81321"
/>
</filter>
</defs>
</svg>
<div class="bg_square" :style="{ background: currentInfo.bgColor }" />
<div class="flex">
<p class="pl-[8px] pf-1">{{ currentInfo.name }}</p>
<p class="pf-1">{{ currentInfo.proportion }}%</p>
@ -100,5 +40,9 @@ const currentInfo = computed(() => props.info);
<style lang="scss">
.computePowerType_wrap {
position: relative;
.bg_square {
width: 12px;
height: 12px;
}
}
</style>

@ -1,13 +1,61 @@
.computePowerAllocation_wrap {
height: 100%;
// padding-top: calc(50vh - 330px - 48px);
.computePowerAllocation_body {
border-radius: 12px;
background: rgba(21, 77, 221, 0.05);
width: 1080px;
height: 660px;
margin: 0 auto;
h3 {
font-weight: bold;
font-size: 16px;
color: #333333;
line-height: 19px;
}
/* header */
.head_info {
// font-size: 28px;
.bg_header_logo {
width: 80px;
height: 80px;
background: url("@/assets/computePower/banner.png");
background-repeat: no-repeat;
background-size: contain;
}
}
/* banner */
.banner_group {
padding-top: 24px;
& > li {
width: 306px;
height: 88px;
background-color: rgba(256, 256, 256, 0.1);
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.1);
border-radius: 8px 8px 8px 8px;
position: relative;
overflow: hidden;
.cp_bg_logo_icon {
min-width: 24px;
height: 26px;
background: url("@/assets/computePower/type1.svg") no-repeat 0 0;
}
.cp_bg_logo_icon_0 {
width: 44px;
height: 16px;
background: url("@/assets/computePower/ruiyinweilogo1.svg") no-repeat
0 0;
}
.bg_banner_group_logo {
width: 316px;
height: 88px;
position: absolute;
background: url("@/assets/computePower/guoqi.svg") no-repeat 0 0;
background-size: cover;
opacity: 0.1;
}
.bg_banner_group_logo_1 {
background: url("@/assets/computePower/NVIDIA.svg");
}
}
}
/* footer */
}
.computePower_header {
@ -55,14 +103,6 @@
}
}
.bg_banner_center {
width: 360px;
height: 360px;
background: url("@/assets/computePower/banner.png");
background-repeat: no-repeat;
background-size: contain;
}
.banner_right {
.computePowerCube_wrap {
padding: 16px;
@ -74,8 +114,4 @@
}
}
}
.computePower_footer {
padding: 10px;
}
}

@ -2,142 +2,95 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-01-19 09:22:30
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-03-04 14:27:02
* @LastEditTime: 2024-03-08 15:26:06
* @FilePath: \General-AI-Platform-Web-Client\src\views\computePowerAllocation\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<script setup lang="ts">
import { ref } from "vue"; //api/json
import { onMounted, ref } from "vue";
import ComputePowerCube from "./components/computePowerCube.vue";
import ComputePowerType from "./components/computePowerType.vue";
import { ComputePowerPoolItem } from "./typing";
import { getPowerPoolsList, getPowerGroupList } from "@/api/list";
defineOptions({
name: "ComputePowerAllocation"
});
const groupList = ref<Record<string, any>[]>([
{
label: "NVIDIA GeForce 4090"
},
{
label: "NVIDIA GeForce 4090"
},
{
label: "NVIDIA GeForce 4090"
},
{
label: "NVIDIA GeForce 4090"
}
]); //dom;
const groupList = ref<Record<string, any>[]>([]); //dom;
const poolsData = ref<ComputePowerPoolItem[]>([]);
const poolsData: ComputePowerPoolItem[] = [
{
name: "焊线颜色检测",
type: 1,
proportion: 34,
pretreatmentEfficiency: 20,
color: "#3879FE",
bgColor: "linear-gradient(180deg, #015DE6 0%, #4881F6 100%)"
},
{
name: "螺纹缺陷检测",
type: 2,
proportion: 46,
pretreatmentEfficiency: 15,
color: "#FAA90B",
bgColor: "linear-gradient(180deg, #FA8316 0%, #FAAD16 100%)"
},
async function fetchPowerData() {
const res = await getPowerPoolsList();
console.log("fetchPowerData_res", res);
poolsData.value = res.data;
}
async function fetchGroupData() {
const res = await getPowerGroupList();
console.log("fetchGroupData_res", res);
groupList.value = res.data.splice(0, 4);
}
{
name: "空闲算力",
type: 0,
proportion: 20,
pretreatmentEfficiency: 0,
color: "#DCDCDC",
bgColor: "linear-gradient(90deg, #7B7979 0%, #C1C1C1 100%)"
}
];
onMounted(() => {
fetchGroupData();
fetchPowerData();
});
</script>
<template>
<div
class="flex items-center justify-center main_booy_container computePowerAllocation_wrap"
>
<div class="computePowerAllocation_body">
<div class="flex justify-center computePower_header">
<svg
xmlns="http://www.w3.org/2000/svg"
width="667"
height="50"
viewBox="0 0 667 50"
fill="none"
>
<path
d="M4 1.25H2.39949L3.42366 2.47992L21.2082 23.8375C25.9105 29.4845 32.879 32.75 40.2275 32.75H169.682C173.92 32.75 178.078 33.9086 181.706 36.1005L192.922 42.8776C199.28 46.7193 206.567 48.75 213.996 48.75H316.342C317.146 48.75 317.909 48.3989 318.431 47.7889L320.231 45.6869L319.662 45.199L320.231 45.6869C320.469 45.4096 320.816 45.25 321.181 45.25H346.911C347.242 45.25 347.56 45.3818 347.795 45.6165L350.121 47.9438C350.636 48.46 351.336 48.75 352.066 48.75H443.362C450.566 48.75 457.641 46.8403 463.867 43.2154L476.417 35.9077C479.969 33.8396 484.006 32.75 488.116 32.75H630.515C638.594 32.75 646.165 28.8065 650.796 22.186L664.615 2.42988L665.44 1.25H664H4Z"
fill="url(#paint0_linear_7277_81243)"
stroke="white"
stroke-width="1.5"
/>
<defs>
<linearGradient
id="paint0_linear_7277_81243"
x1="334"
y1="10"
x2="334"
y2="48"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="#154DDD" stop-opacity="0.15" />
<stop offset="1" stop-color="#154DDD" stop-opacity="0" />
</linearGradient>
</defs>
</svg>
<span>苏胜天算力资源池</span>
</div>
<div class="flex items-center justify-between computePower_banner">
<div class="banner_left">
<p class="hf-1">硬件组成</p>
<ul class="banner_group">
<div class="main_booy_container computePowerAllocation_wrap">
<ul class="computePowerAllocation_body">
<li>
<h3>算力配置</h3>
<div class="flex items-center head_info mt-[16px]">
<div class="bg_header_logo"></div>
<div class="head_info_item ml-[12px]">
<h6 class="font-bold pf-1">苏胜天算力资源池</h6>
<p class="pf-2">算力资源999Tops</p>
</div>
</div>
</li>
<li class="mt-[16px]">
<h3>硬件组成</h3>
<ul class="flex justify-between banner_group">
<li
v-for="(v, k) in groupList"
:key="k"
class="flex items-center mb-[16px]"
>
<div class="flex items-center px-[16px]">
<div
class="cp_bg_logo_icon"
:class="`cp_bg_logo_icon_${v.type}`"
/>
<span class="pl-[12px] pf-2 two-line w-[230px]">{{
v.label
}}</span>
</div>
<div
class="bg_banner_group_logo"
:class="`bg_banner_group_logo_${v.type}`"
/>
</li>
</ul>
</li>
<li class="mt-[16px]">
<h3>算力配置</h3>
<div class="mt-[16px]">
<ComputePowerCube :list="poolsData" />
<ul class="flex flex-wrap items-center computePower_footer mt-[16px]">
<li
v-for="(v, k) in groupList"
v-for="(v, k) in poolsData"
:key="k"
class="flex items-center bg-white p-[16px] mt-[16px]"
class="flex items-center justify-center mr-[16px] mb-[16px]"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
>
<path
d="M8.948 8.7975V7.3675C9.08911 7.35702 9.23051 7.35102 9.372 7.3495C13.294 7.2255 15.865 10.7235 15.865 10.7235C15.865 10.7235 13.091 14.5745 10.115 14.5745C9.72158 14.5753 9.33059 14.5128 8.957 14.3895V10.0435C10.485 10.2285 10.794 10.9005 11.704 12.4285L13.744 10.7145C13.744 10.7145 12.252 8.7625 9.744 8.7625C9.47818 8.75656 9.21227 8.76826 8.948 8.7975ZM8.948 4.0625V6.2005L9.372 6.1735C14.822 5.9885 18.382 10.6435 18.382 10.6435C18.382 10.6435 14.302 15.6075 10.052 15.6075C9.68491 15.6063 9.31858 15.5739 8.957 15.5105V16.8355C9.257 16.8705 9.567 16.8975 9.867 16.8975C13.824 16.8975 16.687 14.8745 19.46 12.4895C19.919 12.8605 21.8 13.7525 22.19 14.1415C19.557 16.3495 13.418 18.1255 9.937 18.1255C9.602 18.1255 9.284 18.1075 8.966 18.0725V19.9365H24V4.0625H8.948ZM8.948 14.3885V15.5195C5.291 14.8655 4.275 11.0595 4.275 11.0595C4.275 11.0595 6.033 9.1155 8.948 8.7975V10.0345H8.94C7.412 9.8485 6.21 11.2795 6.21 11.2795C6.21 11.2795 6.89 13.6915 8.949 14.3895M2.456 10.8995C2.456 10.8995 4.62 7.7025 8.956 7.3665V6.2005C4.153 6.5895 0 10.6525 0 10.6525C0 10.6525 2.35 17.4545 8.948 18.0725V16.8355C4.108 16.2355 2.456 10.8995 2.456 10.8995Z"
fill="#76B900"
/>
</svg>
<p class="pf-2 pl-[12px]">{{ v.label }}</p>
<div class="bg_banner_group_logo">&nbsp;</div>
<ComputePowerType :info="v" />
</li>
</ul>
</div>
<div class="bg_banner_center"></div>
<div class="banner_right">
<p class="hf-1 pb-[16px]">算力配置</p>
<ComputePowerCube :list="poolsData" />
</div>
</div>
<ul
class="flex items-center justify-center computePower_footer mt-[70px]"
>
<li
v-for="(v, k) in poolsData"
:key="k"
class="flex items-center justify-center mx-[20px]"
>
<ComputePowerType :info="v" />
</li>
</ul>
</div>
</li>
</ul>
</div>
</template>

Loading…
Cancel
Save