mirror of
https://github.com/balzack/databag.git
synced 2025-02-14 20:49:16 +00:00
supporting global notification setting
This commit is contained in:
parent
8f4c15d5da
commit
ae0ea4724c
@ -183,6 +183,14 @@ export function Dashboard(props) {
|
|||||||
<Text style={styles.option}>RSA 4096</Text>
|
<Text style={styles.option}>RSA 4096</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
<TouchableOpacity style={styles.media} activeOpacity={1}
|
||||||
|
onPress={() => actions.setPushSupported(!state.pushSupported)}>
|
||||||
|
<Text style={styles.modalLabel}>Enable Push Notifications: </Text>
|
||||||
|
<Switch style={styles.switch} value={state.pushSupported}
|
||||||
|
onValueChange={actions.setPushSupported} trackColor={styles.track}/>
|
||||||
|
</TouchableOpacity>
|
||||||
|
|
||||||
<TouchableOpacity style={styles.media} activeOpacity={1}
|
<TouchableOpacity style={styles.media} activeOpacity={1}
|
||||||
onPress={() => actions.setEnableImage(!state.enableImage)}>
|
onPress={() => actions.setEnableImage(!state.enableImage)}>
|
||||||
<Text style={styles.modalLabel}>Enable Image Queue: </Text>
|
<Text style={styles.modalLabel}>Enable Image Queue: </Text>
|
||||||
|
@ -96,6 +96,9 @@ export function useDashboard(config, server, token) {
|
|||||||
setStorage: (storage) => {
|
setStorage: (storage) => {
|
||||||
updateState({ storage: Number(storage.replace(/[^0-9]/g, '')) });
|
updateState({ storage: Number(storage.replace(/[^0-9]/g, '')) });
|
||||||
},
|
},
|
||||||
|
setPushSupported: (pushSupported) => {
|
||||||
|
updateState({ pushSupported });
|
||||||
|
},
|
||||||
setEnableImage: (enableImage) => {
|
setEnableImage: (enableImage) => {
|
||||||
updateState({ enableImage });
|
updateState({ enableImage });
|
||||||
},
|
},
|
||||||
|
@ -3566,6 +3566,8 @@ components:
|
|||||||
type: boolean
|
type: boolean
|
||||||
keyType:
|
keyType:
|
||||||
type: string
|
type: string
|
||||||
|
pushSupported:
|
||||||
|
type: boolean
|
||||||
|
|
||||||
AccountStatus:
|
AccountStatus:
|
||||||
type: object
|
type: object
|
||||||
|
@ -21,6 +21,7 @@ func GetNodeConfig(w http.ResponseWriter, r *http.Request) {
|
|||||||
config.EnableAudio = getBoolConfigValue(CNFEnableAudio, true)
|
config.EnableAudio = getBoolConfigValue(CNFEnableAudio, true)
|
||||||
config.EnableVideo = getBoolConfigValue(CNFEnableVideo, true)
|
config.EnableVideo = getBoolConfigValue(CNFEnableVideo, true)
|
||||||
config.KeyType = getStrConfigValue(CNFKeyType, APPRSA4096)
|
config.KeyType = getStrConfigValue(CNFKeyType, APPRSA4096)
|
||||||
|
config.PushSupported = getBoolConfigValue(CNFPushSupported, true)
|
||||||
|
|
||||||
WriteResponse(w, config)
|
WriteResponse(w, config)
|
||||||
}
|
}
|
||||||
|
@ -66,6 +66,14 @@ func SetNodeConfig(w http.ResponseWriter, r *http.Request) {
|
|||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// upsert push supported
|
||||||
|
if res := tx.Clauses(clause.OnConflict{
|
||||||
|
Columns: []clause.Column{{Name: "config_id"}},
|
||||||
|
DoUpdates: clause.AssignmentColumns([]string{"bool_value"}),
|
||||||
|
}).Create(&store.Config{ConfigID: CNFPushSupported, BoolValue: config.PushSupported}).Error; res != nil {
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
|
||||||
// upsert key type
|
// upsert key type
|
||||||
if res := tx.Clauses(clause.OnConflict{
|
if res := tx.Clauses(clause.OnConflict{
|
||||||
Columns: []clause.Column{{Name: "config_id"}},
|
Columns: []clause.Column{{Name: "config_id"}},
|
||||||
|
@ -347,6 +347,8 @@ type NodeConfig struct {
|
|||||||
KeyType string `json:"keyType"`
|
KeyType string `json:"keyType"`
|
||||||
|
|
||||||
AccountStorage int64 `json:"accountStorage"`
|
AccountStorage int64 `json:"accountStorage"`
|
||||||
|
|
||||||
|
PushSupported bool `json:"pushSupported"`
|
||||||
}
|
}
|
||||||
|
|
||||||
//Profile public attributes of account
|
//Profile public attributes of account
|
||||||
|
Loading…
Reference in New Issue
Block a user