mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-03 12:20:28 +08:00
WebP转换质量转移到WebP策略配置
This commit is contained in:
@@ -6,7 +6,6 @@ Vue.component("http-webp-config-box", {
|
||||
config = {
|
||||
isPrior: false,
|
||||
isOn: false,
|
||||
quality: 50,
|
||||
minLength: {count: 0, "unit": "kb"},
|
||||
maxLength: {count: 0, "unit": "kb"},
|
||||
mimeTypes: ["image/png", "image/jpeg", "image/bmp", "image/x-ico"],
|
||||
@@ -24,21 +23,7 @@ Vue.component("http-webp-config-box", {
|
||||
|
||||
return {
|
||||
config: config,
|
||||
moreOptionsVisible: false,
|
||||
quality: config.quality
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
quality: function (v) {
|
||||
let quality = parseInt(v)
|
||||
if (isNaN(quality)) {
|
||||
quality = 90
|
||||
} else if (quality < 1) {
|
||||
quality = 1
|
||||
} else if (quality > 100) {
|
||||
quality = 100
|
||||
}
|
||||
this.config.quality = quality
|
||||
moreOptionsVisible: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -95,16 +80,6 @@ Vue.component("http-webp-config-box", {
|
||||
<p class="comment">响应的Content-Type里包含这些MimeType的内容将会被转成WebP。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>图片质量</td>
|
||||
<td>
|
||||
<div class="ui input right labeled">
|
||||
<input type="text" v-model="quality" style="width: 5em" maxlength="4"/>
|
||||
<span class="ui label">%</span>
|
||||
</div>
|
||||
<p class="comment">取值在0到100之间,数值越大生成的图像越清晰,同时文件尺寸也会越大。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>内容最小长度</td>
|
||||
<td>
|
||||
|
||||
@@ -15,6 +15,16 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tbody v-show="webpPolicy.isOn">
|
||||
<tr>
|
||||
<td>图片质量</td>
|
||||
<td>
|
||||
<div class="ui input right labeled">
|
||||
<input type="text" name="quality" v-model="webpPolicy.quality" style="width: 5em" maxlength="4"/>
|
||||
<span class="ui label">%</span>
|
||||
</div>
|
||||
<p class="comment">取值在0到100之间,0表示默认;数值越大生成的图像越清晰,文件尺寸也会越大,同时消耗的系统资源越多(在低配置的边缘节点上建议不超过50%)。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>需要满足缓存条件</td>
|
||||
<td>
|
||||
|
||||
Reference in New Issue
Block a user