Allow setting of custom sizes for types hash (#219)
parent
5f8931c231
commit
323cae4c50
|
@ -66,7 +66,8 @@ export default (domains, global) => {
|
||||||
config.http.push(['server_tokens', 'off']);
|
config.http.push(['server_tokens', 'off']);
|
||||||
if (!global.logging.logNotFound.computed)
|
if (!global.logging.logNotFound.computed)
|
||||||
config.http.push(['log_not_found', 'off']);
|
config.http.push(['log_not_found', 'off']);
|
||||||
config.http.push(['types_hash_max_size', 2048]);
|
config.http.push(['types_hash_max_size', global.nginx.typesHashMaxSize.computed]);
|
||||||
|
config.http.push(['types_hash_bucket_size', global.nginx.typesHashBucketSize.computed]);
|
||||||
config.http.push(['client_max_body_size', `${global.nginx.clientMaxBodySize.computed}M`]);
|
config.http.push(['client_max_body_size', `${global.nginx.clientMaxBodySize.computed}M`]);
|
||||||
|
|
||||||
config.http.push(['# MIME', '']);
|
config.http.push(['# MIME', '']);
|
||||||
|
|
|
@ -116,6 +116,38 @@ THE SOFTWARE.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="field is-horizontal">
|
||||||
|
<div class="field-label">
|
||||||
|
<label class="label">types_hash_max_size</label>
|
||||||
|
</div>
|
||||||
|
<div class="field-body">
|
||||||
|
<div class="field">
|
||||||
|
<div :class="`control${typesHashMaxSizeChanged ? ' is-changed' : ''}`">
|
||||||
|
<VueSelect v-model="typesHashMaxSize"
|
||||||
|
:options="$props.data.typesHashMaxSize.options"
|
||||||
|
:clearable="false"
|
||||||
|
></VueSelect>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="field is-horizontal">
|
||||||
|
<div class="field-label">
|
||||||
|
<label class="label">types_hash_bucket_size</label>
|
||||||
|
</div>
|
||||||
|
<div class="field-body">
|
||||||
|
<div class="field">
|
||||||
|
<div :class="`control${typesHashBucketSizeChanged ? ' is-changed' : ''}`">
|
||||||
|
<VueSelect v-model="typesHashBucketSize"
|
||||||
|
:options="$props.data.typesHashBucketSize.options"
|
||||||
|
:clearable="false"
|
||||||
|
></VueSelect>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -150,6 +182,16 @@ THE SOFTWARE.
|
||||||
default: 16,
|
default: 16,
|
||||||
enabled: true,
|
enabled: true,
|
||||||
},
|
},
|
||||||
|
typesHashMaxSize: {
|
||||||
|
default: 2048,
|
||||||
|
options: Array.from({ length: 8 }, (_, i) => Math.pow(2, i + 6)),
|
||||||
|
enabled: true,
|
||||||
|
},
|
||||||
|
typesHashBucketSize: {
|
||||||
|
default: 64,
|
||||||
|
options: Array.from({ length: 10 }, (_, i) => Math.pow(2, i + 4)),
|
||||||
|
enabled: true,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -195,6 +237,26 @@ THE SOFTWARE.
|
||||||
},
|
},
|
||||||
deep: true,
|
deep: true,
|
||||||
},
|
},
|
||||||
|
// Check hash max size selection is valid
|
||||||
|
'$props.data.typesHashMaxSize': {
|
||||||
|
handler(data) {
|
||||||
|
// This might cause recursion, but seems not to
|
||||||
|
if (data.enabled)
|
||||||
|
if (!data.options.includes(data.computed))
|
||||||
|
data.computed = data.default;
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
},
|
||||||
|
// Check hash bucket size selection is valid
|
||||||
|
'$props.data.typesHashBucketSize': {
|
||||||
|
handler(data) {
|
||||||
|
// This might cause recursion, but seems not to
|
||||||
|
if (data.enabled)
|
||||||
|
if (!data.options.includes(data.computed))
|
||||||
|
data.computed = data.default;
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue