Статистика приема
Настройки приема/передачи
Настройки QoS
Классы CD
- +#{{ index }} CIR={{ rule.cir }}кбит, PIR={{ rule.pir }}кбит {{ rule.description }}
Фильтры ({{ rule.filters.length }})
- -#{{ filterIndex }} {{ qosGenerateRuleDescription(filter) }}
-
Эти настройки пока недоступны, но скоро разработчик это поправит. А пока купи разработчику банку пива колы)
@@ -498,7 +498,7 @@
Эти настройки пока недоступны, но скоро разработчик это поправит. А пока смотри на крокодила
@@ -609,6 +609,10 @@ return { modulation: 'qpsk', speed: '1/4' } } + Vue.component('qos-component-root', { + template: "" + }) + const app = new Vue({ el: '#app', data: { @@ -731,7 +735,7 @@ qos: { en: false, - rt1: [{cir: 100, description: 'test class'}], + rt1: [{cir: 100, description: 'test class'}, {cir: 200, description: 'fuck class'}], rt2: [], rt3: [], cd: [], @@ -916,6 +920,56 @@ case 'rt3': this.qos.rt3.splice(index, 1); break case 'cd': this.qos.cd.splice(index, 1); break } + }, + + qosDelFilter(name, index, filterIndex) { + switch (name) { + case 'rt1': this.qos.rt1[index].filters.splice(filterIndex, 1); break + case 'rt2': this.qos.rt2[index].filters.splice(filterIndex, 1); break + case 'rt3': this.qos.rt3[index].filters.splice(filterIndex, 1); break + case 'cd': this.qos.cd[index].filters.splice(filterIndex, 1); break + } + }, + + qosGenerateRuleDescription(filter) { + // попытка 1: просто отобразить все фильтры + let result = "" + let isFirst = true; + for (const key in filter) { + if (!filter[key]) { + continue + } + if (isFirst) { + isFirst = false; + } else { + result += '; ' + } + result += `${key}: ${filter[key]}` + } + if (result === "") { + return "пустой" + } + + const maxResultLen = 60 + + if (result.length > maxResultLen) { + // попытка 2, отобразить что вообще в этом фильтре использовалось + result = "" + isFirst = true; + for (const key in filter) { + if (!filter[key]) { + continue + } + if (isFirst) { + isFirst = false; + } else { + result += ', ' + } + result += `${key}` + } + } + + return result } }, mounted() { diff --git a/static/style.css b/static/style.css index 23b0fbd..13be20f 100644 --- a/static/style.css +++ b/static/style.css @@ -12,6 +12,7 @@ body { --bg-selected: #F1F1F1; --bg-element: #a7a7a7; --bg-action: #5181fe; + --bg-danger: #db2828; } @media (prefers-color-scheme: dark) {