Skip to content
This repository was archived by the owner on Nov 5, 2024. It is now read-only.

Commit 8df48a8

Browse files
committed
MongoDB可以设置连接池尺寸、连接超时时间
1 parent 18f92a5 commit 8df48a8

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

src/main/web/views/@default/settings/mongo/update.html

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,34 @@ <h3>MongoDB连接设置 <a href="https://docs.mongodb.com/manual/reference/conne
7878
</td>
7979
</tr>
8080
</tbody>
81-
</table>
81+
<tr>
82+
<td colspan="2">
83+
<a href="" v-if="!advancedOptionsVisible" @click.prevent="showAdvancedOptions()" style="font-weight:normal">更多选项 <i class="icon down angle"></i> </a>
84+
<a href="" v-if="advancedOptionsVisible" @click.prevent="showAdvancedOptions()" style="font-weight:normal">收起选项 <i class="icon up angle"></i> </a>
85+
</td>
86+
</tr>
87+
<tbody v-show="advancedOptionsVisible">
88+
<tr>
89+
<td>连接池最大尺寸</td>
90+
<td>
91+
<input type="text" name="poolSize" style="width:5em" v-model="config.poolSize" maxlength="4"/>
92+
<p class="comment">0表示默认,根据MongoDB所在服务器的性能可以适当增加连接池,从而提升写日志的速度。建议在10-100之间选择。</p>
93+
</td>
94+
</tr>
95+
<tr>
96+
<td>连接超时时间</td>
97+
<td>
98+
<div class="ui fields inline">
99+
<div class="ui field">
100+
<input type="text" name="timeout" style="width:5em" v-model="config.timeout" maxlength="4"/>
101+
</div>
102+
<div class="ui field"></div>
103+
</div>
104+
<p class="comment">0表示默认。</p>
105+
</td>
106+
</tr>
107+
</tbody>
108+
</table>
82109

83110
<div class="ui segment red" v-if="testingError != null && testingError.length > 0">{{testingError}}</div>
84111
<div class="ui segment green" v-if="testingSuccess != null && testingSuccess.length > 0">{{testingSuccess}}</div>

src/main/web/views/@default/settings/mongo/update.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,13 @@ Tea.context(function () {
5353
this.isTesting = false;
5454
});
5555
};
56+
57+
/**
58+
* 高级选项
59+
*/
60+
this.advancedOptionsVisible = false;
61+
62+
this.showAdvancedOptions = function () {
63+
this.advancedOptionsVisible = !this.advancedOptionsVisible;
64+
};
5665
});

0 commit comments

Comments
 (0)