0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-01-06 22:40:26 -05:00

Merge branch '4.x' into 4.x-improvements-to-new-pacakge-sidebar

This commit is contained in:
Ayush Sharma 2019-02-19 23:03:48 +01:00 committed by GitHub
commit 0c449e1503
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 10 deletions

View file

@ -12,7 +12,6 @@ import express from 'express';
import { combineBaseUrl, getWebProtocol } from '../../lib/utils';
import Search from '../../lib/search';
import { HEADERS, HTTP_STATUS, WEB_TITLE } from '../../lib/constants';
import { spliceURL } from '../../utils/string';
const { securityIframe } = require('../middleware');
/* eslint new-cap:off */
@ -58,7 +57,7 @@ module.exports = function(config, auth, storage) {
const webPage = template
.replace(/ToReplaceByVerdaccio/g, base)
.replace(/ToReplaceByTitle/g, _.get(config, 'web.title') ? config.web.title : WEB_TITLE)
.replace(/ToReplaceByLogo/g, _.get(config, 'web.logo') ? config.web.logo : null)
.replace(/ToReplaceByLogo/g, _.get(config, 'web.logo') ? config.web.logo : '')
.replace(/ToReplaceByScope/g, _.get(config, 'web.scope') ? config.web.scope : '');
res.setHeader('Content-Type', 'text/html');
@ -66,16 +65,10 @@ module.exports = function(config, auth, storage) {
res.send(webPage);
}
router.get('/-/web/:pkg', function(req, res) {
router.get('/-/web/:section/*', function(req, res) {
renderHTML(req, res);
});
router.get('/-/verdaccio/logo', function(req, res) {
const installPath = _.get(config, 'url_prefix', '');
res.send(_.get(config, 'web.logo') || spliceURL(installPath, '/-/static/logo.png'));
});
router.get('/', function(req, res) {
renderHTML(req, res);
});

View file

@ -127,7 +127,7 @@ class Header extends Component<IProps, IState> {
renderLogo = (): Node => {
const { logo } = this.props;
if (logo) {
if (logo !== '') {
return <img alt={'logo'} height={'40px'} src={logo} />;
} else {
return <Logo />;