2019-01-05 16:12:09 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<p v-if="!isDefault">
|
2021-03-21 11:51:58 +00:00
|
|
|
<label for="username">{{ $t("settings.username") }}</label>
|
|
|
|
<input
|
|
|
|
class="input input--block"
|
|
|
|
type="text"
|
|
|
|
v-model="user.username"
|
|
|
|
id="username"
|
|
|
|
/>
|
2019-01-05 16:12:09 +00:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<p v-if="!isDefault">
|
2021-03-21 11:51:58 +00:00
|
|
|
<label for="password">{{ $t("settings.password") }}</label>
|
|
|
|
<input
|
|
|
|
class="input input--block"
|
|
|
|
type="password"
|
|
|
|
:placeholder="passwordPlaceholder"
|
|
|
|
v-model="user.password"
|
|
|
|
id="password"
|
|
|
|
/>
|
2019-01-05 16:12:09 +00:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
2021-03-21 11:51:58 +00:00
|
|
|
<label for="scope">{{ $t("settings.scope") }}</label>
|
|
|
|
<input
|
|
|
|
class="input input--block"
|
|
|
|
type="text"
|
|
|
|
v-model="user.scope"
|
|
|
|
id="scope"
|
|
|
|
/>
|
2019-01-05 16:12:09 +00:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
2021-03-21 11:51:58 +00:00
|
|
|
<label for="locale">{{ $t("settings.language") }}</label>
|
|
|
|
<languages
|
|
|
|
class="input input--block"
|
|
|
|
id="locale"
|
|
|
|
:locale.sync="user.locale"
|
|
|
|
></languages>
|
2019-01-05 16:12:09 +00:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<p v-if="!isDefault">
|
2021-03-21 11:51:58 +00:00
|
|
|
<input
|
|
|
|
type="checkbox"
|
|
|
|
:disabled="user.perm.admin"
|
|
|
|
v-model="user.lockPassword"
|
|
|
|
/>
|
|
|
|
{{ $t("settings.lockPassword") }}
|
2019-01-05 16:12:09 +00:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<permissions :perm.sync="user.perm" />
|
2020-10-01 14:45:24 +00:00
|
|
|
<commands v-if="isExecEnabled" :commands.sync="user.commands" />
|
2019-01-05 16:12:09 +00:00
|
|
|
|
|
|
|
<div v-if="!isDefault">
|
2021-03-21 11:51:58 +00:00
|
|
|
<h3>{{ $t("settings.rules") }}</h3>
|
|
|
|
<p class="small">{{ $t("settings.rulesHelp") }}</p>
|
2019-01-05 16:12:09 +00:00
|
|
|
<rules :rules.sync="user.rules" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-03-21 11:51:58 +00:00
|
|
|
import Languages from "./Languages";
|
|
|
|
import Rules from "./Rules";
|
|
|
|
import Permissions from "./Permissions";
|
|
|
|
import Commands from "./Commands";
|
|
|
|
import { enableExec } from "@/utils/constants";
|
2019-01-05 16:12:09 +00:00
|
|
|
|
|
|
|
export default {
|
2021-03-21 11:51:58 +00:00
|
|
|
name: "user",
|
2019-01-05 16:12:09 +00:00
|
|
|
components: {
|
|
|
|
Permissions,
|
|
|
|
Languages,
|
|
|
|
Rules,
|
2021-03-21 11:51:58 +00:00
|
|
|
Commands,
|
2019-01-05 16:12:09 +00:00
|
|
|
},
|
2021-03-21 11:51:58 +00:00
|
|
|
props: ["user", "isNew", "isDefault"],
|
2019-01-05 16:12:09 +00:00
|
|
|
computed: {
|
2021-03-21 11:51:58 +00:00
|
|
|
passwordPlaceholder() {
|
|
|
|
return this.isNew ? "" : this.$t("settings.avoidChanges");
|
2020-10-01 14:45:24 +00:00
|
|
|
},
|
2021-03-21 11:51:58 +00:00
|
|
|
isExecEnabled: () => enableExec,
|
2019-01-05 16:12:09 +00:00
|
|
|
},
|
|
|
|
watch: {
|
2021-03-21 11:51:58 +00:00
|
|
|
"user.perm.admin": function () {
|
|
|
|
if (!this.user.perm.admin) return;
|
|
|
|
this.user.lockPassword = false;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2019-01-05 16:12:09 +00:00
|
|
|
</script>
|