Compare commits

..

16 commits

Author SHA1 Message Date
UptimeKumaBot
806642d7db
Merge ff29c99ee1 into a65a9f5549 2024-12-31 07:43:26 +00:00
vipnetant
ff29c99ee1 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (130 of 130 strings)

Translation: Dockge/dockge
Translate-URL: https://weblate.kuma.pet/projects/dockge/dockge/zh_Hans/
2024-12-31 07:43:22 +00:00
JIAN YI CHEN
aa8e12780f Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (130 of 130 strings)

Translation: Dockge/dockge
Translate-URL: https://weblate.kuma.pet/projects/dockge/dockge/zh_Hant/
2024-12-31 07:43:22 +00:00
Aindriú Mac Giolla Eoin
12df354c4c Translated using Weblate (Irish)
Currently translated at 100.0% (130 of 130 strings)

Translation: Dockge/dockge
Translate-URL: https://weblate.kuma.pet/projects/dockge/dockge/ga/
2024-12-31 07:43:22 +00:00
Jordi Garcia
f113a5d34b Translated using Weblate (Spanish)
Currently translated at 100.0% (130 of 130 strings)

Translation: Dockge/dockge
Translate-URL: https://weblate.kuma.pet/projects/dockge/dockge/es/
2024-12-31 07:43:22 +00:00
Marco
d18d556d54 Translated using Weblate (German)
Currently translated at 100.0% (130 of 130 strings)

Translation: Dockge/dockge
Translate-URL: https://weblate.kuma.pet/projects/dockge/dockge/de/
2024-12-31 07:43:22 +00:00
Gunnar Norin
2a95700f30 Translated using Weblate (Swedish)
Currently translated at 100.0% (130 of 130 strings)

Translation: Dockge/dockge
Translate-URL: https://weblate.kuma.pet/projects/dockge/dockge/sv/
2024-12-31 07:43:22 +00:00
wial88
06308caa3b Translated using Weblate (German)
Currently translated at 99.2% (129 of 130 strings)

Translation: Dockge/dockge
Translate-URL: https://weblate.kuma.pet/projects/dockge/dockge/de/
2024-12-31 07:43:22 +00:00
retmas-gh
f5bf9a9271 Translated using Weblate (Polish)
Currently translated at 100.0% (130 of 130 strings)

Translation: Dockge/dockge
Translate-URL: https://weblate.kuma.pet/projects/dockge/dockge/pl/
2024-12-31 07:43:22 +00:00
Celer21
718cce4ab2 Translated using Weblate (Czech)
Currently translated at 76.9% (100 of 130 strings)

Translation: Dockge/dockge
Translate-URL: https://weblate.kuma.pet/projects/dockge/dockge/cs/
2024-12-31 07:43:22 +00:00
Donker_Jumala
b4fd436d43 Translated using Weblate (Japanese)
Currently translated at 97.6% (127 of 130 strings)

Translation: Dockge/dockge
Translate-URL: https://weblate.kuma.pet/projects/dockge/dockge/ja/
2024-12-31 07:43:22 +00:00
stanol
7dcd816a83 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (130 of 130 strings)

Translation: Dockge/dockge
Translate-URL: https://weblate.kuma.pet/projects/dockge/dockge/uk/
2024-12-31 07:43:22 +00:00
Cyril59310
3826ba9fdd Translated using Weblate (French)
Currently translated at 100.0% (130 of 130 strings)

Translation: Dockge/dockge
Translate-URL: https://weblate.kuma.pet/projects/dockge/dockge/fr/
2024-12-31 07:43:22 +00:00
MrEddX
1cbfccb379 Translated using Weblate (Bulgarian)
Currently translated at 100.0% (130 of 130 strings)

Translation: Dockge/dockge
Translate-URL: https://weblate.kuma.pet/projects/dockge/dockge/bg/
2024-12-31 07:43:22 +00:00
turnah
a65a9f5549
fix bug 176: preserve YAML comments when reordering items by matching… (#685)
Some checks failed
Node.js CI - Dockge / ci (22, ARM) (push) Has been cancelled
Node.js CI - Dockge / ci (22, ARM64) (push) Has been cancelled
Node.js CI - Dockge / ci (22, macos-latest) (push) Has been cancelled
Node.js CI - Dockge / ci (22, ubuntu-latest) (push) Has been cancelled
Node.js CI - Dockge / ci (22, windows-latest) (push) Has been cancelled
json-yaml-validate / json-yaml-validate (push) Has been cancelled
2024-12-31 15:43:17 +08:00
Cyril59310
9b73e44cd9
Remove useless scrollbar (#642) 2024-12-31 15:41:15 +08:00
2 changed files with 42 additions and 22 deletions

View file

@ -236,42 +236,63 @@ export function copyYAMLComments(doc : Document, src : Document) {
/**
* Copy yaml comments from srcItems to items
* Typescript is super annoying here, so I have to use any here
* TODO: Since comments are belong to the array index, the comments will be lost if the order of the items is changed or removed or added.
* Attempts to preserve comments by matching content rather than just array indices
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function copyYAMLCommentsItems(items : any, srcItems : any) {
function copyYAMLCommentsItems(items: any, srcItems: any) {
if (!items || !srcItems) {
return;
}
// First pass - try to match items by their content
for (let i = 0; i < items.length; i++) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const item : any = items[i];
const item: any = items[i];
// Try to find matching source item by content
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const srcItem : any = srcItems[i];
const srcIndex = srcItems.findIndex((srcItem: any) =>
JSON.stringify(srcItem.value) === JSON.stringify(item.value) &&
JSON.stringify(srcItem.key) === JSON.stringify(item.key)
);
if (!srcItem) {
continue;
}
if (srcIndex !== -1) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const srcItem: any = srcItems[srcIndex];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const nextSrcItem: any = srcItems[srcIndex + 1];
if (item.key && srcItem.key) {
item.key.comment = srcItem.key.comment;
item.key.commentBefore = srcItem.key.commentBefore;
}
if (item.key && srcItem.key) {
item.key.comment = srcItem.key.comment;
item.key.commentBefore = srcItem.key.commentBefore;
}
if (srcItem.comment) {
item.comment = srcItem.comment;
}
if (srcItem.comment) {
item.comment = srcItem.comment;
}
if (item.value && srcItem.value) {
if (typeof item.value === "object" && typeof srcItem.value === "object") {
item.value.comment = srcItem.value.comment;
item.value.commentBefore = srcItem.value.commentBefore;
// Handle comments between array items
if (nextSrcItem && nextSrcItem.commentBefore) {
if (items[i + 1]) {
items[i + 1].commentBefore = nextSrcItem.commentBefore;
}
}
if (item.value.items && srcItem.value.items) {
copyYAMLCommentsItems(item.value.items, srcItem.value.items);
// Handle trailing comments after array items
if (srcItem.value && srcItem.value.comment) {
if (item.value) {
item.value.comment = srcItem.value.comment;
}
}
if (item.value && srcItem.value) {
if (typeof item.value === "object" && typeof srcItem.value === "object") {
item.value.comment = srcItem.value.comment;
item.value.commentBefore = srcItem.value.commentBefore;
if (item.value.items && srcItem.value.items) {
copyYAMLCommentsItems(item.value.items, srcItem.value.items);
}
}
}
}

View file

@ -247,7 +247,6 @@ export default {
<style scoped lang="scss">
.main-terminal {
height: 100%;
overflow-x: scroll;
}
</style>