From bffe6fb9bfa1fe61eab4f03bd318c010644d7afb Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 30 Jun 2022 10:53:40 +0900 Subject: [PATCH] tweak client --- locales/ja-JP.yml | 2 + packages/client/src/components/form/group.vue | 36 --- packages/client/src/components/form/range.vue | 17 +- .../src/components/global/router-view.vue | 3 +- packages/client/src/menu.ts | 2 + .../client/src/pages/admin/object-storage.vue | 1 - packages/client/src/pages/gallery/edit.vue | 7 +- packages/client/src/pages/settings/deck.vue | 6 +- .../client/src/pages/settings/general.vue | 12 +- packages/client/src/scripts/get-note-menu.ts | 248 +++++++++--------- packages/client/src/store.ts | 4 + .../client/src/widgets/instance-cloud.vue | 2 +- 12 files changed, 156 insertions(+), 184 deletions(-) delete mode 100644 packages/client/src/components/form/group.vue diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 9de5b99d1..17de04ebc 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -858,6 +858,8 @@ isSystemAccount: "システムにより自動で作成・管理されている typeToConfirm: "この操作を行うには {x} と入力してください" deleteAccount: "アカウント削除" document: "ドキュメント" +numberOfPageCache: "ページキャッシュ数" +numberOfPageCacheDescription: "多くすると利便性が向上しますが、負荷とメモリ使用量が増えます。" _emailUnavailable: used: "既に使用されています" diff --git a/packages/client/src/components/form/group.vue b/packages/client/src/components/form/group.vue deleted file mode 100644 index 1e8376ca4..000000000 --- a/packages/client/src/components/form/group.vue +++ /dev/null @@ -1,36 +0,0 @@ - - - - - diff --git a/packages/client/src/components/form/range.vue b/packages/client/src/components/form/range.vue index ac4a781e3..9bb0164a2 100644 --- a/packages/client/src/components/form/range.vue +++ b/packages/client/src/components/form/range.vue @@ -4,7 +4,7 @@
-
+
@@ -12,6 +12,7 @@
+
@@ -62,7 +63,7 @@ export default defineComponent({ const thumbEl = ref(); const rawValue = ref((props.modelValue - props.min) / (props.max - props.min)); - const steppedValue = computed(() => { + const steppedRawValue = computed(() => { if (props.step) { const step = props.step / (props.max - props.min); return (step * Math.round(rawValue.value / step)); @@ -71,7 +72,11 @@ export default defineComponent({ } }); const finalValue = computed(() => { - return (steppedValue.value * (props.max - props.min)) + props.min; + if (Number.isInteger(props.step)) { + return Math.round((steppedRawValue.value * (props.max - props.min)) + props.min); + } else { + return (steppedRawValue.value * (props.max - props.min)) + props.min; + } }); watch(finalValue, () => { context.emit('update:modelValue', finalValue.value); @@ -86,10 +91,10 @@ export default defineComponent({ if (containerEl.value == null) { thumbPosition.value = 0; } else { - thumbPosition.value = (containerEl.value.offsetWidth - thumbWidth.value) * steppedValue.value; + thumbPosition.value = (containerEl.value.offsetWidth - thumbWidth.value) * steppedRawValue.value; } }; - watch([steppedValue, containerEl], calcThumbPosition); + watch([steppedRawValue, containerEl], calcThumbPosition); let ro: ResizeObserver | undefined; @@ -154,7 +159,7 @@ export default defineComponent({ return { rawValue, finalValue, - steppedValue, + steppedRawValue, onMousedown, containerEl, thumbEl, diff --git a/packages/client/src/components/global/router-view.vue b/packages/client/src/components/global/router-view.vue index 56b53e012..7138faaa9 100644 --- a/packages/client/src/components/global/router-view.vue +++ b/packages/client/src/components/global/router-view.vue @@ -1,5 +1,5 @@ @@ -7,6 +7,7 @@