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

Dev #6

Merged
merged 3 commits into from
Feb 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
fix: [PAASC-8002] fix issues
  • Loading branch information
张鹏程(时速云) committed Feb 3, 2023
commit 68e019f6ef6d6e2735aa485053cfd4e6ac228c96
18 changes: 16 additions & 2 deletions bff-sdk/sdk.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { GraphQLClient } from 'graphql-request';
import { ClientError } from 'graphql-request/dist/types';
import * as Dom from 'graphql-request/dist/types.dom';
import gql from 'graphql-tag';
import { ClientError } from 'graphql-request/dist/types';
import { Key as SWRKeyInterface, SWRConfiguration as SWRConfigInterface } from 'swr';
import useSWR from './useSWR';
import { SWRConfiguration as SWRConfigInterface, Key as SWRKeyInterface } from 'swr';
export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends { [key: string]: unknown }> = {
Expand All @@ -22,6 +22,8 @@ export type Scalars = {
Boolean: boolean;
Int: number;
Float: number;
JSON: any;
JSONObject: any;
};

/** 联盟 */
Expand Down Expand Up @@ -49,6 +51,8 @@ export type Federation = {

/** 「联盟」状态 */
export enum FederationStatus {
/** 失败 */
Error = 'Error',
/** 已激活 */
FederationActivated = 'FederationActivated',
/** 已解散 */
Expand Down Expand Up @@ -255,6 +259,10 @@ export type Proposal = {
creationTimestamp: Scalars['String'];
/** 截止时间 */
endAt?: Maybe<Scalars['String']>;
/** 相关联盟 */
federation?: Maybe<Scalars['String']>;
/** 相关内容 */
information?: Maybe<Scalars['JSONObject']>;
/** 发起者 */
initiator?: Maybe<Organization>;
/** name */
Expand Down Expand Up @@ -775,6 +783,7 @@ export type GetProposalsQuery = {
policy?: ProposalPolicy | null;
status?: ProposalStatus | null;
voted?: VotePhase | null;
federation?: string | null;
initiator?: {
__typename?: 'Organization';
name: string;
Expand Down Expand Up @@ -809,6 +818,8 @@ export type GetProposalQuery = {
policy?: ProposalPolicy | null;
status?: ProposalStatus | null;
voted?: VotePhase | null;
federation?: string | null;
information?: any | null;
initiator?: {
__typename?: 'Organization';
name: string;
Expand Down Expand Up @@ -1095,6 +1106,7 @@ export const GetProposalsDocument = gql`
policy
status
voted
federation
initiator {
name
admin
Expand Down Expand Up @@ -1122,6 +1134,8 @@ export const GetProposalDocument = gql`
policy
status
voted
federation
information
initiator {
name
admin
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@formily/core": "^2.1.4",
"@formily/react": "^2.1.4",
"@tenx-ui/icon": "^2.4.13",
"@tenx-ui/materials": "1.0.11",
"@tenx-ui/materials": "1.0.13",
"@tenx-ui/utils": "^2.2.1",
"@umijs/max": "^4.0.42",
"antd": "^5.1.4",
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const i18nConfig = {
"i18n-54sfaqivd5i": "Organization management",
"i18n-5er0ayqzcp": "Last update time",
"i18n-5jwxi1nlnsm": "I created",
"i18n-5xl7aihzcuy": "total",
"i18n-65qwbj9telu": "The proposal to disband the network succeeded",
"i18n-66pkydvtrcv": "I manage",
"i18n-67illnj3hic": "6 month",
Expand Down Expand Up @@ -113,6 +114,7 @@ const i18nConfig = {
"i18n-gnwdi4ep1vt": "Enter the user name to search",
"i18n-gspz6pec67u": "AddMemberProposal",
"i18n-gwumlhyv4ub": "Invitational member",
"i18n-h05l2cens9w": "Related federation",
"i18n-h52hay1ld2s": "Delete a user",
"i18n-h8159rss9ij":
",After the user is deleted, all permissions under the organization will be revoked",
Expand Down Expand Up @@ -175,6 +177,7 @@ const i18nConfig = {
"i18n-onidezp69vb": "Please choose to decide",
"i18n-p5gea1q7fem": "User deletion failure",
"i18n-p98jmw4mkzq": "Proposed voting strategy",
"i18n-pair5ijzb3j": "content",
"i18n-pev2ce1ut3l": "FederationDissolved",
"i18n-pg663sglzcs": "Standard edition",
"i18n-pjire30gfe": "Enter voter search",
Expand Down Expand Up @@ -207,6 +210,7 @@ const i18nConfig = {
"i18n-v1ic8b3llyo": "Cut-off time",
"i18n-v4wf8ejznd": "Total organizational users",
"i18n-v6gmjbqnol": "Set initiator",
"i18n-v7xu122b9o": "item",
"i18n-vo8kd18n6pd": "Consensus cluster node",
"i18n-vxubih1pqa": "Network ID",
"i18n-w4mcacnr3z": "Number of networks",
Expand Down Expand Up @@ -270,6 +274,7 @@ const i18nConfig = {
"i18n-54sfaqivd5i": "组织管理",
"i18n-5er0ayqzcp": "最近更新时间",
"i18n-5jwxi1nlnsm": "我创建的",
"i18n-5xl7aihzcuy": "共计",
"i18n-65qwbj9telu": "解散网络提议成功",
"i18n-66pkydvtrcv": "我管理的",
"i18n-67illnj3hic": "6个月",
Expand Down Expand Up @@ -345,6 +350,7 @@ const i18nConfig = {
"i18n-gnwdi4ep1vt": "输入用户名搜索",
"i18n-gspz6pec67u": "联盟添加组织",
"i18n-gwumlhyv4ub": "邀请成员",
"i18n-h05l2cens9w": "相关联盟",
"i18n-h52hay1ld2s": "删除用户",
"i18n-h8159rss9ij": ",删除后,用户在该组织下所有权限将被收回",
"i18n-hbf63hki898": "版本",
Expand Down Expand Up @@ -405,6 +411,7 @@ const i18nConfig = {
"i18n-onidezp69vb": "请选择决定",
"i18n-p5gea1q7fem": "删除用户失败",
"i18n-p98jmw4mkzq": "提议投票策略",
"i18n-pair5ijzb3j": "内容",
"i18n-pev2ce1ut3l": "已解散",
"i18n-pg663sglzcs": "标准版",
"i18n-pjire30gfe": "输入投票人搜索",
Expand Down Expand Up @@ -436,6 +443,7 @@ const i18nConfig = {
"i18n-v1ic8b3llyo": "截止时间",
"i18n-v4wf8ejznd": "组织用户总数",
"i18n-v6gmjbqnol": "设置发起者",
"i18n-v7xu122b9o": "条",
"i18n-vo8kd18n6pd": "共识集群节点",
"i18n-vxubih1pqa": "网络 ID",
"i18n-w4mcacnr3z": "网络个数",
Expand Down
27 changes: 22 additions & 5 deletions src/pages/Federation/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,12 @@ class Federation$$Page extends React.Component {
});
}

paginationShowTotal(total, range) {
return `${this.i18n("i18n-5xl7aihzcuy")} ${total} ${this.i18n(
"i18n-v7xu122b9o"
)}`;
}

componentDidMount() {
const getOrganizations = async () => {
var _res$organizations;
Expand Down Expand Up @@ -351,7 +357,7 @@ class Federation$$Page extends React.Component {
componentProps={{
colon: false,
labelAlign: "left",
labelCol: 5,
labelCol: 7,
layout: "horizontal",
wrapperCol: 19,
}}
Expand Down Expand Up @@ -387,7 +393,7 @@ class Federation$$Page extends React.Component {
message:
"大小写字母, 数字, 中划线组成,开头和结尾只能是字母或数字",
pattern:
"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$",
"^[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?)*$",
},
],
}}
Expand Down Expand Up @@ -563,7 +569,7 @@ class Federation$$Page extends React.Component {
"x-validator": [
{
message: "联盟描述由 0 ~ 200 字符组成",
pattern: "^[\\w]{0,200}$",
pattern: "^.{0,200}$",
},
],
}}
Expand Down Expand Up @@ -648,7 +654,11 @@ class Federation$$Page extends React.Component {
/>
</Modal>
<Row __component_name="Row" wrap={true}>
<Col __component_name="Col" span={24}>
<Col
__component_name="Col"
span={24}
style={{ paddingBottom: "12px" }}
>
<Typography.Title
__component_name="Typography.Title"
bold={true}
Expand Down Expand Up @@ -718,7 +728,7 @@ class Federation$$Page extends React.Component {
__component_name="Space"
align="center"
direction="horizontal"
size="large"
size={34}
>
<Space
__component_name="Space"
Expand Down Expand Up @@ -1345,6 +1355,12 @@ class Federation$$Page extends React.Component {
pageSize: __$$eval(() => this.state.size),
showQuickJumper: false,
showSizeChanger: false,
showTotal: function () {
return this.paginationShowTotal.apply(
this,
Array.prototype.slice.call(arguments).concat([])
);
}.bind(this),
simple: false,
size: "default",
total: __$$eval(
Expand Down Expand Up @@ -1384,6 +1400,7 @@ class Federation$$Page extends React.Component {
scroll={{ scrollToFirstRowOnChange: true }}
showHeader={true}
size="default"
style={{ marginTop: "-20px" }}
/>
</Card>
</Col>
Expand Down
29 changes: 28 additions & 1 deletion src/pages/FederationDetail/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,12 @@ class FederationDetail$$Page extends React.Component {
});
}

paginationShowTotal(total, range) {
return `${this.i18n("i18n-5xl7aihzcuy")} ${total} ${this.i18n(
"i18n-v7xu122b9o"
)}`;
}

componentDidMount() {
const getOrganizations = async () => {
var _res$organizations;
Expand Down Expand Up @@ -283,7 +289,11 @@ class FederationDetail$$Page extends React.Component {
style={{ height: "100%" }}
>
<Row __component_name="Row" wrap={true}>
<Col __component_name="Col" span={24}>
<Col
__component_name="Col"
span={24}
style={{ paddingBottom: "12px" }}
>
<Button.Back
__component_name="Button.Back"
title={this._i18nText({
Expand Down Expand Up @@ -886,6 +896,14 @@ class FederationDetail$$Page extends React.Component {
pageSize: __$$eval(() => this.state.userSize),
showQuickJumper: false,
showSizeChanger: false,
showTotal: function () {
return this.paginationShowTotal.apply(
this,
Array.prototype.slice
.call(arguments)
.concat([])
);
}.bind(this),
simple: false,
size: "default",
total: __$$eval(
Expand All @@ -900,6 +918,7 @@ class FederationDetail$$Page extends React.Component {
scroll={{ scrollToFirstRowOnChange: true }}
showHeader={true}
size="default"
style={{ marginTop: "-10px" }}
/>
</Col>
</Row>
Expand All @@ -914,6 +933,7 @@ class FederationDetail$$Page extends React.Component {
},
]}
size="large"
style={{ marginTop: "-20px" }}
tabPosition="top"
type="line"
/>
Expand Down Expand Up @@ -1245,6 +1265,12 @@ class FederationDetail$$Page extends React.Component {
pageSize: __$$eval(() => this.state.size),
showQuickJumper: false,
showSizeChanger: false,
showTotal: function () {
return this.paginationShowTotal.apply(
this,
Array.prototype.slice.call(arguments).concat([])
);
}.bind(this),
simple: false,
size: "default",
total: __$$eval(
Expand Down Expand Up @@ -1276,6 +1302,7 @@ class FederationDetail$$Page extends React.Component {
scroll={{ scrollToFirstRowOnChange: true }}
showHeader={true}
size="default"
style={{ marginTop: "-20px" }}
/>
</Card>
</Col>
Expand Down
14 changes: 6 additions & 8 deletions src/pages/Network/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,11 @@ class Network$$Page extends React.Component {
return (
<Page>
<Row __component_name="Row" wrap={true}>
<Col __component_name="Col" span={24}>
<Col
__component_name="Col"
span={24}
style={{ paddingBottom: "12px" }}
>
<Typography.Title
__component_name="Typography.Title"
bold={true}
Expand Down Expand Up @@ -434,13 +438,7 @@ class Network$$Page extends React.Component {
gridEnable={true}
itemLayout="horizontal"
loading={__$$eval(() => this.props.useGetNetworks?.loading)}
pagination={{
position: "top",
showQuickJumper: false,
showSizeChanger: false,
simple: false,
size: "default",
}}
pagination={false}
renderItem={(item) =>
((__$$context) => (
<List.Item __component_name="List.Item">
Expand Down
Loading