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