我想更改搜索栏的背景颜色。它具有appearance="outline"我喜欢的设计,但如果我设置了一种新颜色,它会越过边界并且看起来很丑陋。我能在这里做什么?
我的CSS:
::ng-deep .mat-form-field-appearance-outline .mat-form-field-infix {
padding: 5%;
}
::ng-deep .mat-form-field-infix {
top: -3px;
}
::ng-deep .mat-form-field-appearance-outline .mat-form-field-outline {
background-color: white;
}
Run Code Online (Sandbox Code Playgroud)
我的 HTML:
<mat-form-field style="width:110%;" appearance="outline" >
<mat-icon matPrefix>search</mat-icon>
<input type="search" name="test" [(ngModel)]="searchText"
placeholder="Search" aria-label="Search" matInput>
</mat-form-field>
Run Code Online (Sandbox Code Playgroud)
嘿,我们想使用 Django 来执行 python 代码并使用通道来获取结果。实现了 websockets 无法正常工作的所有内容。如果我尝试从我们的 Angular 前端向 Django 发送一些东西,它工作正常。否则我们的 Spring Boot StompSession Websockets 可以与其他 Spring Boot 应用程序和 Angular 一起正常工作。
但是 Django 3.1.3 和 Spring Boot 2.3.3 没有。此外,使用通道 3.0.2、通道-redis 3.2.0 和 redis 6 的 docker 容器。
我可以从 Django 服务器日志中看到:
WebSocket HANDSHAKING /ws/card-detection/ [127.0.0.1:53209]
i'm in connect method
WebSocket CONNECT /ws/card-detection/ [127.0.0.1:53209]
i'm in receive method
text_data: CONNECT
Run Code Online (Sandbox Code Playgroud)
一旦 websocket 请求进来,它就会被执行。
django 消费者(没有上面记录的打印):
class MyConsumer(WebsocketConsumer):
groups = ["broadcast"]
def connect(self):
self.accept()
def receive(self, text_data=None, bytes_data=None):
self.send(text_data="Hello world!")
def disconnect(self, close_code): …Run Code Online (Sandbox Code Playgroud) 我已经为 Windows 11 发行版和 Ubuntu 20.04 安装了 WSL。我看到很多人说我可以使用命令而无需使用wsl命令打开发行版。
不知怎的,这对我不起作用。当我输入命令时,wsl结果是:
Processing fstab with mount -a failed.
Run Code Online (Sandbox Code Playgroud)
例如:wsl rsync -r -v /mnt/d/DUMMY_SOURCE/ /mnt/e/DUMMY_DESTINATION
唯一真正有效的 wsl 命令是wsl -l -v
NAME STATE VERSION
* docker-desktop-data Stopped 2
docker-desktop Stopped 2
Ubuntu-20.04 Stopped 2
Run Code Online (Sandbox Code Playgroud)
我的设置有什么问题吗?
从昨天开始,我无法再拉图像了。而且我无法使用docker login. 出现同样的错误:
Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
Run Code Online (Sandbox Code Playgroud)
我不支持任何代理,我所有的 docker 容器本身都运行良好。我在家里运行它,我使用的唯一反向代理在容器中运行,这不是原因。
继续运行:
您可以在任何地方找到如何将文本居中,甚至占位符和标签以及所有内容,但我无法将整个表单域居中,而且它看起来很丑陋。
<div class="mat-app-background basic-container">
<div layout-gt-sm="column" style="min-width: 350px; max-width: 450px; margin:auto">
<mat-card flex-gt-sm class="push">
<div style="text-align:center;">
<mat-card-title>Login</mat-card-title>
</div>
<div style="text-align:center;">
<mat-card-content>
<form [formGroup]="loginForm" class="form" (ngSubmit)="login()">
<table cellspacing="0">
<tr>
<td>
<mat-form-field>
<div style="text-align:center;">
<input matInput placeholder="{{ 'LOGIN.USERNAME' | translate }}" name="username"
formControlName="username" type="name" />
<mat-error *ngIf="formErrors.username" class="form__error">{{ formErrors.username }} </mat-error>
</div>
</mat-form-field>
</td>
</tr>
Run Code Online (Sandbox Code Playgroud)
我希望这段代码需要。如果没有,我将发布其余的 html。但这只是使领域居中。这里没有使用 CSS。
我知道有几个关于此问题的线程,我全部阅读了它们,但好几天都无法解决此问题。我可能找到了一个解决方案,但它似乎对我来说很脏。
\n\n因此,与其他用户一样,我对 datePicker 也有同样的问题。对我来说,它是 Angular Material Datepickermat-datepicker
当我记录该值时,我得到正确的结果:
\n\nWed Dec 24 1999 00:00:00 GMT+0100 (Mitteleurop\xc3\xa4ische Normalzeit)\nRun Code Online (Sandbox Code Playgroud)\n\n但在请求中是
\n\n1999-12-23T23:00:00.000Z\nRun Code Online (Sandbox Code Playgroud)\n\n我还尝试过什么:
\n\n我已添加{ provide: MAT_MOMENT_DATE_ADAPTER_OPTIONS, useValue: { useUtc: true } }到我的component和 到我的app.module.ts. 这对我来说没有任何区别。
我的肮脏解决方案(在发送请求之前):
\n\nWed Dec 24 1999 00:00:00 GMT+0100 (Mitteleurop\xc3\xa4ische Normalzeit)\nRun Code Online (Sandbox Code Playgroud)\n\n当我这样做时,控制台会记录:
\n\nWed Dec 24 1999 01:00:00 GMT+0100 (Mitteleurop\xc3\xa4ische Normalzeit)\nRun Code Online (Sandbox Code Playgroud)\n\n并且请求是正确的:
\n\n1997-12-24T00:00:00.000Z\nRun Code Online (Sandbox Code Playgroud)\n\n但如果现在有人来自不同的时区,比如 GMT-0100,这将再次不起作用。如何正确解决这个问题?
\n\n如果有必要知道的话,我还会动态更改适配器:
\n\n1999-12-23T23:00:00.000Z\nRun Code Online (Sandbox Code Playgroud)\n 我有点困惑,在这里找不到任何东西,如何使用PrimeFaces的PrimeIcons。我只想使用PrimeFaces示例的图标:
<p:contextMenu for="table">
<p:menuitem value="Löschen" update="table" icon="pi pi-times" action="#{telefonbuchList.deleteEntry}"/>
</p:contextMenu>
Run Code Online (Sandbox Code Playgroud)
“ pi pi-times”。相反,我只是得到一个^。我什至现在都不想要使用FontAwesome和这些东西。我以为图标已经通过PrimeFaces的依赖关系实现了,但是我似乎错了。
我正在解析 excel 表格,但如果用户需要选择的表格不止 1 张。我想用一个对话框来做到这一点,该函数需要等到结果出现。
我的代码:
app.component.ts:
onFileSelected(file: File): void {
const reader: FileReader = new FileReader();
reader.onload = async (e: any) => {
// read workbook
const bstr: string = e.target.result;
const wb: XLSX.WorkBook = XLSX.read(bstr, {
type: "binary",
sheetRows: 101
});
this.sheetNames = wb.SheetNames;
if (this.sheetNames.length > 1) {
console.log("größer eins");
await this.openDialog();
}
// grab first sheet
const wsname: string = wb.SheetNames[this.sheetIndex];
const ws: XLSX.WorkSheet = wb.Sheets[wsname];
this.data = XLSX.utils.sheet_to_json(ws, { header: 0 });
};
reader.readAsBinaryString(this.uploadComponent.file);
} …Run Code Online (Sandbox Code Playgroud) 我没有为我的问题找到简单的解决方案。我想使用 TextInputDialog,您必须在其中输入用户密码,以重置数据库中的所有数据。TextInputDialog 的问题在于它没有屏蔽文本,我不知道有任何选项可以做到这一点。
我的代码:
public void buttonReset() {
TextInputDialog dialog = new TextInputDialog("Test");
dialog.setTitle("Alle Daten löschen");
dialog.setHeaderText("Sind Sie sich ganz sicher? Damit werden alle im Programm vorhandenen Daten gelöscht.");
dialog.setContentText("Bitte geben Sie zur Bestätigung ihr Passwort ein:");
Stage stage = (Stage) dialog.getDialogPane().getScene().getWindow();
stage.getIcons().add(new Image("/icons8-blockchain-technology-64.png"));
Optional<String> result = dialog.showAndWait();
if (result.isPresent()){
try {
if (connector.checkUserPassword(userName, result.get())) {
System.out.println("Your name: " + result.get());
} else {
exc.alertWrongPassword();
buttonReset();
}
} catch (TimeoutException te) {
te.printStackTrace();
exc.alertServerNotReached();
}
}
Run Code Online (Sandbox Code Playgroud)
那么是否有可能使用对话框或其他东西来屏蔽 TextInput?
我想突出显示 MenuItem 中当前处于活动状态的元素,即用户当前所在的元素。
例如:我正在导航到个人资料页面。然后我希望突出显示该菜单项。我已经用一些 HTML 和 TypeScript 尝试过,但不知何故它出现了地狱般的错误:
StackBlitz:https://stackblitz.com/edit/angular-vgp585
HTML:
<mat-toolbar color="primary" style="height:67px;">
<mat-menu #menu="matMenu">
<button mat-menu-item id="settings" *ngIf="authenticationService.currentUserValue" [routerLink]="['/settings']"
(click)="setActiveItem('settings')">
<mat-icon [ngStyle]="{'color' : activeItem===settings ? 'blue' : 'rgba(0,0,0,.54)' }">settings</mat-icon>
<span
[ngStyle]="{'font-weight': activeItem===settings ? 'bold' : 'normal' }">{{ 'HEADER.SETTINGS' | translate }}</span>
</button>
<button mat-menu-item *ngIf="authenticationService.currentUserValue" [routerLink]="['/profile']"
(click)="setActiveItem('profile')">
<fa-icon [icon]="['fas', 'address-card']"
[ngStyle]="{'color' : activeItem===profile ? 'blue' : 'rgba(0,0,0,.54)' }" class="font-awesome" size="lg">
</fa-icon>
<span
[ngStyle]="{'font-weight': activeItem===profile ? 'bold' : 'normal' }">{{ 'HEADER.PROFILE' | translate }}</span>
</button>
<button mat-menu-item …Run Code Online (Sandbox Code Playgroud) angular ×5
css ×2
dialog ×2
typescript ×2
datepicker ×1
django ×1
docker ×1
html ×1
javafx ×1
masking ×1
powershell ×1
primefaces ×1
spring-boot ×1
stomp ×1
ubuntu-18.04 ×1
utc ×1
websocket ×1