Skip to content
This repository was archived by the owner on Jul 4, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
docs
frontend
**
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "time"

const (
Name = "go.micro.dashboard"
Version = "1.1.0"
Version = "1.2.0"
)

const (
Expand Down
18 changes: 12 additions & 6 deletions docs/docs.go
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag

package docs

import (
"bytes"
"encoding/json"
"strings"
"text/template"

"github.com/alecthomas/template"
"github.com/swaggo/swag"
)

var doc = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{.Description}}",
"description": "{{escape .Description}}",
"title": "{{.Title}}",
"termsOfService": "http://swagger.io/terms/",
"contact": {},
Expand Down Expand Up @@ -763,7 +762,7 @@ type swaggerInfo struct {

// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = swaggerInfo{
Version: "1.1.0",
Version: "1.2.0",
Host: "",
BasePath: "/",
Schemes: []string{},
Expand All @@ -782,6 +781,13 @@ func (s *s) ReadDoc() string {
a, _ := json.Marshal(v)
return string(a)
},
"escape": func(v interface{}) string {
// escape tabs
str := strings.Replace(v.(string), "\t", "\\t", -1)
// replace " with \", and if that results in \\", replace that with \\\"
str = strings.Replace(str, "\"", "\\\"", -1)
return strings.Replace(str, "\\\\\"", "\\\\\\\"", -1)
},
}).Parse(doc)
if err != nil {
return doc
Expand All @@ -796,5 +802,5 @@ func (s *s) ReadDoc() string {
}

func init() {
swag.Register(swag.Name, &s{})
swag.Register("swagger", &s{})
}
2 changes: 1 addition & 1 deletion docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"title": "Go Micro Dashboard",
"termsOfService": "http://swagger.io/terms/",
"contact": {},
"version": "1.1.0"
"version": "1.2.0"
},
"basePath": "/",
"paths": {
Expand Down
2 changes: 1 addition & 1 deletion docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ info:
description: go micro dashboard restful-api
termsOfService: http://swagger.io/terms/
title: Go Micro Dashboard
version: 1.1.0
version: 1.2.0
paths:
/api/account/login:
post:
Expand Down
2 changes: 1 addition & 1 deletion frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "go-micro-dashboard",
"version": "1.0.0",
"version": "1.2.0",
"scripts": {
"ng": "ng",
"start": "ng s -o",
Expand Down
5 changes: 0 additions & 5 deletions frontend/src/app/core/net/default.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
} from '@angular/common/http';
import { Injectable, Injector } from '@angular/core';
import { Router } from '@angular/router';
import { DA_SERVICE_TOKEN, ITokenService } from '@delon/auth';
import { ALAIN_I18N_TOKEN, _HttpClient } from '@delon/theme';
import { NzNotificationService } from 'ng-zorro-antd/notification';
import { Observable, of, throwError } from 'rxjs';
Expand Down Expand Up @@ -63,10 +62,6 @@ export class DefaultInterceptor implements HttpInterceptor {
if (!headers?.has('Accept-Language') && lang) {
res['Accept-Language'] = lang;
}
const token = this.injector.get<ITokenService>(DA_SERVICE_TOKEN).get()?.token
if (token) {
res['Authorization'] = 'Bearer ' + token;
}
return res;
}

Expand Down
7 changes: 6 additions & 1 deletion frontend/src/app/global-config.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ const alainConfig: AlainConfig = {
license: `A59B099A586B3851E0F0D7FDBF37B603`,
licenseA: `C94CEE276DB2187AE6B65D56B3FC2848`
},
auth: { login_url: '/passport/login' }
auth: {
login_url: '/passport/login',
token_send_key: 'Authorization',
token_send_template: 'Bearer ${token}',
ignores: [/\/login/, /assets\//, /passport\//, /\/version/,],
}
};

const alainModules: any[] = [AlainThemeModule.forRoot(), DelonACLModule.forRoot()];
Expand Down
9 changes: 7 additions & 2 deletions frontend/src/app/layout/passport/passport.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
<div class="wrap">
<div class="top">
<div class="head">
<span class="title" >Go Micro Dashboard</span>
<img class="logo" src="./assets/logo-color.png">
<p class="title">Go Micro Dashboard</p>
</div>
</div>
<router-outlet></router-outlet>
<global-footer>
<a href="https://github.com/xpunch" target="_blank">X Punch</a>
<p>{{version}}</p>
</global-footer>
</div>
</div>
</div>
4 changes: 3 additions & 1 deletion frontend/src/app/layout/passport/passport.component.less
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@
}
}
.logo {
height: 44px;
height: 96px;
margin-right: 16px;
margin-top: 64px;
margin-bottom: 16px;
}
.title {
position: relative;
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/app/layout/passport/passport.component.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import { Component, Inject, OnInit } from '@angular/core';
import { DA_SERVICE_TOKEN, ITokenService } from '@delon/auth';
import { ServiceProxy } from 'src/app/shared/service-proxies/service-proxies';

@Component({
selector: 'layout-passport',
templateUrl: './passport.component.html',
styleUrls: ['./passport.component.less']
})
export class LayoutPassportComponent implements OnInit {
constructor(@Inject(DA_SERVICE_TOKEN) private tokenService: ITokenService) {}
constructor(@Inject(DA_SERVICE_TOKEN) private tokenService: ITokenService, private readonly service: ServiceProxy) { }

version: string = '';

ngOnInit(): void {
this.tokenService.clear();
this.service.getVersion().subscribe(resp => {
this.version = resp.version;
});
}
}
6 changes: 5 additions & 1 deletion frontend/src/app/routes/client/call.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,11 @@ export class ClientCallComponent implements OnInit {
break;
default:
if (v.type.startsWith('[]')) {
value = [];
if (v.type.endsWith('byte') || v.type.endsWith('int8')) {
value = 'base64';
} else {
value = [];
}
} else {
console.log(v.type);
value = v.type;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/routes/client/publish.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item *ngIf="selectedService">
<nz-form-item *ngIf="selectedService&&selectedService.versions">
<nz-form-control>
<nz-select nzShowSearch name="version" nzPlaceHolder="Select version" [(ngModel)]="version"
(ngModelChange)="versionChanged($event)">
Expand Down
34 changes: 15 additions & 19 deletions frontend/src/app/routes/passport/login/login.component.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
<form nz-form [formGroup]="form" (ngSubmit)="submit()" role="form">
<nz-tabset [nzAnimated]="false" class="tabs" (nzSelectChange)="switch($event)">
<nz-tab [nzTitle]="'Credentials'" style="margin:auto;">
<nz-alert *ngIf="error" [nzType]="'error'" [nzMessage]="error" [nzShowIcon]="true" class="mb-lg"></nz-alert>
<nz-form-item>
<nz-form-control nzErrorTip="Please enter username">
<nz-input-group nzSize="large" nzPrefixIcon="user">
<input nz-input formControlName="username" placeholder="username" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-control nzErrorTip="Please enter password">
<nz-input-group nzSize="large" nzPrefixIcon="lock">
<input nz-input type="password" formControlName="password" placeholder="password" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
</nz-tab>
</nz-tabset>
<nz-alert *ngIf="error" [nzType]="'error'" [nzMessage]="error" [nzShowIcon]="true" class="mb-lg"></nz-alert>
<nz-form-item>
<nz-form-control nzErrorTip="Please enter username">
<nz-input-group nzSize="large" nzPrefixIcon="user">
<input nz-input formControlName="username" placeholder="username" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-control nzErrorTip="Please enter password">
<nz-input-group nzSize="large" nzPrefixIcon="lock">
<input nz-input type="password" formControlName="password" placeholder="password" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-col [nzSpan]="12">
<label nz-checkbox formControlName="remember">Remember me</label>
Expand Down
9 changes: 2 additions & 7 deletions frontend/src/app/routes/passport/login/login.component.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Inject, OnDestroy, Optional } from '@angular/core';
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Inject, Optional } from '@angular/core';
import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
import { Router } from '@angular/router';
import { StartupService } from '@core';
import { ReuseTabService } from '@delon/abc/reuse-tab';
import { DA_SERVICE_TOKEN, ITokenService, SocialOpenType, SocialService } from '@delon/auth';
import { SettingsService, _HttpClient } from '@delon/theme';
import { environment } from '@env/environment';
import { DA_SERVICE_TOKEN, ITokenService, SocialService } from '@delon/auth';
import { NzTabChangeEvent } from 'ng-zorro-antd/tabs';
import { finalize } from 'rxjs/operators';
import { AccountServiceProxy, LoginRequest } from 'src/app/shared/service-proxies/service-proxies';
Expand All @@ -21,14 +19,11 @@ export class UserLoginComponent {
constructor(
fb: FormBuilder,
private router: Router,
private settingsService: SettingsService,
private socialService: SocialService,
@Optional()
@Inject(ReuseTabService)
private reuseTabService: ReuseTabService,
@Inject(DA_SERVICE_TOKEN) private tokenService: ITokenService,
private startupSrv: StartupService,
private http: _HttpClient,
private cdr: ChangeDetectorRef,
private accountService: AccountServiceProxy,
) {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/app/routes/services/detail.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ export class ServiceDetailComponent implements OnInit {
this.router.navigate(['/client/call'], navigationExtras);
}

gotoPublish(service: string, version: string, endpoint: string) {
gotoPublish(service: string, version: string, topic: string) {
let navigationExtras: NavigationExtras = {
queryParams: { 'service': service, 'version': version, 'endpoint': endpoint }
queryParams: { 'service': service, 'version': version, 'topic': topic }
};
this.router.navigate(['/client/publish'], navigationExtras);
}
Expand Down
Binary file added frontend/src/assets/logo-color.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/src/assets/logo-full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/src/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/src/favicon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func Register(opts Options) error {
registry.NewRouteRegistrar(opts.Client.Options().Registry),
statistics.NewRouteRegistrar(opts.Client.Options().Registry),
} {
r.RegisterRoute(router)
r.RegisterRoute(router.Group(""))
}
return nil
}
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

// @title Go Micro Dashboard
// @version 1.1.0
// @version 1.2.0
// @description go micro dashboard restful-api
// @termsOfService http://swagger.io/terms/
// @BasePath /
Expand Down
4 changes: 2 additions & 2 deletions web/ab0x.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions web/b0xfile__449.ea3505f8c3a78bc5ec51.js.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Code generaTed by fileb0x at "2021-11-30 15:12:48.2738525 +0800 CST m=+0.179014501" from config file "b0x.yaml" DO NOT EDIT.
// modified(2021-11-30 14:59:54.7720466 +0800 CST)
// Code generaTed by fileb0x at "2021-12-07 10:11:10.6402683 +0800 CST m=+0.216443201" from config file "b0x.yaml" DO NOT EDIT.
// modified(2021-12-07 10:11:05.7530359 +0800 CST)
// original path: frontend\dist\449.ea3505f8c3a78bc5ec51.js

package web
Expand Down
30 changes: 30 additions & 0 deletions web/b0xfile__assets_logo-color.png.go

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions web/b0xfile__assets_logo-full.png.go

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions web/b0xfile__assets_logo.png.go

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions web/b0xfile__favicon.ico.go

Large diffs are not rendered by default.

Loading