将部分MB、GB...改成MiB、GiB...

This commit is contained in:
GoEdgeLab
2023-12-03 11:30:02 +08:00
parent 89255cb437
commit c938df5b7e
12 changed files with 378 additions and 138 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -63,12 +63,12 @@ Vue.component("size-capacity-box", {
<div class="ui field">
<select class="ui dropdown" v-model="capacity.unit" @change="change">
<option value="byte" v-if="supportedUnits.length == 0 || supportedUnits.$contains('byte')">字节</option>
<option value="kb" v-if="supportedUnits.length == 0 || supportedUnits.$contains('kb')">KB</option>
<option value="mb" v-if="supportedUnits.length == 0 || supportedUnits.$contains('mb')">MB</option>
<option value="gb" v-if="supportedUnits.length == 0 || supportedUnits.$contains('gb')">GB</option>
<option value="tb" v-if="supportedUnits.length == 0 || supportedUnits.$contains('tb')">TB</option>
<option value="pb" v-if="supportedUnits.length == 0 || supportedUnits.$contains('pb')">PB</option>
<option value="eb" v-if="supportedUnits.length == 0 || supportedUnits.$contains('eb')">EB</option>
<option value="kb" v-if="supportedUnits.length == 0 || supportedUnits.$contains('kb')">KiB</option>
<option value="mb" v-if="supportedUnits.length == 0 || supportedUnits.$contains('mb')">MiB</option>
<option value="gb" v-if="supportedUnits.length == 0 || supportedUnits.$contains('gb')">GiB</option>
<option value="tb" v-if="supportedUnits.length == 0 || supportedUnits.$contains('tb')">TiB</option>
<option value="pb" v-if="supportedUnits.length == 0 || supportedUnits.$contains('pb')">PiB</option>
<option value="eb" v-if="supportedUnits.length == 0 || supportedUnits.$contains('eb')">EiB</option>
</select>
</div>
</div>`

View File

@@ -26,7 +26,7 @@ Vue.component("plan-price-view", {
按{{plan.bandwidthPrice.percentile}}th带宽计费
<div>
<div v-for="range in plan.bandwidthPrice.ranges">
<span class="small grey">{{range.minMB}} - <span v-if="range.maxMB > 0">{{range.maxMB}}MB</span><span v-else>&infin;</span> <span v-if="range.totalPrice > 0">{{range.totalPrice}}元</span><span v-else="">{{range.pricePerMB}}元/MB</span></span>
<span class="small grey">{{range.minMB}} - <span v-if="range.maxMB > 0">{{range.maxMB}}MiB</span><span v-else>&infin;</span> <span v-if="range.totalPrice > 0">{{range.totalPrice}}元</span><span v-else="">{{range.pricePerMB}}元/MiB</span></span>
</div>
</div>
</div>

View File

@@ -85,7 +85,7 @@ Vue.component("http-access-log-config-box", {
<label :for="'access-log-field-' + index">{{field.name}}</label>
</div>
<p class="comment">在基础信息之外要存储的信息。
<span class="red" v-if="hasRequestBodyField">记录"请求Body"将会显著消耗更多的系统资源建议仅在调试时启用最大记录尺寸为2MB。</span>
<span class="red" v-if="hasRequestBodyField">记录"请求Body"将会显著消耗更多的系统资源建议仅在调试时启用最大记录尺寸为2MiB。</span>
</p>
</td>
</tr>

View File

@@ -124,21 +124,21 @@ window.teaweb = {
return bytes + "B";
}
if (bytes < Math.pow(1024, 2)) {
return (Math.round(bytes * 100 / Math.pow(1024, 1)) / 100) + "KB";
return (Math.round(bytes * 100 / Math.pow(1024, 1)) / 100) + "KiB";
}
if (bytes < Math.pow(1024, 3)) {
return (Math.round(bytes * 100 / Math.pow(1024, 2)) / 100) + "MB";
return (Math.round(bytes * 100 / Math.pow(1024, 2)) / 100) + "MiB";
}
if (bytes < Math.pow(1024, 4)) {
return (Math.round(bytes * 100 / Math.pow(1024, 3)) / 100) + "GB";
return (Math.round(bytes * 100 / Math.pow(1024, 3)) / 100) + "GiB";
}
if (bytes < Math.pow(1024, 5)) {
return (Math.round(bytes * 100 / Math.pow(1024, 4)) / 100) + "TB";
return (Math.round(bytes * 100 / Math.pow(1024, 4)) / 100) + "TiB";
}
if (bytes < Math.pow(1024, 6)) {
return (Math.round(bytes * 100 / Math.pow(1024, 5)) / 100) + "PB";
return (Math.round(bytes * 100 / Math.pow(1024, 5)) / 100) + "PiB";
}
return (Math.round(bytes * 100 / Math.pow(1024, 6)) / 100) + "EB";
return (Math.round(bytes * 100 / Math.pow(1024, 6)) / 100) + "EiB";
},
formatBits: function (bits, decimal) {
bits = Math.ceil(bits);

File diff suppressed because one or more lines are too long

View File

@@ -184,9 +184,9 @@
<td>磁盘预估写入最大速度</td>
<td>
<span v-if="node.status.diskWritingSpeedMB == 0">-</span><span v-if="node.status.diskWritingSpeedMB > 0">&gt; {{node.status.diskWritingSpeedMB}}</span>
<span v-if="node.status.diskWritingSpeedMB > 1000">MB/s 极快</span>
<span v-else-if="node.status.diskWritingSpeedMB > 150">MB/s 快</span>
<span v-else-if="node.status.diskWritingSpeedMB > 0">MB/s 一般</span>
<span v-if="node.status.diskWritingSpeedMB > 1000">MiB/s 极快</span>
<span v-else-if="node.status.diskWritingSpeedMB > 150">MiB/s 快</span>
<span v-else-if="node.status.diskWritingSpeedMB > 0">MiB/s 一般</span>
</td>
</tr>
<tr>

View File

@@ -67,7 +67,7 @@
<td class="color-border">缓存磁盘最小空余空间</td>
<td>
<size-capacity-box :v-name="'fileMinFreeSizeJSON'" :v-count="0" :v-unit="'gb'" :key="'minFreeSizeJSON'"></size-capacity-box>
<p class="comment">缓存磁盘保留的最小空余空间如果为0表示自动限制目前默认保留5GB</p>
<p class="comment">缓存磁盘保留的最小空余空间如果为0表示自动限制目前默认保留5GiB</p>
</td>
</tr>
<tr>

View File

@@ -74,7 +74,7 @@
<td class="color-border">缓存磁盘最小空余空间</td>
<td>
<size-capacity-box :v-name="'fileMinFreeSizeJSON'" :v-value="cachePolicy.options.minFreeSize" :key="'minFreeSizeJSON'"></size-capacity-box>
<p class="comment">缓存磁盘保留的最小空余空间如果为0表示使用默认目前默认保留5GB</p>
<p class="comment">缓存磁盘保留的最小空余空间如果为0表示使用默认目前默认保留5GiB</p>
</td>
</tr>
<tr>

View File

@@ -89,7 +89,7 @@
<option value="avg">平均带宽</option>
</select>
<p class="comment" v-if="user.bandwidthAlgo == 'secondly'">按在计时时间段内5分钟最高带宽峰值计算比如5分钟内最高的某个时间点带宽为100Mbps那么就认为此时间段内的峰值带宽为100Mbps。</p>
<p class="comment" v-if="user.bandwidthAlgo == 'avg'">按在计时时间段内5分钟平均带宽计算即此时间段内的总流量除以时间段的秒数比如5分钟300秒内总流量600MB那么带宽即为<code-label>600MB * 8bit/300s = 16Mbps</code-label>;通常平均带宽算法要比峰值带宽要少很多。</p>
<p class="comment" v-if="user.bandwidthAlgo == 'avg'">按在计时时间段内5分钟平均带宽计算即此时间段内的总流量除以时间段的秒数比如5分钟300秒内总流量600MiB那么带宽即为<code-label>600MiB * 8bit/300s = 16Mbps</code-label>;通常平均带宽算法要比峰值带宽要少很多。</p>
</td>
</tr>
<tr>