@tencentcloud/ai-desk-customer-vue 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/adapter-vue.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import Vue from 'vue';
2
2
  import * as VueWeb from './adapter-vue-web';
3
3
 
4
- let vue: any ;
4
+ let vue: any;
5
5
 
6
6
  if (window && !(window as any).uni) {
7
7
  vue = { ...VueWeb, ...(VueWeb as any).vue };
@@ -1,6 +1,7 @@
1
1
  .tui-chat-h5 {
2
2
  flex: 1;
3
3
  position: static;
4
+ max-height: 100%;
4
5
 
5
6
  .tui-chat-main {
6
7
  .tui-message-list {
@@ -14,7 +14,7 @@
14
14
  }
15
15
 
16
16
  &-message-input {
17
- height: auto;
17
+ height: 100px;
18
18
  }
19
19
 
20
20
  &-message-input-toolbar {
@@ -1,9 +1,6 @@
1
1
  .tui-chat-uni {
2
2
  &-message-input {
3
- max-height: 370px;
4
- margin-top: auto;
5
- margin-bottom: auto;
6
- height: auto;
3
+ max-height: 70px;
7
4
  }
8
5
  &-message-input-hide{
9
6
  display: none;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tencentcloud/ai-desk-customer-vue",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "chat uikit ai-desk-customer",
5
5
  "main": "index",
6
6
  "keywords": [
package/logger/index.ts DELETED
@@ -1,12 +0,0 @@
1
- import Logger from './main';
2
-
3
- const logger = new Logger({
4
- url: `https://otlp.tccc.qcloud.com/v1/logs`,
5
- id: 'tccc',
6
- name: 'webCustomerUIKit',
7
- attributes: {
8
- origin: 'webCustomerUIKit',
9
- },
10
- });
11
-
12
- export default logger;
package/logger/main.ts DELETED
@@ -1,120 +0,0 @@
1
- import * as logsAPI from '@opentelemetry/api-logs';
2
- import { OTLPLogExporter } from '@opentelemetry/exporter-logs-otlp-http';
3
- import { LoggerProvider, BatchLogRecordProcessor } from '@opentelemetry/sdk-logs';
4
- import { Resource } from '@opentelemetry/resources';
5
- type LogBody =
6
- | string
7
- | {
8
- msg: string;
9
- attributes?: logsAPI.LogAttributes;
10
- };
11
-
12
- const getLogBody = (args: LogBody, defaultAttributes: logsAPI.LogAttributes) => ({
13
- body: typeof args === 'string' ? args : args.msg,
14
- attributes:
15
- typeof args === 'string'
16
- ? defaultAttributes
17
- : {
18
- ...defaultAttributes,
19
- ...args.attributes,
20
- },
21
- });
22
-
23
- export default class Logger {
24
- logger: logsAPI.Logger;
25
- attributes: logsAPI.LogAttributes;
26
- logLevel: logsAPI.SeverityNumber;
27
- name: string;
28
- constructor({
29
- name,
30
- id,
31
- url,
32
- version = 'latest',
33
- attributes,
34
- logLevel = logsAPI.SeverityNumber.ERROR2,
35
- }: {
36
- name: string;
37
- id: string;
38
- url: URL | string;
39
- version?: string;
40
- attributes: logsAPI.LogAttributes;
41
- logLevel?: logsAPI.SeverityNumber;
42
- }) {
43
- this.name = name;
44
- this.logLevel = logLevel;
45
- const loggerProvider = new LoggerProvider({
46
- resource: new Resource({
47
- 'service.name': name,
48
- 'tps.tenant.id': id,
49
- }),
50
- });
51
- loggerProvider.addLogRecordProcessor(
52
- new BatchLogRecordProcessor(
53
- new OTLPLogExporter({
54
- url: url.toString(),
55
- headers: {
56
- 'X-Tps-TenantID': id,
57
- },
58
- }),
59
- ),
60
- );
61
- const logger = loggerProvider.getLogger(name, version);
62
- this.attributes = attributes;
63
- this.logger = logger;
64
- }
65
-
66
- debug = (args: LogBody) => {
67
- if (this.logLevel <= logsAPI.SeverityNumber.DEBUG) {
68
- console.debug(`[${this.name}]`, args);
69
- }
70
- this.logger.emit({
71
- severityNumber: logsAPI.SeverityNumber.DEBUG,
72
- severityText: 'debug',
73
- ...getLogBody(args, this.attributes),
74
- });
75
- };
76
-
77
- info(args: LogBody) {
78
- if (this.logLevel <= logsAPI.SeverityNumber.INFO) {
79
- console.info(`[${this.name}]`, args);
80
- }
81
-
82
- return this.logger.emit({
83
- severityNumber: logsAPI.SeverityNumber.INFO,
84
- severityText: 'info',
85
- ...getLogBody(args, this.attributes),
86
- });
87
- }
88
-
89
- warn = (args: LogBody) => {
90
- if (this.logLevel <= logsAPI.SeverityNumber.WARN) {
91
- console.warn(`[${this.name}]`, args);
92
- }
93
- this.logger.emit({
94
- severityNumber: logsAPI.SeverityNumber.WARN,
95
- severityText: 'warn',
96
- ...getLogBody(args, this.attributes),
97
- });
98
- };
99
-
100
- error = (args: LogBody) => {
101
- if (this.logLevel <= logsAPI.SeverityNumber.ERROR) {
102
- console.error(`[${this.name}]`, args);
103
- }
104
- this.logger.emit({
105
- severityNumber: logsAPI.SeverityNumber.ERROR,
106
- severityText: 'error',
107
- ...getLogBody(args, this.attributes),
108
- });
109
- };
110
-
111
- setAttribute = (key: string, value: string | number) => {
112
- Object.assign(this.attributes, {
113
- [key]: value,
114
- });
115
- };
116
-
117
- setAttributes = (attributes: logsAPI.LogAttributes) => {
118
- Object.assign(this.attributes, attributes);
119
- };
120
- }