diff --git a/static/fields.css b/static/fields.css index 5709004..29c2837 100644 --- a/static/fields.css +++ b/static/fields.css @@ -113,6 +113,29 @@ select * { background: var(--bg-selected); } +.settings-set-container details summary { + display: flex; + justify-content: space-between; +} + +.dangerous-button, .action-button { + border: solid 1px var(--text-color2); + border-radius: 0.5em; + padding: 0.3em; + margin: 0.2em; +} +summary .dangerous-button, summary .action-button { + margin: 0; +} + +.dangerous-button { + background: var(--bg-danger); +} + +.action-button { + background: var(--brand-bg); +} + /*********************** Стили для красивых 'switch' ***********************/ .toggle-input { diff --git a/static/main.html b/static/main.html index 9f810ce..87a2985 100644 --- a/static/main.html +++ b/static/main.html @@ -43,7 +43,7 @@
-
+

Статистика приема

@@ -112,7 +112,7 @@
-
+

Настройки приема/передачи

-
+

Настройки 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) {