Skip to content

Commit b7cef05

Browse files
committed
Merge branch 'v2-next'
2 parents 5f1a956 + 0b9f997 commit b7cef05

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+2259
-3256
lines changed

README.md

+60-8
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,63 @@ $ npm install
163163

164164
```
165165

166+
## Usage
167+
168+
### Test
169+
``` bash
170+
# test
171+
$ php vendor/bin/phpunit
172+
```
173+
174+
### If you need separate backend and frontend
175+
176+
``` bash
177+
# back to laravel directory
178+
$ cd ../laravel
179+
180+
# start local server
181+
$ php artisan serve
182+
183+
$ cd ../coreui
184+
185+
$ npm run serve
186+
```
187+
Open your browser with address: [localhost:8080](localhost:8080)
188+
189+
If you need change backend adress go to file /coreui/src/main.js
190+
And change line:
191+
```js
192+
Vue.prototype.$apiAdress = 'http://127.0.0.1:8000'
193+
```
194+
195+
### If you don't need separate backend and frontend
196+
197+
1. Go to file /laravel/routes/web.php
198+
And uncomment this lines:
199+
```php
200+
Route::get('/{any}', function () {
201+
return view('coreui.homepage');
202+
})->where('any', '.*');
203+
```
204+
2. Go to file /laravel/config/filesystems.php
205+
And change this line:
206+
```php
207+
'root' => public_path() . '/../../coreui/public/public',
208+
```
209+
To this:
210+
```php
211+
'root' => public_path('public'),
212+
```
213+
3. Go to file /coreui/src/views/media/Media.vue
214+
And change this line:
215+
```js
216+
changePort: 'localhost:8080',
217+
```
218+
To this:
219+
```js
220+
changePort: 'localhost:8000',
221+
```
222+
4.
166223
``` bash
167224
# back to laravel directory
168225
$ cd ../laravel
@@ -172,19 +229,14 @@ $ npm run dev
172229

173230
# and repeat generate mixing
174231
$ npm run dev
175-
```
176-
177-
## Usage
178232

179-
``` bash
180233
# start local server
181234
$ php artisan serve
182-
183-
# test
184-
$ php vendor/bin/phpunit
185235
```
236+
Open your browser with address: [localhost:8000](localhost:8000)
237+
238+
### When you have project open in browser
186239

187-
Open your browser with address: [localhost:8000](localhost:8000)
188240
Click "Login" on sidebar menu and log in with credentials:
189241

190242
* E-mail: _[email protected]_

coreui/package-lock.json

+1,906-3,137
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coreui/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"core-js": "~3.6.4",
5353
"eslint": "~6.8.0",
5454
"eslint-plugin-vue": "~6.2.1",
55-
"node-sass": "~4.13.1",
55+
"node-sass": "~4.14.1",
5656
"npm-run-all": "~4.1.5",
5757
"sass-loader": "~8.0.2",
5858
"vue-template-compiler": "~2.6.11"

coreui/public/public/test.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test

coreui/src/containers/Menu.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ export default {
113113
},
114114
mounted () {
115115
let self = this;
116-
axios.get( '/api/menu?token=' + localStorage.getItem("api_token") + '&menu=' + 'top_menu')
116+
console.log(this.$apiAdress)
117+
axios.get( this.$apiAdress + '/api/menu?token=' + localStorage.getItem("api_token") + '&menu=' + 'top_menu' )
117118
.then(function (response) {
118119
self.nav = self.rebuildData(response.data);
119120
}).catch(function (error) {

coreui/src/containers/TheHeaderDropdownAccnt.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export default {
7777
methods:{
7878
logout(){
7979
let self = this;
80-
axios.post('/api/logout?token=' + localStorage.getItem("api_token"),{})
80+
axios.post(this.$apiAdress + '/api/logout?token=' + localStorage.getItem("api_token"),{})
8181
.then(function (response) {
8282
localStorage.setItem('roles', '');
8383
self.$router.push({ path: '/login' });

coreui/src/containers/TheSidebar.vue

+4-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,10 @@ export default {
122122
this.show = sidebarClosed ? true : 'responsive'
123123
})
124124
let self = this;
125-
axios.get( '/api/menu?token=' + localStorage.getItem("api_token") )
125+
126+
console.log(this.$apiAdress);
127+
128+
axios.get( this.$apiAdress + '/api/menu?token=' + localStorage.getItem("api_token") )
126129
.then(function (response) {
127130
self.nav = self.rebuildData(response.data);
128131
}).catch(function (error) {

coreui/src/main.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import CoreuiVue from '@coreui/vue'
66
import { iconsSet as icons } from './assets/icons/icons.js'
77
import store from './store'
88

9+
Vue.prototype.$apiAdress = 'http://127.0.0.1:8000'
910
Vue.config.performance = true
1011
Vue.use(CoreuiVue)
1112

coreui/src/store.js

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const mutations = {
2121
}
2222
}
2323

24+
2425
export default new Vuex.Store({
2526
state,
2627
mutations

coreui/src/views/bread/Bread.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default {
5656
},
5757
mounted: function(){
5858
let self = this;
59-
axios.get( '/api/bread/' + self.$route.params.id + '?token=' + localStorage.getItem("api_token"))
59+
axios.get( this.$apiAdress + '/api/bread/' + self.$route.params.id + '?token=' + localStorage.getItem("api_token"))
6060
.then(function (response) {
6161
self.form = response.data.form
6262
self.formFields = response.data.formFields

coreui/src/views/bread/Breads.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export default {
107107
},
108108
getBreads (){
109109
let self = this;
110-
axios.get( '/api/bread?token=' + localStorage.getItem("api_token") )
110+
axios.get( this.$apiAdress + '/api/bread?token=' + localStorage.getItem("api_token") )
111111
.then(function (response) {
112112
self.items = response.data;
113113
}).catch(function (error) {

coreui/src/views/bread/CreateBread.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export default {
165165
},
166166
choiceTableInDatabase(){
167167
let self = this
168-
axios.post( '/api/bread?token=' + localStorage.getItem("api_token"),
168+
axios.post( this.$apiAdress + '/api/bread?token=' + localStorage.getItem("api_token"),
169169
{
170170
marker: 'selectModel',
171171
model: self.tableNameInDatabase,
@@ -237,7 +237,7 @@ export default {
237237
store(){
238238
let self = this;
239239
let postData = self.createPostDataForStore();
240-
axios.post( '/api/bread?token=' + localStorage.getItem("api_token"),
240+
axios.post( this.$apiAdress + '/api/bread?token=' + localStorage.getItem("api_token"),
241241
postData
242242
)
243243
.then(function (response) {

coreui/src/views/bread/DeleteBread.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default {
3838
},
3939
deleteBread() {
4040
let self = this;
41-
axios.post( '/api/bread/' + self.$route.params.id + '?token=' + localStorage.getItem("api_token"), {
41+
axios.post( this.$apiAdress + '/api/bread/' + self.$route.params.id + '?token=' + localStorage.getItem("api_token"), {
4242
_method: 'DELETE'
4343
})
4444
.then(function (response) {

coreui/src/views/bread/EditBread.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export default {
187187
update() {
188188
let self = this
189189
let postData = this.createPostDataForUpdate()
190-
axios.post( '/api/bread/' + self.$route.params.id + '?token=' + localStorage.getItem("api_token"), postData )
190+
axios.post( this.$apiAdress + '/api/bread/' + self.$route.params.id + '?token=' + localStorage.getItem("api_token"), postData )
191191
.then(function (response) {
192192
self.message = 'Successfully updated BREAD.'
193193
self.showAlert()
@@ -214,7 +214,7 @@ export default {
214214
},
215215
mounted: function(){
216216
let self = this
217-
axios.get( '/api/bread/' + self.$route.params.id + '/edit?token=' + localStorage.getItem("api_token"))
217+
axios.get( this.$apiAdress + '/api/bread/' + self.$route.params.id + '/edit?token=' + localStorage.getItem("api_token"))
218218
.then(function (response) {
219219
self.form = response.data.form
220220
self.formFields = response.data.formFields

coreui/src/views/email/CreateEmail.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default {
5252
},
5353
store() {
5454
let self = this;
55-
axios.post( '/api/mail?token=' + localStorage.getItem("api_token"),
55+
axios.post( this.$apiAdress + '/api/mail?token=' + localStorage.getItem("api_token"),
5656
self.template
5757
)
5858
.then(function (response) {

coreui/src/views/email/EditEmail.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default {
4949
},
5050
update() {
5151
let self = this;
52-
axios.post( '/api/mail/' + self.$route.params.id + '?token=' + localStorage.getItem("api_token"),
52+
axios.post( this.$apiAdress + '/api/mail/' + self.$route.params.id + '?token=' + localStorage.getItem("api_token"),
5353
{
5454
_method: 'PUT',
5555
name: self.template.name,
@@ -80,7 +80,7 @@ export default {
8080
},
8181
mounted: function(){
8282
let self = this;
83-
axios.get( '/api/mail/' + self.$route.params.id + '/edit?token=' + localStorage.getItem("api_token"))
83+
axios.get( this.$apiAdress + '/api/mail/' + self.$route.params.id + '/edit?token=' + localStorage.getItem("api_token"))
8484
.then(function (response) {
8585
self.template = response.data.template;
8686
}).catch(function (error) {

coreui/src/views/email/Emails.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export default {
103103
deleteEmail ( id ) {
104104
let self = this;
105105
let noteId = id;
106-
axios.post( '/api/mail/' + id + '?token=' + localStorage.getItem("api_token"), {
106+
axios.post( this.$apiAdress + '/api/mail/' + id + '?token=' + localStorage.getItem("api_token"), {
107107
_method: 'DELETE'
108108
})
109109
.then(function (response) {
@@ -126,7 +126,7 @@ export default {
126126
},
127127
getTemplates (){
128128
let self = this;
129-
axios.get( '/api/mail?token=' + localStorage.getItem("api_token") )
129+
axios.get( this.$apiAdress + '/api/mail?token=' + localStorage.getItem("api_token") )
130130
.then(function (response) {
131131
self.items = response.data;
132132
}).catch(function (error) {

coreui/src/views/email/SendEmail.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default {
4949
},
5050
store() {
5151
let self = this;
52-
axios.post( '/api/mailSend/' + self.$route.params.id + '?token=' + localStorage.getItem("api_token"),
52+
axios.post( this.$apiAdress + '/api/mailSend/' + self.$route.params.id + '?token=' + localStorage.getItem("api_token"),
5353
{email: self.email}
5454
)
5555
.then(function (response) {
@@ -80,7 +80,7 @@ export default {
8080
},
8181
mounted: function(){
8282
let self = this;
83-
axios.get( '/api/prepareSend/' + self.$route.params.id + '?token=' + localStorage.getItem("api_token"))
83+
axios.get( this.$apiAdress + '/api/prepareSend/' + self.$route.params.id + '?token=' + localStorage.getItem("api_token"))
8484
.then(function (response) {
8585
self.template = response.data.template;
8686
}).catch(function (error) {

coreui/src/views/email/ShowEmail.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export default {
3636
},
3737
mounted: function(){
3838
let self = this;
39-
axios.get( '/api/mail/' + self.$route.params.id + '?token=' + localStorage.getItem("api_token"))
39+
axios.get( this.$apiAdress + '/api/mail/' + self.$route.params.id + '?token=' + localStorage.getItem("api_token"))
4040
.then(function (response) {
4141
self.template = response.data.template;
4242
}).catch(function (error) {

0 commit comments

Comments
 (0)