mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
agent: adds restore alerts
This commit is contained in:
committed by
Aiden McClelland
parent
18f18e3b95
commit
db8a26c84c
@@ -288,6 +288,7 @@ getInstalledAppByIdLogic appId = do
|
|||||||
, appInstalledFullTorAddress = Nothing
|
, appInstalledFullTorAddress = Nothing
|
||||||
, appInstalledFullConfiguredRequirements = []
|
, appInstalledFullConfiguredRequirements = []
|
||||||
, appInstalledFullUninstallAlert = Nothing
|
, appInstalledFullUninstallAlert = Nothing
|
||||||
|
, appInstalledFullRestoreAlert = Nothing
|
||||||
}
|
}
|
||||||
serverApps <- AppMgr2.list [AppMgr2.flags|-s -d|]
|
serverApps <- AppMgr2.list [AppMgr2.flags|-s -d|]
|
||||||
let remapped = remapAppMgrInfo jobCache serverApps
|
let remapped = remapAppMgrInfo jobCache serverApps
|
||||||
@@ -325,7 +326,8 @@ getInstalledAppByIdLogic appId = do
|
|||||||
, appInstalledFullLastBackup = backupTime
|
, appInstalledFullLastBackup = backupTime
|
||||||
, appInstalledFullTorAddress = infoResTorAddress
|
, appInstalledFullTorAddress = infoResTorAddress
|
||||||
, appInstalledFullConfiguredRequirements = HM.elems requirements
|
, appInstalledFullConfiguredRequirements = HM.elems requirements
|
||||||
, appInstalledFullUninstallAlert = manifest >>= AppManifest.appManifestUninstallAlert
|
, appInstalledFullUninstallAlert = manifest >>= AppManifest.appManifestUninstallAlert
|
||||||
|
, appInstalledFullRestoreAlert = manifest >>= AppManifest.appManifestRestoreAlert
|
||||||
}
|
}
|
||||||
runMaybeT (installing <|> installed) `orThrowM` NotFoundE "appId" (show appId)
|
runMaybeT (installing <|> installed) `orThrowM` NotFoundE "appId" (show appId)
|
||||||
|
|
||||||
|
|||||||
@@ -132,6 +132,7 @@ data AppInstalledFull = AppInstalledFull
|
|||||||
, appInstalledFullLastBackup :: Maybe UTCTime
|
, appInstalledFullLastBackup :: Maybe UTCTime
|
||||||
, appInstalledFullConfiguredRequirements :: [Stripped AppDependencyRequirement]
|
, appInstalledFullConfiguredRequirements :: [Stripped AppDependencyRequirement]
|
||||||
, appInstalledFullUninstallAlert :: Maybe Text
|
, appInstalledFullUninstallAlert :: Maybe Text
|
||||||
|
, appInstalledFullRestoreAlert :: Maybe Text
|
||||||
}
|
}
|
||||||
instance ToJSON AppInstalledFull where
|
instance ToJSON AppInstalledFull where
|
||||||
toJSON AppInstalledFull {..} = object
|
toJSON AppInstalledFull {..} = object
|
||||||
@@ -145,6 +146,7 @@ instance ToJSON AppInstalledFull where
|
|||||||
, "versionInstalled" .= appInstalledFullVersionInstalled
|
, "versionInstalled" .= appInstalledFullVersionInstalled
|
||||||
, "status" .= appInstalledFullStatus
|
, "status" .= appInstalledFullStatus
|
||||||
, "uninstallAlert" .= appInstalledFullUninstallAlert
|
, "uninstallAlert" .= appInstalledFullUninstallAlert
|
||||||
|
, "restoreAlert" .= appInstalledFullRestoreAlert
|
||||||
]
|
]
|
||||||
|
|
||||||
data AppVersionInfo = AppVersionInfo
|
data AppVersionInfo = AppVersionInfo
|
||||||
|
|||||||
2
agent/src/Lib/External/AppManifest.hs
vendored
2
agent/src/Lib/External/AppManifest.hs
vendored
@@ -61,6 +61,7 @@ data AppManifest where
|
|||||||
, appManifestOnionVersion :: OnionVersion
|
, appManifestOnionVersion :: OnionVersion
|
||||||
, appManifestDependencies :: HM.HashMap AppId VersionRange
|
, appManifestDependencies :: HM.HashMap AppId VersionRange
|
||||||
, appManifestUninstallAlert :: Maybe Text
|
, appManifestUninstallAlert :: Maybe Text
|
||||||
|
, appManifestRestoreAlert :: Maybe Text
|
||||||
} -> AppManifest
|
} -> AppManifest
|
||||||
|
|
||||||
uiAvailable :: AppManifest -> Bool
|
uiAvailable :: AppManifest -> Bool
|
||||||
@@ -81,6 +82,7 @@ instance FromJSON AppManifest where
|
|||||||
appManifestOnionVersion <- o .: "hidden-service-version"
|
appManifestOnionVersion <- o .: "hidden-service-version"
|
||||||
appManifestDependencies <- o .:? "dependencies" .!= HM.empty >>= traverse parseDepInfo
|
appManifestDependencies <- o .:? "dependencies" .!= HM.empty >>= traverse parseDepInfo
|
||||||
appManifestUninstallAlert <- o .:? "uninstall-alert"
|
appManifestUninstallAlert <- o .:? "uninstall-alert"
|
||||||
|
appManifestRestoreAlert <- o .:? "restore-alert"
|
||||||
pure $ AppManifest { .. }
|
pure $ AppManifest { .. }
|
||||||
where
|
where
|
||||||
parsePortMapping = withObject "Port Mapping" $ \o -> liftA2 (,) (o .: "tor") (o .: "internal")
|
parsePortMapping = withObject "Port Mapping" $ \o -> liftA2 (,) (o .: "tor") (o .: "internal")
|
||||||
|
|||||||
Reference in New Issue
Block a user