From c75b640b7a071c03e88f40c53839e96a165eb3ef Mon Sep 17 00:00:00 2001 From: hexxa Date: Sat, 20 Nov 2021 21:52:55 +0800 Subject: [PATCH] fix(pane-admin): unify styles --- public/static/css/white.css | 15 +- src/client/web/src/components/pane_admin.tsx | 210 +++++++++---------- 2 files changed, 105 insertions(+), 120 deletions(-) diff --git a/public/static/css/white.css b/public/static/css/white.css index 84cded2..8f0ab61 100644 --- a/public/static/css/white.css +++ b/public/static/css/white.css @@ -43,11 +43,8 @@ border-radius: 0.6rem; } -.theme-default #panes #title-container { - padding: 2rem; -} - .theme-default #panes .container { + padding: 2rem; background-color: white; margin: 3rem auto 1rem auto; border-radius: 0.6rem; @@ -109,6 +106,16 @@ line-height: 1.8rem; } +.theme-default .user-form { + border: dashed 2px #ccc; + padding: 1rem; + margin-top: 1rem; +} + +.theme-default .role-list-item { + margin: 0 auto 1rem 0; +} + .theme-default .wide-input { width: 20rem; } diff --git a/src/client/web/src/components/pane_admin.tsx b/src/client/web/src/components/pane_admin.tsx index e0918a5..91a7f2c 100644 --- a/src/client/web/src/components/pane_admin.tsx +++ b/src/client/web/src/components/pane_admin.tsx @@ -152,25 +152,21 @@ export class UserForm extends React.Component< render() { return ( -
+
- - {this.props.msg.pkg.get("user.name")} {this.props.name} - -  /  - - {this.props.msg.pkg.get("user.id")} {this.props.id} - +
+ {`${this.props.msg.pkg.get("user.name")}: `} + {this.props.name} +
+
+ {`${this.props.msg.pkg.get("user.id")}: `} + {this.props.id} +
, - , ])} @@ -182,13 +178,13 @@ export class UserForm extends React.Component< ])} /> -
+
- -
+ +
{this.props.msg.pkg.get("user.role")}
- -
+ +
{`${this.props.msg.pkg.get("spaceLimit")} (${FileSize( parseInt(this.state.quota.spaceLimit, 10), { round: 0 } @@ -213,13 +208,12 @@ export class UserForm extends React.Component< type="number" onChange={this.changeSpaceLimit} value={this.state.quota.spaceLimit} - className="black0-font margin-r-m" placeholder={`${this.state.quota.spaceLimit}`} /> - -
+ +
{`${this.props.msg.pkg.get("uploadLimit")} (${FileSize( this.state.quota.uploadSpeedLimit, { round: 0 } @@ -230,13 +224,12 @@ export class UserForm extends React.Component< type="number" onChange={this.changeUploadSpeedLimit} value={this.state.quota.uploadSpeedLimit} - className="black0-font margin-r-m" placeholder={`${this.state.quota.uploadSpeedLimit}`} /> - -
+ +
{`${this.props.msg.pkg.get("downloadLimit")} (${FileSize( this.state.quota.downloadSpeedLimit, { round: 0 } @@ -247,13 +240,12 @@ export class UserForm extends React.Component< type="number" onChange={this.changeDownloadSpeedLimit} value={this.state.quota.downloadSpeedLimit} - className="black0-font margin-r-m" placeholder={`${this.state.quota.downloadSpeedLimit}`} />
, - , ])} @@ -266,34 +258,40 @@ export class UserForm extends React.Component< ])} /> -
+
-
- {this.props.msg.pkg.get("user.password")} +
+
+ {this.props.msg.pkg.get("settings.pwd.new1")} +
+ +
- - +
+
+ {this.props.msg.pkg.get("settings.pwd.new2")} +
+ +
, - , ])} @@ -303,7 +301,6 @@ export class UserForm extends React.Component< justifyContent: "flex-end", }, ])} - className="margin-t-m" />
); @@ -362,12 +359,7 @@ export class AdminPane extends React.Component { }; delRole = async (role: string) => { - if ( - !confirmMsg( - // "After deleting this role, some of users may not be able to login." - this.props.msg.pkg.get("role.delete.warning") - ) - ) { + if (!confirmMsg(this.props.msg.pkg.get("role.delete.warning"))) { return; } @@ -424,7 +416,7 @@ export class AdminPane extends React.Component { render() { const userList = this.props.admin.users.valueSeq().map((user: User) => { return ( -
+
{ const roleList = this.props.admin.roles.valueSeq().map((role: string) => { return ( -
-
- {role} -
-
- -
+
+ {role}, + , + ])} + childrenStyles={List([{}, { justifyContent: "flex-end" }])} + />
); }); return (
-
+
{ />
-
+
{this.props.msg.pkg.get("user.add")}, - , +
{this.props.msg.pkg.get("user.add")}
, + , ])} - className="title-m bold margin-b-m" + childrenStyles={List([{}, { justifyContent: "flex-end" }])} /> - -
- {this.props.msg.pkg.get("user.name")} -
+ +
{this.props.msg.pkg.get("user.name")}
- -
- {this.props.msg.pkg.get("user.role")} -
+ +
{this.props.msg.pkg.get("user.role")}
- -
+ +
{this.props.msg.pkg.get("settings.pwd.new1")}
- -
+ +
{this.props.msg.pkg.get("settings.pwd.new2")}
- - - -
-
+
{this.props.msg.pkg.get("admin.users")}, +
+ {this.props.msg.pkg.get("admin.users")} +
, , ])} - className="title-m bold margin-b-m" /> {userList}
-
+
{this.props.msg.pkg.get("role.add")}, +
{this.props.msg.pkg.get("role.add")}
, , ])} - className="title-m bold margin-b-m" /> - - , - , ])} @@ -577,14 +554,15 @@ export class AdminPane extends React.Component { />
-
+
{this.props.msg.pkg.get("admin.roles")}, +
+ {this.props.msg.pkg.get("admin.roles")} +
, , ])} - className="title-m bold margin-b-m" /> {roleList}