# Database
db:
image: percona:latest
container_name: myname.db
restart: on-failure
ports:
- 127.0.0.150:3306:3306
expose:
- 3306
environment:
- MYSQL_ROOT_PASSWORD=rdkw1UDddqOEF4L1pmNkcyQ2oL
- MYSQL_DATABASE=mydb
- MYSQL_ROOT_HOST=%
[CATEGORIES]({commit, state}) {
if (state[CATEGORIES].length === 0)
this.$axios.$get(`${process.env.api}/categories.get`, {
params: {
lvl: 0,
offset: 0,
count: 1000
}
}).then(({code, count, items}) => {
if (code === 0) {
commit(CATEGORIES, items)
}
});
},
<div v-if="myObjects.length == 0">Ничего нет...</div>
<div v-if="Array.isArray(myObjects) && myObjects.length === 0">Ничего нет...</div>
import {ACTIVE_COUNTRY_ID, CITY, COUNTRIES, CATEGORIES, REGION, TITLE, COUNTRY} from "./mutation-types";
export default {
[TITLE](state, value) {
state[TITLE] = value
},
[CITY](state, value) {
state[CITY] = value
},
[REGION](state, value) {
state[REGION] = value
},
[ACTIVE_COUNTRY_ID](state, value) {
state[ACTIVE_COUNTRY_ID] = value
},
[COUNTRIES](state, value) {
state[COUNTRIES] = value
},
[COUNTRY](state, value) {
state[COUNTRY] = value
},
[ACTIVE_COUNTRY_ID](state, value) {
state[ACTIVE_COUNTRY_ID] = value
},
[CATEGORIES](state, value) {
state[CATEGORIES] = value
},
};
import {ACTIVE_COUNTRY_ID, CITY, COUNTRIES, CATEGORIES, REGION, TITLE, COUNTRY} from "./mutation-types";
export default {
[REGION]: (state) => {
return state[REGION]
},
[CITY]: (state) => {
return state[CITY] || {id: 0, name: ""}
},
[ACTIVE_COUNTRY_ID]: (state) => {
return state[ACTIVE_COUNTRY_ID]
},
[COUNTRIES]: (state) => {
return state[COUNTRIES]
},
[COUNTRY]: (state) => {
return state[COUNTRY]
},
[CATEGORIES]: (state) => {
return state[CATEGORIES]
},
};
import {CITY, COUNTRIES, CATEGORIES, REGION, COUNTRY} from "./mutation-types";
export default {
async nuxtServerInit({commit, dispatch}, {query}) {
await dispatch(CITY, query.hasOwnProperty("city_id") ? query.city_id : 0)
},
/**
* Getting one city
* @param commit
* @param city_id
* @param id
* @returns {Promise<void>}
*/
async [CITY]({commit, state}, city_id) {
if (city_id === 0) {
commit(CITY, {
id: 0,
name: ""
})
return new Promise(function (resolve) {resolve()})
} else {
if (state.city.id !== city_id) {
return this.$axios.$get(`${process.env.api}/database.getCityById`, {
params: {
city_id
}
}).then(({code, data}) => {
if (code === 0) {
commit(CITY, data)
}
});
} else {
return new Promise(function (resolve) {resolve()})
}
}
},
/**
*
* @param commit
* @param state
*/
[CATEGORIES]({commit, state},) {
if (state[CATEGORIES].length === 0)
this.$axios.$get(`${process.env.api}/categories.get`, {
params: {
lvl: 0,
offset: 0,
count: 1000
}
}).then(({code, count, items}) => {
if (code === 0) {
commit(CATEGORIES, items)
}
});
},
}
import {ACTIVE_COUNTRY_ID, CITY, COUNTRIES, CATEGORIES, REGION, TITLE, COUNTRY} from "./mutation-types";
export const state = () => ({
[TITLE]: "",
[CITY]: {
id: 0,
name: ""
},
[REGION]: {
id: 0,
name: ""
},
[ACTIVE_COUNTRY_ID]: 0,
[COUNTRY]: {
id: 0,
name: ""
},
[COUNTRIES]: [],
[CATEGORIES]: [],
});
menuOtd
menuOtd
menuOtd
не произойдёт!ot.pndOtd.sub
именно строка, которая имеет значение true/false
web_1 | Waiting that SQL database is up...
то подождите, посмотрите в диспетчере, насколько загружен диск.У меня бывало по часу инициализация выполнялась, а всё из-за того что процент фрагментации диска, превышал все мыслимые и немыслимые приделы.