сделал вторую версию прототипа для QoS, осталось для нее только сохранение прикрутить

This commit is contained in:
Vladislav Ostapov 2024-11-08 18:08:47 +03:00
parent 1f5eb54225
commit 4c1ce6031b

View File

@ -432,15 +432,18 @@
<span class="toggle-input"><input type="checkbox" v-model="qos.en" /><span class="slider"></span></span> <span class="toggle-input"><input type="checkbox" v-model="qos.en" /><span class="slider"></span></span>
</label> </label>
</div> </div>
<h3>Классы CD</h3> <template>
<button class="action-button" @click="qosAddClass('cd')">Добавить класс CD</button> <div v-for="classesGroup in ['rt1', 'rt2', 'rt3', 'cd']">
<details v-for="(rule, index) in qos.cd" :key="index" class="settings-set-container"> <h3>Классы {{ classesGroup.toUpperCase() }}</h3>
<summary >#{{ index }} CIR={{ rule.cir }}кбит, PIR={{ rule.pir }}кбит {{ rule.description }}</summary> <button class="action-button" @click="qosAddClass(classesGroup)">Добавить класс {{ classesGroup.toUpperCase() }}</button>
<details v-for="(rule, index) in qos[classesGroup]" :key="index" class="settings-set-container">
<summary v-if="classesGroup === 'cd'">#{{ index }} CIR={{ rule.cir }}кбит, PIR={{ rule.pir }}кбит {{ rule.description }}</summary>
<summary v-if="classesGroup !== 'cd'">#{{ index }} CBR={{ rule.cir }}кбит {{ rule.description }}</summary>
<label> <label>
<span>CIR</span> <span v-if="classesGroup === 'cd'">CIR</span> <span v-if="classesGroup !== 'cd'">CBR</span>
<input v-model="rule.cir" type="number"/> <input v-model="rule.cir" type="number"/>
</label> </label>
<label> <label v-if="classesGroup === 'cd'">
<span>PIR</span> <span>PIR</span>
<input v-model="rule.pir" type="number"/> <input v-model="rule.pir" type="number"/>
</label> </label>
@ -451,10 +454,10 @@
<h3>Фильтры ({{ rule.filters.length }})</h3> <h3>Фильтры ({{ rule.filters.length }})</h3>
<div> <div>
<button class="action-button" @click="qosClassAddRule('cd', index)">Добавить правило</button> <button class="action-button" @click="qosClassAddRule(classesGroup, index)">Добавить правило</button>
</div> </div>
<details v-for="(filter, filterIndex) in rule.filters" :key="filterIndex" class="settings-set-container"> <details v-for="(filter, filterIndex) in rule.filters" :key="filterIndex" class="settings-set-container">
<summary><span>#{{ filterIndex }} {{ qosGenerateRuleDescription(filter) }}</span> <button class="dangerous-button" @click="qosDelFilter('cd', index, filterIndex)">Del</button></summary> <summary><span>#{{ filterIndex }} {{ qosGenerateRuleDescription(filter) }}</span> <button class="dangerous-button" @click="qosDelFilter(classesGroup, index, filterIndex)">Del</button></summary>
<label> <label>
<span>VLAN ID</span> <span>VLAN ID</span>
<input v-model="filter.vlan" type="text"> <input v-model="filter.vlan" type="text">
@ -486,9 +489,14 @@
</details> </details>
<div> <div>
<button class="dangerous-button" @click="qosDelClass('cd', index)">Удалить класс QoS</button> <button class="dangerous-button" @click="qosDelClass(classesGroup, index)">Удалить класс QoS</button>
</div> </div>
</details> </details>
</div>
</template>
<button class="action-button" @click="settingsSubmitQoS()">Применить <span class="submit-spinner" v-show="submitStatus.qos"></span></button> <button class="action-button" @click="settingsSubmitQoS()">Применить <span class="submit-spinner" v-show="submitStatus.qos"></span></button>
<p> <p>