mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-07 23:30:26 +08:00
正则表达式填写多行时提示用户需要转换成竖杠(|)符号
This commit is contained in:
@@ -589,7 +589,7 @@ body.expanded .main {
|
||||
width: 4px;
|
||||
}
|
||||
.main .tab-menu {
|
||||
margin-top: 0.5em !important;
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -106,7 +106,7 @@
|
||||
<!-- 右侧主操作栏 -->
|
||||
<div class="main" :class="{'without-menu':teaSubMenus.menus == null || teaSubMenus.menus.length == 0 || (teaSubMenus.menus.length == 1 && teaSubMenus.menus[0].alwaysActive), 'without-secondary-menu':teaSubMenus.alwaysMenu == null || teaSubMenus.alwaysMenu.items.length <= 1, 'without-footer':!teaShowOpenSourceInfo}" v-cloak="">
|
||||
<!-- 操作菜单 -->
|
||||
<div class="ui top menu tabular tab-menu small" v-if="teaTabbar.length > 0">
|
||||
<div class="ui top menu tabular tab-menu small" v-if="teaTabbar.length > 1">
|
||||
<a class="item" v-for="item in teaTabbar" :class="{'active':item.active, right:item.right, title: item.isTitle, icon: item.icon != null && item.icon.length > 0}" :href="item.url">
|
||||
<var>{{item.name}}<span v-if="item.subName.length > 0">({{item.subName}})</span><i class="icon small" :class="item.icon" v-if="item.icon != null && item.icon.length > 0"></i> </var>
|
||||
<div class="bottom-indicator" v-if="item.active && !item.isTitle"></div>
|
||||
|
||||
@@ -578,7 +578,7 @@ body.expanded .main {
|
||||
|
||||
.main {
|
||||
.tab-menu {
|
||||
margin-top: 0.5em !important;
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
|
||||
@@ -116,6 +116,7 @@
|
||||
|
||||
<!-- 其余数据 -->
|
||||
<textarea rows="3" maxlength="4096" name="value" v-model="rule.value" @input="changeRuleValue" v-else></textarea>
|
||||
<p class="comment" v-if="(rule.operator == 'match' || rule.operator == 'not match') && rule.value.match(/\n/)"><span class="red">警告:发现你填写的正则表达式中包含了换行符,如果你的意图是每行都表示不同的选项,那么请使用竖杠(<code-label>|</code-label>)符号代替换行符,比如把<code-label>a换行b换行c换行</code-label>改成<code-label>a|b|c</code-label>,<a href="" @click.prevent="convertValueLine">[帮我转换]</a>。</span></p>
|
||||
|
||||
<!-- 特殊规则 -->
|
||||
<div style="margin-top: 1em">
|
||||
|
||||
@@ -122,6 +122,21 @@ Tea.context(function () {
|
||||
}
|
||||
}
|
||||
|
||||
this.convertValueLine = function () {
|
||||
let value = this.rule.value
|
||||
if (value != null && value.length > 0) {
|
||||
let lines = value.split(/\n/)
|
||||
let resultLines = []
|
||||
lines.forEach(function (line) {
|
||||
line = line.trim()
|
||||
if (line.length > 0) {
|
||||
resultLines.push(line)
|
||||
}
|
||||
})
|
||||
this.rule.value = resultLines.join("|")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 正则测试
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user