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": {
|
"scripts": {
|
||||||
"dev": "concurrently -k \"yarn dev-run -C\" \"yarn dev:main\" \"yarn dev:renderer\"",
|
"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:main": "env DEBUG=true yarn compile:main --watch $@",
|
||||||
"dev:renderer": "env DEBUG=true yarn compile:renderer --watch $@",
|
"dev:renderer": "env DEBUG=true yarn compile:renderer --watch $@",
|
||||||
"compile": "concurrently \"yarn i18n:compile\" \"yarn compile:main -p\" \"yarn compile:renderer -p\"",
|
"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 {
|
export class BaseStore<T = any> extends Singleton {
|
||||||
protected storeConfig: Config<T>;
|
protected storeConfig: Config<T>;
|
||||||
protected syncDisposers: Function[] = [];
|
protected syncDisposers: Function[] = [];
|
||||||
public whenLoaded = when(() => this.isLoaded);
|
|
||||||
|
|
||||||
@observable isLoaded = false;
|
@observable isLoaded = false;
|
||||||
@observable protected data: T;
|
@observable protected data: T;
|
||||||
@ -26,7 +25,7 @@ export class BaseStore<T = any> extends Singleton {
|
|||||||
protected constructor(protected params: BaseStoreParams) {
|
protected constructor(protected params: BaseStoreParams) {
|
||||||
super();
|
super();
|
||||||
this.params = {
|
this.params = {
|
||||||
autoLoad: !app, // disabled in main process due delayed configuration
|
autoLoad: false,
|
||||||
syncEnabled: true,
|
syncEnabled: true,
|
||||||
...params,
|
...params,
|
||||||
}
|
}
|
||||||
@ -50,7 +49,7 @@ export class BaseStore<T = any> extends Singleton {
|
|||||||
await this.load();
|
await this.load();
|
||||||
}
|
}
|
||||||
if (this.params.syncEnabled) {
|
if (this.params.syncEnabled) {
|
||||||
await this.whenLoaded;
|
await when(() => this.isLoaded);
|
||||||
this.enableSync();
|
this.enableSync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
import "../common/system-ca"
|
import "../common/system-ca"
|
||||||
import "../common/prometheus-providers"
|
import "../common/prometheus-providers"
|
||||||
import { app, dialog } from "electron"
|
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 path from "path"
|
||||||
import { format as formatUrl } from "url"
|
import { format as formatUrl } from "url"
|
||||||
import initMenu from "./menu"
|
import initMenu from "./menu"
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
// todo: remove, currently not used in runtime
|
||||||
|
|
||||||
import "../../common/system-ca"
|
import "../../common/system-ca"
|
||||||
import "./assets/css/app.scss"
|
import "./assets/css/app.scss"
|
||||||
import { PromiseIpc } from 'electron-promise-ipc'
|
import { PromiseIpc } from 'electron-promise-ipc'
|
||||||
@ -6,9 +8,6 @@ import BootstrapVue from 'bootstrap-vue'
|
|||||||
import App from './App'
|
import App from './App'
|
||||||
import router from './router'
|
import router from './router'
|
||||||
import store from './store'
|
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});
|
const promiseIpc = new PromiseIpc({maxTimeoutMs: 6000});
|
||||||
|
|
||||||
@ -26,12 +25,6 @@ Vue.mixin({
|
|||||||
})
|
})
|
||||||
|
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
await Promise.all([
|
|
||||||
userStore.whenLoaded,
|
|
||||||
workspaceStore.whenLoaded,
|
|
||||||
clusterStore.whenLoaded,
|
|
||||||
]);
|
|
||||||
|
|
||||||
await store.dispatch('init')
|
await store.dispatch('init')
|
||||||
new Vue({
|
new Vue({
|
||||||
components: {App},
|
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 "../common/system-ca"
|
||||||
import { userStore } from "../common/user-store";
|
import { Clusters } from "./components/+clusters";
|
||||||
import { workspaceStore } from "../common/workspace-store";
|
|
||||||
import { clusterStore } from "../common/cluster-store";
|
|
||||||
// import { App } from "./components/app";
|
|
||||||
|
|
||||||
async function render() {
|
async function render() {
|
||||||
await Promise.all([
|
await Clusters.init();
|
||||||
userStore.whenLoaded,
|
ReactDOM.render(<Clusters/>, document.getElementById("app"),)
|
||||||
workspaceStore.whenLoaded,
|
|
||||||
clusterStore.whenLoaded,
|
|
||||||
]);
|
|
||||||
|
|
||||||
// App.init();
|
|
||||||
document.getElementById("app").innerHTML = "<p>Hello from renderer!</p>"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// run
|
window.addEventListener("load", render);
|
||||||
render();
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user