waveterm/frontend/app/view/helpview/helpview.tsx
Evan Simkowitz 74cda378f8
Embed static copy of docsite for help view (#949)
This will take the latest artifact from the waveterm-docs repo and embed
it in the app binary. When the help view is launched, it will be served
from our backend. If the embedded copy doesn't exist, such as in
unpackaged versions of the app or in locally packaged versions, it will
use the hosted site instead.

There is a sibling PR in the docs repository to build the embedded
version of the app (strips out some external links, removes Algolia
DocSearch, updates the baseUrl)
https://github.com/wavetermdev/waveterm-docs/pull/46
2024-10-03 20:28:05 -07:00

31 lines
699 B
TypeScript

// Copyright 2024, Command Line Inc.
// SPDX-License-Identifier: Apache-2.0
import { getApi } from "@/app/store/global";
import { useState } from "react";
import "./helpview.less";
class HelpViewModel implements ViewModel {
viewType: string;
constructor() {
this.viewType = "help";
}
}
function makeHelpViewModel() {
return new HelpViewModel();
}
function HelpView({}: { model: HelpViewModel }) {
const [url] = useState(() => getApi().getDocsiteUrl());
console.log(url);
return (
<div className="help-view">
<webview className="docsite-webview" src={url} />
</div>
);
}
export { HelpView, HelpViewModel, makeHelpViewModel };