diff --git a/src/components/proxy/Info.vue b/src/components/proxy/Info.vue
index 0f049aca..d651caad 100644
--- a/src/components/proxy/Info.vue
+++ b/src/components/proxy/Info.vue
@@ -3,7 +3,7 @@
{{ proxy?.title }}
- {{ proxy?.request?.method }}
+
{{ urlJoin(proxy?.endpoint, proxy?.path) }}
@@ -19,7 +19,7 @@ import { ElTag } from 'element-plus';
export default defineComponent({
name: 'ProxyInfo',
components: {
- ElTag
+ // ElTag
},
props: {
proxy: {
diff --git a/src/i18n/zh/application/field.ts b/src/i18n/zh/application/field.ts
index 5bf57151..04e4ee4c 100644
--- a/src/i18n/zh/application/field.ts
+++ b/src/i18n/zh/application/field.ts
@@ -1,11 +1,13 @@
export default {
- remainingCount: '剩余次数',
- usedCount: '已使用次数',
+ remainingCount: '剩余量',
+ usedCount: '使用量',
apiKey: 'API Key',
service: '服务',
operation: '操作',
amount: '数量',
shouldPayPrice: '应付金额',
api: 'API',
- credential: '密钥'
+ proxy: '代理',
+ credential: '密钥',
+ name: '名称'
};
diff --git a/src/operators/application/operator.ts b/src/operators/application/operator.ts
index efd56ce3..ac14bde5 100644
--- a/src/operators/application/operator.ts
+++ b/src/operators/application/operator.ts
@@ -1,11 +1,12 @@
import { AxiosResponse } from 'axios';
import { httpClient } from '../instance';
-import { IApplication, IApplicationDetailResponse, IApplicationListResponse } from './models';
+import { IApplication, IApplicationDetailResponse, IApplicationListResponse, IApplicationType } from './models';
export interface IApplicationQuery {
user_id?: string;
offset?: number;
limit?: number;
+ type?: IApplicationType;
}
class ApplicationOperator {
diff --git a/src/pages/console/application/List.vue b/src/pages/console/application/List.vue
index db108272..23ecdef0 100644
--- a/src/pages/console/application/List.vue
+++ b/src/pages/console/application/List.vue
@@ -9,8 +9,12 @@
+
+ {{ $t('application.field.api') }}
+ {{ $t('application.field.proxy') }}
+
-
+
{{ scope.row?.api?.title }}
{{ scope.row?.proxy?.title }}
@@ -89,7 +93,7 @@ import {
import Pagination from '@/components/common/Pagination.vue';
import CopyToClipboard from '@/components/common/CopyToClipboard.vue';
import CreateOrder from '@/components/order/Create.vue';
-import { ElTable, ElRow, ElCol, ElTableColumn, ElButton, ElCard } from 'element-plus';
+import { ElTable, ElRow, ElCol, ElTableColumn, ElButton, ElCard, ElMenu, ElMenuItem } from 'element-plus';
import { ROUTE_DOCUMENT_DETAIL } from '@/router/constants';
interface IData {
@@ -120,7 +124,9 @@ export default defineComponent({
ElCol,
ElTableColumn,
ElButton,
- ElCard
+ ElCard,
+ ElMenu,
+ ElMenuItem
},
data(): IData {
return {
@@ -146,6 +152,9 @@ export default defineComponent({
},
page() {
return parseInt(this.$route.query.page?.toString() || '1');
+ },
+ type() {
+ return (this.$route.query.type?.toString() || IApplicationType.API) as IApplicationType;
}
},
watch: {
@@ -153,12 +162,30 @@ export default defineComponent({
handler() {
this.onFetchData();
}
+ },
+ type: {
+ handler() {
+ this.onFetchData();
+ }
}
},
mounted() {
this.onFetchData();
},
methods: {
+ onFilterType(type: string) {
+ if (type === this.type) {
+ return;
+ }
+ this.$router.push({
+ ...this.$route,
+ query: {
+ ...this.$route.query,
+ page: 1,
+ type
+ }
+ });
+ },
onGoDocument(application: IApplication) {
const documentId = application?.api?.document_id;
this.$router.push({
@@ -176,6 +203,7 @@ export default defineComponent({
this.$router.push({
name: this.$route.name?.toString(),
query: {
+ ...this.$route.query,
page: page
}
});
@@ -186,7 +214,8 @@ export default defineComponent({
.getAll({
limit: this.limit,
offset: (this.page - 1) * this.limit,
- user_id: this.$store.getters.user.id
+ user_id: this.$store.getters.user.id,
+ type: this.type
})
.then(({ data: data }: { data: IApplicationListResponse }) => {
this.applications = data.items;
@@ -209,7 +238,7 @@ export default defineComponent({
color: #333;
}
.el-table {
- min-height: calc(100vh - 300px);
+ min-height: calc(100vh - 350px);
margin-bottom: 50px;
}