Skip to content

Commit

Permalink
Merge pull request #3 from joon610/v1.0.0
Browse files Browse the repository at this point in the history
V1.0.0
  • Loading branch information
joon610 authored Jan 6, 2020
2 parents 164f1fd + f7c2f9e commit 31a643c
Show file tree
Hide file tree
Showing 35 changed files with 676 additions and 96 deletions.
6 changes: 4 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ module.exports = {
"babel/camelcase": 1,
"babel/no-invalid-this": 1,
"babel/object-curly-spacing": 1,
"babel/quotes": 1,
"babel/quotes": 0,
"babel/semi": 1,
"babel/no-unused-expressions": 1,
"babel/valid-typeof": 1
"babel/valid-typeof": 1,
"@typescript-eslint/explicit-function-return-type":0,
"@typescript-eslint/no-use-before-define":0
}
};

Expand Down
Binary file modified build/icons/1024x1024.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 build/icons/128x128.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 build/icons/16x16.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 build/icons/24x24.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 build/icons/256x256.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 build/icons/32x32.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 build/icons/48x48.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 build/icons/512x512.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 build/icons/64x64.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 build/icons/icon.icns
Binary file not shown.
Binary file modified build/icons/icon.ico
Binary file not shown.
51 changes: 49 additions & 2 deletions package-lock.json

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

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mockup-server",
"version": "0.2.6",
"version": "1.0.0",
"private": true,
"scripts": {
"build": "vue-cli-service build",
Expand All @@ -15,14 +15,17 @@
"@types/cors": "^2.8.6",
"@types/express": "^4.17.2",
"@types/node": "^12.12.6",
"axios": "^0.19.0",
"body-parser": "^1.19.0",
"core-js": "^2.6.10",
"cors": "^2.8.5",
"eslint-plugin-babel": "^5.3.0",
"express": "^4.17.1",
"moment": "^2.24.0",
"style-loader": "^1.0.0",
"ts-loader": "^6.2.1",
"vue": "^2.6.10",
"vue-axios": "^2.1.5",
"vue-class-component": "^7.0.2",
"vue-property-decorator": "^8.3.0",
"vue-router": "^3.0.3",
Expand Down Expand Up @@ -71,4 +74,4 @@
"last 2 versions"
],
"main": "background.js"
}
}
Binary file removed public/favicon.ico
Binary file not shown.
Binary file modified public/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<head >
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>mock server</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css">
</head>
<body>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css">
</head >
<body >
<script>
document.documentElement.style.overflow = 'hidden';
</script>
<noscript>
<strong>We're sorry but vitual-server doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
Expand Down
82 changes: 68 additions & 14 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,78 @@
<template lang="pug">
v-app(dark)
v-app(dark style="-webkit-app-region: drag")
v-app-bar(app)
v-toolbar-title.headline.text-uppercase
span Mockup Server
v-toolbar-title.headline
span Mockup-server
| {{'v'+packageVersion}}
v-spacer
v-btn(text @click="openBrowser()")
span.mr-2 Latest Release
v-icon mdi-open-in-new
v-btn(v-if="diffResult === true" color="deep-orange" @click="openBrowser()")
span.mr-2 Release {{ newVersion }}
v-icon fa-external-link-square-alt
v-btn(v-else @click="openBugReport()")
span.mr-2 Issues
v-icon fa-external-link-square-alt
v-content
router-view
</template>
</template>  

<style scoped>
.headline {
margin-top: 20px
}
</style>

<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
const shell = require("electron").shell;
import fs from 'fs';
import {Component, Vue} from 'vue-property-decorator';
const shell = require('electron').shell;
import {VERSION} from '@/const/mockConst';
@Component
export default class ComponentName extends Vue {
private openBrowser(): void {
shell.openExternalSync("https://github.com/joon610/mock-server/releases");
return;
}
export default class ComponentName extends Vue {
private newVersion = '';
private packageVersion = VERSION;
private openBrowser() {
shell.openExternalSync(
'https://github.com/joon610/mock-server/releases',
);
return;
}
private openBugReport() {
shell.openExternalSync(
'https://github.com/joon610/mockup-server/issues',
);
return;
}
private created() {
this.getNewRelease();
// this.getCurrentVersion();
}
private get diffResult() {
if(this.newVersion === '') return false;
if(this.packageVersion === '') return false;
const githubVersionNum = Number(this.removeVersion(this.removePoint(this.newVersion)));
const packageVersionNum = Number(this.removePoint(this.packageVersion));
return githubVersionNum > packageVersionNum ? true:false;
}
private async getNewRelease(){
const url = "https://api.github.com/repos/joon610/mockup-server/releases/latest";
const response = await this.axios.get(url);
const data = response?.data?.name;
this.newVersion = data;
}
private getCurrentVersion() {
const json = JSON.parse(fs.readFileSync('package.json', 'utf8'));
this.packageVersion = json.version;
}
private removePoint = (value:string):string => (value.replace(/\./g ,''));
private removeVersion = (value:string):string => (value.replace(/v/ ,''));
}
</script>
Binary file removed src/assets/icons/mac/mockup-icon.icns
Binary file not shown.
Binary file removed src/assets/icons/win/mockup-icon.ico
Binary file not shown.
Binary file removed src/assets/logo.png
Binary file not shown.
1 change: 0 additions & 1 deletion src/assets/logo.svg

This file was deleted.

10 changes: 7 additions & 3 deletions src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@ protocol.registerSchemesAsPrivileged([
]);

function createWindow(): void {
let appWidth = 570;
let appWidth = 870;
if (process.platform === 'darwin') {
appWidth = 540;
appWidth = 870;
}
// Create the browser window.
win = new BrowserWindow({
resizable: true,
width: appWidth,
height: 600,
titleBarStyle: 'hidden',
maximizable:false,
transparent: isDevelopment? false: true,
frame: isDevelopment? true: false,
height: 710,
webPreferences: {
nodeIntegration: true,
},
Expand Down
28 changes: 16 additions & 12 deletions src/components/ApiList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
</template>

<script lang="ts">
import { Component, Prop, Vue, Watch } from "vue-property-decorator";
import {Component, Prop, Vue} from "vue-property-decorator";
import MockupServer from "@/utils/server/mockupServer";
import { ApiInfo } from "@/const/mockType";
import {ApiInfo} from "@/const/mockType";
import {
LOCAL_HOST,
Expand All @@ -27,7 +27,6 @@ const shell = require("electron").shell;
@Component
export default class ApiList extends Vue {
private get hasApiList(): boolean {
console.log("object :", this.$store.getters.apiInfoList);
return this.$store.getters.apiInfoList.length === 0 ? true : false;
}
Expand Down Expand Up @@ -79,7 +78,6 @@ export default class ApiList extends Vue {
private openBrowser(api: string): void {
if (this.isServerOn) {
console.log(LOCAL_HOST + this.port + api);
shell.openExternalSync(LOCAL_HOST + this.port + api);
}
}
Expand All @@ -98,12 +96,11 @@ button {
display: inline-block;
background-color: #424242;
border-radius: 5px;
margin-bottom: 5px;
padding-bottom: 5px;
justify-content: center;
vertical-align: middle;
height: 50px;
width: 510px;
border-bottom: 3px solid #303030;
display: flex;
}
.api-container:hover {
Expand Down Expand Up @@ -142,10 +139,6 @@ button {
text-align: left;
padding: 10px;
}
.api-list-container {
width: 340px;
}
.api-path {
width: 250px;
float: left;
Expand All @@ -157,6 +150,11 @@ button {
white-space: nowrap;
}
.api-container .radio-group .v-input__control .v-input__slot{
margin-bottom: 0 !important;
}
.http-method {
line-height: 50px;
width: 50px;
Expand All @@ -165,13 +163,19 @@ button {
.radio-style {
height: 50px;
margin-right: 10px;
padding: 0;
}
.radio-group {
margin: 0px;
padding: 0px;
display: contents;
}
.v-input__slot {
margin: 0px !important;
padding: 0px !important;
}
.loacalhost-label {
height: 48px;
line-height: 48px;
Expand Down
Loading

0 comments on commit 31a643c

Please sign in to comment.