mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 18:35:51 +02:00
bug fix, update screenshots
This commit is contained in:
parent
02986a4bfd
commit
87c2fa520c
13 changed files with 16 additions and 36 deletions
|
@ -7,6 +7,10 @@
|
|||
<a href="/index.html">
|
||||
<a-icon type="home"/>
|
||||
</a>
|
||||
|
||||
<a @click="logout" style="margin-left: 20px">
|
||||
<a-icon type="logout"/>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -15,6 +19,14 @@
|
|||
export default {
|
||||
name: 'HeaderComponent',
|
||||
components: {},
|
||||
methods: {
|
||||
logout() {
|
||||
this.$api.auth.logout().then(() => {
|
||||
this.$message.success('注销成功')
|
||||
this.$router.push('/login')
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<a-card title="配置文件实时编辑">
|
||||
<a-card title="配置文件编辑">
|
||||
<vue-itextarea v-model="configText"/>
|
||||
<footer-tool-bar>
|
||||
<a-button type="primary" @click="save">保存</a-button>
|
||||
|
@ -9,11 +9,11 @@
|
|||
|
||||
<script>
|
||||
import FooterToolBar from "@/components/FooterToolbar/FooterToolBar"
|
||||
|
||||
import VueItextarea from "@/components/VueItextarea/VueItextarea"
|
||||
|
||||
export default {
|
||||
name: "DomainEdit",
|
||||
components: {FooterToolBar},
|
||||
components: {FooterToolBar, VueItextarea},
|
||||
data() {
|
||||
return {
|
||||
name: this.$route.params.name,
|
||||
|
|
|
@ -263,37 +263,6 @@ export default {
|
|||
}
|
||||
}
|
||||
|
||||
},
|
||||
pressTab(event) {
|
||||
let target = event.target
|
||||
let value = target.value
|
||||
let start = target.selectionStart;
|
||||
let end = target.selectionEnd;
|
||||
if (event) {
|
||||
value = value.substring(0, start) + '\t' + value.substring(end);
|
||||
event.target.value = value;
|
||||
setTimeout(() => target.selectionStart = target.selectionEnd = start + 1, 0);
|
||||
}
|
||||
},
|
||||
pressEnter(event) {
|
||||
let target = event.target
|
||||
let value = target.value
|
||||
let start = target.selectionStart
|
||||
let end = target.selectionEnd
|
||||
|
||||
if (event.key === 'Enter') {
|
||||
let current_line = value.substr(0, start).split("\n").pop(); // line, we are currently on
|
||||
if (current_line && current_line.startsWith('\t')) { // type tab
|
||||
event.preventDefault();
|
||||
// detect how many tabs in the begining and apply
|
||||
let spaces_count = current_line.search(/\S|$/); // position of first non white-space character
|
||||
let tabs_count = spaces_count ? spaces_count / this.TAB_SIZE : 0
|
||||
value = value.substring(0, start) + '\n' + '\t'.repeat(tabs_count) + value.substring(end)
|
||||
event.target.value = value
|
||||
setTimeout(() => target.selectionStart = target.selectionEnd =
|
||||
start + this.TAB_SIZE * tabs_count + 1, 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":"0.1.0","build_id":16}
|
||||
{"version":"0.1.0","build_id":18}
|
Loading…
Add table
Add a link
Reference in a new issue