-
+
-
+
-
+ void;
diff --git a/src/event/src/components/type-iput.tsx b/src/event/src/components/type-iput.tsx
index 4a3eb3f..74218df 100644
--- a/src/event/src/components/type-iput.tsx
+++ b/src/event/src/components/type-iput.tsx
@@ -26,7 +26,7 @@
import Select from 'antd/es/select';
import React from 'react';
-import { MetricType } from '../typings/metric';
+import type { MetricType } from '../typings/metric';
const { Option } = Select;
const metaList: { id: MetricType; name: string }[] = [
{
diff --git a/src/event/src/components/variable-editor.tsx b/src/event/src/components/variable-editor.tsx
index 2119351..0f85ab3 100644
--- a/src/event/src/components/variable-editor.tsx
+++ b/src/event/src/components/variable-editor.tsx
@@ -29,18 +29,19 @@ import Select from 'antd/es/select';
import Spin from 'antd/es/spin';
import React from 'react';
-import Datasource from '../datasource/datasource';
-import { ICommonItem, IConditionItem, MetricType, IDataItem } from '../typings/metric';
-import { VariableQueryType, VariableQuery } from '../typings/variable';
+import type { ICommonItem, IConditionItem, MetricType, IDataItem } from '../typings/metric';
+import { VariableQueryType, type VariableQuery } from '../typings/variable';
import { LanguageContext } from '../utils/context';
// import { CascaderOptionType } from 'antd/es/cascader';
-import { getCookie, getEnByName } from '../utils/utils';
+import { getCookie, t } from 'common/utils/utils';
import AliasInput from './alias-input';
import ConditionIput from './condition-input';
import DataInput from './data-input';
import DimensionInput from './dimension-input';
import TypeInput from './type-iput';
import VariableLine from './variable-line';
+
+import type Datasource from '../datasource/datasource';
interface IVariableEditorProps {
datasource: Datasource;
query?: VariableQuery;
@@ -67,11 +68,11 @@ interface IVariableEditorState {
const language = getCookie('blueking_language');
export default class VariableQueryEditor extends React.PureComponent {
queryTypes: { value: string; label: string }[] = [
- { value: VariableQueryType.Host, label: getEnByName('主机', language) },
- { value: VariableQueryType.Module, label: getEnByName('模块', language) },
- { value: VariableQueryType.Set, label: getEnByName('集群', language) },
- { value: VariableQueryType.ServiceInstance, label: getEnByName('服务实例', language) },
- { value: VariableQueryType.Dimension, label: getEnByName('维度', language) },
+ { value: VariableQueryType.Host, label: t('主机', language) },
+ { value: VariableQueryType.Module, label: t('模块', language) },
+ { value: VariableQueryType.Set, label: t('集群', language) },
+ { value: VariableQueryType.ServiceInstance, label: t('服务实例', language) },
+ { value: VariableQueryType.Dimension, label: t('维度', language) },
];
constructor(props) {
super(props);
@@ -344,7 +345,7 @@ export default class VariableQueryEditor extends React.PureComponent
-
+
);
}
diff --git a/src/event/src/configuration/config-editor.tsx b/src/event/src/configuration/config-editor.tsx
index 8a33ce6..63aaa47 100644
--- a/src/event/src/configuration/config-editor.tsx
+++ b/src/event/src/configuration/config-editor.tsx
@@ -23,12 +23,12 @@
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
-import { DataSourcePluginOptionsEditorProps } from '@grafana/data';
+import type { DataSourcePluginOptionsEditorProps } from '@grafana/data';
import { LegacyForms, TagsInput } from '@grafana/ui';
import React from 'react';
-import { QueryOption, SecureOption } from '../typings/config';
-import { getEnByName } from '../utils/utils';
+import type { QueryOption, SecureOption } from '../typings/config';
+import { t } from 'common/utils/utils';
const { FormField, Input, Switch } = LegacyForms;
export default class ConfigEditor extends React.PureComponent<
DataSourcePluginOptionsEditorProps,
@@ -87,14 +87,14 @@ export default class ConfigEditor extends React.PureComponent<
this.handleChange('baseUrl', e)}
/>
}
label='Base Url'
labelWidth={10}
- tooltip={getEnByName('蓝鲸监控API路径')}
+ tooltip={t('蓝鲸监控API路径')}
/>