ui/server/src/pageChanges
thin glue between the core change tracker (src/file-change-tracker.mjs), the core diff view model (src/text-diff.mjs) and the Pages Editor routes.
Cockpit server, v0.9. Source: ui/server/src/pageChanges.mjs.
Variables#
pageChangeTracker#
constpageChangeTracker:object
Defined in: ui/server/src/pageChanges.mjs:9
Type Declaration#
adopt
adopt: (
key,content) =>void
Parameters
key
string
content
string
Returns
void
dismiss
dismiss: (
key) =>void
Parameters
key
string
Returns
void
getLastChange
getLastChange: (
key) =>any
Parameters
key
string
Returns
any
observe
observe: (
key,content) =>any
Parameters
key
string
content
string
Returns
any
Functions#
adoptOwnWrite()#
adoptOwnWrite(
relPath,content,tracker?):void
Defined in: ui/server/src/pageChanges.mjs:25
Called by the editor's own save path so its writes are never reported as external.
Parameters#
relPath
any
content
any
tracker?
adopt
(key, content) => void
dismiss
(key) => void
getLastChange
(key) => any
observe
(key, content) => any
Returns#
void
describePageChange()#
describePageChange(
absPath,relPath,tracker?):object
Defined in: ui/server/src/pageChanges.mjs:14
Observe the file's current disk content and describe its last external change (or null). The change is per-file and persists until dismissed or until the editor itself saves the file.
Parameters#
absPath
any
relPath
any
tracker?
adopt
(key, content) => void
dismiss
(key) => void
getLastChange
(key) => any
observe
(key, content) => any
Returns#
object
change
change:
object
change.afterHash
afterHash:
any
change.at
at:
any
change.beforeHash
beforeHash:
any
change.rows
rows:
object[]
change.stats
stats:
object
change.stats.added
added:
number
change.stats.removed
removed:
number