Skip to content

Commit 98d574e

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 5ce8461 + ae274db commit 98d574e

File tree

6 files changed

+256
-201
lines changed

6 files changed

+256
-201
lines changed

application/src/main/resources/extensions/attachment-local-policy.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: PolicyTemplate
33
metadata:
44
name: local
55
spec:
6-
displayName: Local Storage
6+
displayName: 本地存储
77
settingName: local-policy-template-setting
88
---
99
apiVersion: storage.halo.run/v1alpha1

ui/console-src/modules/contents/attachments/components/AttachmentGroupList.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ const onEditingModalClose = () => {
9595
const handleDelete = (group: Group) => {
9696
Dialog.warning({
9797
title: t("core.attachment.group_list.operations.delete.title"),
98-
description: t("core.attachment.group_list.operations.delete.title"),
98+
description: t("core.attachment.group_list.operations.delete.description"),
9999
confirmType: "danger",
100100
confirmText: t("core.common.buttons.confirm"),
101101
cancelText: t("core.common.buttons.cancel"),

ui/src/components/form/AnnotationsForm.vue

+74-26
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
<script lang="ts" setup>
22
import {
3-
reset,
4-
submitForm,
53
type FormKitNode,
64
type FormKitSchemaCondition,
75
type FormKitSchemaNode,
6+
reset,
7+
submitForm,
88
} from "@formkit/core";
9+
10+
import { IconArrowRight } from "@halo-dev/components";
11+
912
import { computed, nextTick, onMounted, ref, watch } from "vue";
1013
import { apiClient } from "@/utils/api-client";
1114
import type { AnnotationSetting } from "@halo-dev/api-client";
@@ -196,6 +199,12 @@ defineExpose({
196199
annotations,
197200
customAnnotations,
198201
});
202+
203+
const showCustomForm = ref(false);
204+
205+
function onCustomFormToggle(e: Event) {
206+
showCustomForm.value = (e.target as HTMLDetailsElement).open;
207+
}
199208
</script>
200209

201210
<template>
@@ -219,34 +228,73 @@ defineExpose({
219228
/>
220229
</template>
221230
</FormKit>
222-
<FormKit
223-
v-if="annotations"
224-
:id="customFormId"
225-
type="form"
226-
:preserve="true"
227-
:form-class="`${avaliableAnnotationSettings.length ? 'py-4' : ''}`"
228-
@submit-invalid="onCustomFormSubmitCheck"
229-
@submit="customFormInvalid = false"
231+
232+
<details
233+
:open="showCustomForm"
234+
class="flex cursor-pointer space-y-4 py-4 transition-all first:pt-0"
235+
@toggle="onCustomFormToggle"
230236
>
237+
<summary class="group flex items-center justify-between">
238+
<div class="block text-sm font-medium text-gray-700">
239+
{{
240+
$t(
241+
showCustomForm
242+
? "core.components.annotations_form.buttons.collapse"
243+
: "core.components.annotations_form.buttons.expand"
244+
)
245+
}}
246+
</div>
247+
<div
248+
class="-mr-1 inline-flex items-center justify-center rounded-full p-1 group-hover:bg-gray-100"
249+
:class="{ 'bg-gray-100': showCustomForm }"
250+
>
251+
<IconArrowRight
252+
:class="{ 'rotate-90 !text-gray-900': showCustomForm }"
253+
class="text-gray-600 transition-all"
254+
/>
255+
</div>
256+
</summary>
257+
231258
<FormKit
232-
v-model="customAnnotationsState"
233-
type="repeater"
234-
:label="$t('core.components.annotations_form.custom_fields.label')"
259+
v-if="annotations"
260+
:id="customFormId"
261+
type="form"
262+
:preserve="true"
263+
:form-class="`${avaliableAnnotationSettings.length ? 'py-4' : ''}`"
264+
@submit-invalid="onCustomFormSubmitCheck"
265+
@submit="customFormInvalid = false"
235266
>
236267
<FormKit
237-
type="text"
238-
label="Key"
239-
name="key"
240-
validation="required:trim|keyValidationRule"
241-
:validation-rules="{ keyValidationRule }"
242-
:validation-messages="{
243-
keyValidationRule: $t(
244-
'core.components.annotations_form.custom_fields.validation'
245-
),
246-
}"
247-
></FormKit>
248-
<FormKit type="text" label="Value" name="value" value=""></FormKit>
268+
v-model="customAnnotationsState"
269+
type="repeater"
270+
:label="$t('core.components.annotations_form.custom_fields.label')"
271+
>
272+
<FormKit
273+
type="text"
274+
label="Key"
275+
name="key"
276+
validation="required:trim|keyValidationRule"
277+
:validation-rules="{ keyValidationRule }"
278+
:validation-messages="{
279+
keyValidationRule: $t(
280+
'core.components.annotations_form.custom_fields.validation'
281+
),
282+
}"
283+
></FormKit>
284+
<FormKit type="text" label="Value" name="value" value=""></FormKit>
285+
</FormKit>
249286
</FormKit>
250-
</FormKit>
287+
</details>
251288
</div>
252289
</template>
290+
291+
<style scoped>
292+
details > summary {
293+
list-style: none;
294+
}
295+
296+
/** Hide the default marker **/
297+
details > summary::-webkit-details-marker {
298+
display: none;
299+
}
300+
</style>

0 commit comments

Comments
 (0)