未验证 提交 f7dbdbb3 编写于 作者: P Peter Pan 提交者: GitHub

fix: graph export style missing (#665)

* fix: graph export style missing

* bump 2.0.0-beta.6

* build: use stable channel of rust toolchain
上级 991d012e
......@@ -110,7 +110,7 @@ const Navbar: FunctionComponent = () => {
if (process.env.API_TOKEN_KEY) {
const id = getApiToken();
if (id) {
path += `?${process.env.API_TOKEN_KEY}=${id}`;
path += `?${process.env.API_TOKEN_KEY}=${encodeURIComponent(id)}`;
}
}
return path;
......
import App, {AppContext, AppProps} from 'next/app';
import {GlobalStyle, iconFontPath} from '~/utils/style';
import {Router, appWithTranslation} from '~/utils/i18n';
import {fetcher, getApiToken, setApiToken} from '~/utils/fetch';
import {GlobalStyle} from '~/utils/style';
import Head from 'next/head';
import Layout from '~/components/Layout';
import NProgress from 'nprogress';
import Preloader from '~/components/Preloader';
import React from 'react';
import {SWRConfig} from 'swr';
import {ToastContainer} from 'react-toastify';
......@@ -52,9 +51,6 @@ class VDLApp extends App {
return (
<>
{['ttf', 'woff', 'svg'].map(ext => (
<Preloader url={`${iconFontPath}.${ext}`} as="font" key={ext} />
))}
<Head>
<title>{process.env.title}</title>
<link rel="shortcut icon" href={`${process.env.PUBLIC_PATH}/favicon.ico`} />
......
......@@ -695,7 +695,7 @@ view.View = class {
if (this._activeGraph && (extension == 'png' || extension == 'svg')) {
const graphElement = this._host.document.getElementById('canvas');
const exportElement = graphElement.cloneNode(true);
this.applyStyleSheet(exportElement, 'view-grapher.css');
this.applyStyleSheet(exportElement, 'style.css');
exportElement.setAttribute('id', 'export');
exportElement.removeAttribute('width');
exportElement.removeAttribute('height');
......
......@@ -35,12 +35,6 @@ module.exports = {
name: 'vendors',
test: /[\\/]node_modules[\\/](?!netron)/,
chunks: 'all'
},
styles: {
name: 'styles',
test: /\.scss$/,
chunks: 'all',
enforce: true
}
}
}
......@@ -58,8 +52,7 @@ module.exports = {
pako: 'pako'
}),
new MiniCssExtractPlugin({
filename: '[name].[contenthash].css',
chunkFilename: '[id].[contenthash].css'
filename: '[name].css'
}),
new HtmlWebpackPlugin({
filename: 'index.html',
......
......@@ -38,7 +38,13 @@ async function start() {
if (backend) {
const {createProxyMiddleware} = await import('http-proxy-middleware');
server.use(config.env.API_URL, createProxyMiddleware({target: backend, changeOrigin: true}));
server.use(
config.env.API_URL,
createProxyMiddleware({
target: backend,
changeOrigin: true
})
);
} else if (isDev) {
const {default: mock} = await import('@visualdl/mock');
server.use(config.env.API_URL, mock({delay: delay ? () => Math.random() * delay : 0}));
......
......@@ -55,7 +55,7 @@ console_error_panic_hook = "0.1.6"
# These crates are used for running unit tests.
[dev-dependencies]
wasm-bindgen-test = "0.3.6"
futures = "0.3.4"
futures = "0.3.5"
js-sys = "0.3.36"
wasm-bindgen-futures = "0.4.9"
......
......@@ -5,7 +5,7 @@ set -e
# rust toolchain
# https://rustup.rs/
if ! hash rustup 2>/dev/null; then
curl https://sh.rustup.rs -sSf | sh -s -- --no-modify-path --default-toolchain nightly -y
curl https://sh.rustup.rs -sSf | sh -s -- --no-modify-path -y
PATH="$HOME/.cargo/bin:$PATH"
fi
......
......@@ -13,4 +13,4 @@
# limitations under the License.
# =======================================================================
vdl_version = '2.0.0-beta.4'
vdl_version = '2.0.0-beta.6'
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册