added admin option for configuring Aria2 globally;option for diallowing aria2 settings for non-privileged users;cleanining up

This commit is contained in:
huangjx
2022-07-31 22:30:32 +08:00
parent e85b8b87ba
commit b1b8bcf988
16 changed files with 284 additions and 129 deletions

View File

@@ -18,7 +18,7 @@
</button>
<button
class="custom-settings-save-btn"
@click.prevent="saveOptions($event)"
@click.prevent="saveOptions"
:data-rel="id"
>
<slot name="save">Save</slot>

View File

@@ -9,7 +9,7 @@
placeholder="Leave empty if no value needed"
class="form-input-text"
/>
<button class="has-content icon-close" @click="remove($event)"></button>
<button class="has-content icon-close" @click="remove"></button>
</div>
</template>
<script>

View File

@@ -8,7 +8,7 @@
:name="id"
:value="value"
:placeholder="placeholder"
@blur="saveHandler($event)"
@change="saveHandler"
:data-rel="container"
/>
<input
@@ -16,7 +16,7 @@
type="button"
value="save"
:data-rel="container"
@click.prevent="saveHandler($event)"
@click.prevent="saveHandler"
/>
</div>
</template>
@@ -36,14 +36,15 @@ export default {
},
},
data() {
let id = this.id.replaceAll("_", "-");
return {
classes: this.id.replace("_", "-") + "-input",
container: this.id.replace("_", "-") + "-container",
classes: id + "-input",
container: id + "-container",
};
},
methods: {
saveHandler(e) {
if (e.type == "blur" && this.useBtn) {
if (e.type == "change" && this.useBtn) {
return;
}
e.stopPropagation();
@@ -56,6 +57,9 @@ export default {
.httpClient(url)
.setData(data)
.setHandler(function (resp) {
if (!resp) {
return;
}
if (resp.error) {
helper.error(resp.error);
return;