我正在尝试将样式应用于ListItemText(Material-UI @next)中的文本:
const text = {
color: 'red'
}
<ListItem button><ListItemText style={text} primary="MyText" /></ListItem>
Run Code Online (Sandbox Code Playgroud)
但是<Typograhy>里面的渲染元素根本没有样式("MyText"不是红色).
查看生成的代码,似乎Typography> subheading的默认CSS规则覆盖了我的CSS.
谢谢你的帮助
编辑:在问题的第一个版本中,有一个错误("className"而不是ListItemText上的"style"道具,对不起).
我目前正在使用angularJS和phonegap为Android/iOS构建测试应用程序.
该应用仅使用存储在Firebase数据库中的文本数据.我希望应用程序拥有自己的本地数据库(在设备离线时使用),有时(当设备在线时)与Firebase数据库同步.
离线模式使用phonegap/cordova的存储API.我可以只检查设备的在线状态并定期备份在线数据库吗?
有关如何实现这一目标的任何线索?上次提出类似问题时,答案是"尚未"...... (此处) ......因为它专注于假设的Firebase功能.
如何使用add()更新数据库中的行?
这是我试过的代码:
@view_config(route_name='doc_user_edit', renderer='doc/edit.mako')
def doc_user_edit(request):
""" Edit a documentation page. """
message = ""
try:
page = DBSession.query(Page).filter_by(title=request.matchdict['pagename']).first()
except DBAPIError:
return Response('An error occured while trying to contact the database', content_type='text/plain', status_int=500)
if page is None:
return HTTPNotFound('No such page')
if 'form.submitted' in request.params:
page = Page(request.params['title'], request.params['content'], datetime.now())
DBSession.add(page)
DBSession.commit()
message = _('Page edited')
return {'p':page,
'm':message,
'save_url': request.route_url('doc_user_edit', pagename=page.title),
}
Run Code Online (Sandbox Code Playgroud)
注意:DBSession是一个scoped_session.
如果该行是全新的(即不存在唯一键"title"),则它会正确地添加一个新行,其中包含我传递给它的值.
但如果该行是现有的,它只是......没有.我希望用新值更新行(即从表单中提取的值).我怎样才能做到这一点?
我找不到任何有关如何配置 filebeat 来处理 ECS 格式的 JSON 日志的文档。
我使用ecs-pino-format输出“ECS”日志,这是我输出的典型日志:
{"log":{"level":"debug","logger":"pino"},"@timestamp":"2020-06-10T17:02:11.266Z","module":"APM","ecs":{"version":"1.5.0"},"message":"ended transaction {\"trans\":\"7614bf8a4895a7a4\",\"trace\":\"8a5c71d2c1c63f6dfc1a5bfd046701ed\",\"type\":\"request\",\"result\":\"HTTP 2xx\",\"name\":\"GET /healthcheck\"}"}
Run Code Online (Sandbox Code Playgroud)
这是我的 filebeat 配置:
{"log":{"level":"debug","logger":"pino"},"@timestamp":"2020-06-10T17:02:11.266Z","module":"APM","ecs":{"version":"1.5.0"},"message":"ended transaction {\"trans\":\"7614bf8a4895a7a4\",\"trace\":\"8a5c71d2c1c63f6dfc1a5bfd046701ed\",\"type\":\"request\",\"result\":\"HTTP 2xx\",\"name\":\"GET /healthcheck\"}"}
Run Code Online (Sandbox Code Playgroud)
我将此注释添加到我的 pod 中(甚至不确定我必须这样做......):
filebeat.autodiscover:
providers:
- type: kubernetes
node: ${NODE_NAME}
hints.enabled: true
hints.default_config:
type: container
paths:
- /var/log/containers/*${data.kubernetes.container.id}.log
Run Code Online (Sandbox Code Playgroud)
这是我在 filebeat 上遇到的错误:
2020-06-10T16:47:00.773Z WARN [elasticsearch] elasticsearch/client.go:384 Cannot index event publisher.Event{Content:beat.Event{Timestamp:time.Time{wall:0x304e23a, ext:63727404418, loc:(*time.Location)(nil)}, Meta:null, Fields:{"agent":{"ephemeral_id":"cc9f9def-5d67-4592-8459-f556f8f2fc29","hostname":"filebeat-filebeat-4dqpq","id":"e8d9cffe-ceca-49f5-ae31-65bbb29353e8","type":"filebeat","version":"7.7.0"},"ecs":{"version":"1.5.0"},"host":{"name":"filebeat-filebeat-4dqpq"},"input":{"type":"container"},"json":{"@timestamp":"2020-06-10T16:46:58.049Z","ecs":{"version":"1.5.0"},"log":"","message":"sending span {\"span\":\"87ad75b7f0858817\",\"parent\":\"82e1f82870aa3e55\",\"trace\":\"13c7569f7562a72bef1300097d1ab86c\",\"name\":\"SELECT\",\"type\":\"db\"}","module":"APM","trace.id":"13c7569f7562a72bef1300097d1ab86c","transaction.id":"82e1f82870aa3e55"},"kubernetes":{"container":{"image":"registry.gitlab.com/consensys/codefi/products/assets/workflow-api:v0.1.3-2-g358bbc6","name":"generic-app"},"labels":{"app_kubernetes_io/instance":"workflow-api","app_kubernetes_io/name":"workflow-api","pod-template-hash":"b946b7c49"},"namespace":"codefi","node":{"name":"ip-192-168-33-94.eu-west-3.compute.internal"},"pod":{"name":"workflow-api-b946b7c49-7qldb","uid":"e984519d-8cc5-426d-bdac-e3f0dfa55c0b"},"replicaset":{"name":"workflow-api-b946b7c49"}},"log":{"file":{"path":"/var/log/containers/workflow-api-b946b7c49-7qldb_codefi_generic-app-9bff78b56f893e056e1e614de3c28aa6671dd4723c0dfc166460ac9bde43571a.log"},"offset":2303955},"stream":"stdout"}, Private:file.State{Id:"", Finished:false, Fileinfo:(*os.fileStat)(0xc000ac8a90), Source:"/var/log/containers/workflow-api-b946b7c49-7qldb_codefi_generic-app-9bff78b56f893e056e1e614de3c28aa6671dd4723c0dfc166460ac9bde43571a.log", Offset:2304478, Timestamp:time.Time{wall:0xbfb060a48062556d, ext:986606661848, loc:(*time.Location)(0x3bdbf40)}, TTL:-1, Type:"container", Meta:map[string]string(nil), FileStateOS:file.StateOS{Inode:0x601c938, Device:0x10301}}, TimeSeries:false}, Flags:0x1, Cache:publisher.EventCache{m:common.MapStr(nil)}} (status=400): {"type":"mapper_parsing_exception","reason":"object mapping for …Run Code Online (Sandbox Code Playgroud) angularjs ×1
cordova ×1
filebeat ×1
firebase ×1
kibana ×1
material-ui ×1
pyramid ×1
python ×1
reactjs ×1
sqlalchemy ×1