mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-20 22:52:46 -05:00
commit
e81d50162f
2 changed files with 16 additions and 6 deletions
|
@ -32,9 +32,8 @@ module.exports = function(config, auth, storage) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
router.get('/-/logo', function(req, res) {
|
router.get('/-/verdaccio/logo', function(req, res) {
|
||||||
res.sendFile(_.get(config, 'web.logo') || `${env.APP_ROOT}/static/logo-sm.png`
|
res.send(_.get(config, 'web.logo') || '/-/static/logo.png');
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
router.get('/', function(req, res) {
|
router.get('/', function(req, res) {
|
||||||
|
|
|
@ -10,13 +10,14 @@ import storage from '../../../utils/storage';
|
||||||
|
|
||||||
|
|
||||||
import classes from './header.scss';
|
import classes from './header.scss';
|
||||||
import logo from './logo.png';
|
import './logo.png';
|
||||||
|
|
||||||
export default class Header extends React.Component {
|
export default class Header extends React.Component {
|
||||||
state = {
|
state = {
|
||||||
showLogin: false,
|
showLogin: false,
|
||||||
username: '',
|
username: '',
|
||||||
password: ''
|
password: '',
|
||||||
|
logo: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
@ -37,6 +38,16 @@ export default class Header extends React.Component {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentWillMount() {
|
||||||
|
API.get('logo')
|
||||||
|
.then((response) => {
|
||||||
|
this.setState({logo: response.data});
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
throw new Error(error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async handleSubmit() {
|
async handleSubmit() {
|
||||||
if (this.state.username === '' || this.state.password === '') {
|
if (this.state.username === '' || this.state.password === '') {
|
||||||
return MessageBox.alert('Username or password can\'t be empty!', '');
|
return MessageBox.alert('Username or password can\'t be empty!', '');
|
||||||
|
@ -120,7 +131,7 @@ export default class Header extends React.Component {
|
||||||
<header className={ classes.header }>
|
<header className={ classes.header }>
|
||||||
<div className={ classes.headerWrap }>
|
<div className={ classes.headerWrap }>
|
||||||
<Link to="/">
|
<Link to="/">
|
||||||
<img src={ logo } className={ classes.logo } />
|
<img src={ this.state.logo } className={ classes.logo } />
|
||||||
</Link>
|
</Link>
|
||||||
<figure>
|
<figure>
|
||||||
npm set registry { location.origin }
|
npm set registry { location.origin }
|
||||||
|
|
Loading…
Add table
Reference in a new issue