Skip to content

Updates from conf23 #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"inquirer": "^7.3.3",
"inquirer-checkbox-plus-prompt": "^1.0.1",
"node-fetch": "^2.6.1",
"prettier": "^1.19.1",
"prettier": "^3.0.0",
"querystring": "^0.2.0",
"sharp": "^0.29.2",
"xmldoc": "^1.1.2"
Expand Down
5 changes: 3 additions & 2 deletions template/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ limitations under the License.
const fs = require('fs');
const path = require('path');
const settings = Object.assign({}, require('./package.json').dashpub.settings);
const withVideos = require('next-videos');

module.exports = {
module.exports = withVideos({
webpack(config, { buildId, webpack }) {
const snapshotPath = path.join(__dirname, 'src/pages/api/data/_snapshot.json');
if (!fs.existsSync(snapshotPath)) {
Expand All @@ -40,4 +41,4 @@ module.exports = {

return config;
},
};
});
84 changes: 31 additions & 53 deletions template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,67 +5,45 @@
"license": "UNLICENSED",
"dependencies": {
"@babel/runtime": "^7.9.2",
"@splunk/charting-bundle": "24.5.0",
"@splunk/dashboard-context": "24.5.0",
"@splunk/dashboard-core": "24.5.0",
"@splunk/dashboard-definition": "24.5.0",
"@splunk/dashboard-event-handlers": "24.5.0",
"@splunk/dashboard-icons": "24.5.0",
"@splunk/dashboard-inputs": "24.5.0",
"@splunk/dashboard-layouts": "24.5.0",
"@splunk/dashboard-presets": "24.5.0",
"@splunk/dashboard-telemetry": "24.5.0",
"@splunk/dashboard-ui": "24.5.0",
"@splunk/dashboard-utils": "24.5.0",
"@splunk/dashboard-visualizations": "24.5.0",
"@splunk/datasource-utils": "24.5.0",
"@splunk/datasources": "24.5.0",
"@splunk/react-icons": "3.2.0",
"@splunk/react-ui": "4.7.0",
"@splunk/visualization-color-palettes": "24.5.0",
"@splunk/visualization-context": "24.5.0",
"@splunk/visualization-encoding": "24.5.0",
"@splunk/visualization-encoding-parsers": "24.5.0",
"@splunk/visualization-icons": "24.5.0",
"@splunk/visualization-themes": "24.5.0",
"@splunk/visualizations": "24.5.0",
"@splunk/visualizations-shared": "24.5.0",
"@splunk/charting-bundle": "25.9.0",
"@splunk/dashboard-context": "26.0.1",
"@splunk/dashboard-core": "26.0.1",
"@splunk/dashboard-definition": "26.0.1",
"@splunk/dashboard-event-handlers": "26.0.1",
"@splunk/dashboard-icons": "26.0.1",
"@splunk/dashboard-inputs": "26.0.1",
"@splunk/dashboard-layouts": "26.0.1",
"@splunk/dashboard-presets": "26.0.1",
"@splunk/dashboard-telemetry": "26.0.1",
"@splunk/dashboard-ui": "26.0.1",
"@splunk/dashboard-utils": "26.0.1",
"@splunk/dashboard-visualizations": "25.9.0",
"@splunk/datasource-utils": "26.0.1",
"@splunk/datasources": "26.0.1",
"@splunk/react-icons": "^3.3.1",
"@splunk/react-ui": "4.16.3",
"@splunk/visualization-color-palettes": "25.8.1",
"@splunk/visualization-context": "25.8.1",
"@splunk/visualization-encoding": "25.8.1",
"@splunk/visualization-encoding-parsers": "25.8.1",
"@splunk/visualization-icons": "25.8.1",
"@splunk/visualization-themes": "25.8.1",
"@splunk/visualizations": "25.8.1",
"@splunk/visualizations-shared": "25.8.1",
"fast-text-encoding": "^1.0.2",
"fullscreen-react": "^1.0.4",
"interweave": "^13.1.0",
"next": "^9.3.6",
"prettier": "^2.0.5",
"next-videos": "^1.4.1",
"prettier": "^2.8.8",
"querystring": "^0.2.0",
"react": "16.14.0",
"react-component-rotator": "^0.1.1",
"react-dom": "16.14.0",
"react-full-screen": "^0.2.4",
"react-html-parser": "^2.0.2",
"styled-components": "^5.0.0"
},
"resolutions": {
"@splunk/charting-bundle": "24.5.0",
"@splunk/dashboard-context": "24.5.0",
"@splunk/dashboard-core": "24.5.0",
"@splunk/dashboard-definition": "24.5.0",
"@splunk/dashboard-event-handlers": "24.5.0",
"@splunk/dashboard-icons": "24.5.0",
"@splunk/dashboard-inputs": "24.5.0",
"@splunk/dashboard-layouts": "24.5.0",
"@splunk/dashboard-presets": "24.5.0",
"@splunk/dashboard-telemetry": "24.5.0",
"@splunk/dashboard-ui": "24.5.0",
"@splunk/dashboard-utils": "24.5.0",
"@splunk/dashboard-visualizations": "24.5.0",
"@splunk/datasource-utils": "24.5.0",
"@splunk/datasources": "24.5.0",
"@splunk/react-icons": "3.2.0",
"@splunk/react-ui": "4.7.0",
"@splunk/visualization-color-palettes": "24.5.0",
"@splunk/visualization-context": "24.5.0",
"@splunk/visualization-encoding": "24.5.0",
"@splunk/visualization-encoding-parsers": "24.5.0",
"@splunk/visualization-icons": "24.5.0",
"@splunk/visualization-themes": "24.5.0",
"@splunk/visualizations": "24.5.0",
"@splunk/visualizations-shared": "24.5.0"
},
"scripts": {
"dev": "next dev",
"build": "next build",
Expand Down
Binary file added template/public/video_assist_preparing.mov
Binary file not shown.
Binary file added template/public/video_inspector_running.mov
Binary file not shown.
55 changes: 40 additions & 15 deletions template/src/components/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,17 @@ limitations under the License.
*/

import { DashboardContextProvider } from '@splunk/dashboard-context';
import GeoRegistry from '@splunk/dashboard-context/GeoRegistry';
import GeoJsonProvider from '@splunk/dashboard-context/GeoJsonProvider';
import { GeoJsonProvider, GeoRegistry } from '@splunk/dashboard-context';
import DashboardCore from '@splunk/dashboard-core';
import React, { Suspense, useMemo, useEffect, useRef } from 'react';
import Loading from './loading';
import defaultPreset from '../preset';
import { SayCheese, registerScreenshotReadinessDep } from '../ready';
import { testTileConfig } from '@splunk/visualization-context/MapContext';
import Fullscreen from '@splunk/react-icons/Fullscreen';

const mapTileConfig = { defaultTileConfig: testTileConfig };


const PROD_SRC_PREFIXES = [
// Add URL prefixes here that will be replaced with the page's current origin
];
Expand Down Expand Up @@ -110,18 +109,44 @@ export default function Dashboard({ definition, preset, width = '100vw', height
};
}, []);

const toggleFullSceen = () => {
if (!document.fullscreenElement) {
document.documentElement.requestFullscreen();
document.body.style.cursor = 'none';
} else {
if (document.exitFullscreen) {
document.exitFullscreen();
}
}
};

return (
<DashboardContextProvider mapTileConfig={mapTileConfig} geoRegistry={geoRegistry} featureFlags={{ enableSvgHttpDownloader: true }}>
<Suspense fallback={<Loading />}>
<SayCheese />
<DashboardCore
preset={preset || defaultPreset}
definition={processedDef}
mode="view"
width={width}
height={height}
/>
</Suspense>
</DashboardContextProvider>
<>
<Fullscreen
style={{
position: 'fixed',
zIndex: '2',
top: 0,
left: 0,
right: 0,
bottom: 0,
color: 'black',
}}
onClick={() => toggleFullSceen()}
></Fullscreen>
<DashboardContextProvider
preset={preset || defaultPreset}
mapTileConfig={mapTileConfig}
geoRegistry={geoRegistry}
initialDefinition={processedDef}
initialMode="view"
featureFlags={{ enableSvgHttpDownloader: true, enableSmartSourceDS: true }}
>
<Suspense fallback={<Loading />}>
<SayCheese />
<DashboardCore preset={preset || defaultPreset} width={width} height={height} />
</Suspense>
</DashboardContextProvider>
</>
);
}
9 changes: 6 additions & 3 deletions template/src/components/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import React from 'react';
import styled from 'styled-components';
import { variables } from '@splunk/themes';
import dashboardManifest from '../_dashboards.json';
import Chip from '@splunk/react-ui/Chip';

const Wrapper = styled.div`
width: 100vw;
Expand All @@ -37,7 +38,8 @@ const DashLink = styled.a`
align-items: center;
justify-content: center;
text-align: center;
width: 280px;
width: 500px;

height: 80px;
border: 1px solid #eee;
margin: 10px 10px 0 0;
Expand All @@ -59,8 +61,9 @@ export default function Home({ title = 'Dashboards' }) {
<Wrapper>
<Title>Dashboards</Title>
{Object.keys(dashboardManifest).map((k) => (
<DashLink key={k} href={`/${k}`}>
{dashboardManifest[k]}
<DashLink key={k} href={`/${k.includes('timelapse') ? 'timelapse?dashboard=' + k : k}`}>
{dashboardManifest[k].replace(' - Demo', '')}&nbsp;
{dashboardManifest[k].includes('Demo') ? <Chip>Demo</Chip> : <></>}
</DashLink>
))}
</Wrapper>
Expand Down
12 changes: 11 additions & 1 deletion template/src/components/loading.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,17 @@ export default function Loading() {
return (
<Wrapper>
<Inner>
<Msg>Loading...</Msg>
<div style={{ width: '600px', margin: 'auto' }}>
{' '}
<video
autoPlay
muted
loop
width="600px"
style={{ margin: 'auto', align: 'center' }}
src={require('../../public/video_inspector_running.mov')}
/>
</div>
</Inner>
</Wrapper>
);
Expand Down
2 changes: 1 addition & 1 deletion template/src/pages/[dashboard].jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function DashboardPage({ definition, dashboardId, baseUrl }) {
description={definition.description}
imageUrl={`/screens/${dashboardId}.png`}
path={`/${dashboardId}`}
backgroundColor={definition.layout.options.backgroundColor}
backgroundColor={definition.layout.options.backgroundColor ? definition.layout.options.backgroundColor : '#000'}
theme={definition.theme}
baseUrl={baseUrl}
>
Expand Down
Loading