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

feat: 1.14功能开发 #59

Merged
merged 1 commit into from
Jun 28, 2024
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
6 changes: 3 additions & 3 deletions src/dashboard-front/src/components/resource-detail/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
class="title mt15"
:class="{
'ag-diff':
checkDiff('localData.proxy') ||
checkDiff('localData.proxy.backend_name') ||
checkDiff('localData.proxy.config.method') ||
checkDiff('localData.proxy.config.timeout') ||
checkDiff('localData.proxy.config.path'),
Expand Down Expand Up @@ -218,14 +218,14 @@
</bk-row> -->

<bk-row
:class="{ 'ag-diff': checkDiff('localData?.proxy?.backend?.name') }"
:class="{ 'ag-diff': checkDiff('localData.proxy.backend_name') }"
>
<bk-col :span="4">
<label class="ag-key">{{ $t("后端服务:") }}</label>
</bk-col>
<bk-col :span="10">
<div class="ag-value">
{{ localData?.proxy?.backend_name || "--" }}
{{ localData.proxy.backend_name || "--" }}
</div>
</bk-col>
</bk-row>
Expand Down
14 changes: 14 additions & 0 deletions src/dashboard-front/src/components/version-diff/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,20 @@ const getDiffData = async () => {
});
res.update.forEach((item: any) => {
item.isExpanded = false;

if (item?.source?.diff?.proxy?.backend_id) {
const curBackend: any = backendsList.value?.find((backend: any) => {
return backend.id === item.source.diff.proxy.backend_id;
});
item.source.diff.proxy.backend_name = curBackend?.name || '';
}

if (item?.target?.diff?.proxy?.backend_id) {
const curBackend: any = backendsList.value?.find((backend: any) => {
return backend.id === item.target.diff.proxy.backend_id;
});
item.target.diff.proxy.backend_name = curBackend?.name || '';
}
});

diffData.add = res.add;
Expand Down
2 changes: 1 addition & 1 deletion src/dashboard-front/src/http/access-log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const { BK_DASHBOARD_URL } = window;
* 获取流程日志列表
* @param apigwId 网关id
*/
export const fetchApigwAccessLogList = (apigwId: number, params: ChartInterface) => fetch.get(`${BK_DASHBOARD_URL}/gateways/${apigwId}/logs/?${json2Query(params)}`);
export const fetchApigwAccessLogList = (apigwId: number, params: ChartInterface, extraStr?: string) => fetch.get(`${BK_DASHBOARD_URL}/gateways/${apigwId}/logs/?${json2Query(params)}${extraStr}`);

/**
* 获取流程日志chart
Expand Down
4 changes: 4 additions & 0 deletions src/dashboard-front/src/language/lang.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1422,6 +1422,10 @@ const lang: ILANG = {
'版本列表': ['VersionList'],
'请输入网关名称': ['Please enter gateway name'],
'': [''],
'切换插件': ['Switching plug-in'],
'确认{optType}插件({name})到 {stage} 环境?': ['Confirm the {optType} plug-in ({name}) to the {stage} environment?'],
'插件配置变更后,将立即影响线上环境,请确认。': ['The plug-in configuration change will affect the online environment immediately. Please confirm.'],
'allow_origins 与 allow_origins_by_regex 不能同时为空': ['allow_origins and allow_origins_by_regex cannot be empty at the same time'],
'条': ['line'],
'共': ['total'],
'日志详情': ['Log details'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</div>
<div class="choose-plugin" v-show="isAdd" @click="showChoosePlugin = !showChoosePlugin">
<transfer />
<span>切换插件</span>
<span>{{ t('切换插件') }}</span>
</div>
</div>
<bk-select
Expand Down Expand Up @@ -65,7 +65,7 @@

<bk-alert
theme="warning"
title="allow_origins 与 allow_origins_by_regex 不能同时为空"
:title="t('allow_origins 与 allow_origins_by_regex 不能同时为空')"
v-show="typeId === 1"
/>

Expand All @@ -87,15 +87,17 @@
:schema="formConfig.schema"
:layout="formConfig.layout"
:rules="formConfig.rules"
:label-width="180"
ref="formRef">
</BkSchemaForm>
</div>
<div class="info-btn mt20">
<div class="last-step">
<bk-pop-confirm
:title="`确认${isAdd ? '添加' : '修改'}插件(${curPluginInfo?.name})到 ${stageStore?.curStageData?.name} 环境?`"
content="插件配置变更后,将立即影响线上环境,请确认。"
:title="t('确认{optType}插件({name})到 {stage} 环境?',
{ optType: isAdd ? t('添加') : t('修改'),
name: curPluginInfo?.name,
stage: stageStore?.curStageData?.name })"
:content="t('插件配置变更后,将立即影响线上环境,请确认。')"
trigger="click"
@confirm="handleAdd"
v-if="isStage"
Expand Down
42 changes: 35 additions & 7 deletions src/dashboard-front/src/views/operate-data/access-log/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
<span class="opt-btns" v-if="field === 'request_id'">
<copy-shape v-bk-tooltips="t('复制')" @click="handleRowCopy(field, row)" class="opt-copy" />
<enlarge-line v-bk-tooltips="t('添加到本次检索')" @click="handleKeySearch(row)" />
<narrow-line v-bk-tooltips="t('从本次检索中排除')" @click="handleRemoveKey" />
<narrow-line v-bk-tooltips="t('从本次检索中排除')" @click="handleRemoveKey(row)" />
</span>

</dd>
Expand Down Expand Up @@ -270,6 +270,8 @@ const table = ref({
fields: [],
headers: [],
});
const includeObj = ref<string[]>([]);
const excludeObj = ref<string[]>([]);
// const searchUsage = ref({
// showed: false,
// });
Expand Down Expand Up @@ -476,7 +478,16 @@ const getApigwAccessLogList = async () => {
offset: (pagination.value.current - 1) * pagination.value.limit,
limit: pagination.value.limit,
};
return await fetchApigwAccessLogList(apigwId.value, params);

let includeStr = '';
includeObj.value?.forEach((item: string) => {
includeStr += `&include=${item}`;
});
let excludeStr = '';
excludeObj.value?.forEach((item: string) => {
excludeStr += `&exclude=${item}`;
});
return await fetchApigwAccessLogList(apigwId.value, params, includeStr + excludeStr);
};

const getApigwAccessLogChart = async () => {
Expand Down Expand Up @@ -525,13 +536,30 @@ const handleRowCopy = (field: string, row: any) => {

const handleKeySearch = (row: any) => {
const { request_id } = row;
keyword.value = `request_id: ${request_id}`;
handleSearch(keyword.value);

includeObj.value?.push(`request_id:${request_id}`);
includeObj.value = Array.from(new Set(includeObj.value));

const index = excludeObj.value?.indexOf(`request_id:${request_id}`);
if (index !== -1) {
excludeObj.value?.splice(index, 1);
}

getSearchData();
};

const handleRemoveKey = () => {
keyword.value = '';
handleSearch(keyword.value);
const handleRemoveKey = (row: any) => {
const { request_id } = row;

excludeObj.value?.push(`request_id:${request_id}`);
excludeObj.value = Array.from(new Set(excludeObj.value));

const index = includeObj.value?.indexOf(`request_id:${request_id}`);
if (index !== -1) {
includeObj.value?.splice(index, 1);
}

getSearchData();
};

// const handleClickCopyLink = async ({ request_id }: any) => {
Expand Down
3 changes: 2 additions & 1 deletion src/dashboard-front/src/views/resource/setting/detail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -937,11 +937,12 @@ watch(
color: #313238;
font-weight: 700;
font-size: 14px;
margin-bottom: 18px;
margin-bottom: 12px;
}
.form-cls {
font-size: 12px;
flex-flow: wrap;
margin-bottom: 30px;
:deep(.form-item-cls){
flex: 0 0 50%;
margin-bottom: 6px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
</span>
</template>
</bk-table-column>
<bk-table-column :label="t('创建者')" prop="created_by">
</bk-table-column>
<bk-table-column :label="t('操作')" width="200">
<template #default="{ data }">
<bk-button
Expand Down
Loading