feat: update policy list

This commit is contained in:
Fine 2023-05-22 10:39:46 +08:00
parent b4bf447a51
commit a9d29c4ec9
8 changed files with 46 additions and 19 deletions

17
src/assets/icons/edit.svg Normal file
View File

@ -0,0 +1,17 @@
<!-- Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. -->
<svg t="1684722897341" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2408">
<path d="M853.333333 501.333333c-17.066667 0-32 14.933333-32 32v320c0 6.4-4.266667 10.666667-10.666666 10.666667H170.666667c-6.4 0-10.666667-4.266667-10.666667-10.666667V213.333333c0-6.4 4.266667-10.666667 10.666667-10.666666h320c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32H170.666667c-40.533333 0-74.666667 34.133333-74.666667 74.666666v640c0 40.533333 34.133333 74.666667 74.666667 74.666667h640c40.533333 0 74.666667-34.133333 74.666666-74.666667V533.333333c0-17.066667-14.933333-32-32-32z" fill="#666666" p-id="2409"></path><path d="M405.333333 484.266667l-32 125.866666c-2.133333 10.666667 0 23.466667 8.533334 29.866667 6.4 6.4 14.933333 8.533333 23.466666 8.533333h8.533334l125.866666-32c6.4-2.133333 10.666667-4.266667 14.933334-8.533333l300.8-300.8c38.4-38.4 38.4-102.4 0-140.8-38.4-38.4-102.4-38.4-140.8 0L413.866667 469.333333c-4.266667 4.266667-6.4 8.533333-8.533334 14.933334z m59.733334 23.466666L761.6 213.333333c12.8-12.8 36.266667-12.8 49.066667 0 12.8 12.8 12.8 36.266667 0 49.066667L516.266667 558.933333l-66.133334 17.066667 14.933334-68.266667z" p-id="2410"></path>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -124,12 +124,10 @@ export const GetProfileTaskLogs = {
`,
};
export const GetStrategyList = {
variable: "$serviceId: ID",
variable: "$serviceId: ID!",
query: `
strategyList: getStrategyList(serviceId: $serviceId) {
serviceId
targets {
targetType
strategyList: queryContinuousProfilingServiceTargets(serviceId: $serviceId) {
type
checkItems {
type
threshold
@ -139,7 +137,6 @@ export const GetStrategyList = {
uriRegex
}
}
}
`,
};

View File

@ -37,6 +37,6 @@ export const getProfileAnalyze = `query getProfileAnalyze(${GetProfileAnalyze.va
export const getProfileTaskLogs = `query profileTaskLogs(${GetProfileTaskLogs.variable}) {${GetProfileTaskLogs.query}}`;
export const getStrategyList = `query GetStrategyList(${GetStrategyList.variable}) {${GetStrategyList.query}}`;
export const getStrategyList = `query getStrategyList(${GetStrategyList.variable}) {${GetStrategyList.query}}`;
export const editStrategy = `query GetStrategyList(${EditStrategy.variable}) {${EditStrategy.query}}`;
export const editStrategy = `mutation editStrategy(${EditStrategy.variable}) {${EditStrategy.query}}`;

View File

@ -390,5 +390,6 @@ const msg = {
rabbitMQ: "RabbitMQ",
save: "Save",
editStrategy: "Edit Policies",
policyList: "Policy List",
};
export default msg;

View File

@ -389,5 +389,6 @@ const msg = {
rabbitMQ: "RabbitMQ",
save: "Salvar",
editStrategy: "Estrategia editorial",
policyList: "Lista de políticas",
};
export default msg;

View File

@ -387,5 +387,6 @@ const msg = {
rabbitMQ: "RabbitMQ",
save: "保存",
editStrategy: "编辑策略",
policyList: "策略列表",
};
export default msg;

View File

@ -38,4 +38,13 @@ export const TimeRangeConfig = {
text: "text",
};
export const ControlsTypes = ["Trace", "Profile", "Log", "DemandLog", "Ebpf", "NetworkProfiling", "ThirdPartyApp"];
export const ControlsTypes = [
"Trace",
"Profile",
"Log",
"DemandLog",
"Ebpf",
"NetworkProfiling",
"ThirdPartyApp",
"ContinuousProfiling",
];

View File

@ -16,9 +16,9 @@ limitations under the License. -->
<div class="profile-task-list flex-v">
<div class="profile-task-wrapper flex-v">
<div class="profile-t-tool">
<span>{{ t("taskList") }}</span>
<span>{{ t("policyList") }}</span>
<span class="new-task cp" @click="setStrategies">
<Icon iconName="library_add" size="middle" />
<Icon iconName="edit" size="middle" />
</span>
</div>
<div class="profile-t-wrapper">
@ -80,7 +80,7 @@ limitations under the License. -->
fetchStrategyList();
function policyItem(items: CheckItems[]) {
return items.map((d: CheckItems) => d.type).join(";");
return items.map((d: CheckItems) => `${d.type}>=${d.threshold}`).join(";");
}
async function changePolicy(item: StrategyItem) {
@ -187,6 +187,7 @@ limitations under the License. -->
border-bottom: 1px solid rgba(0, 0, 0, 0.07);
background: #f3f4f9;
width: 100%;
font-weight: bold;
}
.new-task {