Merge pull request #6 from xpunch/dev

1.2.0
main 1.2.0
Johnson C 2 years ago committed by GitHub
commit ec51aa7c75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,2 +1 @@
docs
frontend
**

@ -4,7 +4,7 @@ import "time"
const (
Name = "go.micro.dashboard"
Version = "1.1.0"
Version = "1.2.0"
)
const (

@ -1,14 +1,13 @@
// 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"
)
@ -16,7 +15,7 @@ var doc = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{.Description}}",
"description": "{{escape .Description}}",
"title": "{{.Title}}",
"termsOfService": "http://swagger.io/terms/",
"contact": {},
@ -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{},
@ -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
@ -796,5 +802,5 @@ func (s *s) ReadDoc() string {
}
func init() {
swag.Register(swag.Name, &s{})
swag.Register("swagger", &s{})
}

@ -5,7 +5,7 @@
"title": "Go Micro Dashboard",
"termsOfService": "http://swagger.io/terms/",
"contact": {},
"version": "1.1.0"
"version": "1.2.0"
},
"basePath": "/",
"paths": {

@ -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:

@ -1,6 +1,6 @@
{
"name": "go-micro-dashboard",
"version": "1.0.0",
"version": "1.2.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

@ -1,6 +1,6 @@
{
"name": "go-micro-dashboard",
"version": "1.0.0",
"version": "1.2.0",
"scripts": {
"ng": "ng",
"start": "ng s -o",

@ -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';
@ -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;
}

@ -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()];

@ -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>

@ -51,8 +51,10 @@
}
}
.logo {
height: 44px;
height: 96px;
margin-right: 16px;
margin-top: 64px;
margin-bottom: 16px;
}
.title {
position: relative;

@ -1,5 +1,6 @@
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',
@ -7,9 +8,14 @@ import { DA_SERVICE_TOKEN, ITokenService } from '@delon/auth';
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;
});
}
}

@ -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;

@ -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)">

@ -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>

@ -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';
@ -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,
) {

@ -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);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 552 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 261 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

@ -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
}

@ -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 /

@ -1,5 +1,5 @@
// Code generated by fileb0x at "2021-11-30 15:12:48.1868883 +0800 CST m=+0.092050301" from config file "b0x.yaml" DO NOT EDIT.
// modification hash(13d61c2e25ff201c032844b85c950766.8be3f833d63e3c844663716446e13a42)
// Code generated by fileb0x at "2021-12-07 10:11:10.4808383 +0800 CST m=+0.057013201" from config file "b0x.yaml" DO NOT EDIT.
// modification hash(fecae112933101acf070cd0740e400a2.8be3f833d63e3c844663716446e13a42)
package web

@ -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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,5 +1,5 @@
// Code generaTed by fileb0x at "2021-11-30 15:12:48.2273449 +0800 CST m=+0.132506901" from config file "b0x.yaml" DO NOT EDIT.
// modified(2021-11-30 14:59:54.7705286 +0800 CST)
// Code generaTed by fileb0x at "2021-12-07 10:11:10.6541906 +0800 CST m=+0.230365501" from config file "b0x.yaml" DO NOT EDIT.
// modified(2021-12-07 10:11:05.7530359 +0800 CST)
// original path: frontend\dist\polyfills.d3127c390f57a23419e1.js
package web

@ -1,5 +1,5 @@
// Code generaTed by fileb0x at "2021-11-30 15:12:48.2319353 +0800 CST m=+0.137097301" from config file "b0x.yaml" DO NOT EDIT.
// modified(2021-11-30 14:59:54.7710356 +0800 CST)
// Code generaTed by fileb0x at "2021-12-07 10:11:10.5996812 +0800 CST m=+0.175856101" from config file "b0x.yaml" DO NOT EDIT.
// modified(2021-12-07 10:11:05.7530359 +0800 CST)
// original path: frontend\dist\runtime.0edec77bcc0e6f764d02.js
package web

@ -1,5 +1,5 @@
// Code generaTed by fileb0x at "2021-11-30 15:12:48.2335896 +0800 CST m=+0.138751601" from config file "b0x.yaml" DO NOT EDIT.
// modified(2021-11-30 14:59:54.7730521 +0800 CST)
// Code generaTed by fileb0x at "2021-12-07 10:11:10.6017344 +0800 CST m=+0.177909301" from config file "b0x.yaml" DO NOT EDIT.
// modified(2021-12-07 10:11:05.7530359 +0800 CST)
// original path: frontend\dist\styles.40a72a43f1959e5b9ccc.css
package web

@ -1,6 +1,8 @@
package web
import (
"os"
"os/exec"
"path/filepath"
"github.com/gin-gonic/gin"
@ -25,10 +27,15 @@ func RegisterRoute(router *gin.Engine) error {
case ".css":
c.Header("Content-Type", "text/css; charset=utf-8")
case ".js":
c.Header("Content-Type", "application/javascript")
c.Header("Content-Type", "text/javascript")
case ".svg":
c.Header("Content-Type", "image/svg+xml")
}
if path, err := exec.LookPath(os.Args[0]); err == nil {
if file, err := os.Stat(path); err == nil {
c.Header("Last-Modified", file.ModTime().UTC().Format("Mon, 02 Jan 2006 15:04:05 GMT"))
}
}
if _, err := c.Writer.Write(data); err != nil {
c.AbortWithError(500, err)
return

Loading…
Cancel
Save