mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
1 parent
2d75fd6717
commit
fe1105b60b
15 files changed
+15
-21
No files matched your search
@@ -48,7 +48,6 @@ function getSubFrames(): ClusterFrameInfo[] {
|
||||
}
|
||||
|
||||
export function broadcastMessage(channel: string, ...args: any[]) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const views = (webContents || remote?.webContents)?.getAllWebContents();
|
||||
|
||||
if (!views) return;
|
||||
|
||||
@@ -19,13 +19,14 @@
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import { app, ipcMain, remote } from "electron";
|
||||
import { ipcMain } from "electron";
|
||||
import winston, { format } from "winston";
|
||||
import type Transport from "winston-transport";
|
||||
import { consoleFormat } from "winston-console-format";
|
||||
import { isDebugging, isTestEnv } from "./vars";
|
||||
import BrowserConsole from "winston-transport-browserconsole";
|
||||
import { SentryTransport } from "./logger-transports";
|
||||
import { getPath } from "./utils/getPath";
|
||||
|
||||
const logLevel = process.env.LOG_LEVEL
|
||||
? process.env.LOG_LEVEL
|
||||
@@ -69,7 +70,7 @@ if (!isTestEnv) {
|
||||
handleExceptions: false,
|
||||
level: logLevel,
|
||||
filename: "lens.log",
|
||||
dirname: (app ?? remote?.app)?.getPath("logs"),
|
||||
dirname: getPath("logs"),
|
||||
maxsize: 16 * 1024,
|
||||
maxFiles: 16,
|
||||
tailable: true,
|
||||
|
||||
@@ -33,6 +33,5 @@ export function getPath(name: Parameters<typeof app["getPath"]>[0]): string {
|
||||
return app.getPath(name);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
return remote.app.getPath(name);
|
||||
}
|
||||
@@ -19,13 +19,13 @@
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import { app, remote } from "electron";
|
||||
import path from "path";
|
||||
import * as uuid from "uuid";
|
||||
import type { ClusterId } from "../cluster-types";
|
||||
import { getPath } from "./getPath";
|
||||
|
||||
export function storedKubeConfigFolder(): string {
|
||||
return path.resolve((app || remote.app).getPath("userData"), "kubeconfigs");
|
||||
return path.resolve(getPath("userData"), "kubeconfigs");
|
||||
}
|
||||
|
||||
export function getCustomKubeConfigPath(clusterId: ClusterId = uuid.v4()): string {
|
||||
|
||||
@@ -26,14 +26,9 @@ import { ClusterManager } from "./cluster-manager";
|
||||
import logger from "./logger";
|
||||
|
||||
export function exitApp() {
|
||||
console.log("before windowManager");
|
||||
const windowManager = WindowManager.getInstance(false);
|
||||
|
||||
console.log("before clusterManager");
|
||||
const clusterManager = ClusterManager.getInstance(false);
|
||||
|
||||
console.log("after clusterManager");
|
||||
|
||||
appEventBus.emit({ name: "service", action: "close" });
|
||||
windowManager?.hide();
|
||||
clusterManager?.stop();
|
||||
|
||||
@@ -65,7 +65,7 @@ export function createAppStorage<T>(key: string, defaultValue: T, clusterId?: st
|
||||
// bind auto-saving data changes to %storage-file.json
|
||||
reaction(
|
||||
() => toJS(storage.data),
|
||||
async (state: Record<string, any> = {}) => {
|
||||
async state => {
|
||||
logger.info(`${logPrefix} saving ${filePath}`);
|
||||
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user