mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-08 19:38:51 +01:00
74cda378f8
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
31 lines
699 B
TypeScript
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 };
|