可以在管理界面修改用户平台数据看板相关设置

This commit is contained in:
刘祥超
2022-07-07 12:39:23 +08:00
parent 25d73ac0a2
commit a34204e25e
4 changed files with 37 additions and 5 deletions

View File

@@ -84,10 +84,13 @@ func loadUserUIConfig() (*systemconfigs.UserUIConfig, error) {
func defaultUserUIConfig() *systemconfigs.UserUIConfig {
return &systemconfigs.UserUIConfig{
ProductName: "GoEdge",
UserSystemName: "GoEdge用户系统",
ShowOpenSourceInfo: true,
ShowVersion: true,
ShowFinance: true,
ProductName: "GoEdge",
UserSystemName: "GoEdge用户系统",
ShowOpenSourceInfo: true,
ShowVersion: true,
ShowFinance: true,
BandwidthUnit: systemconfigs.BandwidthUnitBit,
ShowBandwidthCharts: true,
ShowTrafficCharts: true,
}
}

View File

@@ -48,6 +48,10 @@ func (this *IndexAction) RunPost(params struct {
LogoFile *actions.File
TimeZone string
ShowTrafficCharts bool
ShowBandwidthCharts bool
BandwidthUnit string
Must *actions.Must
CSRF *actionutils.CSRF
}) {
@@ -68,6 +72,9 @@ func (this *IndexAction) RunPost(params struct {
config.ShowVersion = params.ShowVersion
config.Version = params.Version
config.ShowFinance = params.ShowFinance
config.ShowTrafficCharts = params.ShowTrafficCharts
config.ShowBandwidthCharts = params.ShowBandwidthCharts
config.BandwidthUnit = params.BandwidthUnit
config.TimeZone = params.TimeZone
// 上传Favicon文件

View File

@@ -2,6 +2,7 @@
<first-menu>
<a href="" class="item" @click.prevent="createNode()">[添加节点]</a>
<a href="/settings/user-ui" class="item">[界面设置]</a>
</first-menu>
<p class="comment" v-if="nodes.length == 0">暂时还没有节点。</p>

View File

@@ -79,6 +79,27 @@
</tr>
</table>
<h4>数据看板</h4>
<table class="ui table definition selectable">
<tr>
<td class="title">显示流量相关数据和图表</td>
<td><checkbox name="showTrafficCharts" v-model="config.showTrafficCharts"></checkbox></td>
</tr>
<tr>
<td class="title">显示带宽相关数据和图表</td>
<td><checkbox name="showBandwidthCharts" v-model="config.showBandwidthCharts"></checkbox></td>
</tr>
<tr>
<td class="title">带宽单位</td>
<td>
<select class="ui dropdown auto-width" name="bandwidthUnit" v-model="config.bandwidthUnit">
<option value="bit">比特</option>
<option value="byte">字节</option>
</select>
</td>
</tr>
</table>
<h4>其他</h4>
<table class="ui table definition selectable">
<tr>