Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: fix args All and add trans #720

Merged
merged 1 commit into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion pkg/web/src/i18n/resources/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,13 @@
"节点名": "Node Name",
"闲置节点": "Idle Node",
"采纳推荐": "Adopt Recommendation",
"查看采纳命令": "View Adoption Command"
"查看采纳命令": "View Adoption Command",
"Workload类型": "Workload Type",
"Workload": "Workload",
"查看监控": "View Metrics",
"采纳推荐成功": "Adopt Recommendation Successful",
"采纳推荐失败": "Adopt Recommendation Failed",
"应用总览": "Workload Overview",
"应用洞察": "Workload Insight",
"应用成本分布": "Workload Cost Dimension"
}
10 changes: 9 additions & 1 deletion pkg/web/src/i18n/resources/zh/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,13 @@
"节点名": "节点名",
"闲置节点": "闲置节点",
"采纳推荐": "采纳推荐",
"查看采纳命令": "查看采纳命令"
"查看采纳命令": "查看采纳命令",
"Workload类型": "Workload类型",
"Workload": "Workload",
"查看监控": "查看监控",
"采纳推荐成功": "采纳推荐成功",
"采纳推荐失败": "采纳推荐失败",
"应用总览": "应用总览",
"应用洞察": "应用洞察",
"应用成本分布": "应用成本分布"
}
20 changes: 20 additions & 0 deletions pkg/web/src/pages/Cost/NamespaceCosts/NamespaceCostSearchPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,26 @@ export const NamespaceCostSearchPanel = React.memo(() => {
}}
/>
</div>
<div
style={{
display: 'flex',
flexDirection: 'row',
alignItems: 'center',
marginRight: '1rem',
marginTop: 5,
marginBottom: 5,
}}
>
<div style={{marginRight: '1rem', width: '70px'}}>{t('Discount')}</div>
<InputNumber
min={0}
theme='column'
value={discount}
onChange={(value) => {
dispatch(insightAction.discount(value));
}}
/>
</div>
</Card>
</div>
);
Expand Down
10 changes: 5 additions & 5 deletions pkg/web/src/pages/Cost/WorkloadOverview/OverviewSearchPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {nanoid} from '@reduxjs/toolkit';
import dayjs from 'dayjs';
import _ from 'lodash';

const ALL_NAMESPACE_VALUE = "ALL";
const ALL_NAMESPACE_VALUE = "All";

export const OverviewSearchPanel = React.memo(() => {
const dispatch = useDispatch();
Expand All @@ -39,7 +39,7 @@ export const OverviewSearchPanel = React.memo(() => {
() => [
{
value: ALL_NAMESPACE_VALUE,
label: 'ALL',
label: 'All',
},
...(namespaceList?.data?.data?.items ?? []).map((namespace) => ({
label: namespace,
Expand All @@ -55,7 +55,7 @@ export const OverviewSearchPanel = React.memo(() => {
start: (Date.parse(customRange.start)/1000).toString(),
end: (Date.parse(customRange.end)/1000).toString(),
match: `crane_analysis_resource_recommendation{namespace=~"(${
selectedNamespace === "ALL"
selectedNamespace === "All"
? namespaceOptions
.filter((option) => option.label !== ALL_NAMESPACE_VALUE)
.map((option) => option.label)
Expand Down Expand Up @@ -83,7 +83,7 @@ export const OverviewSearchPanel = React.memo(() => {
start: (Date.parse(customRange.start)/1000).toString(),
end: (Date.parse(customRange.end)/1000).toString(),
match: `crane_analysis_resource_recommendation{namespace=~"(${
selectedNamespace === "ALL"
selectedNamespace === "All"
? namespaceOptions
.filter((option) => option.label !== ALL_NAMESPACE_VALUE)
.map((option) => option.label)
Expand All @@ -95,7 +95,7 @@ export const OverviewSearchPanel = React.memo(() => {
const workloadOptions: any[] = React.useMemo(() => {
const options = _.uniqBy(
[
{ label: 'ALL', value: 'ALL' },
{ label: 'All', value: 'All' },
...(workloadList.data?.data ?? []).map((data: any) => ({
label: data.owner_name,
value: data.owner_name,
Expand Down
4 changes: 2 additions & 2 deletions pkg/web/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ export default (params) => ({
// 用于开发环境下的转发请求
// 更多请参考:https://vitejs.dev/config/#server-proxy
// Set to your craned address
target: 'http://localhost:8082',
target: 'http://localhost:9090',
changeOrigin: true,
},
'/grafana': {
// Set to your craned address
target: 'http://localhost:8082',
target: 'http://localhost:9090',
changeOrigin: true,
},
},
Expand Down