aboutsummaryrefslogtreecommitdiff
path: root/Assistant/Alert.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-11-21 17:49:56 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-11-21 17:49:56 -0400
commit40c91a0d45a875b8ef58c42a38fb29f4a608b425 (patch)
tree1ba0bcab443dfad4301d3d824034067d57fce4c3 /Assistant/Alert.hs
parent5ec99409fa0e4ec617f70c4c87c6f7c8460b61c4 (diff)
upgrade alerts
The webapp will check twice a day, when the network is connected, to see if it can download a distributon upgrade file. If a newer version is found, display an upgrade alert. This will need the autobuilders to set UPGRADE_LOCATION to the url it can be downloaded from when building git-annex. Only builds with that set need automatic upgrade alerts. Currently, the upgrade page just requests the user manually download and upgrade it. But, all the info is provided to do automated upgrades in the future. Note that urls used will need to all be https. This commit was sponsored by Dirk Kraft.
Diffstat (limited to 'Assistant/Alert.hs')
-rw-r--r--Assistant/Alert.hs20
1 files changed, 20 insertions, 0 deletions
diff --git a/Assistant/Alert.hs b/Assistant/Alert.hs
index 8bdedaa3e..93eea6d7d 100644
--- a/Assistant/Alert.hs
+++ b/Assistant/Alert.hs
@@ -215,6 +215,26 @@ notFsckedAlert mr button = Alert
, alertData = []
}
+canUpgradeAlert :: AlertPriority -> AlertButton -> Alert
+canUpgradeAlert priority button = Alert
+ { alertHeader = Just $ fromString $ concat
+ [ if priority >= High
+ then "An important upgrade of git-annex is available!"
+ else "An upgrade of git-annex is available."
+ ]
+ , alertIcon = Just UpgradeIcon
+ , alertPriority = priority
+ , alertButton = Just button
+ , alertClosable = True
+ , alertClass = Message
+ , alertMessageRender = renderData
+ , alertCounter = 0
+ , alertBlockDisplay = True
+ , alertName = Just UpgradeAlert
+ , alertCombiner = Just $ dataCombiner $ \_old new -> new
+ , alertData = []
+ }
+
brokenRepositoryAlert :: AlertButton -> Alert
brokenRepositoryAlert = errorAlert "Serious problems have been detected with your repository. This needs your immediate attention!"