小编San*_*isy的帖子

JavaFx中的表设计

表

如何在javafx中设计如上所示的表格.我正在使用tableview并做了一些css,但设计不是我想要的.

请任何人都能告诉我如何实现上述设计

这是我试过的CSS

.table-view{
   -fx-background-color: transparent;
}

.table-view:focused{
    -fx-background-color: transparent;
}

/* Spaltenköpfe
    Struktur column-header-background -> column-header */

.table-view .column-header-background{
    -fx-background-color: linear-gradient(#131313 0%, #424141 100%);
}

.table-view .column-header-background .label{
    -fx-background-color: transparent;
    -fx-text-fill: white;
}

.table-view .column-header {
    -fx-background-color: transparent;
}

.table-view .table-cell{
    -fx-text-fill: white;
}

.table-row-cell{
    -fx-background-color: -fx-table-cell-border-color, #616161;
    -fx-background-insets: 0, 0 0 1 0;
    -fx-padding: 0.0em; /* 0 */
}
Run Code Online (Sandbox Code Playgroud)

目前的设计表

目前的设计

java javafx java-8 javafx-2 javafx-8

3
推荐指数
1
解决办法
1687
查看次数

PostLogoutRedirectUri 在带有 SPA(Angular 7 OIDC 客户端)的身份服务器 4 中始终为空

在带有身份服务器的Angular应用程序中使用 Facebook 登录身份验证 4. 在注销方法PostLogoutRedirectUri 上,ClientName、LogoutId始终为空。

private async Task<LoggedOutViewModel> BuildLoggedOutViewModelAsync(string logoutId)
    {
        // get context information (client name, post logout redirect URI and iframe for federated signout)
        var logout = await _interaction.GetLogoutContextAsync(logoutId);

        var vm = new LoggedOutViewModel
        {
            AutomaticRedirectAfterSignOut = AccountOptions.AutomaticRedirectAfterSignOut,
            PostLogoutRedirectUri = logout?.PostLogoutRedirectUri,
            ClientName = string.IsNullOrEmpty(logout?.ClientName) ? logout?.ClientId : logout?.ClientName,
            SignOutIframeUrl = logout?.SignOutIFrameUrl,
            LogoutId = logoutId
        };

        if (User?.Identity.IsAuthenticated == true)
        {
            var idp = User.FindFirst(JwtClaimTypes.IdentityProvider)?.Value;
            if (idp != null && idp != IdentityServer4.IdentityServerConstants.LocalIdentityProvider)
            { …
Run Code Online (Sandbox Code Playgroud)

asp.net openid-connect asp.net-core identityserver4 angular

3
推荐指数
1
解决办法
4965
查看次数

Bootstrap angular datepicker ngbDatepicker 不会在 ngbPanelContent 上溢出

我使用了以下形式的 ngbDatepicker

<ngb-panel>
              <ng-template ngbPanelTitle>
                <div class="row">
                  <ui-switch (change)="onChange($event,2)" [checked]="professionalLearningEvent.sportsPractive" size="small"></ui-switch>&nbsp;&nbsp;
                  <label class="accordianTitle" (click)="onAccordianTitleClick(2)">Will your sports practice be
                    affected ?</label>
                </div>
              </ng-template>
              <ng-template ngbPanelContent>
                <div class="container">

<div class="input-group">
  <input class="form-control" [formControl]="control" ngbDatepicker [dayTemplate]="getDayTemplate()" #d="ngbDatepicker" [ngClass]="{ 'is-invalid': isFieldInvalid(control) }">
  <div class="input-group-append">
    <button class="btn btn-sm btn-outline-secondary" (click)="d.toggle()" type="button">
      <span class="fa fa-calendar"></span>
    </button>
  </div>
</div>

                </div>
              </ng-template>
            </ngb-panel>
Run Code Online (Sandbox Code Playgroud)

日期选择器 UI 不会溢出。尝试找到一些解决方案,但无法找到。

日期选择器

css twitter-bootstrap bootstrap-datepicker bootstrap-4 angular

3
推荐指数
2
解决办法
1930
查看次数

用于验证电话号码的角度表单验证

我正在尝试使用 angular 中的正则表达式来验证电话号码

HTML 内容

<div class="form-group row">
                <input type="text" class="form-control" appPhoneMask placeholder="Mobile Number" autocomplete="off"
                    [ngClass]="{ 'is-invalid': (f.inputCountryCode.errors && mobileNumberform.submitted) }"
                    formControlName="inputCountryCode">
                <div *ngIf="(f.inputCountryCode.invalid ) || (f.inputCountryCode.invalid && (f.inputCountryCode.dirty || f.inputCountryCode.touched))"
                    class="invalid-feedback">
                    <div *ngIf="f.inputCountryCode.errors.required">This field is required.</div>
                    <div *ngIf="f.inputCountryCode.errors.pattern">Invalid phone number.</div>
                </div>
            </div>
Run Code Online (Sandbox Code Playgroud)

TS代码

 this.$form = this.$builder.group({
      selectCountryCode: [null, Validators.required],
      inputCountryCode: [null, [Validators.required, Validators.pattern("[0-9 ]{12}")]]
    });
Run Code Online (Sandbox Code Playgroud)

验证模式应该允许带空格的数字,因为我使用的是电话号码屏蔽,它在 3 位数字后添加了空格。

在此处输入图片说明

该模式不起作用,不断让电话号码验证为假

Angular 4 手机号码验证

允许数字和空格的字段的正则表达式

屏蔽指令

export class PhoneMaskDirective {

  constructor(public ngControl: NgControl) { }

  @HostListener('ngModelChange', ['$event'])
  onModelChange(event) {
    this.onInputChange(event, false); …
Run Code Online (Sandbox Code Playgroud)

javascript angular-validation angular angular7 angular8

3
推荐指数
2
解决办法
4万
查看次数

Whitelabel Error Page Swagger,此应用程序没有明确的 /error 映射,因此您将其视为后备 swagger2:3.0.0-SNAPSHOT

尝试在 spring boot 2.3.1 中配置 swagger。

摇篮配置

repositories {
    mavenCentral()
    maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local/' }
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-data-rest'
    testImplementation('org.springframework.boot:spring-boot-starter-test') {
        exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
    }
    implementation "io.springfox:springfox-boot-starter:3.0.0-SNAPSHOT"
    compile('io.springfox:springfox-swagger2:3.0.0-SNAPSHOT')
    compile('io.springfox:springfox-swagger-ui:3.0.0-SNAPSHOT')
}
Run Code Online (Sandbox Code Playgroud)

Swagger 配置

@Configuration
@EnableSwagger2
public class ApplicationSwaggerConfig {
    @Bean
    public Docket employeeApi() {
        return new Docket(DocumentationType.SWAGGER_2)
                .select()
                .apis(RequestHandlerSelectors.any())
                .paths(PathSelectors.any())
                .build()
                .apiInfo(getApiInfo());
    }

    //create api metadata that goes at the top of the generated page
    private ApiInfo getApiInfo() {
        return new ApiInfoBuilder()
                .title("Employee API")
                .version("1.0")
                .description("API for managing …
Run Code Online (Sandbox Code Playgroud)

java spring swagger spring-boot springfox

3
推荐指数
1
解决办法
4892
查看次数

在 Java 中将一个 Optional&lt;List&lt;Object&gt;&gt; 转换为另一个 Optional&lt;List&lt;Object&gt;&gt;

例如,如何将可选列表对象从一种类型转换为另一种类型

Optional<List<ProductMultipleOptionViewModel>> productOptionType1 // One type

Optional<List<ProductMultipleOption>> productOptionType2 // Other type
Run Code Online (Sandbox Code Playgroud)

ProductMultipleOptionViewModel

类型 1

@Introspected
public record ProductMultipleOptionViewModel(
        ProductOptionViewModel productOption,
        String optionName) {
}
Run Code Online (Sandbox Code Playgroud)

类型 2

 @Introspected
    public record ProductMultipleOption(
            ProductOptionViewModel productOption,
            String optionName) {
    }
Run Code Online (Sandbox Code Playgroud)

我想从 转换Optional<List<ProductMultipleOption>>为其他Optional<List<ProductMultipleOptionViewModel>>. 我试过下面的代码

Optional<List<ProductMultipleOptionViewModel>> conveertItem = Optional.ofNullable(product.getProductMultipleOption())
                .orElseGet(null)
                .stream()
                .map(option -> {
                    return new ProductMultipleOptionViewModel(
                            ProductOptionViewModel.valueOf(//Access the option value//), //access the option value//
                    );
                })
                .collect(Collectors.toList());
Run Code Online (Sandbox Code Playgroud)

使用上面的代码,我无法访问 map 方法中的选项值

如果product.getProductMultipleOption()为 null,则返回 null 或空列表。

java java-stream java-14

3
推荐指数
1
解决办法
122
查看次数

包更新为angular 5最新版本,但在使用角度模板的visual studio 2017中未更新npm

我在visual studio 2017模板中更新了角4到角5.

我按照链接http://www.talkingdotnet.com/upgrade-angular-4-app-angular-5-visual-studio-2017/的说明进行操作

npm install -g npm-check-updates

ncu -u

package.json文件已更新,但是npm没有更新,并且某些npm包没有被修改.

这是屏幕截图 屏幕截图

从图像中,右侧包更新为5.5.1,但npm依赖项仍指向旧版本.

怎么能解决这个问题.

asp.net asp.net-mvc asp.net-core angular angular5

2
推荐指数
1
解决办法
2395
查看次数

找不到模块“popper.js”Angular 5 Visual Studio 2017 asp.net core

我将我的 Angular 版本从 4 更新到 5。下面是截图,我按照链接http://www.talkingdotnet.com/upgrade-angular-4-app-angular-5-visual-studio-2017的说明进行操作/

截屏

package.json 文件

{
  "name": "VotingWebsite",
  "private": true,
  "version": "0.0.0",
  "scripts": {
    "test": "karma start ClientApp/test/karma.conf.js"
  },
  "devDependencies": {
    "@angular/animations": "5.2.1",
    "@angular/common": "5.2.1",
    "@angular/compiler": "5.2.1",
    "@angular/compiler-cli": "5.2.1",
    "@angular/core": "5.2.1",
    "@angular/forms": "5.2.1",
    "@angular/http": "5.2.1",
    "@angular/platform-browser": "5.2.1",
    "@angular/platform-browser-dynamic": "5.2.1",
    "@angular/platform-server": "5.2.1",
    "@angular/router": "5.2.1",
    "@ngtools/webpack": "1.9.5",
    "@types/chai": "4.1.1",
    "@types/jasmine": "2.8.5",
    "@types/webpack-env": "1.13.3",
    "angular2-router-loader": "0.3.5",
    "angular2-template-loader": "0.6.2",
    "aspnet-prerendering": "^3.0.1",
    "aspnet-webpack": "^2.0.1",
    "awesome-typescript-loader": "3.4.1",
    "popper.js": "^1.12.5",
    "bootstrap": "4.0.0",
    "chai": "4.1.2",
    "css": "2.2.1",
    "css-loader": "0.28.9",
    "es6-shim": "0.35.3",
    "event-source-polyfill": …
Run Code Online (Sandbox Code Playgroud)

asp.net asp.net-core angular popper.js angular5

2
推荐指数
2
解决办法
8581
查看次数

客户端的客户端密码验证失败,授权代码流上的客户端密码无效

我在身份服务器 4 中使用 OIDC 客户端 JS,反应不断收到错误

Client secret validation failed for client, Invalid client secret

关于授权码流程,

Oidc设置

private getClientSettings(): any {
    return {
      authority: "https://localhost:5001",
      client_id: "Local",
      redirect_uri: "https://localhost:5001/auth-callback",
      post_logout_redirect_uri: "https://localhost:5001",
      response_type: "code",
      scope: "profile openid email IdentityPortal.API offline_access",
      //filterProtocolClaims: environment.openID.filterProtocolClaims,
      loadUserInfo: true,
      monitorSession: true,
      silent_redirect_uri: "https://localhost:5001/silent-reniew.html",
      accessTokenExpiringNotificationTime: 20, //default 60
      checkSessionInterval: 5000, //default 2000
      silentRequestTimeout: 2000,
    };
  }
Run Code Online (Sandbox Code Playgroud)

身份服务器 4 配置

public static IEnumerable<Client> GetClients()
        {
            // client credentials client
            return new List<Client>
            {
                new Client
                {
                    ClientId = …
Run Code Online (Sandbox Code Playgroud)

asp.net reactjs openid-connect identityserver4 oidc-client-js

2
推荐指数
1
解决办法
1621
查看次数

zsh:找不到命令:dotnet-ef

我在 mac 中使用 asp.net core 2.1 和 Visual Studio Code 或 Rider。我已经在 mac 上安装了 2.1 sdk,同时使用以下命令

dotnet-ef database update --project XXXX.XXXX
Run Code Online (Sandbox Code Playgroud)

我得到一个例外

zsh: command not found: dotnet-ef
Run Code Online (Sandbox Code Playgroud)

使用命令

dotnet tool install --global dotnet-ef

得到一个异常Tool 'dotnet-ef' is already installed.

然后使用这个命令dotnet tool restore

error NU3037: Package 'dotnet-ef 3.1.1' from source 'https://api.nuget.org/v3/index.json': The repository countersignature validity period has expired.

Package "dotnet-ef" failed to restore, due to Microsoft.DotNet.ToolPackage.ToolPackageException: The tool package could not be restored.
Run Code Online (Sandbox Code Playgroud)

c# asp.net .net-core asp.net-core dotnet-cli

2
推荐指数
1
解决办法
3919
查看次数