1。首先,右鍵點選專案裡的 [Settings]
2。移到 Credential 頁面,Config Type 選擇 Local,然後填入你 Repository 的 URL,Helper是指認真的工具,在此選 manager,將會以微軟內建對話框詢問。(若忘記專案網址,可用指令查詢: git config --get remote.origin.url
就這麼簡單。
![]() |
| Install Node.js via Synology Package Center |
![]() |
| Enable SSH port |
![]() |
| Setting to Virtual Host |
ssh -p {your_ssh_port} {your_account_name}@{your_NAS_ip}
root@NAS:/volume1/web/code/build# vi /etc/nginx/app.d/server.webstation-vhost.conf
location / {
root /volume1/web/code/build;
index index.html;
try_files $uri /index.html;
}
root@NAS:/volume1/web/code/build# nginx -s reload
syn_conf=/etc/nginx/app.d/server.webstation-vhost.conf
ok_conf=/volume1/web/server.webstation-vhost.conf
syn_filesize=`ls -l $syn_conf | awk '{ print $5 }'`
ok_filesize=`ls -l $ok_conf | awk '{ print $5 }'`
if [ $syn_filesize -ne $ok_filesize ]; then cp $ok_conf $syn_conf; sudo nginx -s reload; fi
class Parent extends React.Component {
callChildFunction = () => {
this.child.handleActionParent(); ///calling a child function here
}
render(){
return (
<div>
{/* other things */}
<Child ref={(cd) => this.child = cd}/>
</div>
)
}
}
class Child extends React.Component {
handleActionParent = () => {
console.log('called from parent')
}
render() {
return (
{/*...*/}
)
}
}
bytesConvertToSize = (bytes) => {
let sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
if (bytes === 0)
return '0 Bytes';
let i = Math.floor(Math.log(bytes) / Math.log(1024));
return +(Math.round(bytes / Math.pow(1024, i) + "e+2") + "e-2") + ' ' + sizes[i];
// 下行會有尾數為 0 的狀況,因此改另一方法
// With problem 123.499 will be 123.50 KB,
// return (bytes / Math.pow(1024, i)).toFixed(2) + ' ' + sizes[i];
}