component-shipinlv 1.1.20 → 1.1.21

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
6
6
  import React, { useEffect, useState, useRef } from 'react';
7
7
  import { Button, Divider, Dropdown, Empty, Input, Space, Tooltip } from 'antd';
8
8
  import "./list.less";
9
- import { PlusCircleOutlined, SearchOutlined } from '@ant-design/icons';
9
+ import { PlusCircleOutlined, SearchOutlined, GlobalOutlined } from '@ant-design/icons';
10
10
  import { useRequest } from "@umijs/hooks";
11
11
  import * as VideoPublishVideoAccountController from "../../service/api/VideoPublishVideoAccountController";
12
12
  import PageContentWarp from "../../UI/PageContentWarp";
@@ -22,6 +22,7 @@ import VideoPlatform from "../../component/video-platform/logo";
22
22
  import isInstalledChrome from "../../component/is-installed-chrome";
23
23
  import Tool from "../../lib/Tool";
24
24
  import VideoPublishVideoAccountBaseInfo from "../video-account/base-info";
25
+ import VideoPublishVideoAccountProxySelect from "../proxy/select";
25
26
  import { jsx as _jsx } from "react/jsx-runtime";
26
27
  import { jsxs as _jsxs } from "react/jsx-runtime";
27
28
  import { Fragment as _Fragment } from "react/jsx-runtime";
@@ -63,6 +64,16 @@ var HomePageAccountList = function HomePageAccountList(_ref) {
63
64
  _useState14 = _slicedToArray(_useState13, 2),
64
65
  listData = _useState14[0],
65
66
  setListData = _useState14[1];
67
+ var _useState15 = useState({
68
+ id: 0,
69
+ ip: '',
70
+ port: 0,
71
+ username: '',
72
+ password: ''
73
+ }),
74
+ _useState16 = _slicedToArray(_useState15, 2),
75
+ proxyInfo = _useState16[0],
76
+ setProxyInfo = _useState16[1];
66
77
  var _useRequest = useRequest(function () {
67
78
  return VideoPublishVideoAccountController.list({
68
79
  current: 1,
@@ -177,7 +188,7 @@ var HomePageAccountList = function HomePageAccountList(_ref) {
177
188
  // window.bridge.ipcRenderer.sendMessage( eventName ); // 添加抖音账号
178
189
  settingConfig = AccountManageSettingConfig();
179
190
  _context.next = 9;
180
- return (_window$getBridge = (_window = window).getBridge) === null || _window$getBridge === void 0 || (_window$getBridge = _window$getBridge.call(_window)) === null || _window$getBridge === void 0 ? void 0 : _window$getBridge.ipcRenderer.invoke('shipinlv-video-account-add', platform, settingConfig.isChromeOpen).catch(function (err) {
191
+ return (_window$getBridge = (_window = window).getBridge) === null || _window$getBridge === void 0 || (_window$getBridge = _window$getBridge.call(_window)) === null || _window$getBridge === void 0 ? void 0 : _window$getBridge.ipcRenderer.invoke('shipinlv-video-account-add', platform, proxyInfo, settingConfig.isChromeOpen).catch(function (err) {
181
192
  Notification.notificationError('获取账号信息错误' + ((err === null || err === void 0 ? void 0 : err.message) || JSON.stringify(err)));
182
193
  });
183
194
  case 9:
@@ -203,6 +214,21 @@ var HomePageAccountList = function HomePageAccountList(_ref) {
203
214
  return _ref2.apply(this, arguments);
204
215
  };
205
216
  }();
217
+ var onProxy = function onProxy() {
218
+ var dialog = Tool.drawer({
219
+ title: '编辑代理',
220
+ content: /*#__PURE__*/_jsx(VideoPublishVideoAccountProxySelect, {
221
+ env: env,
222
+ nickname: "[\u5F85\u6DFB\u52A0]",
223
+ videoAccountProxyId: proxyInfo.id || 0,
224
+ onSuccess: function onSuccess(newVideoAccountProxyId, info) {
225
+ setProxyInfo(_objectSpread({}, info));
226
+ dialog.destroy();
227
+ }
228
+ }),
229
+ width: 680
230
+ });
231
+ };
206
232
  useEffect(function () {
207
233
  var platformMenuItems = [];
208
234
  VideoPlatformList.forEach(function (item) {
@@ -224,19 +250,31 @@ var HomePageAccountList = function HomePageAccountList(_ref) {
224
250
  var addButton = function addButton() {
225
251
  return /*#__PURE__*/_jsx("div", {
226
252
  className: "addButton",
227
- children: /*#__PURE__*/_jsx(Dropdown, {
228
- placement: "top",
229
- menu: {
230
- items: platformMenuItems,
231
- onClick: function onClick(e) {
232
- return onAdd(e.key);
233
- }
234
- },
235
- children: /*#__PURE__*/_jsx(Button, {
236
- icon: /*#__PURE__*/_jsx(PlusCircleOutlined, {}),
237
- type: "primary",
238
- children: "\u6DFB\u52A0\u89C6\u9891\u8D26\u53F7"
239
- })
253
+ children: /*#__PURE__*/_jsxs(Space, {
254
+ children: [/*#__PURE__*/_jsx(Tooltip, {
255
+ title: "\u8BBE\u7F6E\u4EE3\u7406",
256
+ children: /*#__PURE__*/_jsx(Button, {
257
+ type: "primary",
258
+ ghost: !proxyInfo.ip,
259
+ onClick: function onClick() {
260
+ return onProxy();
261
+ },
262
+ children: /*#__PURE__*/_jsx(GlobalOutlined, {})
263
+ })
264
+ }), /*#__PURE__*/_jsx(Dropdown, {
265
+ placement: "top",
266
+ menu: {
267
+ items: platformMenuItems,
268
+ onClick: function onClick(e) {
269
+ return onAdd(e.key);
270
+ }
271
+ },
272
+ children: /*#__PURE__*/_jsx(Button, {
273
+ icon: /*#__PURE__*/_jsx(PlusCircleOutlined, {}),
274
+ type: "primary",
275
+ children: "\u8D26\u53F7"
276
+ })
277
+ })]
240
278
  })
241
279
  });
242
280
  };
@@ -4,7 +4,7 @@ interface Props {
4
4
  env?: Global.Env;
5
5
  nickname: string;
6
6
  videoAccountProxyId: number;
7
- onSuccess: (id: number) => void;
7
+ onSuccess: (id: number, proxyInfo: VideoPublishVideoAccountProxy.List) => void;
8
8
  }
9
9
  declare const VideoPublishVideoAccountProxySelect: React.FC<Props>;
10
10
  export default VideoPublishVideoAccountProxySelect;
@@ -39,7 +39,15 @@ var VideoPublishVideoAccountProxySelect = function VideoPublishVideoAccountProxy
39
39
  loading = _useRequest.loading,
40
40
  run = _useRequest.run;
41
41
  var onFinish = function onFinish(values) {
42
- onSuccess(values.id);
42
+ var _listData$filter;
43
+ var item = ((_listData$filter = listData.filter(function (item) {
44
+ return item.id === values.id;
45
+ })) === null || _listData$filter === void 0 ? void 0 : _listData$filter[0]) || {
46
+ id: 0,
47
+ domain: '',
48
+ port: 0
49
+ };
50
+ onSuccess(values.id, item);
43
51
  };
44
52
  return /*#__PURE__*/_jsx(PageContentWarp, {
45
53
  loading: loading,
package/dist/typings.d.ts CHANGED
@@ -72,6 +72,7 @@ declare namespace Global {
72
72
  }
73
73
 
74
74
  interface ProxyInfo {
75
+ id?: number;
75
76
  ip?: string;
76
77
  port?: number;
77
78
  username?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "component-shipinlv",
3
- "version": "1.1.20",
3
+ "version": "1.1.21",
4
4
  "description": "",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",