mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
added dummy react files for replacing vue-components
Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
parent
1f26f0b3a7
commit
434f26f17f
@ -12,7 +12,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "concurrently -k \"yarn dev-run -C\" \"yarn dev:main\" \"yarn dev:renderer\"",
|
||||
"dev-run": "env DEBUG=true nodemon --watch out/main.* --exec \"electron --inspect .\" $@",
|
||||
"dev-run": "nodemon --watch out/main.* --exec \"electron --inspect .\" $@",
|
||||
"dev:main": "env DEBUG=true yarn compile:main --watch $@",
|
||||
"dev:renderer": "env DEBUG=true yarn compile:renderer --watch $@",
|
||||
"compile": "concurrently \"yarn i18n:compile\" \"yarn compile:main -p\" \"yarn compile:renderer -p\"",
|
||||
|
||||
@ -18,7 +18,6 @@ export interface BaseStoreParams<T = any> {
|
||||
export class BaseStore<T = any> extends Singleton {
|
||||
protected storeConfig: Config<T>;
|
||||
protected syncDisposers: Function[] = [];
|
||||
public whenLoaded = when(() => this.isLoaded);
|
||||
|
||||
@observable isLoaded = false;
|
||||
@observable protected data: T;
|
||||
@ -26,7 +25,7 @@ export class BaseStore<T = any> extends Singleton {
|
||||
protected constructor(protected params: BaseStoreParams) {
|
||||
super();
|
||||
this.params = {
|
||||
autoLoad: !app, // disabled in main process due delayed configuration
|
||||
autoLoad: false,
|
||||
syncEnabled: true,
|
||||
...params,
|
||||
}
|
||||
@ -50,7 +49,7 @@ export class BaseStore<T = any> extends Singleton {
|
||||
await this.load();
|
||||
}
|
||||
if (this.params.syncEnabled) {
|
||||
await this.whenLoaded;
|
||||
await when(() => this.isLoaded);
|
||||
this.enableSync();
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
import "../common/system-ca"
|
||||
import "../common/prometheus-providers"
|
||||
import { app, dialog } from "electron"
|
||||
import { appName, appProto, isDevelopment, isMac, staticDir, staticProto } from "../common/vars";
|
||||
import { appName, appProto, isMac, staticDir, staticProto } from "../common/vars";
|
||||
import path from "path"
|
||||
import { format as formatUrl } from "url"
|
||||
import initMenu from "./menu"
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
// todo: remove, currently not used in runtime
|
||||
|
||||
import "../../common/system-ca"
|
||||
import "./assets/css/app.scss"
|
||||
import { PromiseIpc } from 'electron-promise-ipc'
|
||||
@ -6,9 +8,6 @@ import BootstrapVue from 'bootstrap-vue'
|
||||
import App from './App'
|
||||
import router from './router'
|
||||
import store from './store'
|
||||
import { userStore } from "../../common/user-store"
|
||||
import { workspaceStore } from "../../common/workspace-store"
|
||||
import { clusterStore } from "../../common/cluster-store"
|
||||
|
||||
const promiseIpc = new PromiseIpc({maxTimeoutMs: 6000});
|
||||
|
||||
@ -26,12 +25,6 @@ Vue.mixin({
|
||||
})
|
||||
|
||||
setTimeout(async () => {
|
||||
await Promise.all([
|
||||
userStore.whenLoaded,
|
||||
workspaceStore.whenLoaded,
|
||||
clusterStore.whenLoaded,
|
||||
]);
|
||||
|
||||
await store.dispatch('init')
|
||||
new Vue({
|
||||
components: {App},
|
||||
|
||||
10
src/renderer/components/+clusters/add-cluster.tsx
Normal file
10
src/renderer/components/+clusters/add-cluster.tsx
Normal file
@ -0,0 +1,10 @@
|
||||
import React from "react";
|
||||
|
||||
interface Props {
|
||||
}
|
||||
|
||||
export class AddCluster extends React.Component {
|
||||
render() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
10
src/renderer/components/+clusters/cluster-settings.tsx
Normal file
10
src/renderer/components/+clusters/cluster-settings.tsx
Normal file
@ -0,0 +1,10 @@
|
||||
import React from "react";
|
||||
|
||||
interface Props {
|
||||
}
|
||||
|
||||
export class ClusterSettings extends React.Component {
|
||||
render() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
10
src/renderer/components/+clusters/clusters-menu.tsx
Normal file
10
src/renderer/components/+clusters/clusters-menu.tsx
Normal file
@ -0,0 +1,10 @@
|
||||
import React from "react";
|
||||
|
||||
interface Props {
|
||||
}
|
||||
|
||||
export class ClusterSettings extends React.Component {
|
||||
render() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
26
src/renderer/components/+clusters/clusters.tsx
Normal file
26
src/renderer/components/+clusters/clusters.tsx
Normal file
@ -0,0 +1,26 @@
|
||||
import React from "react";
|
||||
import { userStore } from "../../../common/user-store";
|
||||
import { workspaceStore } from "../../../common/workspace-store";
|
||||
import { clusterStore } from "../../../common/cluster-store";
|
||||
|
||||
interface Props {
|
||||
}
|
||||
|
||||
export class Clusters extends React.Component {
|
||||
static async init(){
|
||||
// todo: move to App.init()
|
||||
await Promise.all([
|
||||
userStore.load(),
|
||||
workspaceStore.load(),
|
||||
clusterStore.load(),
|
||||
]);
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="Clusters">
|
||||
Clusters page
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
1
src/renderer/components/+clusters/index.tsx
Normal file
1
src/renderer/components/+clusters/index.tsx
Normal file
@ -0,0 +1 @@
|
||||
export * from "./clusters"
|
||||
0
src/renderer/components/+landing-page/index.tsx
Normal file
0
src/renderer/components/+landing-page/index.tsx
Normal file
0
src/renderer/components/+preferences/index.tsx
Normal file
0
src/renderer/components/+preferences/index.tsx
Normal file
0
src/renderer/components/+whats-new/index.tsx
Normal file
0
src/renderer/components/+whats-new/index.tsx
Normal file
0
src/renderer/components/+workspaces/index.tsx
Normal file
0
src/renderer/components/+workspaces/index.tsx
Normal file
0
src/renderer/components/+workspaces/workspaces.tsx
Normal file
0
src/renderer/components/+workspaces/workspaces.tsx
Normal file
@ -1,19 +1,11 @@
|
||||
import React from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
import "../common/system-ca"
|
||||
import { userStore } from "../common/user-store";
|
||||
import { workspaceStore } from "../common/workspace-store";
|
||||
import { clusterStore } from "../common/cluster-store";
|
||||
// import { App } from "./components/app";
|
||||
import { Clusters } from "./components/+clusters";
|
||||
|
||||
async function render() {
|
||||
await Promise.all([
|
||||
userStore.whenLoaded,
|
||||
workspaceStore.whenLoaded,
|
||||
clusterStore.whenLoaded,
|
||||
]);
|
||||
|
||||
// App.init();
|
||||
document.getElementById("app").innerHTML = "<p>Hello from renderer!</p>"
|
||||
await Clusters.init();
|
||||
ReactDOM.render(<Clusters/>, document.getElementById("app"),)
|
||||
}
|
||||
|
||||
// run
|
||||
render();
|
||||
window.addEventListener("load", render);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user