Добавлление gzip
Теперь ответы сжимаются , что увеличивает скорость работы.
This commit is contained in:
@@ -64,6 +64,8 @@
|
||||
"formStatus": "Status",
|
||||
"formRouting": "Root file routing",
|
||||
"formRoutingHint": "If enabled, all requests to non-existent files will be redirected to the root file",
|
||||
"formCompression": "Gzip compression",
|
||||
"formCompressionHint": "Compress text responses (HTML, CSS, JS, JSON, SVG) to reduce traffic",
|
||||
"deleteTitle": "Delete Site",
|
||||
"deleteConfirm": "Are you sure you want to delete site \"{name}\" ({host})?",
|
||||
"deleteWarning": "This action is IRREVERSIBLE!"
|
||||
@@ -88,6 +90,8 @@
|
||||
"formLocalPort": "Local Port",
|
||||
"formServiceHttps": "HTTPS to service",
|
||||
"formServiceHttpsHint": "Use HTTPS when connecting to the local service",
|
||||
"formCompression": "Gzip compression",
|
||||
"formCompressionHint": "Compress text responses (HTML, CSS, JS, JSON, SVG) to reduce traffic",
|
||||
"formAutoHttps": "Auto HTTPS",
|
||||
"formAutoHttpsHint": "Automatically redirect HTTP requests to HTTPS",
|
||||
"deleteTitle": "Delete Proxy",
|
||||
|
||||
@@ -64,6 +64,8 @@
|
||||
"formStatus": "Статус",
|
||||
"formRouting": "Root file routing",
|
||||
"formRoutingHint": "Если включено, все запросы к несуществующим файлам будут перенаправляться на root файл",
|
||||
"formCompression": "Gzip сжатие",
|
||||
"formCompressionHint": "Сжатие текстовых ответов (HTML, CSS, JS, JSON, SVG) для уменьшения трафика",
|
||||
"deleteTitle": "Удалить сайт",
|
||||
"deleteConfirm": "Вы действительно хотите удалить сайт \"{name}\" ({host})?",
|
||||
"deleteWarning": "Это действие НЕОБРАТИМО!"
|
||||
@@ -88,6 +90,8 @@
|
||||
"formLocalPort": "Локальный порт",
|
||||
"formServiceHttps": "HTTPS к сервису",
|
||||
"formServiceHttpsHint": "Использовать HTTPS при подключении к локальному сервису",
|
||||
"formCompression": "Gzip сжатие",
|
||||
"formCompressionHint": "Сжатие текстовых ответов (HTML, CSS, JS, JSON, SVG) для уменьшения трафика",
|
||||
"formAutoHttps": "Авто HTTPS",
|
||||
"formAutoHttpsHint": "Автоматически перенаправлять HTTP запросы на HTTPS",
|
||||
"deleteTitle": "Удалить прокси",
|
||||
|
||||
@@ -30,6 +30,7 @@ export const useProxiesStore = defineStore('proxies', {
|
||||
LocalPort: proxyData.localPort,
|
||||
ServiceHTTPSuse: proxyData.serviceHttps,
|
||||
AutoHTTPS: proxyData.autoHttps,
|
||||
Compression: proxyData.compression !== undefined ? proxyData.compression : true,
|
||||
AutoCreateSSL: proxyData.autoSSL,
|
||||
})
|
||||
const result = await api.saveConfig(JSON.stringify(config))
|
||||
|
||||
@@ -10,6 +10,7 @@ const form = reactive({
|
||||
localAddr: '127.0.0.1',
|
||||
localPort: '',
|
||||
serviceHttps: false,
|
||||
compression: true,
|
||||
certMode: 'none',
|
||||
})
|
||||
|
||||
@@ -26,6 +27,7 @@ const createProxy = async () => {
|
||||
enabled: true,
|
||||
serviceHttps: form.serviceHttps,
|
||||
autoHttps: form.serviceHttps,
|
||||
compression: form.compression,
|
||||
autoSSL: false,
|
||||
})
|
||||
creating.value = false
|
||||
@@ -70,6 +72,14 @@ const createProxy = async () => {
|
||||
<VToggle v-model="form.serviceHttps" :label="t('common.enabled')" />
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="form-label-row">
|
||||
<VTooltip :text="t('proxies.formCompressionHint')" />
|
||||
<label class="form-label">{{ t('proxies.formCompression') }}</label>
|
||||
</div>
|
||||
<VToggle v-model="form.compression" :label="t('common.enabled')" />
|
||||
</div>
|
||||
|
||||
<SslUploadSection v-model="form.certMode" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -16,6 +16,7 @@ const form = reactive({
|
||||
localPort: '',
|
||||
enabled: true,
|
||||
serviceHttps: false,
|
||||
compression: true,
|
||||
autoHttps: true,
|
||||
autoSSL: false,
|
||||
})
|
||||
@@ -33,6 +34,7 @@ onMounted(async () => {
|
||||
form.localPort = proxy.LocalPort
|
||||
form.enabled = proxy.Enable
|
||||
form.serviceHttps = proxy.ServiceHTTPSuse
|
||||
form.compression = proxy.Compression !== false
|
||||
form.autoHttps = proxy.AutoHTTPS
|
||||
form.autoSSL = proxy.AutoCreateSSL || false
|
||||
}
|
||||
@@ -50,6 +52,7 @@ const saveProxy = async () => {
|
||||
config.Proxy_Service[idx].Enable = form.enabled
|
||||
config.Proxy_Service[idx].ServiceHTTPSuse = form.serviceHttps
|
||||
config.Proxy_Service[idx].AutoHTTPS = form.serviceHttps
|
||||
config.Proxy_Service[idx].Compression = form.compression
|
||||
config.Proxy_Service[idx].AutoCreateSSL = form.autoSSL
|
||||
const result = await api.saveConfig(JSON.stringify(config))
|
||||
if (isSuccess(result)) {
|
||||
@@ -120,7 +123,11 @@ const confirmDelete = async () => {
|
||||
</div>
|
||||
|
||||
<!-- Toggles -->
|
||||
<div class="form-row">
|
||||
<div class="form-row form-row-3">
|
||||
<div class="form-group">
|
||||
<label class="form-label">{{ t('proxies.formCompression') }}:</label>
|
||||
<VToggle v-model="form.compression" :label="t('common.enabled')" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">HTTPS:</label>
|
||||
<VToggle v-model="form.serviceHttps" :label="t('common.enabled')" />
|
||||
|
||||
@@ -11,6 +11,7 @@ const form = reactive({
|
||||
rootFile: 'index.html',
|
||||
status: 'active',
|
||||
routing: true,
|
||||
compression: true,
|
||||
certMode: 'none',
|
||||
})
|
||||
|
||||
@@ -36,6 +37,7 @@ const createSite = async () => {
|
||||
root_file: form.rootFile,
|
||||
status: form.status,
|
||||
root_file_routing: form.routing,
|
||||
Compression: form.compression,
|
||||
AutoCreateSSL: form.certMode === 'auto',
|
||||
}
|
||||
const result = await sitesStore.create(siteData)
|
||||
@@ -82,6 +84,14 @@ const createSite = async () => {
|
||||
<VToggle v-model="form.routing" :label="t('common.enabled')" />
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="form-label-row">
|
||||
<VTooltip :text="t('sites.formCompressionHint')" />
|
||||
<label class="form-label">{{ t('sites.formCompression') }}</label>
|
||||
</div>
|
||||
<VToggle v-model="form.compression" :label="t('common.enabled')" />
|
||||
</div>
|
||||
|
||||
<SslUploadSection v-model="form.certMode" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -16,6 +16,7 @@ const form = reactive({
|
||||
rootFile: 'index.html',
|
||||
status: 'active',
|
||||
routing: true,
|
||||
compression: true,
|
||||
autoSSL: false,
|
||||
})
|
||||
|
||||
@@ -38,6 +39,7 @@ onMounted(async () => {
|
||||
form.rootFile = site.root_file
|
||||
form.status = site.status
|
||||
form.routing = site.root_file_routing
|
||||
form.compression = site.Compression !== false
|
||||
form.autoSSL = site.AutoCreateSSL || false
|
||||
}
|
||||
})
|
||||
@@ -65,6 +67,7 @@ const saveSite = async () => {
|
||||
config.Site_www[idx].root_file = form.rootFile
|
||||
config.Site_www[idx].status = form.status
|
||||
config.Site_www[idx].root_file_routing = form.routing
|
||||
config.Site_www[idx].Compression = form.compression
|
||||
config.Site_www[idx].AutoCreateSSL = form.autoSSL
|
||||
const result = await api.saveConfig(JSON.stringify(config))
|
||||
if (isSuccess(result)) {
|
||||
@@ -147,7 +150,11 @@ const confirmDelete = async () => {
|
||||
<VSelect v-model="form.rootFile" :label="t('sites.formRootFile')" :options="rootFileOptions" />
|
||||
|
||||
<!-- Toggles -->
|
||||
<div class="form-row">
|
||||
<div class="form-row form-row-3">
|
||||
<div class="form-group">
|
||||
<label class="form-label">{{ t('sites.formCompression') }}:</label>
|
||||
<VToggle v-model="form.compression" :label="t('common.enabled')" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">{{ t('sites.formRouting') }}:</label>
|
||||
<VToggle v-model="form.routing" :label="t('common.enabled')" />
|
||||
|
||||
Reference in New Issue
Block a user