mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-03 20:40:26 +08:00
集群设置增加自动硬盘TRIM选项
This commit is contained in:
@@ -113,6 +113,7 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
"autoRemoteStart": cluster.AutoRemoteStart,
|
"autoRemoteStart": cluster.AutoRemoteStart,
|
||||||
"autoInstallNftables": cluster.AutoInstallNftables,
|
"autoInstallNftables": cluster.AutoInstallNftables,
|
||||||
"autoSystemTuning": cluster.AutoSystemTuning,
|
"autoSystemTuning": cluster.AutoSystemTuning,
|
||||||
|
"autoTrimDisks": cluster.AutoTrimDisks,
|
||||||
"sshParams": sshParams,
|
"sshParams": sshParams,
|
||||||
"domainName": fullDomainName,
|
"domainName": fullDomainName,
|
||||||
}
|
}
|
||||||
@@ -141,6 +142,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
AutoRemoteStart bool
|
AutoRemoteStart bool
|
||||||
AutoInstallNftables bool
|
AutoInstallNftables bool
|
||||||
AutoSystemTuning bool
|
AutoSystemTuning bool
|
||||||
|
AutoTrimDisks bool
|
||||||
|
|
||||||
Must *actions.Must
|
Must *actions.Must
|
||||||
}) {
|
}) {
|
||||||
@@ -196,6 +198,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
AutoRemoteStart: params.AutoRemoteStart,
|
AutoRemoteStart: params.AutoRemoteStart,
|
||||||
AutoInstallNftables: params.AutoInstallNftables,
|
AutoInstallNftables: params.AutoInstallNftables,
|
||||||
AutoSystemTuning: params.AutoSystemTuning,
|
AutoSystemTuning: params.AutoSystemTuning,
|
||||||
|
AutoTrimDisks: params.AutoTrimDisks,
|
||||||
SshParamsJSON: sshParamsJSON,
|
SshParamsJSON: sshParamsJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ func (this *CreateAction) RunPost(params struct {
|
|||||||
SystemdServiceIsOn bool
|
SystemdServiceIsOn bool
|
||||||
AutoInstallNftables bool
|
AutoInstallNftables bool
|
||||||
AutoSystemTuning bool
|
AutoSystemTuning bool
|
||||||
|
AutoTrimDisks bool
|
||||||
|
|
||||||
// DNS相关
|
// DNS相关
|
||||||
DnsDomainId int64
|
DnsDomainId int64
|
||||||
@@ -149,6 +150,7 @@ func (this *CreateAction) RunPost(params struct {
|
|||||||
GlobalServerConfigJSON: globalServerConfigJSON,
|
GlobalServerConfigJSON: globalServerConfigJSON,
|
||||||
AutoInstallNftables: params.AutoInstallNftables,
|
AutoInstallNftables: params.AutoInstallNftables,
|
||||||
AutoSystemTuning: params.AutoSystemTuning,
|
AutoSystemTuning: params.AutoSystemTuning,
|
||||||
|
AutoTrimDisks: params.AutoTrimDisks,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CheckDiskPartitions 检查服务器磁盘空间
|
// CheckDiskPartitions 检查服务器硬盘空间
|
||||||
func CheckDiskPartitions(thresholdPercent float64) (path string, usage uint64, usagePercent float64, shouldWarning bool) {
|
func CheckDiskPartitions(thresholdPercent float64) (path string, usage uint64, usagePercent float64, shouldWarning bool) {
|
||||||
partitions, err := disk.Partitions(false)
|
partitions, err := disk.Partitions(false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -119,6 +119,13 @@
|
|||||||
<p class="comment">选中后,表示自动调整Linux内核等参数,以便提升性能;启用后,以往安装的边缘节点需要重启进程后才能生效。</p>
|
<p class="comment">选中后,表示自动调整Linux内核等参数,以便提升性能;启用后,以往安装的边缘节点需要重启进程后才能生效。</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>自动执行硬盘<br/>TRIM</td>
|
||||||
|
<td>
|
||||||
|
<checkbox name="autoTrimDisks" value="1" v-model="cluster.autoTrimDisks"></checkbox>
|
||||||
|
<p class="comment">执行TRIM后可以移除SSD硬盘中无效的数据,从而显著提升SSD硬盘写入性能。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<submit-btn></submit-btn>
|
<submit-btn></submit-btn>
|
||||||
|
|||||||
@@ -70,6 +70,13 @@
|
|||||||
<p class="comment">选中后,表示自动调整Linux内核等参数,以便提升性能。</p>
|
<p class="comment">选中后,表示自动调整Linux内核等参数,以便提升性能。</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr v-show="false">
|
||||||
|
<td>自动执行硬盘<br/>TRIM</td>
|
||||||
|
<td>
|
||||||
|
<checkbox name="autoTrimDisks" value="1"></checkbox>
|
||||||
|
<p class="comment">执行TRIM后可以移除SSD硬盘中无效的数据,从而显著SSD硬盘提升写入性能。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h4>DNS设置选项 <span class="grey small">(可选)</span></h4>
|
<h4>DNS设置选项 <span class="grey small">(可选)</span></h4>
|
||||||
|
|||||||
Reference in New Issue
Block a user