Background: I’m trying to build a shopping site using Vue - free lessons all next week - BTW and also explore the idea of a CDN on SAFE - tough I have yet to work out the economic fesibility of that…
So I have the guts of the beginner tutorial from Vue Mastery and tried to adapt it for SAFE.
I uploaded a bunch of files to safe://vue-shop and also to safe://cdn, made a few edits to try make the SAFE site look a bit like the clearnet tutorial shown here with a box that uses css from the cdn.
FWIW this works locally to an extent, roll over the color picker and the socks chnge from green to blue, click on the cart button and the cart indicator topright increments. THe ugly box bottom right is getting its css from another local site NOT from safe://cdn of course despite what it says there. I ran into some problems editing and it seems to me that the sync command is not working correctly - or I have misunder stood it Anyway - heres a transcript covering form about 0200 this morning until 0400 ish…
willie@gagarin:~/projects/maidsafe/local_sites$ safe files put vue/ --recursive
FilesContainer created at: "safe://hnyynyip71nxtucqtz6xj3pp9h5syan1t1xidno574nrium9hq8k6frkocbnc"
+ vue/assets/images/vm-Socks-blue.png safe://hbwynyd6qcmodk68dqfw4zis5ntgtrrhtjshqpfzdg66u9t3hiniebf45m
+ vue/assets/images/vm-Socks-green.png safe://hbwynydtzkcrmhwyduemg1oct9dq1peawgakz5pgoxofzguzqksqyx5atu
+ vue/css/style.css safe://hbhyyyntwr3u1au7tszhuo4g336pjjheoecnbb3wp4617tdfohb5oqkwtc
+ vue/index.html safe://hbhybynxb61mxyd1r7ycszi44odceteu195zoiit8kt8cenzyca7ekmsi6
+ vue/js/main.js safe://hbkygyn7fziir7377iaqtbx4a589kqe1qtshpc5gqayutri8ss5s1pz364
+ vue/js/vue.min.js safe://hbkygydq15k9ghwiwhp9fuhf3ea1yu9xoahxewsticc7xqcp4cuni1m1fw
+ vue/shop.html safe://hbhybynjweocxs5ioa6qbhdgjgdogbcnpw7ti669ybmp9aj7qhubgzrepu
willie@gagarin:~/projects/maidsafe/local_sites$ safe nrs create vue-shop --link safe://hnyynyip71nxtucqtz6xj3pp9h5syan1t1xidno574nrium9hq8k6frkocbnc
[2020-04-10T02:07:00Z ERROR safe] safe-cli error: [Error] InvalidInput - The linked content (FilesContainer) is versionable, therefore NRS requires the link to specify a version: "safe://hnyynyip71nxtucqtz6xj3pp9h5syan1t1xidno574nrium9hq8k6frkocbnc"
willie@gagarin:~/projects/maidsafe/local_sites$ safe nrs create vue-shop --link safe://hnyynyip71nxtucqtz6xj3pp9h5syan1t1xidno574nrium9hq8k6frkocbnc?v=0
New NRS Map for "safe://vue-shop" created at: "safe://hnyydywk4r9ua5sa69s57abrs96rdt1nhpqgoabfnhc3p1rxg9m67rbuuobqh"
+ vue-shop safe://hnyynyip71nxtucqtz6xj3pp9h5syan1t1xidno574nrium9hq8k6frkocbnc?v=0
willie@gagarin:~/projects/maidsafe/local_sites$ safe files sync vue/ safe://vue-shop --recursive
FilesContainer synced up (version 1): "safe://vue-shop"
* vue/index.html safe://hbhybynw6nhkyf1zqfgkqtzn3ohqt1448oh1ppfmshjgh5iu8mcpxdy3z3
willie@gagarin:~/projects/maidsafe/local_sites$ safe files sync vue/ safe://vue-shop --recursive
FilesContainer synced up (version 2): "safe://vue-shop"
* vue/shop.html safe://hbhybyng16dkiu4748mbz6f4peweksh5xzgwt7nzkwaymza8e7kksu8hec
willie@gagarin:~/projects/maidsafe/local_sites$ safe files sync vue/ safe://vue-shop --recursive
No changes were required, source location is already in sync with FilesContainer (version 2) at: "safe://vue-shop"
willie@gagarin:~/projects/maidsafe/local_sites$ safe files sync vue/ safe://vue-shop --recursive
FilesContainer synced up (version 3): "safe://vue-shop"
* vue/shop.html safe://hbhybynztowmfx67sc4jq34cx1t5phyiten33ak1stthw3ykgetnhijmkc
willie@gagarin:~/projects/maidsafe/local_sites$ safe files sync vue/ safe://vue-shop --recursive
FilesContainer synced up (version 4): "safe://vue-shop"
* vue/index.html safe://hbhybydn4ugsj46xooqzmnr6ms6t7bpawi3rqn3rjbdnrttmc631o8k1zh
willie@gagarin:~/projects/maidsafe/local_sites$ safe files tree safe://vue-shop
safe://vue-shop
├── assets
│ └── images
│ ├── vm-Socks-blue.png
│ └── vm-Socks-green.png
├── css
│ └── style.css
├── index.html
├── js
│ ├── main.js
│ └── vue.min.js
└── shop.html
4 directories, 7 files
willie@gagarin:~/projects/maidsafe/local_sites$ safe cat safe://vue-shop
Files of FilesContainer (version 0) at "safe://vue-shop":
+-----------------------------------+--------+----------------------+----------------------+-------------------------------------------------------------------+
| Name | Size | Created | Modified | Link |
+-----------------------------------+--------+----------------------+----------------------+-------------------------------------------------------------------+
| /assets/images/vm-Socks-blue.png | 754163 | 2020-04-10T02:06:05Z | 2020-04-10T02:06:05Z | safe://hbwynyd6qcmodk68dqfw4zis5ntgtrrhtjshqpfzdg66u9t3hiniebf45m |
+-----------------------------------+--------+----------------------+----------------------+-------------------------------------------------------------------+
| /assets/images/vm-Socks-green.png | 126195 | 2020-04-10T02:06:05Z | 2020-04-10T02:06:05Z | safe://hbwynydtzkcrmhwyduemg1oct9dq1peawgakz5pgoxofzguzqksqyx5atu |
+-----------------------------------+--------+----------------------+----------------------+-------------------------------------------------------------------+
| /css/style.css | 1321 | 2020-04-10T02:06:05Z | 2020-04-10T02:06:05Z | safe://hbhyyyntwr3u1au7tszhuo4g336pjjheoecnbb3wp4617tdfohb5oqkwtc |
+-----------------------------------+--------+----------------------+----------------------+-------------------------------------------------------------------+
| /index.html | 1147 | 2020-04-10T02:06:05Z | 2020-04-10T02:06:05Z | safe://hbhybynxb61mxyd1r7ycszi44odceteu195zoiit8kt8cenzyca7ekmsi6 |
+-----------------------------------+--------+----------------------+----------------------+-------------------------------------------------------------------+
| /js/main.js | 2296 | 2020-04-10T02:06:05Z | 2020-04-10T02:06:05Z | safe://hbkygyn7fziir7377iaqtbx4a589kqe1qtshpc5gqayutri8ss5s1pz364 |
+-----------------------------------+--------+----------------------+----------------------+-------------------------------------------------------------------+
| /js/vue.min.js | 93670 | 2020-04-10T02:06:05Z | 2020-04-10T02:06:05Z | safe://hbkygydq15k9ghwiwhp9fuhf3ea1yu9xoahxewsticc7xqcp4cuni1m1fw |
+-----------------------------------+--------+----------------------+----------------------+-------------------------------------------------------------------+
| /shop.html | 1063 | 2020-04-10T02:06:05Z | 2020-04-10T02:06:05Z | safe://hbhybynjweocxs5ioa6qbhdgjgdogbcnpw7ti669ybmp9aj7qhubgzrepu |
+-----------------------------------+--------+----------------------+----------------------+-------------------------------------------------------------------+
willie@gagarin:~/projects/maidsafe/local_sites$ safe cat safe://hbhybynxb61mxyd1r7ycszi44odceteu195zoiit8kt8cenzyca7ekmsi6
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vue Playground for SAFE</title>
<!-- <link rel="stylesheet" type="text/css" href="css/style.css" />
-->
<link
rel="stylesheet"
type="text/css"
href="safe://hbhyyyd4worx61icfaaow7c5dzb7q16gh1pj6ak91tm3zktu8hrtqu976f"
/>
</head>
<body>
<div class="nav-bar">
<p class="pageTitle">Shop SAFEly</p>
</div>
<div id="app">
<div class="cart">
<p>Cart({{ cart.length }})</p>
</div>
<product :premium="premium" @add-to-cart="updateCart"></product>
</div>
<div class="external">
<h1>It came from Outside!!!</h1>
<h3>style linked from safe://cdn/css/southside.css</h3>
<h4>Or did it? Shop <a href="shop.html">here</a></h4>
</div>
<!--
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
-->
<script src="js/vue.min.js"></script>
<!-- <script src="safe://cdn/js/vue.min.js"></script>-->
<script src="js/main.js"></script>
</body>
</html>
willie@gagarin:~/projects/maidsafe/local_sites$ cat vue/index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vue Shop for SAFE</title>
<link
rel="stylesheet"
type="text/css"
href="css/style.css" />
<link
rel="stylesheet"
type="text/css"
href="safe://cdn/css/southside.css"
/>
</head>
<body>
<div class="nav-bar">
<p class="pageTitle">Shop SAFEly</p>
</div>
<div id="app">
<div class="cart">
<p>Cart({{ cart.length }})</p>
</div>
<product :premium="premium" @add-to-cart="updateCart"></product>
</div>
<div class="external">
<h1>It came from Outside!!!</h1>
<h3>style linked from safe://cdn/css/southside.css</h3>
<h4>Or did it? Shop <a href="shop.html">here</a></h4>
</div>
<!--
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
-->
<script src="js/vue.min.js"></script>
<!-- <script src="safe://cdn/js/vue.min.js"></script>-->
<script src="js/main.js"></script>
</body>
</html>
Note the file modification times shown in the safe cat safe://vue-shop command. the previous few comands were run around 0345.
Notte the difference between catting the index file on the shared section with the same command on my local site - But I had just sync’e them a few seconds beforehand…
I know its late but can someone cast an eye over this and see if it is just a silly mistake on my part please?
The CDN bit seems to work OK at least