Minor - format code

pull/3466/head
Angel Fernando Quiroz Campos 4 years ago
parent 28a52ada54
commit e221d9460f
  1. 192
      assets/vue/App.vue
  2. 7
      assets/vue/components/layout/Footer.vue
  3. 6
      assets/vue/components/layout/Header.vue

@ -40,106 +40,106 @@ import Header from "./components/layout/Header";
import Sidebar from "./components/layout/Sidebar";
import Footer from "./components/layout/Footer";
export default {
name: "App",
components: {
Header,
Sidebar,
Footer,
Breadcrumb,
Snackbar
},
export default {
name: "App",
components: {
Header,
Sidebar,
Footer,
Breadcrumb,
Snackbar
},
mixins: [NotificationMixin],
data: () => ({
drawer: true,
courses: [
['Courses', 'mdi-book', 'CourseList'],
['Courses category', 'mdi-book', 'CourseCategoryList'],
],
cruds: [
['Create', 'add'],
['Read', 'insert_drive_file'],
['Update', 'update'],
['Delete', 'delete'],
],
legacy_content: null,
}),
computed: {
isAuthenticated() {
return this.$store.getters['security/isAuthenticated']
},
isAdmin() {
return this.$store.getters['security/isAdmin']
},
},
watch: {
$route(to, from) {
this.$data.legacy_content = '';
if (document.querySelector("#sectionMainContent")) {
document.querySelector("#sectionMainContent").remove();
}
let url = window.location.href;
var n = url.indexOf("main/");
mixins: [NotificationMixin],
data: () => ({
drawer: true,
courses: [
['Courses', 'mdi-book', 'CourseList'],
['Courses category', 'mdi-book', 'CourseCategoryList'],
],
cruds: [
['Create', 'add'],
['Read', 'insert_drive_file'],
['Update', 'update'],
['Delete', 'delete'],
],
legacy_content: null,
}),
computed: {
isAuthenticated() {
return this.$store.getters['security/isAuthenticated']
},
isAdmin() {
return this.$store.getters['security/isAdmin']
},
},
watch: {
$route(to, from) {
this.$data.legacy_content = '';
if (document.querySelector("#sectionMainContent")) {
document.querySelector("#sectionMainContent").remove();
}
let url = window.location.href;
var n = url.indexOf("main/");
if (n > 0) {
axios.get(url, {
params: {
from_vue: 1
}
})
.then((response) => {
// handle success
this.$data.legacy_content = response.data;
});
}
},
legacy_content: {
handler: function () {
},
immediate: true
},
},
mounted() {
let legacyContent = document.querySelector("#sectionMainContent");
if (legacyContent) {
document.querySelector("#sectionMainContent").remove();
legacyContent.style.display = 'block';
this.$data.legacy_content = legacyContent.outerHTML;
}
},
created() {
this.$data.legacy_content = '';
// section-content
let isAuthenticated = JSON.parse(this.$parent.$el.attributes["data-is-authenticated"].value),
user = JSON.parse(this.$parent.$el.attributes["data-user-json"].value);
if (n > 0) {
axios.get(url, {
params: {
from_vue: 1
}
})
.then((response) => {
// handle success
this.$data.legacy_content = response.data;
});
}
},
legacy_content: {
handler: function () {
},
immediate: true
},
},
mounted() {
let legacyContent = document.querySelector("#sectionMainContent");
if (legacyContent) {
document.querySelector("#sectionMainContent").remove();
legacyContent.style.display = 'block';
this.$data.legacy_content = legacyContent.outerHTML;
}
},
created() {
this.$data.legacy_content = '';
// section-content
let isAuthenticated = JSON.parse(this.$parent.$el.attributes["data-is-authenticated"].value),
user = JSON.parse(this.$parent.$el.attributes["data-user-json"].value);
let payload = {isAuthenticated: isAuthenticated, user: user};
this.$store.dispatch("security/onRefresh", payload);
let payload = {isAuthenticated: isAuthenticated, user: user};
this.$store.dispatch("security/onRefresh", payload);
if (this.$parent.$el.attributes["data-messages"]) {
let messages = JSON.parse(this.$parent.$el.attributes["data-messages"].value);
if (messages) {
Array.from(messages).forEach(element =>
this.showMessage(element)
);
}
}
if (this.$parent.$el.attributes["data-messages"]) {
let messages = JSON.parse(this.$parent.$el.attributes["data-messages"].value);
if (messages) {
Array.from(messages).forEach(element =>
this.showMessage(element)
);
}
}
axios.interceptors.response.use(undefined, (err) => {
return new Promise(() => {
if (err.response.status === 401) {
this.$router.push({path: "/login"})
} else if (err.response.status === 500) {
document.open();
document.write(err.response.data);
document.close();
}
throw err;
});
});
},
beforeMount() {
axios.interceptors.response.use(undefined, (err) => {
return new Promise(() => {
if (err.response.status === 401) {
this.$router.push({path: "/login"})
} else if (err.response.status === 500) {
document.open();
document.write(err.response.data);
document.close();
}
}
throw err;
});
});
},
beforeMount() {
}
}
</script>

@ -6,11 +6,14 @@
>
<b-col lg="6">
<div class="text-center text-lg-left text-muted">
© {{ year }} <a
© {{ year }}
<a
href="https://www.chamilo.com"
class="font-weight-bold ml-1"
target="_blank"
>Chamilo</a>
>
Chamilo
</a>
</div>
</b-col>
<b-col lg="6">

@ -112,8 +112,7 @@
</template>
<script>
export default {
components: {
},
components: {},
props: {
type: {
type: String,
@ -137,7 +136,6 @@ export default {
return this.$store.getters['security/getUser'].username
}
},
methods: {
}
methods: {}
};
</script>

Loading…
Cancel
Save