Commit 79f3cb7d authored by 神楽坂玲奈's avatar 神楽坂玲奈

reboot

Signed-off-by: 神楽坂玲奈's avatarzh99998 <zh99998@gmail.com>
parent eb17e967
{
"vsicons.presets.angular": true
}
\ No newline at end of file
import {Component, OnInit, Input, ChangeDetectorRef, OnChanges, SimpleChanges, ElementRef} from '@angular/core'; import { ChangeDetectorRef, Component, ElementRef, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';
import {AppsService} from './apps.service'; import { AppsService } from './apps.service';
import {InstallOption} from './install-option'; import { InstallOption } from './install-option';
import {SettingsService} from './settings.sevices'; import { SettingsService } from './settings.sevices';
import {App} from './app'; import { App } from './app';
import {DownloadService} from './download.service'; import { DownloadService } from './download.service';
import {clipboard, remote} from 'electron'; import { clipboard, remote } from 'electron';
import * as path from 'path'; import * as path from 'path';
import * as fs from 'fs'; import * as fs from 'fs';
import * as $ from 'jquery'; import * as $ from 'jquery';
import {Points} from './ygopro.component'; import { Points } from './ygopro.component';
import {Http, URLSearchParams} from '@angular/http'; import { Http } from '@angular/http';
import {LoginService} from './login.service'; import { LoginService } from './login.service';
declare const Notification: any; declare const Notification: any;
...@@ -253,7 +253,7 @@ export class AppDetailComponent implements OnInit, OnChanges { ...@@ -253,7 +253,7 @@ export class AppDetailComponent implements OnInit, OnChanges {
let extname = path.extname(filename).slice(1); let extname = path.extname(filename).slice(1);
// let remote = require('electron').remote // let remote = require('electron').remote
let filePaths = await new Promise((resolve, reject) => { let filePaths = await new Promise<string[]>((resolve, reject) => {
remote.dialog.showOpenDialog({ remote.dialog.showOpenDialog({
filters: [{name: filename, extensions: [extname]}], filters: [{name: filename, extensions: [extname]}],
properties: ['openFile'] properties: ['openFile']
......
import {AppLocal} from './app-local'; import { AppLocal } from './app-local';
export enum Category { export enum Category {
game, game,
...@@ -10,6 +10,7 @@ export enum Category { ...@@ -10,6 +10,7 @@ export enum Category {
expansion, expansion,
module module
} }
// export type CategoryString = 'game' | 'music' | 'book' | 'runtime' | 'emulator' | 'language' | 'expansion' | 'module'
// export enum DownloadStatus{ // export enum DownloadStatus{
// downloading, // downloading,
...@@ -55,7 +56,7 @@ export class App { ...@@ -55,7 +56,7 @@ export class App {
description: string; // i18n description: string; // i18n
author: string; // English Only author: string; // English Only
homepage: string; homepage: string;
developers: {name: string, url: string}[]; developers: { name: string, url: string }[];
released_at: Date; released_at: Date;
category: Category; category: Category;
parent?: App; parent?: App;
...@@ -64,7 +65,7 @@ export class App { ...@@ -64,7 +65,7 @@ export class App {
references: Map<string, App>; references: Map<string, App>;
dependencies: Map<string, App>; dependencies: Map<string, App>;
locales: string[]; locales: string[];
news: {title: string, url: string, image: string, updated_at: Date}[]; news: { title: string, url: string, image: string, updated_at: Date }[];
network: any; network: any;
tags: string[]; tags: string[];
version: string; version: string;
...@@ -78,7 +79,7 @@ export class App { ...@@ -78,7 +79,7 @@ export class App {
cover: string; cover: string;
background: string; background: string;
price: {[currency: string]: string}; price: { [currency: string]: string };
key?: string; key?: string;
static downloadUrl(app: App, platform: string, locale: string): string { static downloadUrl(app: App, platform: string, locale: string): string {
...@@ -168,7 +169,7 @@ export class App { ...@@ -168,7 +169,7 @@ export class App {
this.released_at = app.released_at; this.released_at = app.released_at;
this.author = app.author; this.author = app.author;
this.homepage = app.homepage; this.homepage = app.homepage;
this.category = Category[app.category as string]; this.category = Category[<string>app.category];
this.actions = app.actions; this.actions = app.actions;
this.dependencies = app.dependencies; this.dependencies = app.dependencies;
this.parent = app.parent; this.parent = app.parent;
......
import {ApplicationRef, EventEmitter, Injectable, NgZone} from '@angular/core'; import { ApplicationRef, EventEmitter, Injectable, NgZone } from '@angular/core';
import {Http, URLSearchParams} from '@angular/http'; import { Http } from '@angular/http';
import * as crypto from 'crypto'; import * as crypto from 'crypto';
import {Action, App, AppStatus} from './app'; import { Action, App, AppStatus } from './app';
import {SettingsService} from './settings.sevices'; import { SettingsService } from './settings.sevices';
import * as fs from 'fs'; import * as fs from 'fs';
import {createReadStream, createWriteStream} from 'fs'; import { createReadStream, createWriteStream } from 'fs';
import * as path from 'path'; import * as path from 'path';
import * as child_process from 'child_process'; import * as child_process from 'child_process';
import {ChildProcess} from 'child_process'; import { ChildProcess } from 'child_process';
import {remote} from 'electron'; import { remote } from 'electron';
import 'rxjs/Rx'; import 'rxjs/Rx';
import * as readline from 'readline'; import * as readline from 'readline';
import {AppLocal} from './app-local'; import { AppLocal } from './app-local';
import * as glob from 'glob'; import * as glob from 'glob';
import * as ini from 'ini'; import * as ini from 'ini';
import {DownloadService, DownloadStatus} from './download.service'; import { DownloadService, DownloadStatus } from './download.service';
import {InstallOption} from './install-option'; import { InstallOption } from './install-option';
import {ComparableSet} from './shared/ComparableSet'; import { ComparableSet } from './shared/ComparableSet';
import {Observable, Observer} from 'rxjs/Rx'; import { Observable, Observer } from 'rxjs/Rx';
import {LoginService} from './login.service'; import { LoginService } from './login.service';
import Timer = NodeJS.Timer; import Timer = NodeJS.Timer;
import ReadableStream = NodeJS.ReadableStream; import ReadableStream = NodeJS.ReadableStream;
const sudo = require('electron-sudo'); const sudo = require('electron-sudo');
......
/** /**
* Created by zh99998 on 16/9/2. * Created by zh99998 on 16/9/2.
*/ */
import {Component, OnInit, ChangeDetectorRef, ElementRef, ViewChild} from '@angular/core'; import { ChangeDetectorRef, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import {AppsService} from './apps.service'; import { AppsService } from './apps.service';
import {LoginService} from './login.service'; import { LoginService } from './login.service';
import {App, Category} from './app'; import { App, Category } from './app';
import {shell} from 'electron'; import { shell } from 'electron';
import {SettingsService} from './settings.sevices'; import { SettingsService } from './settings.sevices';
import {URLSearchParams} from '@angular/http';
const ReconnectingWebSocket = require('reconnecting-websocket'); const ReconnectingWebSocket = require('reconnecting-websocket');
// import 'typeahead.js'; // import 'typeahead.js';
...@@ -60,7 +59,7 @@ export class LobbyComponent implements OnInit { ...@@ -60,7 +59,7 @@ export class LobbyComponent implements OnInit {
this.ref.detectChanges(); this.ref.detectChanges();
let url = new URL('wss://api.moecube.com:3100'); let url = new URL('wss://api.moecube.com:3100');
let params: URLSearchParams = url['searchParams']; let params: URLSearchParams = url.searchParams;
params.set('user_id', this.loginService.user.email); params.set('user_id', this.loginService.user.email);
this.messages = new ReconnectingWebSocket(url); this.messages = new ReconnectingWebSocket(url);
this.messages.onmessage = async(event) => { this.messages.onmessage = async(event) => {
......
/** /**
* Created by zh99998 on 16/9/2. * Created by zh99998 on 16/9/2.
*/ */
import {Component} from '@angular/core'; import { Component } from '@angular/core';
import {LoginService} from './login.service'; import { LoginService } from './login.service';
import * as crypto from 'crypto'; import * as crypto from 'crypto';
import {shell} from 'electron'; import { shell } from 'electron';
declare const URLSearchParams: any;
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
...@@ -51,6 +48,9 @@ export class LoginComponent { ...@@ -51,6 +48,9 @@ export class LoginComponent {
return; return;
} }
let token = new URL(return_url)['searchParams'].get('sso'); let token = new URL(return_url)['searchParams'].get('sso');
if (!token) {
return;
}
let user = this.toObject(new URLSearchParams(Buffer.from(token, 'base64').toString())); let user = this.toObject(new URLSearchParams(Buffer.from(token, 'base64').toString()));
this.loginService.login(user); this.loginService.login(user);
} }
......
...@@ -2,29 +2,29 @@ ...@@ -2,29 +2,29 @@
* Created by zh99998 on 16/9/2. * Created by zh99998 on 16/9/2.
*/ */
import { import {
Component,
OnInit,
ChangeDetectorRef, ChangeDetectorRef,
Input, Component,
ElementRef,
EventEmitter, EventEmitter,
Output, Input,
OnDestroy, OnDestroy,
ViewChild, OnInit,
ElementRef Output,
ViewChild
} from '@angular/core'; } from '@angular/core';
import * as fs from 'fs'; import * as fs from 'fs';
import * as path from 'path'; import * as path from 'path';
import * as child_process from 'child_process'; import * as child_process from 'child_process';
import {remote, shell} from 'electron'; import { remote, shell } from 'electron';
import * as ini from 'ini'; import * as ini from 'ini';
import {EncodeOptions} from 'ini'; import { EncodeOptions } from 'ini';
import {LoginService} from './login.service'; import { LoginService } from './login.service';
import {App} from './app'; import { App } from './app';
import {Http, Headers, URLSearchParams} from '@angular/http'; import { Headers, Http } from '@angular/http';
import 'rxjs/Rx'; import 'rxjs/Rx';
import {ISubscription} from 'rxjs/Subscription'; import { ISubscription } from 'rxjs/Subscription';
import {AppsService} from './apps.service'; import { AppsService } from './apps.service';
import {SettingsService} from './settings.sevices'; import { SettingsService } from './settings.sevices';
import * as $ from 'jquery'; import * as $ from 'jquery';
import Timer = NodeJS.Timer; import Timer = NodeJS.Timer;
import WillNavigateEvent = Electron.WebViewElement.WillNavigateEvent; import WillNavigateEvent = Electron.WebViewElement.WillNavigateEvent;
......
...@@ -8,11 +8,10 @@ ...@@ -8,11 +8,10 @@
"experimentalDecorators": true, "experimentalDecorators": true,
"lib": [ "lib": [
"es2017", "es2017",
"dom" "dom.iterable"
], ],
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true, "suppressImplicitAnyIndexErrors": true,
"strictNullChecks": true, "strict": true,
"skipLibCheck": true "skipLibCheck": true
}, },
"exclude": [ "exclude": [
......
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