mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add support for customizing the extension install registry URL (#4503)
This commit is contained in:
parent
a711499bb6
commit
78678bdf2f
@ -306,6 +306,36 @@ const updateChannel: PreferenceDescription<string> = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export enum ExtensionRegistryLocation {
|
||||||
|
DEFAULT = "default",
|
||||||
|
NPMRC = "npmrc",
|
||||||
|
CUSTOM = "custom",
|
||||||
|
}
|
||||||
|
export type ExtensionRegistry = {
|
||||||
|
location: ExtensionRegistryLocation.DEFAULT | ExtensionRegistryLocation.NPMRC;
|
||||||
|
customUrl?: undefined;
|
||||||
|
} | {
|
||||||
|
location: ExtensionRegistryLocation.CUSTOM,
|
||||||
|
customUrl: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const defaultExtensionRegistryUrl = "https://registry.npmjs.org";
|
||||||
|
|
||||||
|
const extensionRegistryUrl: PreferenceDescription<ExtensionRegistry> = {
|
||||||
|
fromStore(val) {
|
||||||
|
return val ?? {
|
||||||
|
location: ExtensionRegistryLocation.DEFAULT,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
toStore(val) {
|
||||||
|
if (val.location === ExtensionRegistryLocation.DEFAULT) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
return val;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
type PreferencesModelType<field extends keyof typeof DESCRIPTORS> = typeof DESCRIPTORS[field] extends PreferenceDescription<infer T, any> ? T : never;
|
type PreferencesModelType<field extends keyof typeof DESCRIPTORS> = typeof DESCRIPTORS[field] extends PreferenceDescription<infer T, any> ? T : never;
|
||||||
type UserStoreModelType<field extends keyof typeof DESCRIPTORS> = typeof DESCRIPTORS[field] extends PreferenceDescription<any, infer T> ? T : never;
|
type UserStoreModelType<field extends keyof typeof DESCRIPTORS> = typeof DESCRIPTORS[field] extends PreferenceDescription<any, infer T> ? T : never;
|
||||||
|
|
||||||
@ -335,6 +365,7 @@ export const DESCRIPTORS = {
|
|||||||
editorConfiguration,
|
editorConfiguration,
|
||||||
terminalCopyOnSelect,
|
terminalCopyOnSelect,
|
||||||
updateChannel,
|
updateChannel,
|
||||||
|
extensionRegistryUrl,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const CONSTANTS = {
|
export const CONSTANTS = {
|
||||||
|
|||||||
@ -29,7 +29,7 @@ import { kubeConfigDefaultPath } from "../kube-helpers";
|
|||||||
import { appEventBus } from "../event-bus";
|
import { appEventBus } from "../event-bus";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import { ObservableToggleSet, toJS } from "../../renderer/utils";
|
import { ObservableToggleSet, toJS } from "../../renderer/utils";
|
||||||
import { DESCRIPTORS, EditorConfiguration, KubeconfigSyncValue, UserPreferencesModel } from "./preferences-helpers";
|
import { DESCRIPTORS, EditorConfiguration, ExtensionRegistry, KubeconfigSyncValue, UserPreferencesModel } from "./preferences-helpers";
|
||||||
import logger from "../../main/logger";
|
import logger from "../../main/logger";
|
||||||
import { AppPaths } from "../app-paths";
|
import { AppPaths } from "../app-paths";
|
||||||
|
|
||||||
@ -75,6 +75,7 @@ export class UserStore extends BaseStore<UserStoreModel> /* implements UserStore
|
|||||||
@observable kubectlBinariesPath?: string;
|
@observable kubectlBinariesPath?: string;
|
||||||
@observable terminalCopyOnSelect: boolean;
|
@observable terminalCopyOnSelect: boolean;
|
||||||
@observable updateChannel?: string;
|
@observable updateChannel?: string;
|
||||||
|
@observable extensionRegistryUrl: ExtensionRegistry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Download kubectl binaries matching cluster version
|
* Download kubectl binaries matching cluster version
|
||||||
@ -201,6 +202,7 @@ export class UserStore extends BaseStore<UserStoreModel> /* implements UserStore
|
|||||||
this.editorConfiguration = DESCRIPTORS.editorConfiguration.fromStore(preferences?.editorConfiguration);
|
this.editorConfiguration = DESCRIPTORS.editorConfiguration.fromStore(preferences?.editorConfiguration);
|
||||||
this.terminalCopyOnSelect = DESCRIPTORS.terminalCopyOnSelect.fromStore(preferences?.terminalCopyOnSelect);
|
this.terminalCopyOnSelect = DESCRIPTORS.terminalCopyOnSelect.fromStore(preferences?.terminalCopyOnSelect);
|
||||||
this.updateChannel = DESCRIPTORS.updateChannel.fromStore(preferences?.updateChannel);
|
this.updateChannel = DESCRIPTORS.updateChannel.fromStore(preferences?.updateChannel);
|
||||||
|
this.extensionRegistryUrl = DESCRIPTORS.extensionRegistryUrl.fromStore(preferences?.extensionRegistryUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
toJSON(): UserStoreModel {
|
toJSON(): UserStoreModel {
|
||||||
@ -224,6 +226,7 @@ export class UserStore extends BaseStore<UserStoreModel> /* implements UserStore
|
|||||||
editorConfiguration: DESCRIPTORS.editorConfiguration.toStore(this.editorConfiguration),
|
editorConfiguration: DESCRIPTORS.editorConfiguration.toStore(this.editorConfiguration),
|
||||||
terminalCopyOnSelect: DESCRIPTORS.terminalCopyOnSelect.toStore(this.terminalCopyOnSelect),
|
terminalCopyOnSelect: DESCRIPTORS.terminalCopyOnSelect.toStore(this.terminalCopyOnSelect),
|
||||||
updateChannel: DESCRIPTORS.updateChannel.toStore(this.updateChannel),
|
updateChannel: DESCRIPTORS.updateChannel.toStore(this.updateChannel),
|
||||||
|
extensionRegistryUrl: DESCRIPTORS.extensionRegistryUrl.toStore(this.extensionRegistryUrl),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -48,6 +48,7 @@ export * from "./n-fircate";
|
|||||||
export * from "./objects";
|
export * from "./objects";
|
||||||
export * from "./openExternal";
|
export * from "./openExternal";
|
||||||
export * from "./paths";
|
export * from "./paths";
|
||||||
|
export * from "./promise-exec";
|
||||||
export * from "./reject-promise";
|
export * from "./reject-promise";
|
||||||
export * from "./singleton";
|
export * from "./singleton";
|
||||||
export * from "./sort-compare";
|
export * from "./sort-compare";
|
||||||
|
|||||||
@ -36,32 +36,39 @@ export interface ExtensionInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface Dependencies {
|
export interface Dependencies {
|
||||||
attemptInstall: (request: InstallRequest, d: ExtendableDisposer) => Promise<void>
|
attemptInstall: (request: InstallRequest, d: ExtendableDisposer) => Promise<void>;
|
||||||
|
getBaseRegistryUrl: () => Promise<string>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const attemptInstallByInfo = ({ attemptInstall }: Dependencies) => async ({
|
export const attemptInstallByInfo = ({ attemptInstall, getBaseRegistryUrl }: Dependencies) => async ({
|
||||||
name,
|
name,
|
||||||
version,
|
version,
|
||||||
requireConfirmation = false,
|
requireConfirmation = false,
|
||||||
}: ExtensionInfo) => {
|
}: ExtensionInfo) => {
|
||||||
const disposer = ExtensionInstallationStateStore.startPreInstall();
|
const disposer = ExtensionInstallationStateStore.startPreInstall();
|
||||||
const registryUrl = new URLParse("https://registry.npmjs.com")
|
const baseUrl = await getBaseRegistryUrl();
|
||||||
.set("pathname", name)
|
const registryUrl = new URLParse(baseUrl).set("pathname", name).toString();
|
||||||
.toString();
|
let json: any;
|
||||||
const { promise } = downloadJson({ url: registryUrl });
|
|
||||||
const json = await promise.catch(console.error);
|
|
||||||
|
|
||||||
if (
|
try {
|
||||||
!json ||
|
json = await downloadJson({ url: registryUrl }).promise;
|
||||||
json.error ||
|
|
||||||
typeof json.versions !== "object" ||
|
|
||||||
!json.versions
|
|
||||||
) {
|
|
||||||
const message = json?.error ? `: ${json.error}` : "";
|
|
||||||
|
|
||||||
Notifications.error(
|
if (!json || json.error || typeof json.versions !== "object" || !json.versions) {
|
||||||
`Failed to get registry information for that extension${message}`,
|
const message = json?.error ? `: ${json.error}` : "";
|
||||||
);
|
|
||||||
|
Notifications.error(`Failed to get registry information for that extension${message}`);
|
||||||
|
|
||||||
|
return disposer();
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
if (error instanceof SyntaxError) {
|
||||||
|
// assume invalid JSON
|
||||||
|
console.warn("Set registry has invalid json", { url: baseUrl }, error);
|
||||||
|
Notifications.error("Failed to get valid registry information for that extension. Registry did not return valid JSON");
|
||||||
|
} else {
|
||||||
|
console.error("Failed to download registry information", error);
|
||||||
|
Notifications.error(`Failed to get valid registry information for that extension. ${error}`);
|
||||||
|
}
|
||||||
|
|
||||||
return disposer();
|
return disposer();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -68,6 +68,10 @@ class NonInjectedExtensions extends React.Component<Dependencies> {
|
|||||||
makeObservable(this);
|
makeObservable(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get dependencies() {
|
||||||
|
return this.props.dependencies;
|
||||||
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
disposeOnUnmount(this, [
|
disposeOnUnmount(this, [
|
||||||
reaction(() => this.props.userExtensions.get().length, (curSize, prevSize) => {
|
reaction(() => this.props.userExtensions.get().length, (curSize, prevSize) => {
|
||||||
|
|||||||
@ -0,0 +1,36 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) 2021 OpenLens Authors
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
* this software and associated documentation files (the "Software"), to deal in
|
||||||
|
* the Software without restriction, including without limitation the rights to
|
||||||
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
* subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { Injectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||||
|
import { UserStore } from "../../../../common/user-store";
|
||||||
|
import { Dependencies, getBaseRegistryUrl } from "./get-base-registry-url";
|
||||||
|
|
||||||
|
const getBaseRegistryUrlInjectable: Injectable<() => Promise<string>, Dependencies> = {
|
||||||
|
getDependencies: () => ({
|
||||||
|
// TODO: use injection
|
||||||
|
getRegistryUrlPreference: () => UserStore.getInstance().extensionRegistryUrl,
|
||||||
|
}),
|
||||||
|
|
||||||
|
instantiate: getBaseRegistryUrl,
|
||||||
|
lifecycle: lifecycleEnum.singleton,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default getBaseRegistryUrlInjectable;
|
||||||
@ -0,0 +1,57 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) 2021 OpenLens Authors
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
* this software and associated documentation files (the "Software"), to deal in
|
||||||
|
* the Software without restriction, including without limitation the rights to
|
||||||
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
* subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import React from "react";
|
||||||
|
import { defaultExtensionRegistryUrl, ExtensionRegistry, ExtensionRegistryLocation } from "../../../../common/user-store/preferences-helpers";
|
||||||
|
import { promiseExecFile } from "../../../utils";
|
||||||
|
import { Notifications } from "../../notifications";
|
||||||
|
|
||||||
|
export interface Dependencies {
|
||||||
|
getRegistryUrlPreference: () => ExtensionRegistry,
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getBaseRegistryUrl = ({ getRegistryUrlPreference }: Dependencies) => async () => {
|
||||||
|
const extensionRegistryUrl = getRegistryUrlPreference();
|
||||||
|
|
||||||
|
switch (extensionRegistryUrl.location) {
|
||||||
|
case ExtensionRegistryLocation.CUSTOM:
|
||||||
|
return extensionRegistryUrl.customUrl;
|
||||||
|
|
||||||
|
case ExtensionRegistryLocation.NPMRC: {
|
||||||
|
try {
|
||||||
|
const filteredEnv = Object.fromEntries(
|
||||||
|
Object.entries(process.env)
|
||||||
|
.filter(([key]) => !key.startsWith("npm")),
|
||||||
|
);
|
||||||
|
const { stdout } = await promiseExecFile("npm", ["config", "get", "registry"], { env: filteredEnv });
|
||||||
|
|
||||||
|
return stdout.trim();
|
||||||
|
} catch (error) {
|
||||||
|
Notifications.error(<p>Failed to get configured registry from <code>.npmrc</code>. Falling back to default registry</p>);
|
||||||
|
console.warn("[EXTENSIONS]: failed to get configured registry from .npmrc", error);
|
||||||
|
// fallthrough
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
case ExtensionRegistryLocation.DEFAULT:
|
||||||
|
return defaultExtensionRegistryUrl;
|
||||||
|
}
|
||||||
|
};
|
||||||
@ -29,7 +29,9 @@ import { Input } from "../input";
|
|||||||
import { isWindows } from "../../../common/vars";
|
import { isWindows } from "../../../common/vars";
|
||||||
import { FormSwitch, Switcher } from "../switch";
|
import { FormSwitch, Switcher } from "../switch";
|
||||||
import moment from "moment-timezone";
|
import moment from "moment-timezone";
|
||||||
import { CONSTANTS } from "../../../common/user-store/preferences-helpers";
|
import { CONSTANTS, defaultExtensionRegistryUrl, ExtensionRegistryLocation } from "../../../common/user-store/preferences-helpers";
|
||||||
|
import { action } from "mobx";
|
||||||
|
import { isUrl } from "../input/input_validators";
|
||||||
import { AppPreferenceRegistry } from "../../../extensions/registries";
|
import { AppPreferenceRegistry } from "../../../extensions/registries";
|
||||||
import { ExtensionSettings } from "./extension-settings";
|
import { ExtensionSettings } from "./extension-settings";
|
||||||
|
|
||||||
@ -43,6 +45,7 @@ const updateChannelOptions: SelectOption<string>[] = Array.from(
|
|||||||
);
|
);
|
||||||
|
|
||||||
export const Application = observer(() => {
|
export const Application = observer(() => {
|
||||||
|
const userStore = UserStore.getInstance();
|
||||||
const defaultShell = process.env.SHELL
|
const defaultShell = process.env.SHELL
|
||||||
|| process.env.PTYSHELL
|
|| process.env.PTYSHELL
|
||||||
|| (
|
|| (
|
||||||
@ -51,7 +54,8 @@ export const Application = observer(() => {
|
|||||||
: "System default shell"
|
: "System default shell"
|
||||||
);
|
);
|
||||||
|
|
||||||
const [shell, setShell] = React.useState(UserStore.getInstance().shell || "");
|
const [customUrl, setCustomUrl] = React.useState(userStore.extensionRegistryUrl.customUrl || "");
|
||||||
|
const [shell, setShell] = React.useState(userStore.shell || "");
|
||||||
const extensionSettings = AppPreferenceRegistry.getInstance().getItems().filter((preference) => preference.showInPreferencesTab === "application");
|
const extensionSettings = AppPreferenceRegistry.getInstance().getItems().filter((preference) => preference.showInPreferencesTab === "application");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -61,8 +65,8 @@ export const Application = observer(() => {
|
|||||||
<SubTitle title="Theme"/>
|
<SubTitle title="Theme"/>
|
||||||
<Select
|
<Select
|
||||||
options={ThemeStore.getInstance().themeOptions}
|
options={ThemeStore.getInstance().themeOptions}
|
||||||
value={UserStore.getInstance().colorTheme}
|
value={userStore.colorTheme}
|
||||||
onChange={({ value }: SelectOption) => UserStore.getInstance().colorTheme = value}
|
onChange={({ value }) => userStore.colorTheme = value}
|
||||||
themeName="lens"
|
themeName="lens"
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
@ -75,8 +79,8 @@ export const Application = observer(() => {
|
|||||||
theme="round-black"
|
theme="round-black"
|
||||||
placeholder={defaultShell}
|
placeholder={defaultShell}
|
||||||
value={shell}
|
value={shell}
|
||||||
onChange={v => setShell(v)}
|
onChange={setShell}
|
||||||
onBlur={() => UserStore.getInstance().shell = shell}
|
onBlur={() => userStore.shell = shell}
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@ -86,8 +90,8 @@ export const Application = observer(() => {
|
|||||||
label="Copy on select and paste on right-click"
|
label="Copy on select and paste on right-click"
|
||||||
control={
|
control={
|
||||||
<Switcher
|
<Switcher
|
||||||
checked={UserStore.getInstance().terminalCopyOnSelect}
|
checked={userStore.terminalCopyOnSelect}
|
||||||
onChange={v => UserStore.getInstance().terminalCopyOnSelect = v.target.checked}
|
onChange={v => userStore.terminalCopyOnSelect = v.target.checked}
|
||||||
name="terminalCopyOnSelect"
|
name="terminalCopyOnSelect"
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
@ -96,13 +100,46 @@ export const Application = observer(() => {
|
|||||||
|
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|
||||||
|
<section id="extensionRegistryUrl">
|
||||||
|
<SubTitle title="Extension Install Registry" />
|
||||||
|
<Select
|
||||||
|
options={Object.values(ExtensionRegistryLocation)}
|
||||||
|
value={userStore.extensionRegistryUrl.location}
|
||||||
|
onChange={action(({ value }) => {
|
||||||
|
userStore.extensionRegistryUrl.location = value;
|
||||||
|
|
||||||
|
if (userStore.extensionRegistryUrl.location === ExtensionRegistryLocation.CUSTOM) {
|
||||||
|
userStore.extensionRegistryUrl.customUrl = "";
|
||||||
|
}
|
||||||
|
})}
|
||||||
|
themeName="lens"
|
||||||
|
/>
|
||||||
|
<p className="mt-4 mb-5 leading-relaxed">
|
||||||
|
This setting is to change the registry URL for installing extensions by name.{" "}
|
||||||
|
If you are unable to access the default registry ({defaultExtensionRegistryUrl}){" "}
|
||||||
|
you can change it in your <b>.npmrc</b> file or in the input below.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<Input
|
||||||
|
theme="round-black"
|
||||||
|
validators={isUrl}
|
||||||
|
value={customUrl}
|
||||||
|
onChange={setCustomUrl}
|
||||||
|
onBlur={() => userStore.extensionRegistryUrl.customUrl = customUrl}
|
||||||
|
placeholder="Custom Extension Registry URL..."
|
||||||
|
disabled={userStore.extensionRegistryUrl.location !== ExtensionRegistryLocation.CUSTOM}
|
||||||
|
/>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<hr/>
|
||||||
|
|
||||||
<section id="other">
|
<section id="other">
|
||||||
<SubTitle title="Start-up"/>
|
<SubTitle title="Start-up"/>
|
||||||
<FormSwitch
|
<FormSwitch
|
||||||
control={
|
control={
|
||||||
<Switcher
|
<Switcher
|
||||||
checked={UserStore.getInstance().openAtLogin}
|
checked={userStore.openAtLogin}
|
||||||
onChange={v => UserStore.getInstance().openAtLogin = v.target.checked}
|
onChange={v => userStore.openAtLogin = v.target.checked}
|
||||||
name="startup"
|
name="startup"
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
@ -120,8 +157,8 @@ export const Application = observer(() => {
|
|||||||
<SubTitle title="Update Channel"/>
|
<SubTitle title="Update Channel"/>
|
||||||
<Select
|
<Select
|
||||||
options={updateChannelOptions}
|
options={updateChannelOptions}
|
||||||
value={UserStore.getInstance().updateChannel}
|
value={userStore.updateChannel}
|
||||||
onChange={({ value }: SelectOption) => UserStore.getInstance().updateChannel = value}
|
onChange={({ value }) => userStore.updateChannel = value}
|
||||||
themeName="lens"
|
themeName="lens"
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
@ -132,8 +169,8 @@ export const Application = observer(() => {
|
|||||||
<SubTitle title="Locale Timezone" />
|
<SubTitle title="Locale Timezone" />
|
||||||
<Select
|
<Select
|
||||||
options={timezoneOptions}
|
options={timezoneOptions}
|
||||||
value={UserStore.getInstance().localeTimezone}
|
value={userStore.localeTimezone}
|
||||||
onChange={({ value }: SelectOption) => UserStore.getInstance().setLocaleTimezone(value)}
|
onChange={({ value }) => userStore.setLocaleTimezone(value)}
|
||||||
themeName="lens"
|
themeName="lens"
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user