Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4aa85f9

Browse files
committed
Merge branch 'v6.0'
2 parents b61f7ae + 4ff1fec commit 4aa85f9

File tree

4 files changed

+45
-24
lines changed

4 files changed

+45
-24
lines changed

‎cleanup.v6.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,8 @@ rm -rf ./api/obj
1010
# cleanup CLIENT
1111
rm -rf ./client/node_modules
1212
rm -rf ./client/dist
13-
rm ./client/index.html
1413

1514
# cleanup DATABASE
16-
rm -rf ./database/declarative-deploy
17-
rm -rf ./database/imperative-deploy
1815
rm -rf ./database/deploy/bin
1916
rm -rf ./database/deploy/obj
2017

‎client/src/api.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const API = "/api/ef/todo";
2+
3+
export default API;

‎client/src/components/ToDoList.vue

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,13 @@
3636
</button>
3737
</footer>
3838
</section>
39-
<footer class="info">
40-
<label v-if="!userDetails" id="login">[<a href=".auth/login/github">login</a>]</label>
41-
<label v-if="userDetails" id="logoff">[<a href=".auth/logout">logoff {{userDetails}}</a>]</label>
42-
<p>Double-click to edit a todo</p>
43-
<p>Original <a href="https://github.com/vuejs/vuejs.org/tree/master/src/v2/examples/vue-20-todomvc">Vue.JS Sample</a> by <a href="http://evanyou.me">Evan You</a></p>
44-
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
45-
</footer>
39+
<UserInfo/>
4640
</template>
4741

4842
<script lang="js">
43+
import UserInfo from './UserInfo.vue'
44+
import API from '../api.js'
4945
50-
var API = "/api/ef/todo";
5146
var HEADERS = { 'Accept': 'application/json', 'Content-Type': 'application/json' };
5247
5348
var filters = {
@@ -66,14 +61,17 @@ var filters = {
6661
}
6762
};
6863
69-
export default {
64+
export default {
65+
components: {
66+
UserInfo
67+
},
68+
7069
data() {
7170
return {
7271
todos: [],
7372
newTodo: "",
7473
editedTodo: null,
75-
visibility: "all",
76-
userDetails: null
74+
visibility: "all"
7775
};
7876
},
7977
@@ -84,16 +82,7 @@ export default {
8482
} else {
8583
window.location.hash = "";
8684
this.visibility = "all";
87-
}
88-
89-
fetch('/.auth/me')
90-
.then(res => {
91-
return res.json()
92-
})
93-
.then(payload => {
94-
const { clientPrincipal } = payload;
95-
this.userDetails = clientPrincipal?.userDetails;
96-
});
85+
}
9786
9887
fetch(API, {
9988
headers: HEADERS,

‎client/src/components/UserInfo.vue

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<template>
2+
<footer class="info">
3+
<label v-if="!userDetails" id="login">[<a href=".auth/login/github">login</a>]</label>
4+
<label v-if="userDetails" id="logoff">[<a href=".auth/logout">logoff {{ userDetails }}</a>]</label>
5+
<p>Double-click to edit a todo</p>
6+
<p>Original <a href="https://github.com/vuejs/vuejs.org/tree/master/src/v2/examples/vue-20-todomvc">Vue.JS
7+
Sample</a> by <a href="http://evanyou.me">Evan You</a></p>
8+
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
9+
</footer>
10+
</template>
11+
12+
13+
<script lang="js">
14+
export default {
15+
data() {
16+
return {
17+
userDetails: null
18+
};
19+
},
20+
21+
mounted() {
22+
fetch('/.auth/me')
23+
.then(res => {
24+
return res.json()
25+
})
26+
.then(payload => {
27+
const { clientPrincipal } = payload;
28+
this.userDetails = clientPrincipal?.userDetails;
29+
});
30+
}
31+
}
32+
</script>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /