@@ -6,6 +6,7 @@ import { ApplicationStore } from '@/state';
66import { UserData } from '@/state/user' ;
77import RenameServerBox from '@/components/server/settings/RenameServerBox' ;
88import FlashMessageRender from '@/components/FlashMessageRender' ;
9+ import Can from '@/components/elements/Can' ;
910
1011export default ( ) => {
1112 const user = useStoreState < ApplicationStore , UserData > ( state => state . user . data ! ) ;
@@ -15,46 +16,50 @@ export default () => {
1516 < div className = { 'my-10 mb-6' } >
1617 < FlashMessageRender byKey = { 'settings' } className = { 'mb-4' } />
1718 < div className = { 'md:flex' } >
18- < TitledGreyBox title = { 'SFTP Details' } className = { 'w-full md:flex-1 md:mr-6' } >
19- < div >
20- < label className = { 'input-dark-label' } > Server Address</ label >
21- < input
22- type = { 'text' }
23- className = { 'input-dark' }
24- value = { `sftp://${ server . sftpDetails . ip } :${ server . sftpDetails . port } ` }
25- readOnly = { true }
26- />
27- </ div >
28- < div className = { 'mt-6' } >
29- < label className = { 'input-dark-label' } > Username</ label >
30- < input
31- type = { 'text' }
32- className = { 'input-dark' }
33- value = { `${ user . username } .${ server . id } ` }
34- readOnly = { true }
35- />
36- </ div >
37- < div className = { 'mt-6 flex items-center' } >
38- < div className = { 'flex-1' } >
39- < div className = { 'border-l-4 border-cyan-500 p-3' } >
40- < p className = { 'text-xs text-neutral-200' } >
41- Your SFTP password is the same as the password you use to access this panel.
42- </ p >
43- </ div >
19+ < Can action = { 'file.sftp' } >
20+ < TitledGreyBox title = { 'SFTP Details' } className = { 'w-full md:flex-1 md:max-w-1/2 md:mr-6' } >
21+ < div >
22+ < label className = { 'input-dark-label' } > Server Address</ label >
23+ < input
24+ type = { 'text' }
25+ className = { 'input-dark' }
26+ value = { `sftp://${ server . sftpDetails . ip } :${ server . sftpDetails . port } ` }
27+ readOnly = { true }
28+ />
4429 </ div >
45- < div className = { 'ml-4' } >
46- < a
47- href = { `sftp://${ user . username } .${ server . id } @${ server . sftpDetails . ip } :${ server . sftpDetails . port } ` }
48- className = { 'btn btn-sm btn-secondary' }
49- >
50- Launch SFTP
51- </ a >
30+ < div className = { 'mt-6' } >
31+ < label className = { 'input-dark-label' } > Username</ label >
32+ < input
33+ type = { 'text' }
34+ className = { 'input-dark' }
35+ value = { `${ user . username } .${ server . id } ` }
36+ readOnly = { true }
37+ />
38+ </ div >
39+ < div className = { 'mt-6 flex items-center' } >
40+ < div className = { 'flex-1' } >
41+ < div className = { 'border-l-4 border-cyan-500 p-3' } >
42+ < p className = { 'text-xs text-neutral-200' } >
43+ Your SFTP password is the same as the password you use to access this panel.
44+ </ p >
45+ </ div >
46+ </ div >
47+ < div className = { 'ml-4' } >
48+ < a
49+ href = { `sftp://${ user . username } .${ server . id } @${ server . sftpDetails . ip } :${ server . sftpDetails . port } ` }
50+ className = { 'btn btn-sm btn-secondary' }
51+ >
52+ Launch SFTP
53+ </ a >
54+ </ div >
5255 </ div >
56+ </ TitledGreyBox >
57+ </ Can >
58+ < Can action = { 'settings.rename' } >
59+ < div className = { 'w-full mt-6 md:flex-1 md:max-w-1/2 md:mt-0' } >
60+ < RenameServerBox />
5361 </ div >
54- </ TitledGreyBox >
55- < div className = { 'w-full mt-6 md:flex-1 md:mt-0' } >
56- < RenameServerBox />
57- </ div >
62+ </ Can >
5863 </ div >
5964 </ div >
6065 ) ;
0 commit comments