2012-07-31 05:11:32 +00:00
|
|
|
{- git-annex assistant webapp configurators
|
|
|
|
-
|
2015-01-21 16:50:09 +00:00
|
|
|
- Copyright 2012 Joey Hess <id@joeyh.name>
|
2012-07-31 05:11:32 +00:00
|
|
|
-
|
2012-09-24 18:48:47 +00:00
|
|
|
- Licensed under the GNU AGPL version 3 or higher.
|
2012-07-31 05:11:32 +00:00
|
|
|
-}
|
|
|
|
|
2013-06-05 01:02:09 +00:00
|
|
|
{-# LANGUAGE QuasiQuotes, TemplateHaskell, OverloadedStrings, CPP #-}
|
2012-07-31 05:11:32 +00:00
|
|
|
|
|
|
|
module Assistant.WebApp.Configurators where
|
|
|
|
|
2012-11-25 04:26:46 +00:00
|
|
|
import Assistant.WebApp.Common
|
2013-03-15 02:10:51 +00:00
|
|
|
import Assistant.WebApp.RepoList
|
2012-11-02 16:59:31 +00:00
|
|
|
#ifdef WITH_XMPP
|
|
|
|
import Assistant.XMPP.Client
|
|
|
|
#endif
|
2012-07-31 05:11:32 +00:00
|
|
|
|
2012-08-03 18:36:16 +00:00
|
|
|
{- The main configuration screen. -}
|
2013-06-27 05:15:28 +00:00
|
|
|
getConfigurationR :: Handler Html
|
2013-10-02 05:06:59 +00:00
|
|
|
getConfigurationR = ifM inFirstRun
|
2013-03-18 16:47:44 +00:00
|
|
|
( redirect FirstRepositoryR
|
2012-12-30 03:10:18 +00:00
|
|
|
, page "Configuration" (Just Configuration) $ do
|
2012-11-02 16:59:31 +00:00
|
|
|
#ifdef WITH_XMPP
|
2013-03-16 04:12:28 +00:00
|
|
|
xmppconfigured <- liftAnnex $ isJust <$> getXMPPCreds
|
2012-11-02 16:59:31 +00:00
|
|
|
#else
|
|
|
|
let xmppconfigured = False
|
|
|
|
#endif
|
2012-08-03 18:36:16 +00:00
|
|
|
$(widgetFile "configurators/main")
|
|
|
|
)
|
2013-03-15 02:10:51 +00:00
|
|
|
|
2013-06-27 05:15:28 +00:00
|
|
|
getAddRepositoryR :: Handler Html
|
2013-03-15 04:34:42 +00:00
|
|
|
getAddRepositoryR = page "Add Repository" (Just Configuration) $ do
|
|
|
|
let repolist = repoListDisplay mainRepoSelector
|
2013-03-15 16:47:41 +00:00
|
|
|
$(widgetFile "configurators/addrepository")
|
2013-03-15 02:10:51 +00:00
|
|
|
|
|
|
|
makeMiscRepositories :: Widget
|
2013-03-15 16:47:41 +00:00
|
|
|
makeMiscRepositories = $(widgetFile "configurators/addrepository/misc")
|
2013-03-15 02:10:51 +00:00
|
|
|
|
2013-04-25 16:23:36 +00:00
|
|
|
makeCloudRepositories :: Widget
|
|
|
|
makeCloudRepositories = $(widgetFile "configurators/addrepository/cloud")
|
|
|
|
|
2014-04-09 20:27:24 +00:00
|
|
|
makeXMPPConnection :: Widget
|
|
|
|
makeXMPPConnection = $(widgetFile "configurators/addrepository/xmppconnection")
|
|
|
|
|
|
|
|
makeSshRepository :: Widget
|
|
|
|
makeSshRepository = $(widgetFile "configurators/addrepository/ssh")
|
|
|
|
|
|
|
|
makeConnectionRepositories :: Widget
|
|
|
|
makeConnectionRepositories = $(widgetFile "configurators/addrepository/connection")
|
|
|
|
|
2013-04-25 16:23:36 +00:00
|
|
|
makeArchiveRepositories :: Widget
|
|
|
|
makeArchiveRepositories = $(widgetFile "configurators/addrepository/archive")
|