Commit 4268cf19 authored by nanahira's avatar nanahira

Merge branch 'master' of git.mycard.moe:mycard/console

parents fa69a6fb 4b4f1170
Pipeline #4721 failed with stages
.env
node_modules/
test/
*.js
*.map
\ No newline at end of file
/.idea
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectCodeStyleSettingsManager">
<option name="PER_PROJECT_SETTINGS">
<value>
<DBN-PSQL>
<case-options enabled="false">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false" />
</DBN-PSQL>
<DBN-SQL>
<case-options enabled="false">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false">
<option name="STATEMENT_SPACING" value="one_line" />
<option name="CLAUSE_CHOP_DOWN" value="chop_down_if_statement_long" />
<option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" />
</formatting-settings>
</DBN-SQL>
<TypeScriptCodeStyleSettings>
<option name="FORCE_SEMICOLON_STYLE" value="true" />
<option name="USE_DOUBLE_QUOTES" value="false" />
<option name="FORCE_QUOTE_STYlE" value="true" />
</TypeScriptCodeStyleSettings>
<codeStyleSettings language="JavaScript">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="TypeScript">
<option name="RIGHT_MARGIN" value="100" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
</value>
</option>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</component>
</project>
\ No newline at end of file
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<DBN-PSQL>
<case-options enabled="false">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false" />
</DBN-PSQL>
<DBN-SQL>
<case-options enabled="false">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false">
<option name="STATEMENT_SPACING" value="one_line" />
<option name="CLAUSE_CHOP_DOWN" value="chop_down_if_statement_long" />
<option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" />
</formatting-settings>
</DBN-SQL>
<TypeScriptCodeStyleSettings version="0">
<option name="FORCE_SEMICOLON_STYLE" value="true" />
<option name="USE_DOUBLE_QUOTES" value="false" />
<option name="FORCE_QUOTE_STYlE" value="true" />
</TypeScriptCodeStyleSettings>
<codeStyleSettings language="JavaScript">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="TypeScript">
<option name="RIGHT_MARGIN" value="100" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
</code_scheme>
</component>
\ No newline at end of file
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>
\ No newline at end of file
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="PROJECT" charset="UTF-8" />
</component>
</project>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="TsLint" enabled="true" level="ERROR" enabled_by_default="true" />
</profile>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
<includedPredefinedLibrary name="ECMAScript 6" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/mycard-console-backend.iml" filepath="$PROJECT_DIR$/.idea/mycard-console-backend.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="TypeScriptCompiler">
<option name="isCompilerEnabled" value="true" />
<option name="useConfig" value="true" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectTasksOptions" suppressed-tasks="Babel" />
</project>
\ No newline at end of file
This diff is collapsed.
{
"singleQuote": true,
"printWidth": 140
}
......@@ -50,7 +50,9 @@
"styles": [
"src/styles.css"
],
"scripts": []
"scripts": [
"feather-icons"
]
},
"configurations": {
"production": {
......
This diff is collapsed.
......@@ -17,6 +17,8 @@
"@angular/platform-browser": "~12.2.0",
"@angular/platform-browser-dynamic": "~12.2.0",
"@angular/router": "~12.2.0",
"bootstrap": "^5.1.0",
"feather-icons": "^4.28.0",
"rxjs": "~6.6.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
......@@ -25,6 +27,7 @@
"@angular-devkit/build-angular": "~12.2.1",
"@angular/cli": "~12.2.1",
"@angular/compiler-cli": "~12.2.0",
"@types/feather-icons": "^4.7.0",
"@types/node": "^12.11.1",
"typescript": "~4.3.5"
}
......
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {AppComponent} from "./app/app.component";
const routes: Routes = [];
const routes: Routes = [
{path: 'apps/:id', component: AppComponent}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
export class AppRoutingModule {
}
This diff is collapsed.
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'console-web';
}
......@@ -2,17 +2,21 @@ import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { MyCardComponent } from './mycard.component';
import {HttpClientModule} from '@angular/common/http';
import { AppComponent } from './app/app.component';
@NgModule({
declarations: [
MyCardComponent,
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule
AppRoutingModule,
HttpClientModule
],
providers: [],
bootstrap: [AppComponent]
bootstrap: [MyCardComponent]
})
export class AppModule { }
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 class="h2">Dashboard</h1>
<div class="btn-toolbar mb-2 mb-md-0">
<div class="btn-group me-2">
<button type="button" class="btn btn-sm btn-outline-secondary">提交</button>
<button type="button" class="btn btn-sm btn-outline-secondary">重置</button>
</div>
<!-- <button type="button" class="btn btn-sm btn-outline-secondary dropdown-toggle">-->
<!-- <span data-feather="calendar"></span>-->
<!-- This week-->
<!-- </button>-->
</div>
</div>
{{app | async | json}}
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { mergeMap } from 'rxjs/operators';
import { AppService } from './app.service';
@Component({
selector: 'app-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent implements OnInit {
app = this.route.params.pipe(mergeMap((params) => this.appService.getApp(params['id'])));
constructor(private route: ActivatedRoute, private appService: AppService) {}
ngOnInit(): void {}
}
import {Injectable} from '@angular/core';
import {Observable} from "rxjs";
import {HttpClient} from "@angular/common/http";
import {map} from "rxjs/operators";
@Injectable({
providedIn: 'root'
})
export class AppService {
apps: Observable<AppsJson.App[]> = this.http.get<AppsJson.App[]>('https://api.mycard.moe/apps.json');
constructor(private http: HttpClient) {
}
getApp(id: string) {
return this.apps.pipe(map(apps => apps.find(app => app.id == id)))
}
}
export namespace AppsJson {
export const enum Locale {
zh_CN = 'zh-CN',
en_US = 'en-US',
ja_JP = 'ja-JP',
ko_KR = 'ko-KR',
pt_BR = 'pt-BR',
zh_HK = 'zh-HK',
zh_TW = 'zh-TW',
}
export const enum Platform {
Linux = 'linux',
macOS = 'darwin',
Windows = 'win32',
}
export type LocaleWise<T> = Record<Locale, T>;
export type PlatformWise<T> = Record<Platform, T>;
export interface Developer {
name: string;
url: string;
}
export interface Trailer {
type: string;
url: string;
url2?: string;
}
export interface Action {
interpreter?: string;
execute: string;
args: any[];
env: Record<string, string>;
open?: string;
}
export type PlatformAction = Record<string, Action>;
export interface News {
url: string;
image: string;
title: string;
text: string;
updated_at: string;
}
export interface NetworkServer {
id: string;
url: string;
}
export interface Network {
protocol: string;
port: number;
servers: NetworkServer[];
}
export interface Syncable {
sync: boolean;
}
export interface Price {
cny: number;
usd: number;
}
export interface App {
id: string;
key?: string;
name?: LocaleWise<string>;
description?: LocaleWise<string>;
developers?: LocaleWise<Developer[]>;
publishers?: LocaleWise<Developer[]>;
released_at?: string;
category?: string;
tags?: string[];
trailer?: Trailer[];
dependencies?: PlatformWise<string[]>;
references?: PlatformWise<string[]>;
author?: string;
homepage?: string;
locales?: string[];
actions?: PlatformWise<PlatformAction>;
version?: PlatformWise<string>;
news?: LocaleWise<News[]>;
conference?: string;
icon?: string;
cover?: string;
background?: string;
parent?: string;
network?: Network;
updated_at?: string;
files?: Record<string, Syncable>;
data?: any;
price?: Price;
}
}
.bd-placeholder-img {
font-size: 1.125rem;
text-anchor: middle;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
@media (min-width: 768px) {
.bd-placeholder-img-lg {
font-size: 3.5rem;
}
}
.feather {
width: 16px;
height: 16px;
vertical-align: text-bottom;
}
/*
* Sidebar
*/
.sidebar {
position: fixed;
top: 0;
/* rtl:raw:
right: 0;
*/
bottom: 0;
/* rtl:remove */
left: 0;
z-index: 100; /* Behind the navbar */
padding: 48px 0 0; /* Height of navbar */
box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
}
@media (max-width: 767.98px) {
.sidebar {
top: 5rem;
}
}
.sidebar-sticky {
position: relative;
top: 0;
height: calc(100vh - 48px);
padding-top: .5rem;
overflow-x: hidden;
overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */
}
.sidebar .nav-link {
font-weight: 500;
color: #333;
}
.sidebar .nav-link .feather {
margin-right: 4px;
color: #727272;
}
.sidebar .nav-link.active {
color: #2470dc;
}
.sidebar .nav-link:hover .feather,
.sidebar .nav-link.active .feather {
color: inherit;
}
.sidebar-heading {
font-size: .75rem;
text-transform: uppercase;
}
/*
* Navbar
*/
.navbar-brand {
padding-top: .75rem;
padding-bottom: .75rem;
font-size: 1rem;
background-color: rgba(0, 0, 0, .25);
box-shadow: inset -1px 0 0 rgba(0, 0, 0, .25);
}
.navbar .navbar-toggler {
top: .25rem;
right: 1rem;
}
.navbar .form-control {
padding: .75rem 1rem;
border-width: 0;
border-radius: 0;
}
.form-control-dark {
color: #fff;
background-color: rgba(255, 255, 255, .1);
border-color: rgba(255, 255, 255, .1);
}
.form-control-dark:focus {
border-color: transparent;
box-shadow: 0 0 0 3px rgba(255, 255, 255, .25);
}
/*zh*/
#sidebarMenu {
overflow-y: auto;
}
<header class='navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0 shadow'>
<a class='navbar-brand col-md-3 col-lg-2 me-0 px-3' href='#'>MyCard Partner Console</a>
<button class='navbar-toggler position-absolute d-md-none collapsed' type='button' data-bs-toggle='collapse'
data-bs-target='#sidebarMenu' aria-controls='sidebarMenu' aria-expanded='false'
aria-label='Toggle navigation'>
<span class='navbar-toggler-icon'></span>
</button>
<input class='form-control form-control-dark w-100' type='text' placeholder='Search' aria-label='Search'>
<div class='navbar-nav'>
<div class='nav-item text-nowrap'>
<a class='nav-link px-3' href='#'>Sign out</a>
</div>
</div>
</header>
<div class='container-fluid'>
<div class='row'>
<nav id='sidebarMenu' class='col-md-3 col-lg-2 d-md-block bg-light sidebar collapse'>
<div class='position-sticky pt-3'>
<h6 class='sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted'>
<span>Apps</span>
<a class='link-secondary' href='#' aria-label='Add a new report'>
<span data-feather='plus-circle'></span>
</a>
</h6>
<ul class='nav flex-column'>
<li class='nav-item' *ngFor='let app of apps | async'>
<a class='nav-link' [routerLink]="['apps', app.id]">
<img class='feather' [src]='app.icon'>
{{app.id}}
</a>
</li>
</ul>
</div>
</nav>
<main class='col-md-9 ms-sm-auto col-lg-10 px-md-4'>
<router-outlet></router-outlet>
</main>
</div>
</div>
import {AfterViewInit, Component} from '@angular/core';
import feather from 'feather-icons';
import {AppService} from "./app/app.service";
@Component({
selector: 'app-root',
templateUrl: './mycard.component.html',
styleUrls: ['./mycard.component.css']
})
export class MyCardComponent implements AfterViewInit {
title = 'console-web';
apps = this.appService.apps;
constructor(private appService: AppService) {
}
ngAfterViewInit(): void {
feather.replace();
}
// getI18nName(app: AppsJson.App){
// return app.name['']
// }
}
/* You can add global styles to this file, and also import other style files */
@import "~bootstrap";
body {
font-size: .875rem;
}
......@@ -19,7 +19,8 @@
"lib": [
"es2018",
"dom"
]
],
"esModuleInterop": true
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment