我正在将应用程序从 angular 8 迁移到 9。如果我尝试构建以进行部署,则会收到此错误消息
ERROR : Cannot assign value "$event" to template variable "value". Template variables are read-only.
at _AstToIrVisitor.visitPropertyWrite (...\node_modules\@angular\compiler\bundles\compiler.umd.js:8617:31)
at PropertyWrite.visit (...\node_modules\@angular\compiler\bundles\compiler.umd.js:7459:28)
at convertActionBinding (...\node_modules\@angular\compiler\bundles\compiler.umd.js:8224:49)
at prepareEventListenerParameters (...\node_modules\@angular\compiler\bundles\compiler.umd.js:16861:27)
at Object.params (...\node_modules\@angular\compiler\bundles\compiler.umd.js:17952:24)
at ...\node_modules\@angular\compiler\bundles\compiler.umd.js:17725:94
at Array.map (<anonymous>)
at ...\node_modules\@angular\compiler\bundles\compiler.umd.js:17725:60
at ...\node_modules\@angular\compiler\bundles\compiler.umd.js:17014:87
at Array.map (<anonymous>)
at TemplateDefinitionBuilder.buildTemplateFunction (...\node_modules\@angular\compiler\bundles\compiler.umd.js:17014:60)
at ...\node_modules\@angular\compiler\bundles\compiler.umd.js:17558:60
at ...\node_modules\@angular\compiler\bundles\compiler.umd.js:16992:81
at Array.forEach (<anonymous>)
at TemplateDefinitionBuilder.buildTemplateFunction (...\node_modules\@angular\compiler\bundles\compiler.umd.js:16992:37)
at Object.compileComponentFromMetadata (...\node_modules\@angular\compiler\bundles\compiler.umd.js:18643:58)
Run Code Online (Sandbox Code Playgroud)
我怎样才能发现问题发生了?
我有一个源自 Identity Platform 示例的 SPA 应用程序,该示例最初调用图形 API。
我已更改端点以调用本地 API。
SPA 使用 Azure AD 进行身份验证。
API 示例源自 API 的 VS 2019 项目模板。
,NET 4.7.2 - 无 .NET Core。
我可以进行身份验证,并且在进行网络跟踪时 ID 和访问令牌都存在。
但是,在 API 方面我收到错误:
"IDX10511: Signature validation failed. Keys tried: 'Microsoft.IdentityModel.Tokens.X509SecurityKey, KeyId: '1E50B4475DAC931359D564309A3385FFAB7FB431', InternalId: 'f61f7746-3cff-4557-8b2c-b47fad9cf1e3'. , KeyId: 1E50B4475DAC931359D564309A3385FFAB7FB431"
Run Code Online (Sandbox Code Playgroud)
解码访问令牌显示:
"{
"typ": "JWT",
"nonce": "G0Q6_BuYJUfZaBnX-l1Ox1eoncxXRT4KMThFBcn1-VA",
"alg": "RS256",
"x5t": "HlC0R12skxNZ1WQwmjOF_6t_tDE",
"kid": "HlC0R12skxNZ1WQwmjOF_6t_tDE"
}"
Run Code Online (Sandbox Code Playgroud)
谷歌搜索一下,似乎签名因标头中的随机数而失败,这需要“特殊处理”。
所有验证均由 OWIN 完成。
知道这是什么或如何解决这个问题吗?
我正在尝试为电影列表中的每部电影创建详细视图。我有 Django 作为后端,React 作为前端。
当我尝试对每部电影进行详细查看时,出现错误。
错误日志:
Failed to compile.
./src/components/movie-list.js
Line 5:26: 'movie' is not defined no-undef
Line 6:28: 'movie' is not defined no-undef
Search for the keywords to learn more about each error.
Run Code Online (Sandbox Code Playgroud)
我尝试过绑定,但不完全明白问题出在哪里。
应用程序.js
import React, { Component } from 'react';
import MovieList from "./components/movie-list";
componentDidMount() {
//fetch data
fetch('http://127.0.0.1:8000/api/movies/', {
method: 'GET',
headers: {
'Authorization': 'Token 8588cb6fcc2ee0bf9915d4c6b720554347d5883f'
}
}).then(resp => resp.json())
.then(res => this.setState({ movies: res }))
.catch(error => console.log(error))
}
movieClicked = movie => {
console.log(movie); …Run Code Online (Sandbox Code Playgroud) 我在 openstack 中部署了一个 k8s 集群。我已经为它部署了 Prometheus operator 来监控集群。但是我收到了所有节点的 Kubernetes 代理停机警报。
我想知道 Prometheus operator 如何抓取 Kubernetes 代理的基础知识?还想知道需要做哪些配置来修复它。
我可以看到 kube 代理正在 10249 端口的所有节点中运行。
错误 :
Get http://10.8.10.11:10249/metrics: dial tcp 10.8.10.11:10249: connect: connection refused
Run Code Online (Sandbox Code Playgroud)
HELM 值配置
kubeProxy:
enabled: true
## If your kube proxy is not deployed as a pod, specify IPs it can be found on
##
endpoints: []
# - 10.141.4.22
# - 10.141.4.23
# - 10.141.4.24
service:
port: 10249
targetPort: 10249
# selector:
# k8s-app: kube-proxy
serviceMonitor:
## Scrape interval. …Run Code Online (Sandbox Code Playgroud) 我想在 Ubuntu 中配置静态 IP 地址。在这里你可以看到我的静态IP寻址配置文件:
network:
version: 2
renderer: NetworkManager
ethernets:
wlp1s0:
dhcp4: no
addresses: [192.168.0.103/24]
Gateway: 192.168.0.1
Nameservers:
Addresses: [127.0.0.53]
Run Code Online (Sandbox Code Playgroud)
在通过 测试配置时$ sudo netplan try,我得到以下响应:
绑定:地址已在使用中
netplan:致命错误:无法绑定到端口 2983,是否有另一个守护进程正在运行?正在退出。
Netstat 显示 Netplan 正在使用的端口。
netstat -pnlt | grep ':2983'
Run Code Online (Sandbox Code Playgroud)
tcp 0 0 0.0.0.0:2983 0.0.0.0:* LISTEN 1524/netplan
那么有人可以给我一个解决这个问题的方法吗?
我正在学习 Rust,但我不明白以下代码的问题是什么
pub enum BagEntryState {
UNUSED, USED, REMOVED
}
impl PartialEq for BagEntryState {
fn eq(&self, other: &Self) -> bool {
self == other
}
}
pub struct BagEntry< T: std::cmp::PartialEq + fmt::Display> {
state : BagEntryState,
value: T,
}
impl<'a, T: std::cmp::PartialEq + fmt::Display> BagEntry<T> {
pub fn new(value: T) -> BagEntry< T> {
BagEntry {
value,
state: BagEntryState::UNUSED,
}
}
pub fn value(self)->T {
self.value
}
}
impl<'a, T: std::cmp::PartialEq + fmt::Display> PartialEq for BagEntry<T> {
fn …Run Code Online (Sandbox Code Playgroud) 我是 terrafrom 的新手,并尝试使用 terraform 将新用户添加到我现有的 GCP 项目中。
provider "google" {
project = var.project_id
region = var.region
}
resource "google_project_iam_member" "project" {
project = var.project_id
role = "roles/owner"
member = "user:abc@gmail.com"
}
Run Code Online (Sandbox Code Playgroud)
但它根本不起作用。虽然它给了我错误:
Batch "iam-project-test modifyIamPolicy" for request "Create IAM Members
roles/owner user:abc@gmail.com for \"project \\\"test\\\"\"" returned
error: Error applying IAM policy for project "test": Error setting IAM policy for
project "test": googleapi: Error 400: Request contains an invalid argument., badRequest.
Run Code Online (Sandbox Code Playgroud) 我想为 ng-bootstrap 的手风琴添加自定义淡入淡出样式!我怎样才能实现它?
使用 Angular/CLI 8 构建 SPA。在本地运行直到成功。将 Firebase 身份验证添加到应用程序。通过 VSC 编译时收到以下错误消息:
node_modules/firebaseui-angular/lib/firebaseui-angular-library.component.d.ts:17:9 中的错误 - 错误 TS1086:无法在环境上下文中声明访问器。
17 get firebaseUiConfig(): NativeFirebaseUIAuthConfig; ~~~~~~~~~~~~~~~~
冉: npm install firebase firebaseui @angular/fire firebaseui-angular --save
Ran:ng serve本地编译查看,报错。
Using:
typescript ~3.5.3
firebase ^7.13.2
firebaseui ^4.5.0
firebaseui-angular ^4.1.0
angular/cli ~8.3.25
angular/compiler-cli ~8.2.14
angular-devkit/build-angular ~0.803.25
Running on MacPro Catalina v-10.15.3
Run Code Online (Sandbox Code Playgroud)
在stackoverflow上看过其他类似的帖子。没有发现任何与相同情况有关的东西。尝试了一些帮助其他人解决类似问题但其他情况的解决方案,例如角度动画和 flex-layout。这两个案例都降低了每个版本。也曾尝试将 firebaseui 的版本从 4.5.0 降低到 3.6.0 无济于事。
我正在使用 Zxing Scanner 实现条形码扫描仪,这部分的一切都正常,但现在我想在布局上添加一个按钮(用于打开/关闭手电筒)。我在互联网上到处查了一下,但一无所获。
所以,这是我的问题:
是否可以修改 .xml 以添加按钮?如果是,如何找到这个文件?
是否已经在某处实现了在布局中添加一些元素的功能?
这就是我调用 ZXingScannerView 的方式:
scannerView = new ZXingScannerView(this);
setContentView(scannerView);
Run Code Online (Sandbox Code Playgroud) 我想在 CKEditor 中添加“选择文件选项”。为此,我指的是有关上传图像插件的文档
单击此图像图标时,将打开以下窗口
没有上传图像选项(选择文件选项)。我想将这个插件与 CKEditor 一起添加。有什么方法可以使用 npm 添加这个吗?
或者有什么其他方法可以在 CKEditor 4 中包含此功能?
我正在尝试从 JsonArray 获取键的值。结果,我得到了 JsonObject,格式如下
{
"docs": [
{
"_index": "esindex",
"_type": "esmessage",
"_id": "4",
"_version": 1,
"found": true,
"_source": {
"account_number": 4,
"balance": 27658
}
}
]
}
Run Code Online (Sandbox Code Playgroud)
我需要找到id所有这些文件的"found": true. 生成的 JsonArray 的格式为
[
{
"_index": "esindex",
"_type": "esmessage",
"_id": "4",
"_version": 1,
"found": true,
"_source": {
"account_number": 4,
"balance": 27658
}
}
]
Run Code Online (Sandbox Code Playgroud)
我可以使用下面的java代码获取所有id的列表
List<Integer> documents = new ArrayList<>();
JsonObject result = esClient.execute(builder.build()).getJsonObject();
JsonArray jsonArray = result.getAsJsonObject().get("docs").getAsJsonArray();
while (i < request.getIds().size()) {
JsonPrimitive checkIfExists = …Run Code Online (Sandbox Code Playgroud) 我在构建 ionic 4 应用程序时遇到问题。每次我尝试构建 android 应用程序时,它都会出现以下错误。
FAILURE: Build failed with an exception.
* What went wrong: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes. Program type already present: android.support.v4.os.ResultReceiver$MyResultReceiver
* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 19s …Run Code Online (Sandbox Code Playgroud) angular ×5
java ×2
android ×1
angular9 ×1
ckeditor ×1
ckeditor4.x ×1
dex ×1
firebase ×1
firebaseui ×1
gson ×1
ionic4 ×1
java-stream ×1
jwt ×1
kubernetes ×1
layout ×1
networking ×1
ng-bootstrap ×1
owin ×1
prometheus ×1
reactjs ×1
rust ×1
terraform ×1
typescript ×1
xml ×1
zxing ×1