mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
Add application logo.
This commit is contained in:
parent
b13ec27981
commit
6459926a0f
@ -25,6 +25,7 @@ type Application struct {
|
|||||||
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
|
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
|
||||||
|
|
||||||
DisplayName string `xorm:"varchar(100)" json:"displayName"`
|
DisplayName string `xorm:"varchar(100)" json:"displayName"`
|
||||||
|
Logo string `xorm:"varchar(100)" json:"logo"`
|
||||||
Providers []string `xorm:"varchar(100)" json:"providers"`
|
Providers []string `xorm:"varchar(100)" json:"providers"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import {Button, Card, Col, Input, Row, Select} from 'antd';
|
import {AutoComplete, Button, Card, Col, Input, Row, Select} from 'antd';
|
||||||
import {LinkOutlined} from "@ant-design/icons";
|
import {LinkOutlined} from "@ant-design/icons";
|
||||||
import * as ApplicationBackend from "./backend/ApplicationBackend";
|
import * as ApplicationBackend from "./backend/ApplicationBackend";
|
||||||
import * as Setting from "./Setting";
|
import * as Setting from "./Setting";
|
||||||
@ -86,6 +86,33 @@ class ApplicationEditPage extends React.Component {
|
|||||||
}} />
|
}} />
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
<Row style={{marginTop: '20px'}} >
|
||||||
|
<Col style={{marginTop: '5px'}} span={2}>
|
||||||
|
Logo:
|
||||||
|
</Col>
|
||||||
|
<Col span={22} >
|
||||||
|
<Row style={{marginTop: '20px'}} >
|
||||||
|
<Col style={{marginTop: '5px'}} span={1}>
|
||||||
|
URL:
|
||||||
|
</Col>
|
||||||
|
<Col span={23} >
|
||||||
|
<Input prefix={<LinkOutlined/>} value={this.state.application.logo} onChange={e => {
|
||||||
|
this.updateApplicationField('logo', e.target.value);
|
||||||
|
}} />
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
<Row style={{marginTop: '20px'}} >
|
||||||
|
<Col style={{marginTop: '5px'}} span={1}>
|
||||||
|
Preview:
|
||||||
|
</Col>
|
||||||
|
<Col span={23} >
|
||||||
|
<a target="_blank" href={this.state.application.logo}>
|
||||||
|
<img src={this.state.application.logo} alt={this.state.application.logo} height={90} style={{marginBottom: '20px'}}/>
|
||||||
|
</a>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
<Row style={{marginTop: '20px'}} >
|
<Row style={{marginTop: '20px'}} >
|
||||||
<Col style={{marginTop: '5px'}} span={2}>
|
<Col style={{marginTop: '5px'}} span={2}>
|
||||||
Providers:
|
Providers:
|
||||||
|
@ -32,6 +32,7 @@ class ApplicationListPage extends React.Component {
|
|||||||
name: `application_${this.state.applications.length}`,
|
name: `application_${this.state.applications.length}`,
|
||||||
createdTime: moment().format(),
|
createdTime: moment().format(),
|
||||||
displayName: `New Application - ${this.state.applications.length}`,
|
displayName: `New Application - ${this.state.applications.length}`,
|
||||||
|
logo: "https://cdn.jsdelivr.net/gh/casbin/static/img/logo@2x.png",
|
||||||
providers: [],
|
providers: [],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -96,6 +97,21 @@ class ApplicationListPage extends React.Component {
|
|||||||
// width: '100px',
|
// width: '100px',
|
||||||
sorter: (a, b) => a.displayName.localeCompare(b.displayName),
|
sorter: (a, b) => a.displayName.localeCompare(b.displayName),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: 'Logo',
|
||||||
|
dataIndex: 'logo',
|
||||||
|
key: 'logo',
|
||||||
|
width: '100px',
|
||||||
|
render: (text, record, index) => {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<a target="_blank" href={text}>
|
||||||
|
<img src={text} alt={text} width={150} style={{marginBottom: '20px'}}/>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: 'Providers',
|
title: 'Providers',
|
||||||
dataIndex: 'providers',
|
dataIndex: 'providers',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user