This commit is contained in:
syuilo 2023-05-29 17:13:12 +09:00
parent afa4cd9112
commit 8c66fad96b
9 changed files with 20 additions and 19 deletions

View file

@ -56,6 +56,7 @@ module.exports = {
'vue/require-v-for-key': 'warn', 'vue/require-v-for-key': 'warn',
'vue/no-unused-components': 'warn', 'vue/no-unused-components': 'warn',
'vue/no-unused-vars': 'warn', 'vue/no-unused-vars': 'warn',
'vue/no-dupe-keys': 'warn',
'vue/valid-v-for': 'warn', 'vue/valid-v-for': 'warn',
'vue/return-in-computed-property': 'warn', 'vue/return-in-computed-property': 'warn',
'vue/no-setup-props-destructure': 'warn', 'vue/no-setup-props-destructure': 'warn',

View file

@ -25,11 +25,11 @@
</div> </div>
<div v-if="type === 'and' || type === 'or'" :class="$style.values" class="_gaps"> <div v-if="type === 'and' || type === 'or'" :class="$style.values" class="_gaps">
<Sortable v-model="v.values" tag="div" class="_gaps" item-key="id" handle=".drag-handle" :group="{ name: 'roleFormula' }" :animation="150" :swap-threshold="0.5"> <Sortable v-model="v.values" tag="div" class="_gaps" itemKey="id" handle=".drag-handle" :group="{ name: 'roleFormula' }" :animation="150" :swapThreshold="0.5">
<template #item="{element}"> <template #item="{element}">
<div :class="$style.item"> <div :class="$style.item">
<!-- divが無いとエラーになる https://github.com/SortableJS/vue.draggable.next/issues/189 --> <!-- divが無いとエラーになる https://github.com/SortableJS/vue.draggable.next/issues/189 -->
<RolesEditorFormula :model-value="element" draggable @update:model-value="updated => valuesItemUpdated(updated)" @remove="removeItem(element)"/> <RolesEditorFormula :modelValue="element" draggable @update:modelValue="updated => valuesItemUpdated(updated)" @remove="removeItem(element)"/>
</div> </div>
</template> </template>
</Sortable> </Sortable>

View file

@ -2,7 +2,7 @@
<div> <div>
<MkStickyContainer> <MkStickyContainer>
<template #header><XHeader :actions="headerActions" :tabs="headerTabs"/></template> <template #header><XHeader :actions="headerActions" :tabs="headerTabs"/></template>
<MkSpacer :content-max="700"> <MkSpacer :contentMax="700">
<div class="_gaps"> <div class="_gaps">
<div class="_buttons"> <div class="_buttons">
<MkButton primary rounded @click="edit"><i class="ti ti-pencil"></i> {{ i18n.ts.edit }}</MkButton> <MkButton primary rounded @click="edit"><i class="ti ti-pencil"></i> {{ i18n.ts.edit }}</MkButton>
@ -11,9 +11,9 @@
<MkFolder> <MkFolder>
<template #icon><i class="ti ti-info-circle"></i></template> <template #icon><i class="ti ti-info-circle"></i></template>
<template #label>{{ i18n.ts.info }}</template> <template #label>{{ i18n.ts.info }}</template>
<XEditor :model-value="role" readonly/> <XEditor :modelValue="role" readonly/>
</MkFolder> </MkFolder>
<MkFolder v-if="role.target === 'manual'" default-open> <MkFolder v-if="role.target === 'manual'" defaultOpen>
<template #icon><i class="ti ti-users"></i></template> <template #icon><i class="ti ti-users"></i></template>
<template #label>{{ i18n.ts.users }}</template> <template #label>{{ i18n.ts.users }}</template>
<template #suffix>{{ role.usersCount }}</template> <template #suffix>{{ role.usersCount }}</template>

View file

@ -2,7 +2,7 @@
<div> <div>
<MkStickyContainer> <MkStickyContainer>
<template #header><XHeader :actions="headerActions" :tabs="headerTabs"/></template> <template #header><XHeader :actions="headerActions" :tabs="headerTabs"/></template>
<MkSpacer :content-max="700"> <MkSpacer :contentMax="700">
<div class="_gaps"> <div class="_gaps">
<MkFolder> <MkFolder>
<template #label>{{ i18n.ts._role.baseRole }}</template> <template #label>{{ i18n.ts._role.baseRole }}</template>
@ -14,7 +14,7 @@
<MkFolder v-if="matchQuery([i18n.ts._role._options.rateLimitFactor, 'rateLimitFactor'])"> <MkFolder v-if="matchQuery([i18n.ts._role._options.rateLimitFactor, 'rateLimitFactor'])">
<template #label>{{ i18n.ts._role._options.rateLimitFactor }}</template> <template #label>{{ i18n.ts._role._options.rateLimitFactor }}</template>
<template #suffix>{{ Math.floor(policies.rateLimitFactor * 100) }}%</template> <template #suffix>{{ Math.floor(policies.rateLimitFactor * 100) }}%</template>
<MkRange :model-value="policies.rateLimitFactor * 100" :min="30" :max="300" :step="10" :text-converter="(v) => `${v}%`" @update:model-value="v => policies.rateLimitFactor = (v / 100)"> <MkRange :modelValue="policies.rateLimitFactor * 100" :min="30" :max="300" :step="10" :textConverter="(v) => `${v}%`" @update:modelValue="v => policies.rateLimitFactor = (v / 100)">
<template #caption>{{ i18n.ts._role._options.descriptionOfRateLimitFactor }}</template> <template #caption>{{ i18n.ts._role._options.descriptionOfRateLimitFactor }}</template>
</MkRange> </MkRange>
</MkFolder> </MkFolder>
@ -156,13 +156,13 @@
<MkFoldableSection> <MkFoldableSection>
<template #header>Manual roles</template> <template #header>Manual roles</template>
<div class="_gaps_s"> <div class="_gaps_s">
<MkRolePreview v-for="role in roles.filter(x => x.target === 'manual')" :key="role.id" :role="role" :for-moderation="true"/> <MkRolePreview v-for="role in roles.filter(x => x.target === 'manual')" :key="role.id" :role="role" :forModeration="true"/>
</div> </div>
</MkFoldableSection> </MkFoldableSection>
<MkFoldableSection> <MkFoldableSection>
<template #header>Conditional roles</template> <template #header>Conditional roles</template>
<div class="_gaps_s"> <div class="_gaps_s">
<MkRolePreview v-for="role in roles.filter(x => x.target === 'conditional')" :key="role.id" :role="role" :for-moderation="true"/> <MkRolePreview v-for="role in roles.filter(x => x.target === 'conditional')" :key="role.id" :role="role" :forModeration="true"/>
</div> </div>
</MkFoldableSection> </MkFoldableSection>
</div> </div>

View file

@ -1,7 +1,7 @@
<template> <template>
<MkStickyContainer> <MkStickyContainer>
<template #header><XHeader :actions="headerActions" :tabs="headerTabs"/></template> <template #header><XHeader :actions="headerActions" :tabs="headerTabs"/></template>
<MkSpacer :content-max="700" :margin-min="16" :margin-max="32"> <MkSpacer :contentMax="700" :marginMin="16" :marginMax="32">
<FormSuspense :p="init"> <FormSuspense :p="init">
<div class="_gaps_m"> <div class="_gaps_m">
<MkFolder> <MkFolder>
@ -33,7 +33,7 @@
<option value="remote">{{ i18n.ts.remoteOnly }}</option> <option value="remote">{{ i18n.ts.remoteOnly }}</option>
</MkRadios> </MkRadios>
<MkRange v-model="sensitiveMediaDetectionSensitivity" :min="0" :max="4" :step="1" :text-converter="(v) => `${v + 1}`"> <MkRange v-model="sensitiveMediaDetectionSensitivity" :min="0" :max="4" :step="1" :textConverter="(v) => `${v + 1}`">
<template #label>{{ i18n.ts._sensitiveMediaDetection.sensitivity }}</template> <template #label>{{ i18n.ts._sensitiveMediaDetection.sensitivity }}</template>
<template #caption>{{ i18n.ts._sensitiveMediaDetection.sensitivityDescription }}</template> <template #caption>{{ i18n.ts._sensitiveMediaDetection.sensitivityDescription }}</template>
</MkRange> </MkRange>
@ -65,7 +65,7 @@
<div class="_gaps_m"> <div class="_gaps_m">
<span>{{ i18n.ts.activeEmailValidationDescription }}</span> <span>{{ i18n.ts.activeEmailValidationDescription }}</span>
<MkSwitch v-model="enableActiveEmailValidation" @update:model-value="save"> <MkSwitch v-model="enableActiveEmailValidation" @update:modelValue="save">
<template #label>Enable</template> <template #label>Enable</template>
</MkSwitch> </MkSwitch>
</div> </div>
@ -77,7 +77,7 @@
<template v-else #suffix>Disabled</template> <template v-else #suffix>Disabled</template>
<div class="_gaps_m"> <div class="_gaps_m">
<MkSwitch v-model="enableIpLogging" @update:model-value="save"> <MkSwitch v-model="enableIpLogging" @update:modelValue="save">
<template #label>Enable</template> <template #label>Enable</template>
</MkSwitch> </MkSwitch>
</div> </div>

View file

@ -1,7 +1,7 @@
<template> <template>
<MkStickyContainer> <MkStickyContainer>
<template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template> <template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template>
<MkSpacer :content-max="800" :margin-min="16" :margin-max="32"> <MkSpacer :contentMax="800" :marginMin="16" :marginMax="32">
<FormSuspense :p="init" class="_gaps"> <FormSuspense :p="init" class="_gaps">
<MkInput v-model="title"> <MkInput v-model="title">
<template #label>{{ i18n.ts.title }}</template> <template #label>{{ i18n.ts.title }}</template>

View file

@ -1,12 +1,12 @@
<template> <template>
<MkStickyContainer> <MkStickyContainer>
<template #header><MkPageHeader v-model:tab="tab" :actions="headerActions" :tabs="headerTabs"/></template> <template #header><MkPageHeader v-model:tab="tab" :actions="headerActions" :tabs="headerTabs"/></template>
<MkSpacer :content-max="1400"> <MkSpacer :contentMax="1400">
<div class="_root"> <div class="_root">
<div v-if="tab === 'explore'"> <div v-if="tab === 'explore'">
<MkFoldableSection class="_margin"> <MkFoldableSection class="_margin">
<template #header><i class="ti ti-clock"></i>{{ i18n.ts.recentPosts }}</template> <template #header><i class="ti ti-clock"></i>{{ i18n.ts.recentPosts }}</template>
<MkPagination v-slot="{items}" :pagination="recentPostsPagination" :disable-auto-load="true"> <MkPagination v-slot="{items}" :pagination="recentPostsPagination" :disableAutoLoad="true">
<div :class="$style.items"> <div :class="$style.items">
<MkGalleryPostPreview v-for="post in items" :key="post.id" :post="post" class="post"/> <MkGalleryPostPreview v-for="post in items" :key="post.id" :post="post" class="post"/>
</div> </div>
@ -14,7 +14,7 @@
</MkFoldableSection> </MkFoldableSection>
<MkFoldableSection class="_margin"> <MkFoldableSection class="_margin">
<template #header><i class="ti ti-comet"></i>{{ i18n.ts.popularPosts }}</template> <template #header><i class="ti ti-comet"></i>{{ i18n.ts.popularPosts }}</template>
<MkPagination v-slot="{items}" :pagination="popularPostsPagination" :disable-auto-load="true"> <MkPagination v-slot="{items}" :pagination="popularPostsPagination" :disableAutoLoad="true">
<div :class="$style.items"> <div :class="$style.items">
<MkGalleryPostPreview v-for="post in items" :key="post.id" :post="post" class="post"/> <MkGalleryPostPreview v-for="post in items" :key="post.id" :post="post" class="post"/>
</div> </div>

View file

@ -1,7 +1,7 @@
<template> <template>
<MkStickyContainer> <MkStickyContainer>
<template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template> <template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template>
<MkSpacer :content-max="1000" :margin-min="16" :margin-max="32"> <MkSpacer :contentMax="1000" :marginMin="16" :marginMax="32">
<div class="_root"> <div class="_root">
<Transition :name="defaultStore.state.animation ? 'fade' : ''" mode="out-in"> <Transition :name="defaultStore.state.animation ? 'fade' : ''" mode="out-in">
<div v-if="post" class="rkxwuolj"> <div v-if="post" class="rkxwuolj">

View file

@ -1,5 +1,5 @@
<template> <template>
<MkContainer :show-header="widgetProps.showHeader" :naked="widgetProps.transparent"> <MkContainer :showHeader="widgetProps.showHeader" :naked="widgetProps.transparent">
<template #icon><i class="ti ti-server"></i></template> <template #icon><i class="ti ti-server"></i></template>
<template #header>{{ i18n.ts._widgets.serverMetric }}</template> <template #header>{{ i18n.ts._widgets.serverMetric }}</template>
<template #func="{ buttonStyleClass }"><button class="_button" :class="buttonStyleClass" @click="toggleView()"><i class="ti ti-selector"></i></button></template> <template #func="{ buttonStyleClass }"><button class="_button" :class="buttonStyleClass" @click="toggleView()"><i class="ti ti-selector"></i></button></template>