File tree 9 files changed +44
-35
lines changed
9 files changed +44
-35
lines changed Original file line number Diff line number Diff line change 1
1
.DS_Store
2
- volume-slider-front /node_modules
2
+ / volume-slider-front /node_modules
3
3
/dist
4
4
/output
5
5
/node
@@ -23,3 +23,5 @@ pnpm-debug.log*
23
23
* .njsproj
24
24
* .sln
25
25
* .sw ?
26
+ bind_windows_amd64.go
27
+ windows.syso
Original file line number Diff line number Diff line change 14
14
],
15
15
"whitelist" : [
16
16
{
17
- "appName" : " Firefox " ,
18
- "exeName" : " firefox.exe "
17
+ "appName" : " Master " ,
18
+ "exeName" : " master "
19
19
},
20
20
{
21
- "appName" : " FACEIT " ,
22
- "exeName" : " FACEIT .exe"
21
+ "appName" : " Firefox " ,
22
+ "exeName" : " firefox .exe"
23
23
},
24
24
{
25
25
"appName" : " Discord" ,
30
30
"exeName" : " Spotify.exe"
31
31
},
32
32
{
33
- "appName" : " Master" ,
34
- "exeName" : " master"
35
- },
36
- {
37
- "appName" : " Forza" ,
38
- "exeName" : " ForzaHorizon4.exe"
33
+ "appName" : " Chrome" ,
34
+ "exeName" : " chrome.exe"
39
35
}
40
36
]
41
37
}
Original file line number Diff line number Diff line change 8
8
"lint" : " vue-cli-service lint"
9
9
},
10
10
"dependencies" : {
11
+ "axios" : " ^0.20.0" ,
11
12
"bootstrap-vue" : " ^2.1.0" ,
12
- "core-js" : " ^3.6.5" ,
13
13
"vue" : " ^2.6.11" ,
14
14
"vue-router" : " ^3.2.0" ,
15
15
"vue-slider-component" : " ^3.2.2" ,
Original file line number Diff line number Diff line change 51
51
}
52
52
},
53
53
mounted () {
54
+ this .updateHostAddress ();
54
55
this .fetchAppSliderList ();
55
-
56
56
},
57
57
methods: {
58
58
... mapActions ([
59
- ' fetchAppSliderList'
59
+ ' fetchAppSliderList' ,
60
+ ' updateHostAddress' ,
60
61
]),
61
62
handleMsg (msg ) {
62
63
console .log (msg);
Original file line number Diff line number Diff line change 28
28
import axios from ' axios' ;
29
29
import VueSlider from ' vue-slider-component'
30
30
import ' vue-slider-component/theme/antd.css'
31
- import {mapActions , mapGetters } from " vuex" ;
31
+ import {mapActions , mapGetters , mapState } from " vuex" ;
32
32
33
33
export default {
34
34
name: " appSlider" ,
49
49
},
50
50
},
51
51
computed: {
52
+ ... mapState ({
53
+ hostAdd : state => state .hostAddress ,
54
+ }),
52
55
... mapGetters ([
53
56
' getAppSliders'
54
57
]),
80
83
' postAppSliderList'
81
84
]),
82
85
updateSliderData () {
83
- axios .get ( ' /app-vol/' + this .slider .exeName )
86
+ axios .get ( this . hostAdd + ' /app-vol/' + this .slider .exeName )
84
87
.then (response => {
85
88
this .value = response .data .volume ;
86
89
this .disabled = false ;
101
104
}
102
105
},
103
106
setAppVolume (newVol ) {
104
- axios .post (' /app-vol-set' , {
107
+ axios .post (this . hostAdd + ' /app-vol-set' , {
105
108
name: this .slider .exeName ,
106
109
volume: parseInt (newVol)
107
110
})
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ Vue.use(Vuex)
6
6
7
7
export default new Vuex . Store ( {
8
8
state : {
9
+ hostAddress : "" ,
9
10
appNames : [
10
11
]
11
12
} ,
@@ -14,10 +15,16 @@ export default new Vuex.Store({
14
15
} ,
15
16
mutations : {
16
17
setAppSliders : ( state , nameList ) => ( state . appNames = nameList ) ,
18
+ setHostAddress : ( state , add ) => ( state . hostAddress = add ) ,
17
19
} ,
18
20
actions : {
19
- fetchAppSliderList ( { commit} ) {
20
- axios . get ( '/slider-list' )
21
+ updateHostAddress ( { commit} ) {
22
+ if ( window . location . href . includes ( 'file:///' ) ) {
23
+ commit ( 'setHostAddress' , 'http://localhost:1323' )
24
+ }
25
+ } ,
26
+ fetchAppSliderList ( { commit, state} ) {
27
+ axios . get ( state . hostAddress + '/slider-list' )
21
28
. then ( response => {
22
29
commit ( 'setAppSliders' , response . data )
23
30
} )
@@ -27,7 +34,7 @@ export default new Vuex.Store({
27
34
} )
28
35
} ,
29
36
postAppSliderList ( { state} ) {
30
- axios . post ( '/slider-list' , {
37
+ axios . post ( state . hostAddress + '/slider-list' , {
31
38
appNames : state . appNames
32
39
} ) . then ( r => console . log ( r ) )
33
40
} ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div class =" home" >
3
- <HelloWorld msg = " Welcome to Your Vue.js App " />
3
+ <Sliders />
4
4
</div >
5
5
</template >
6
6
7
7
<script >
8
8
// @ is an alias to /src
9
- import HelloWorld from ' @/components/Sliders.vue'
9
+ import Sliders from ' @/components/Sliders.vue'
10
10
11
11
export default {
12
12
name: ' Home' ,
13
13
components: {
14
- HelloWorld
14
+ Sliders
15
15
}
16
16
}
17
17
</script >
Original file line number Diff line number Diff line change @@ -1621,6 +1621,13 @@ aws4@^1.8.0:
1621
1621
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.10.0.tgz#a17b3a8ea811060e74d47d306122400ad4497ae2"
1622
1622
integrity sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==
1623
1623
1624
+ axios@^0.20.0 :
1625
+ version "0.20.0"
1626
+ resolved "https://registry.yarnpkg.com/axios/-/axios-0.20.0.tgz#057ba30f04884694993a8cd07fa394cff11c50bd"
1627
+ integrity sha512-ANA4rr2BDcmmAQLOKft2fufrtuvlqR+cXNNinUmvfeSNCOF98PZL+7M/v1zIdGo7OLjEA9J2gXJL+j4zGsl0bA==
1628
+ dependencies :
1629
+ follow-redirects "^1.10.0"
1630
+
1624
1631
babel-eslint@^10.1.0 :
1625
1632
version "10.1.0"
1626
1633
resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232"
@@ -2952,13 +2959,6 @@ dir-glob@^2.0.0, dir-glob@^2.2.2:
2952
2959
dependencies :
2953
2960
path-type "^3.0.0"
2954
2961
2955
- discord-game@^0.1.1 :
2956
- version "0.1.1"
2957
- resolved "https://registry.yarnpkg.com/discord-game/-/discord-game-0.1.1.tgz#88d06f1ea16a2eb4b7c72419a617bc68e2e4fc82"
2958
- integrity sha512-A9Lcd04GqfxIkWFR+o2kDpXSns9aeOV08c7SB2PqvIDKnrEYZzSoDIj5f0Hv3JXxTCrONaAL0CHz9zWsQJD4rQ==
2959
- dependencies :
2960
- bindings "^1.5.0"
2961
-
2962
2962
dns-equal@^1.0.0 :
2963
2963
version "1.0.0"
2964
2964
resolved "https://registry.yarnpkg.com/dns-equal/-/dns-equal-1.0.0.tgz#b39e7f1da6eb0a75ba9c17324b34753c47e0654d"
@@ -3723,6 +3723,11 @@ follow-redirects@^1.0.0:
3723
3723
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.12.1.tgz#de54a6205311b93d60398ebc01cf7015682312b6"
3724
3724
integrity sha512-tmRv0AVuR7ZyouUHLeNSiO6pqulF7dYa3s19c6t+wz9LD69/uSzdMxJ2S91nTI9U3rt/IldxpzMOFejp6f0hjg==
3725
3725
3726
+ follow-redirects@^1.10.0 :
3727
+ version "1.13.0"
3728
+ resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.0.tgz#b42e8d93a2a7eea5ed88633676d6597bc8e384db"
3729
+ integrity sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA==
3730
+
3726
3731
for-in@^1.0.2 :
3727
3732
version "1.0.2"
3728
3733
resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"
You can’t perform that action at this time.
0 commit comments