Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit fbc8588

Browse files
committed
console
1 parent 2f831f5 commit fbc8588

18 files changed

Lines changed: 364 additions & 36 deletions

File tree

main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ global.iconv = require('iconv-lite');
99
global.fetch = (url, options = {}) => fetch(url, options);
1010
global.fs = fs;
1111

12+
app.allowRendererProcessReuse = true;
13+
1214
function createWindow() {
1315
protocol.registerFileProtocol('local', (request, callback) => {
1416
callback({ path: request.url.substring(8).split('?')[0] });

src/src/App.vue

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,39 @@
11
<template>
2-
<div id="wineLauncher">
3-
<Header/>
4-
<div class="wrapper">
5-
<div class="container">
6-
<router-view/>
7-
</div>
2+
<div id="wineLauncher">
3+
<Header/>
4+
<div class="wrapper">
5+
<div class="container">
6+
<router-view/>
7+
</div>
8+
</div>
9+
<Logs v-if="logs.enable"/>
810
</div>
9-
</div>
1011
</template>
1112

1213
<script>
13-
import action from "./store/action";
14-
import Header from "./components/Header/Header";
14+
import action from "./store/action";
15+
import Header from "./components/Header/Header";
16+
import Logs from "./components/UI/Logs";
1517
16-
export default {
17-
name: 'App',
18-
components: {
19-
Header,
20-
},
21-
mounted() {
22-
this.$store.dispatch(action.get('menu').LOAD);
23-
},
24-
}
18+
export default {
19+
name: 'App',
20+
components: {
21+
Header,
22+
Logs,
23+
},
24+
data() {
25+
return {
26+
logs: this.$store.state.logs,
27+
};
28+
},
29+
mounted() {
30+
this.$store.dispatch(action.get('menu').LOAD);
31+
},
32+
}
2533
</script>
2634

2735
<style lang="less" scoped>
28-
.container {
29-
max-width: 800px;
30-
}
36+
.container {
37+
max-width: 800px;
38+
}
3139
</style>

src/src/assets/images/shadow.png

118 KB
Loading

src/src/components/Home/PopupPlay.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
</button>
99

1010
<div :id="id" class="modal-demo">
11+
<ButtonTerminal/>
1112
<button type="button" class="close" @click="cancel">
1213
<span>&times;</span><span class="sr-only">Close</span>
1314
</button>
@@ -56,15 +57,17 @@
5657
</template>
5758

5859
<script>
59-
import action from '../../store/action';
60-
import OnlySelect from "../UI/OnlySelect";
61-
import Collects from "../../helpers/collects";
62-
import AbstractPopup from "../UI/AbstractPopup";
60+
import action from '../../store/action';
61+
import OnlySelect from "../UI/OnlySelect";
62+
import Collects from "../../helpers/collects";
63+
import AbstractPopup from "../UI/AbstractPopup";
64+
import ButtonTerminal from "../UI/ButtonTerminal";
6365
6466
export default {
6567
mixins: [AbstractPopup],
6668
components: {
6769
OnlySelect,
70+
ButtonTerminal,
6871
},
6972
name: "PopupPlay",
7073
props: {

src/src/components/Patches/PopupCommand.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
</button>
88

99
<div :id="id" class="modal-demo">
10+
<ButtonTerminal/>
1011
<button type="button" class="close" @click="cancel">
1112
<span>&times;</span><span class="sr-only">Close</span>
1213
</button>
@@ -45,14 +46,16 @@
4546
</template>
4647

4748
<script>
48-
import action from '../../store/action';
49-
import Form from "../UI/Form";
50-
import AbstractPopup from "../UI/AbstractPopup";
49+
import action from '../../store/action';
50+
import Form from "../UI/Form";
51+
import AbstractPopup from "../UI/AbstractPopup";
52+
import ButtonTerminal from "../UI/ButtonTerminal";
5153
5254
export default {
5355
mixins: [AbstractPopup],
5456
components: {
5557
Form,
58+
ButtonTerminal,
5659
},
5760
name: "PopupCommand",
5861
props: {

src/src/components/UI/AbstractPopup.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import action from "../../store/action";
2+
13
export default {
24
data() {
35
return {
@@ -18,6 +20,12 @@ export default {
1820
this.popup_opened = true;
1921
},
2022
onContentClosed() {
23+
let logs = this.$store.state.logs;
24+
25+
if (logs.enable) {
26+
this.$store.dispatch(action.get('logs').START, true);
27+
}
28+
2129
this.popup_opened = false;
2230
},
2331
},
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<template>
2+
<i class="fa fa-terminal" title="Консоль" @click="open"></i>
3+
</template>
4+
5+
<script>
6+
import action from "../../store/action";
7+
8+
export default {
9+
components: {},
10+
props: {},
11+
name: 'Logs',
12+
data() {
13+
return {
14+
id: action.id,
15+
};
16+
},
17+
mounted() {
18+
},
19+
methods: {
20+
open() {
21+
this.$store.dispatch(action.get('logs').START);
22+
},
23+
},
24+
watch: {},
25+
beforeDestroy() {
26+
},
27+
}
28+
</script>
29+
30+
<style lang="less" scoped>
31+
i {
32+
position: absolute;
33+
top: 14px;
34+
right: 50px;
35+
font-size: 18px;
36+
font-weight: bold;
37+
border: solid 1px;
38+
border-radius: 3px;
39+
padding: 2px 4px;
40+
transition: all 500ms ease;
41+
cursor: pointer;
42+
43+
&:hover {
44+
color: #fff;
45+
background-color: #ffbd4a;
46+
border-color: #ffbd4a;
47+
}
48+
}
49+
</style>

src/src/components/UI/Logs.vue

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
<template>
2+
<div class="logs-wrapper">
3+
<div class="logs-background" :class="{__black: logs.black}" @click="close"></div>
4+
<div class="logs" ref="logs">
5+
<h4 class="logs-header">Консоль</h4>
6+
<button type="button" class="close" @click="close">
7+
<span>×</span>
8+
<span class="sr-only">Close</span>
9+
</button>
10+
<div :id="id" class="logs-wrap">{{logs.logs}}</div>
11+
</div>
12+
</div>
13+
</template>
14+
15+
<script>
16+
import action from "../../store/action";
17+
18+
export default {
19+
components: {},
20+
props: {},
21+
name: 'Logs',
22+
data() {
23+
return {
24+
id: action.id,
25+
logs: this.$store.state.logs,
26+
};
27+
},
28+
mounted() {
29+
this.bindScroll();
30+
},
31+
methods: {
32+
bindScroll() {
33+
$(`#${this.id}`).slimScroll({
34+
height: `${this.$refs.logs.offsetHeight - 52}px`,
35+
position: 'right',
36+
size: "5px",
37+
color: '#98a6ad',
38+
wheelStep: 10,
39+
start: 'bottom',
40+
});
41+
},
42+
unbindScroll() {
43+
$(`#${this.id}`).slimScroll({ destroy: true });
44+
},
45+
close() {
46+
this.$store.dispatch(action.get('logs').STOP);
47+
},
48+
},
49+
watch: {
50+
'logs.logs'() {
51+
this.$nextTick(() => {
52+
let element = $(`#${this.id}`);
53+
element.slimScroll({
54+
scrollTo: element[0].scrollHeight
55+
});
56+
});
57+
}
58+
},
59+
beforeDestroy() {
60+
this.unbindScroll();
61+
},
62+
}
63+
</script>
64+
65+
<style lang="less" scoped>
66+
.logs-wrapper {
67+
position: fixed;
68+
display: block;
69+
width: 100vw;
70+
height: 100vh;
71+
top: 0;
72+
left: 0;
73+
right: 0;
74+
bottom: 0;
75+
z-index: 10000;
76+
margin: auto;
77+
}
78+
79+
.logs-background {
80+
position: absolute;
81+
display: block;
82+
width: 100vw;
83+
height: 100vh;
84+
top: 0;
85+
left: 0;
86+
right: 0;
87+
bottom: 0;
88+
z-index: 10000;
89+
margin: auto;
90+
91+
&.__black {
92+
background-color: rgb(0, 0, 0);
93+
opacity: 0.48;
94+
}
95+
}
96+
97+
.logs {
98+
display: block;
99+
position: absolute;
100+
left: 20px;
101+
bottom: 20px;
102+
top: 20px;
103+
right: 20px;
104+
margin: auto;
105+
min-height: 500px;
106+
height: calc(60vh - 40px);
107+
width: calc(100vw - 40px);
108+
max-width: 800px;
109+
background-color: #36404a;
110+
z-index: 10001;
111+
}
112+
113+
.logs-wrap {
114+
display: block;
115+
height: 100%;
116+
white-space: pre-wrap;
117+
font-family: monospace;
118+
unicode-bidi: embed;
119+
overflow-x: hidden;
120+
padding: 10px;
121+
122+
&:before, &:after {
123+
display: block;
124+
content: '';
125+
position: absolute;
126+
width: calc(100% + 20px);
127+
height: 50px;
128+
background-image: url('../../assets/images/shadow.png');
129+
background-size: 100% 70%;
130+
background-repeat: no-repeat;
131+
pointer-events: none;
132+
margin-left: -20px;
133+
margin-top: -20px;
134+
}
135+
136+
&:after {
137+
transform: rotate(180deg);
138+
bottom: 0;
139+
}
140+
}
141+
142+
.logs-header {
143+
padding: 15px 25px 15px 25px;
144+
line-height: 22px;
145+
font-size: 18px;
146+
background-color: #2b333b;
147+
color: #ffffff;
148+
text-align: left;
149+
margin: 0;
150+
}
151+
152+
.close {
153+
position: absolute;
154+
top: 15px;
155+
right: 25px;
156+
color: #eeeeee;
157+
}
158+
</style>

src/src/less/main.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,4 +191,8 @@ button.badge {
191191
bottom: 0;
192192
}
193193

194+
.modal-demo .close {
195+
right: 20px;
196+
}
197+
194198
@import "item";

0 commit comments

Comments
 (0)