Remove most debug logs.
This commit is contained in:
parent
8c1b0b8b76
commit
4467ceaa74
@ -233,65 +233,65 @@ handleAction = case _ of
|
||||
|
||||
UpdateNewSRRForm rr_update -> case rr_update of
|
||||
Update_SRR_Type val -> do
|
||||
let new_type = fromMaybe "unknown" (baseRecords A.!! val)
|
||||
H.raise $ Log $ SimpleLog ("Update new entry type: " <> new_type)
|
||||
-- let new_type = fromMaybe "unknown" (baseRecords A.!! val)
|
||||
-- H.raise $ Log $ SimpleLog ("Update new entry type: " <> new_type)
|
||||
state <- H.get
|
||||
H.modify_ _ { _current_entry = changeType state._current_entry (baseRecords A.!! val) }
|
||||
Update_SRR_Domain val -> do
|
||||
H.raise $ Log $ SimpleLog ("Update new entry domain: " <> val)
|
||||
-- H.raise $ Log $ SimpleLog ("Update new entry domain: " <> val)
|
||||
H.modify_ _ { _current_entry { domain = val } }
|
||||
Update_SRR_TTL val -> do
|
||||
H.raise $ Log $ SimpleLog ("Update new entry ttl: " <> val)
|
||||
-- H.raise $ Log $ SimpleLog ("Update new entry ttl: " <> val)
|
||||
H.modify_ _ { _current_entry { ttl = val, valid = isInteger val } }
|
||||
Update_SRR_Value val -> do
|
||||
H.raise $ Log $ SimpleLog ("Update new entry value: " <> val)
|
||||
-- H.raise $ Log $ SimpleLog ("Update new entry value: " <> val)
|
||||
H.modify_ _ { _current_entry { value = val } }
|
||||
|
||||
UpdateNewMXForm rr_update -> case rr_update of
|
||||
-- TODO: FIXME: test all inputs
|
||||
Update_MX_Domain val -> do
|
||||
H.raise $ Log $ SimpleLog ("Update new MX entry domain: " <> val)
|
||||
-- H.raise $ Log $ SimpleLog ("Update new MX entry domain: " <> val)
|
||||
state <- H.get
|
||||
H.modify_ _ { _current_entry_mx = state._current_entry_mx { domain = val } }
|
||||
-- TODO: FIXME: test all inputs
|
||||
Update_MX_TTL val -> do
|
||||
H.raise $ Log $ SimpleLog ("Update new MX entry ttl: " <> val)
|
||||
-- H.raise $ Log $ SimpleLog ("Update new MX entry ttl: " <> val)
|
||||
state <- H.get
|
||||
H.modify_ _ { _current_entry_mx = state._current_entry_mx {ttl = val, valid = isInteger val} }
|
||||
-- TODO: FIXME: test all inputs
|
||||
Update_MX_Value val -> do
|
||||
H.raise $ Log $ SimpleLog ("Update new MX entry value: " <> val)
|
||||
-- H.raise $ Log $ SimpleLog ("Update new MX entry value: " <> val)
|
||||
state <- H.get
|
||||
H.modify_ _ { _current_entry_mx = state._current_entry_mx { value = val } }
|
||||
Update_MX_Priority val -> do
|
||||
H.raise $ Log $ SimpleLog ("Update new MX entry priority: " <> val)
|
||||
-- H.raise $ Log $ SimpleLog ("Update new MX entry priority: " <> val)
|
||||
state <- H.get
|
||||
H.modify_ _ { _current_entry_mx = state._current_entry_mx { priority = val } }
|
||||
|
||||
UpdateNewSRVForm rr_update -> case rr_update of
|
||||
Update_SRV_Domain val -> do
|
||||
H.raise $ Log $ SimpleLog ("Update new SRV entry domain: " <> val)
|
||||
-- H.raise $ Log $ SimpleLog ("Update new SRV entry domain: " <> val)
|
||||
state <- H.get
|
||||
H.modify_ _ { _current_entry_srv = state._current_entry_srv { domain = val } }
|
||||
Update_SRV_Value val -> do
|
||||
H.raise $ Log $ SimpleLog ("Update new SRV entry value: " <> val)
|
||||
-- H.raise $ Log $ SimpleLog ("Update new SRV entry value: " <> val)
|
||||
state <- H.get
|
||||
H.modify_ _ { _current_entry_srv = state._current_entry_srv { value = val } }
|
||||
-- TODO: FIXME: test all inputs
|
||||
Update_SRV_TTL val -> do
|
||||
H.raise $ Log $ SimpleLog ("Update new SRV entry ttl: " <> val)
|
||||
-- H.raise $ Log $ SimpleLog ("Update new SRV entry ttl: " <> val)
|
||||
state <- H.get
|
||||
H.modify_ _ { _current_entry_srv = state._current_entry_srv {ttl = val, valid = isInteger val}}
|
||||
Update_SRV_Priority val -> do
|
||||
H.raise $ Log $ SimpleLog ("Update new SRV entry priority: " <> val)
|
||||
-- H.raise $ Log $ SimpleLog ("Update new SRV entry priority: " <> val)
|
||||
state <- H.get
|
||||
H.modify_ _ { _current_entry_srv = state._current_entry_srv { priority = val } }
|
||||
Update_SRV_Weight val -> do
|
||||
H.raise $ Log $ SimpleLog ("Update new SRV entry weight: " <> val)
|
||||
-- H.raise $ Log $ SimpleLog ("Update new SRV entry weight: " <> val)
|
||||
state <- H.get
|
||||
H.modify_ _ { _current_entry_srv = state._current_entry_srv { weight = val } }
|
||||
Update_SRV_Port val -> do
|
||||
H.raise $ Log $ SimpleLog ("Update new SRV entry port: " <> val)
|
||||
-- H.raise $ Log $ SimpleLog ("Update new SRV entry port: " <> val)
|
||||
state <- H.get
|
||||
H.modify_ _ { _current_entry_srv = state._current_entry_srv { port = val } }
|
||||
|
||||
@ -329,63 +329,63 @@ handleAction = case _ of
|
||||
-- state <- H.get
|
||||
-- H.modify_ _ { _srr = changeType state._current_entry (baseRecords A.!! val) }
|
||||
Update_SRR_Domain val -> do
|
||||
H.raise $ Log $ SimpleLog ("Update local RR " <> show rr_id <> " domain: " <> val)
|
||||
-- H.raise $ Log $ SimpleLog ("Update local RR " <> show rr_id <> " domain: " <> val)
|
||||
state <- H.get
|
||||
H.modify_ _ { _srr = (update_domain rr_id val state._srr) }
|
||||
Update_SRR_TTL val -> do
|
||||
H.raise $ Log $ SimpleLog ("Update local RR " <> show rr_id <> " TTL: " <> val)
|
||||
-- H.raise $ Log $ SimpleLog ("Update local RR " <> show rr_id <> " TTL: " <> val)
|
||||
state <- H.get
|
||||
H.modify_ _ { _srr = (update_ttl rr_id val state._srr) }
|
||||
Update_SRR_Value val -> do
|
||||
H.raise $ Log $ SimpleLog ("Update local RR " <> show rr_id <> " value: " <> val)
|
||||
-- H.raise $ Log $ SimpleLog ("Update local RR " <> show rr_id <> " value: " <> val)
|
||||
state <- H.get
|
||||
H.modify_ _ { _srr = (update_value rr_id val state._srr) }
|
||||
|
||||
UpdateLocalMXForm rr_id rr_update -> case rr_update of
|
||||
-- TODO: FIXME: test all inputs
|
||||
Update_MX_Domain val -> do
|
||||
H.raise $ Log $ SimpleLog ("Update local MX RR " <> show rr_id <> " domain: " <> val)
|
||||
-- H.raise $ Log $ SimpleLog ("Update local MX RR " <> show rr_id <> " domain: " <> val)
|
||||
state <- H.get
|
||||
H.modify_ _ { _mxrr = (update_domain rr_id val state._mxrr) }
|
||||
-- TODO: FIXME: test all inputs
|
||||
Update_MX_TTL val -> do
|
||||
H.raise $ Log $ SimpleLog ("Update local MX " <> show rr_id <> " entry ttl: " <> val)
|
||||
-- H.raise $ Log $ SimpleLog ("Update local MX " <> show rr_id <> " entry ttl: " <> val)
|
||||
state <- H.get
|
||||
H.modify_ _ { _mxrr = (update_ttl rr_id val state._mxrr) }
|
||||
-- TODO: FIXME: test all inputs
|
||||
Update_MX_Value val -> do
|
||||
H.raise $ Log $ SimpleLog ("Update local MX " <> show rr_id <> " entry value: " <> val)
|
||||
-- H.raise $ Log $ SimpleLog ("Update local MX " <> show rr_id <> " entry value: " <> val)
|
||||
state <- H.get
|
||||
H.modify_ _ { _mxrr = (update_value rr_id val state._mxrr) }
|
||||
Update_MX_Priority val -> do
|
||||
H.raise $ Log $ SimpleLog ("Update local MX " <> show rr_id <> " entry priority: " <> val)
|
||||
-- H.raise $ Log $ SimpleLog ("Update local MX " <> show rr_id <> " entry priority: " <> val)
|
||||
state <- H.get
|
||||
H.modify_ _ { _mxrr = (update_priority rr_id val state._mxrr) }
|
||||
|
||||
UpdateLocalSRVForm rr_id rr_update -> case rr_update of
|
||||
Update_SRV_Domain val -> do
|
||||
H.raise $ Log $ SimpleLog ("Update local SRV " <> show rr_id <> " entry domain: " <> val)
|
||||
-- H.raise $ Log $ SimpleLog ("Update local SRV " <> show rr_id <> " entry domain: " <> val)
|
||||
state <- H.get
|
||||
H.modify_ _ { _srvrr = (update_domain rr_id val state._srvrr) }
|
||||
Update_SRV_Value val -> do
|
||||
H.raise $ Log $ SimpleLog ("Update local SRV " <> show rr_id <> " entry value: " <> val)
|
||||
-- H.raise $ Log $ SimpleLog ("Update local SRV " <> show rr_id <> " entry value: " <> val)
|
||||
state <- H.get
|
||||
H.modify_ _ { _srvrr = (update_value rr_id val state._srvrr) }
|
||||
-- TODO: FIXME: test all inputs
|
||||
Update_SRV_TTL val -> do
|
||||
H.raise $ Log $ SimpleLog ("Update local SRV " <> show rr_id <> " entry ttl: " <> val)
|
||||
-- H.raise $ Log $ SimpleLog ("Update local SRV " <> show rr_id <> " entry ttl: " <> val)
|
||||
state <- H.get
|
||||
H.modify_ _ { _srvrr = (update_ttl rr_id val state._srvrr) }
|
||||
Update_SRV_Priority val -> do
|
||||
H.raise $ Log $ SimpleLog ("Update local SRV " <> show rr_id <> " entry priority: " <> val)
|
||||
-- H.raise $ Log $ SimpleLog ("Update local SRV " <> show rr_id <> " entry priority: " <> val)
|
||||
state <- H.get
|
||||
H.modify_ _ { _srvrr = (update_priority rr_id val state._srvrr) }
|
||||
Update_SRV_Weight val -> do
|
||||
H.raise $ Log $ SimpleLog ("Update local SRV " <> show rr_id <> " entry weight: " <> val)
|
||||
-- H.raise $ Log $ SimpleLog ("Update local SRV " <> show rr_id <> " entry weight: " <> val)
|
||||
state <- H.get
|
||||
H.modify_ _ { _srvrr = (update_weight rr_id val state._srvrr) }
|
||||
Update_SRV_Port val -> do
|
||||
H.raise $ Log $ SimpleLog ("Update local SRV " <> show rr_id <> " entry port: " <> val)
|
||||
-- H.raise $ Log $ SimpleLog ("Update local SRV " <> show rr_id <> " entry port: " <> val)
|
||||
state <- H.get
|
||||
H.modify_ _ { _srvrr = (update_port rr_id val state._srvrr) }
|
||||
|
||||
@ -503,7 +503,7 @@ handleQuery = case _ of
|
||||
pure (Just a)
|
||||
|
||||
where
|
||||
add_entries [] = H.raise $ Log $ SimpleLog "Done adding entries"
|
||||
add_entries [] = H.raise $ Log $ SimpleLog "[🎉] Zone fully loaded!"
|
||||
add_entries arr = do
|
||||
state <- H.get
|
||||
case A.head arr, A.tail arr of
|
||||
@ -522,7 +522,7 @@ handleQuery = case _ of
|
||||
_, true -> Right $ add_new_entry state $ fromResourceRecordToLocalRepresentationSimpleRR new_rr
|
||||
"MX", _ -> Right $ add_new_mx state $ fromResourceRecordToLocalRepresentationMXRR new_rr
|
||||
"SRV", _ -> Right $ add_new_srv state $ fromResourceRecordToLocalRepresentationSRVRR new_rr
|
||||
_, _ -> Left "TODO: CAN'T ADD THIS KIND OF RR RIGHT NOW"
|
||||
_, _ -> Left $ "TODO: cannot add '" <> new_rr.rrtype <> "' resource records at the moment."
|
||||
|
||||
-- Rendering
|
||||
class_title_size :: Array (HH.ClassName)
|
||||
|
Loading…
Reference in New Issue
Block a user