feat: 通報の即時解決機能の改善 (#132)

* feat: 通報の即時解決機能にplaceholderを設定

* PRから
2134a79353
7c7ca57bd7
de88d6099b
This commit is contained in:
まっちゃとーにゅ
2023-08-03 04:51:02 +09:00
committed by GitHub
parent 233d967b82
commit 33e21dd2ec
4 changed files with 20 additions and 19 deletions

View File

@@ -5,18 +5,18 @@
</MkInput>
<div>
<div :class="$style.label">{{ i18n.ts._abuse._resolver.targetUserPattern }}</div>
<PrismEditor v-model="value.targetUserPattern" class="_code code" :class="$style.highlight" :highlight="highlighter" :lineNumbers="false" :readonly="!props.editable"/>
<PrismEditor v-model="value.targetUserPattern" placeholder="^(LocalUser|RemoteUser@RemoteHost)$" class="_code code" :class="$style.highlight" :highlight="highlighter" :lineNumbers="false" :ignoreTabKey="true" :readonly="!props.editable"/>
</div>
<div>
<div :class="$style.label">{{ i18n.ts._abuse._resolver.reporterPattern }}</div>
<PrismEditor v-model="value.reporterPattern" class="_code code" :class="$style.highlight" :highlight="highlighter" :lineNumbers="false" :readonly="!props.editable"/>
<PrismEditor v-model="value.reporterPattern" placeholder="^(LocalUser|.*@RemoteHost)$" class="_code code" :class="$style.highlight" :highlight="highlighter" :lineNumbers="false" :ignoreTabKey="true" :readonly="!props.editable"/>
</div>
<div>
<div :class="$style.label">{{ i18n.ts._abuse._resolver.reportContentPattern }}</div>
<PrismEditor v-model="value.reportContentPattern" class="_code code" :class="$style.highlight" :highlight="highlighter" :lineNumbers="false" :readonly="!props.editable"/>
<PrismEditor v-model="value.reportContentPattern" placeholder=".*" class="_code code" :class="$style.highlight" :highlight="highlighter" :lineNumbers="false" :ignoreTabKey="true" :readonly="!props.editable"/>
</div>
<MkSelect v-model="value.expiresAt" :disabled="!props.editable">
<template #label>{{ i18n.ts._abuse._resolver.expiresAt }}<span v-if="expirationDate" style="float: right;">{{ expirationDate }}</span></template>
<template #label>{{ i18n.ts._abuse._resolver.expiresAt }}<span v-if="expirationDate" style="float: right;"><MkDate :time="expirationDate" mode="absolute">{{ expirationDate }}</MkDate></span></template>
<option value="1hour">{{ i18n.ts._abuse._resolver['1hour'] }}</option>
<option value="12hours">{{ i18n.ts._abuse._resolver['12hours'] }}</option>
<option value="1day">{{ i18n.ts._abuse._resolver['1day'] }}</option>
@@ -70,7 +70,7 @@ const props = defineProps<{
previousExpiresAt?: string;
}
}>();
let expirationDate: string | null = $ref(null);
let expirationDate: Date | null = $ref(null);
type NonNullType<T> = {
[P in keyof T]: NonNullable<T[P]>
@@ -113,7 +113,7 @@ function highlighter(code) {
function renderExpirationDate(empty = false) {
if (value.value.expirationDate && !empty) {
expirationDate = new Date(value.value.expirationDate).toLocaleString();
expirationDate = new Date(value.value.expirationDate);
} else {
expirationDate = null;
}