Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/cubejs-playground/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class App extends Component<PropsWithChildren<RouteComponentProps>, AppState> {
});
});

const res = await fetch('/playground/context');
const res = await fetch('playground/context');
const context = await res.json();

setTelemetry(context.telemetry);
Expand Down Expand Up @@ -112,7 +112,7 @@ class App extends Component<PropsWithChildren<RouteComponentProps>, AppState> {
<LivePreviewContextProvider
disabled={!context?.livePreview}
>
<Root styles={ROOT_STYLES}>
<Root publicUrl="." styles={ROOT_STYLES}>
<GlobalStyles />

<Header selectedKeys={[location.pathname]} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const useLivePreview = (disabled = false) => {
// }, [status]);

const fetchStatus = () => {
return fetch('/playground/live-preview/status')
return fetch('playground/live-preview/status')
.then((res) => res.json())
.then((status) => {
setStatus({
Expand All @@ -81,7 +81,7 @@ const useLivePreview = (disabled = false) => {
};

const createTokenWithPayload = async (payload): Promise<any> => {
const res = await fetch('/playground/live-preview/token', {
const res = await fetch('playground/live-preview/token', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand All @@ -108,7 +108,7 @@ const useLivePreview = (disabled = false) => {
statusLivePreview: status,
createTokenWithPayload,
stopLivePreview: async (): Promise<Boolean> => {
await fetch('/playground/live-preview/stop');
await fetch('playground/live-preview/stop');
await fetchStatus();
return true;
},
Expand Down
2 changes: 1 addition & 1 deletion packages/cubejs-playground/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async function onTokenPayloadChange(payload: Record<string, any>, token) {
return token;
}

const response = await fetch('/playground/token', {
const response = await fetch('playground/token', {
method: 'post',
headers: {
'Content-Type': 'application/json',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ async function testConnection(variables: Record<string, string>) {
}

async function saveConnection(variables: Record<string, string>) {
await fetch('/playground/env', {
await fetch('playground/env', {
method: 'post',
headers: {
'Content-Type': 'application/json',
Expand Down Expand Up @@ -174,7 +174,7 @@ export function ConnectionWizardPage({ history }) {
}

{
const response = await fetch('/playground/driver', {
const response = await fetch('playground/driver', {
method: 'post',
headers: {
'Content-Type': 'application/json',
Expand Down
2 changes: 1 addition & 1 deletion packages/cubejs-playground/src/pages/Index/IndexPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function IndexPage() {

useEffect(() => {
async function loadFiles() {
const res = await fetch('/playground/files');
const res = await fetch('playground/files');
const result = await res.json();

if (result.error?.includes('Model files not found')) {
Expand Down
6 changes: 3 additions & 3 deletions packages/cubejs-playground/src/pages/Schema/SchemaPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class SchemaPage extends Component<SchemaPageProps, any> {
async loadDBSchema() {
this.setState({ schemaLoading: true });
try {
const res = await playgroundFetch('/playground/db-schema');
const res = await playgroundFetch('playground/db-schema');
const result = await res.json();
this.setState({
tablesSchema: result.tablesSchema,
Expand All @@ -91,7 +91,7 @@ export class SchemaPage extends Component<SchemaPageProps, any> {
}

async loadFiles() {
const res = await playgroundFetch('/playground/files');
const res = await playgroundFetch('playground/files');
const result = await res.json();
this.setState({
files: result.files,
Expand All @@ -106,7 +106,7 @@ export class SchemaPage extends Component<SchemaPageProps, any> {
const options = { format };

playgroundAction('Generate Schema', options);
const res = await playgroundFetch('/playground/generate-schema', {
const res = await playgroundFetch('playground/generate-schema', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down
1 change: 1 addition & 0 deletions packages/cubejs-playground/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import react from '@vitejs/plugin-react';
import environmentPlugin from 'vite-plugin-environment';

export default defineConfig(({ mode }) => ({
base: './',
build: {
outDir: 'build',
target: 'es2018',
Expand Down