Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ai company
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
ai company
Commits
159099af
Commit
159099af
authored
May 13, 2026
by
Vũ Hoàng Anh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(sqlite): backfill description_data_full & fix manage_prompt UI
parent
981784ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
25 deletions
+66
-25
manage_prompt.css
backend/static/manage_prompt/manage_prompt.css
+4
-3
manage_prompt.js
backend/static/manage_prompt/manage_prompt.js
+62
-22
No files found.
backend/static/manage_prompt/manage_prompt.css
View file @
159099af
...
@@ -740,8 +740,8 @@ body {
...
@@ -740,8 +740,8 @@ body {
.diff-output-side
{
.diff-output-side
{
display
:
grid
;
display
:
grid
;
grid-template-columns
:
1
fr
1
fr
;
grid-template-columns
:
1
fr
1
fr
;
height
:
100%
;
min-height
:
300px
;
min-height
:
0
;
height
:
55vh
;
}
}
.diff-pane
{
.diff-pane
{
display
:
flex
;
display
:
flex
;
...
@@ -773,7 +773,8 @@ body {
...
@@ -773,7 +773,8 @@ body {
.diff-output-unified
{
.diff-output-unified
{
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
flex-direction
:
column
;
height
:
100%
;
min-height
:
300px
;
height
:
55vh
;
}
}
.diff-unified-header
{
.diff-unified-header
{
padding
:
10px
16px
;
padding
:
10px
16px
;
...
...
backend/static/manage_prompt/manage_prompt.js
View file @
159099af
...
@@ -354,34 +354,74 @@ let diffViewMode = 'side'; // 'side' | 'unified'
...
@@ -354,34 +354,74 @@ let diffViewMode = 'side'; // 'side' | 'unified'
let
lastDiffData
=
null
;
// cache for view toggle
let
lastDiffData
=
null
;
// cache for view toggle
async
function
openDiffModal
(
moduleName
)
{
async
function
openDiffModal
(
moduleName
)
{
const
mod
=
modules
.
find
(
m
=>
m
.
module_name
===
moduleName
);
try
{
if
(
!
mod
||
!
mod
.
dev
||
!
mod
.
production
)
return
;
const
mod
=
modules
.
find
(
m
=>
m
.
module_name
===
moduleName
);
if
(
!
mod
||
!
mod
.
dev
||
!
mod
.
production
)
{
toast
(
'Module không có cả DEV và PRODUCTION để so sánh'
,
'error'
);
return
;
}
document
.
getElementById
(
'diff-title'
).
textContent
=
`So sánh:
${
moduleName
}
`
;
document
.
getElementById
(
'diff-title'
).
textContent
=
`So sánh:
${
moduleName
}
`
;
document
.
getElementById
(
'btn-promote-modal'
).
onclick
=
()
=>
{
document
.
getElementById
(
'btn-promote-modal'
).
onclick
=
()
=>
{
closeDiffModal
();
closeDiffModal
();
promoteVersion
(
mod
.
dev
.
id
,
moduleName
);
promoteVersion
(
mod
.
dev
.
id
,
moduleName
);
};
};
const
[
devC
,
prodC
]
=
await
Promise
.
all
([
const
[
devC
,
prodC
]
=
await
Promise
.
all
([
fetchContent
(
mod
.
dev
.
id
),
fetchContent
(
mod
.
dev
.
id
),
fetchContent
(
mod
.
production
.
id
),
fetchContent
(
mod
.
production
.
id
),
]);
]);
const
devText
=
devC
||
''
;
const
devText
=
devC
||
''
;
const
prodText
=
prodC
||
''
;
const
prodText
=
prodC
||
''
;
// Compute diff using jsdiff
// Compute diff — use jsdiff if available, else fallback
const
changes
=
Diff
.
diffLines
(
devText
,
prodText
);
let
changes
;
lastDiffData
=
{
changes
,
devText
,
prodText
,
devV
:
mod
.
dev
.
version
,
prodV
:
mod
.
production
.
version
};
if
(
typeof
Diff
!==
'undefined'
&&
Diff
.
diffLines
)
{
changes
=
Diff
.
diffLines
(
devText
,
prodText
);
}
else
{
console
.
warn
(
'jsdiff not loaded, using fallback diff'
);
changes
=
fallbackDiff
(
devText
,
prodText
);
}
// Update char counts
lastDiffData
=
{
changes
,
devText
,
prodText
,
devV
:
mod
.
dev
.
version
,
prodV
:
mod
.
production
.
version
};
document
.
getElementById
(
'ds-dev-chars'
).
textContent
=
devText
.
length
.
toLocaleString
();
document
.
getElementById
(
'ds-prod-chars'
).
textContent
=
prodText
.
length
.
toLocaleString
();
renderDiff
();
// Update char counts
document
.
getElementById
(
'diff-modal'
).
classList
.
add
(
'open'
);
document
.
getElementById
(
'ds-dev-chars'
).
textContent
=
devText
.
length
.
toLocaleString
();
lucide
.
createIcons
();
document
.
getElementById
(
'ds-prod-chars'
).
textContent
=
prodText
.
length
.
toLocaleString
();
renderDiff
();
document
.
getElementById
(
'diff-modal'
).
classList
.
add
(
'open'
);
lucide
.
createIcons
();
}
catch
(
err
)
{
console
.
error
(
'Diff modal error:'
,
err
);
toast
(
'❌ Lỗi mở Compare: '
+
err
.
message
,
'error'
);
}
}
// Fallback diff when jsdiff CDN fails
function
fallbackDiff
(
oldText
,
newText
)
{
const
oldLines
=
oldText
.
split
(
'
\
n'
);
const
newLines
=
newText
.
split
(
'
\
n'
);
const
result
=
[];
const
maxLen
=
Math
.
max
(
oldLines
.
length
,
newLines
.
length
);
for
(
let
i
=
0
;
i
<
maxLen
;
i
++
)
{
const
ol
=
oldLines
[
i
];
const
nl
=
newLines
[
i
];
if
(
ol
===
nl
)
{
result
.
push
({
value
:
ol
+
'
\
n'
,
added
:
false
,
removed
:
false
});
}
else
{
if
(
ol
!==
undefined
)
{
result
.
push
({
value
:
ol
+
'
\
n'
,
added
:
false
,
removed
:
true
});
}
if
(
nl
!==
undefined
)
{
result
.
push
({
value
:
nl
+
'
\
n'
,
added
:
true
,
removed
:
false
});
}
}
}
return
result
;
}
}
function
setDiffView
(
mode
)
{
function
setDiffView
(
mode
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment