mirror of https://github.com/openspug/spug
A 便捷导航新增一些默认图标
parent
5bd1f48172
commit
33ec843fa6
|
@ -154,7 +154,6 @@ class SelfView(View):
|
||||||
Argument('wx_token', required=False),
|
Argument('wx_token', required=False),
|
||||||
).parse(request.body)
|
).parse(request.body)
|
||||||
if error is None:
|
if error is None:
|
||||||
print(form)
|
|
||||||
if form.old_password and form.new_password:
|
if form.old_password and form.new_password:
|
||||||
if request.user.type == 'ldap':
|
if request.user.type == 'ldap':
|
||||||
return json_response(error='LDAP账户无法修改密码')
|
return json_response(error='LDAP账户无法修改密码')
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 6.7 KiB |
Binary file not shown.
After Width: | Height: | Size: 8.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
|
@ -64,7 +64,7 @@ function NavIndex(props) {
|
||||||
</Col>
|
</Col>
|
||||||
{records.map(item => (
|
{records.map(item => (
|
||||||
<Col key={item.id} span={6} style={{marginBottom: 24}}>
|
<Col key={item.id} span={6} style={{marginBottom: 24}}>
|
||||||
<Card actions={[
|
<Card hoverable actions={[
|
||||||
<LeftSquareOutlined onClick={() => handleSort(item, 'up')}/>,
|
<LeftSquareOutlined onClick={() => handleSort(item, 'up')}/>,
|
||||||
<RightSquareOutlined onClick={() => handleSort(item, 'down')}/>,
|
<RightSquareOutlined onClick={() => handleSort(item, 'down')}/>,
|
||||||
<EditOutlined onClick={() => setRecord(item)}/>
|
<EditOutlined onClick={() => setRecord(item)}/>
|
||||||
|
@ -83,9 +83,10 @@ function NavIndex(props) {
|
||||||
{records.map(item => (
|
{records.map(item => (
|
||||||
<Col key={item.id} span={6} style={{marginBottom: 24}}>
|
<Col key={item.id} span={6} style={{marginBottom: 24}}>
|
||||||
<Card
|
<Card
|
||||||
|
hoverable
|
||||||
actions={item.links.map(x => <a href={x.url} rel="noopener noreferrer" target="_blank">{x.name}</a>)}>
|
actions={item.links.map(x => <a href={x.url} rel="noopener noreferrer" target="_blank">{x.name}</a>)}>
|
||||||
<Card.Meta
|
<Card.Meta
|
||||||
avatar={<Avatar src={item.logo}/>}
|
avatar={<Avatar size="large" src={item.logo}/>}
|
||||||
title={item.title}
|
title={item.title}
|
||||||
description={item.desc}/>
|
description={item.desc}/>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* Released under the AGPL-3.0 License.
|
* Released under the AGPL-3.0 License.
|
||||||
*/
|
*/
|
||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { Form, Input, Modal, Button, Upload, message } from 'antd';
|
import { Form, Input, Modal, Button, Upload, Avatar, message } from 'antd';
|
||||||
import { PlusOutlined, MinusCircleOutlined } from '@ant-design/icons';
|
import { PlusOutlined, MinusCircleOutlined } from '@ant-design/icons';
|
||||||
import { http } from 'libs';
|
import { http } from 'libs';
|
||||||
import styles from './index.module.less';
|
import styles from './index.module.less';
|
||||||
|
@ -71,6 +71,7 @@ function NavForm(props) {
|
||||||
<Form form={form} initialValues={record} labelCol={{span: 5}} wrapperCol={{span: 18}}>
|
<Form form={form} initialValues={record} labelCol={{span: 5}} wrapperCol={{span: 18}}>
|
||||||
<Form.Item required label="导航图标">
|
<Form.Item required label="导航图标">
|
||||||
<Upload
|
<Upload
|
||||||
|
accept="image/*"
|
||||||
listType="picture-card"
|
listType="picture-card"
|
||||||
fileList={fileList}
|
fileList={fileList}
|
||||||
beforeUpload={beforeUpload}
|
beforeUpload={beforeUpload}
|
||||||
|
@ -83,6 +84,14 @@ function NavForm(props) {
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Upload>
|
</Upload>
|
||||||
|
<div className={styles.imgExample}>
|
||||||
|
{['gitlab', 'gitee', 'grafana', 'prometheus', 'wiki'].map(item => (
|
||||||
|
<Avatar
|
||||||
|
key={item}
|
||||||
|
src={`/resource/${item}.png`}
|
||||||
|
onClick={() => setFileList([{uid: 0, thumbUrl: `/resource/${item}.png`}])}/>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item required name="title" label="导航标题">
|
<Form.Item required name="title" label="导航标题">
|
||||||
<Input placeholder="请输入"/>
|
<Input placeholder="请输入"/>
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
|
|
||||||
.add {
|
.add {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
height: 166px;
|
height: 167px;
|
||||||
border: 1px dashed #d9d9d9;
|
border: 1px dashed #d9d9d9;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
@ -86,7 +86,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
:global(.ant-card) {
|
:global(.ant-card) {
|
||||||
height: 166px;
|
height: 167px;
|
||||||
background-color: #fdfdfd;
|
background-color: #fdfdfd;
|
||||||
|
|
||||||
:global(.ant-card-actions) {
|
:global(.ant-card-actions) {
|
||||||
|
@ -127,4 +127,15 @@
|
||||||
|
|
||||||
.minusIcon:hover {
|
.minusIcon:hover {
|
||||||
color: #ff4d4f;
|
color: #ff4d4f;
|
||||||
|
}
|
||||||
|
|
||||||
|
.imgExample {
|
||||||
|
position: absolute;
|
||||||
|
top: 62px;
|
||||||
|
left: 130px;
|
||||||
|
|
||||||
|
:global(.ant-avatar) {
|
||||||
|
cursor: pointer;
|
||||||
|
margin-right: 12px;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue