whistle.mockbubu 2.2.0-beta.3 → 2.2.0

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/.gitignore CHANGED
@@ -62,6 +62,9 @@ typings/
62
62
  /.history
63
63
  /dist
64
64
 
65
+ # 前端构建产物
66
+ /public
67
+
65
68
  # macOS system files
66
69
  .DS_Store
67
70
  **/.DS_Store
@@ -73,7 +73,7 @@ exports.LockedFilterMap = {
73
73
  */
74
74
  exports.BusinessRules = {
75
75
  // 版本管理
76
- MAX_VERSIONS_PER_FILE: 10, // 每个文件最多10个版本
76
+ MAX_VERSIONS_PER_FILE: 50, // 每个文件最多50个版本
77
77
  MAX_VERSION_NAME_LENGTH: 20, // 版本名最长20字符
78
78
 
79
79
  // 组管理
package/lib/constants.js CHANGED
@@ -37,7 +37,7 @@ const POLLING_CONFIG = {
37
37
  */
38
38
  const FILE_CONFIG = {
39
39
  // 版本数量上限
40
- MAX_VERSIONS: 10,
40
+ MAX_VERSIONS: 50,
41
41
 
42
42
  // 默认版本名称
43
43
  DEFAULT_VERSION_NAME: 'source',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whistle.mockbubu",
3
- "version": "2.2.0-beta.3",
3
+ "version": "2.2.0",
4
4
  "description": "mock response data",
5
5
  "scripts": {
6
6
  "lint": "eslint . --ext .js",
package/public/js/app.js CHANGED
@@ -1993,7 +1993,23 @@ const __default__ = {
1993
1993
  const handleTabClick = tab => {
1994
1994
  localStorage.setItem(STORAGE_KEY, tab.name);
1995
1995
  };
1996
+
1997
+ // fullUrl 从 url + query 重建完整 URL(含 query 参数)
1998
+ // query 对于已保存文件在 session 加载后填充,对缓存数据在轮询时填充
1999
+ const fullUrl = (0,vue__WEBPACK_IMPORTED_MODULE_6__.computed)(() => {
2000
+ const url = props.currentRow?.url;
2001
+ if (!url) return '';
2002
+ const query = props.currentRow?.query;
2003
+ if (!query || Object.keys(query).length === 0) return url;
2004
+ return `${url}?${new URLSearchParams(query).toString()}`;
2005
+ });
1996
2006
  const overviewItems = [{
2007
+ key: 'id',
2008
+ label: 'File ID'
2009
+ }, {
2010
+ key: 'method',
2011
+ label: 'Method'
2012
+ }, {
1997
2013
  key: 'ruleValue',
1998
2014
  label: 'Mock Mode'
1999
2015
  }, {
@@ -2043,6 +2059,7 @@ const __default__ = {
2043
2059
  STORAGE_KEY,
2044
2060
  activeTabName,
2045
2061
  handleTabClick,
2062
+ fullUrl,
2046
2063
  overviewItems,
2047
2064
  handeMockVersionChange,
2048
2065
  handleFileSaved,
@@ -5090,7 +5107,7 @@ var render = function render() {
5090
5107
  staticClass: "el-icon-warning-outline"
5091
5108
  })])] : _vm._e(), _vm._v(" " + _vm._s(item.label) + " ")], 2), _c("div", {
5092
5109
  staticClass: "request-detail__value"
5093
- }, [_vm._v(_vm._s(_vm.currentRow[item.key]))])]);
5110
+ }, [_vm._v(_vm._s(item.key === "url" ? _setup.fullUrl : _vm.currentRow[item.key]))])]);
5094
5111
  }), 0), _c("el-tab-pane", {
5095
5112
  staticClass: "request-detail__tab-pane",
5096
5113
  attrs: {
@@ -5801,16 +5818,16 @@ var render = function render() {
5801
5818
  attrs: {
5802
5819
  label: " "
5803
5820
  }
5804
- }, [_setup.responseList.length >= 11 ? _c("el-alert", {
5821
+ }, [_setup.responseList.length >= 51 ? _c("el-alert", {
5805
5822
  attrs: {
5806
- title: "已达版本数量上限(10个),请删除旧版本后再创建",
5823
+ title: "已达版本数量上限(50个),请删除旧版本后再创建",
5807
5824
  type: "warning",
5808
5825
  closable: false,
5809
5826
  "show-icon": ""
5810
5827
  }
5811
5828
  }) : _c("el-alert", {
5812
5829
  attrs: {
5813
- title: `当前版本数量:${_setup.responseList.length - 1}/10(不含 source)`,
5830
+ title: `当前版本数量:${_setup.responseList.length - 1}/50(不含 source)`,
5814
5831
  type: "info",
5815
5832
  closable: false,
5816
5833
  "show-icon": ""
@@ -5833,7 +5850,7 @@ var render = function render() {
5833
5850
  }, [_vm._v("取消")]), _c("el-button", {
5834
5851
  attrs: {
5835
5852
  type: "primary",
5836
- disabled: _setup.versionModal.status === "create" && _setup.responseList.length >= 11,
5853
+ disabled: _setup.versionModal.status === "create" && _setup.responseList.length >= 51,
5837
5854
  size: "medium"
5838
5855
  },
5839
5856
  on: {