Skip to content

Commit 39bf73f

Browse files
author
Yang Zhen
committed
Fix permanent btn
1 parent 2a52364 commit 39bf73f

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

src/AccessUrl.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,14 @@ const PortItem = ({ node, handleOpenQR, handleCloseQR, handleDelete, handlePerma
182182
if (ttl === -1) {
183183
ttlDom = <div>{i18n`global.neverExpires`}</div>
184184
} else {
185-
ttlDom = <div>
185+
ttlDom = <div className="post-item-info">
186186
<label className="post-item-ttl">
187187
{ttl}
188188
</label>
189-
<label className="post-item-upgrade" onClick={e => handlePermanent(e, node.port)}>
190-
<i className="fa fa-clock-o" />
189+
{global.sdk.config.userProfile.vip >= 4 && <button className='btn btn-primary btn-xs post-item-upgrade' onClick={e => handlePermanent(e, node.port)}>
190+
<i className="fa fa-hourglass-half" />
191191
{i18n`global.permanent`}
192-
</label>
192+
</button>}
193193
</div>
194194
}
195195
return (

src/actions.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ export function savePort({ port }) {
7676
}
7777
dispatch(listPorts());
7878
dispatch(portOperating({ operating: false }));
79+
})
80+
.catch((res) => {
81+
notify({
82+
notifyType: NOTIFY_TYPE.ERROR,
83+
message: i18n`global.message.saveFailed${{ msg: res.msg }}`,
84+
});
7985
});
8086
};
8187
}

src/base-theme/styles/accessUrl.styl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,18 @@
8888
cursor: pointer;
8989
}
9090
}
91+
.post-item-info {
92+
line-height: 22px;
93+
display: flex;
94+
padding-top: 4px;
95+
}
9196
.post-item-ttl {
9297
width: 120px;
98+
font-weight: normal;
99+
margin-bottom: 0;
100+
line-height: 22px;
93101
}
94102
.post-item-upgrade {
95-
padding-left: 10px;
96103
cursor: pointer;
97104
.fa {
98105
margin-right: 4px;

0 commit comments

Comments
 (0)