mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-14 05:23:09 +00:00
add isExpiry
This commit is contained in:
@@ -810,6 +810,17 @@ class Inbound extends XrayCommonClass {
|
||||
return this.stream.grpc.serviceName;
|
||||
}
|
||||
|
||||
isExpiry(index) {
|
||||
switch (this.protocol) {
|
||||
case Protocols.VMESS:
|
||||
return this.settings.vmesses[index].expiryTime < new Date().getTime();
|
||||
case Protocols.VLESS:
|
||||
return this.settings.vlesses[index].expiryTime < new Date().getTime();
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
canEnableTls() {
|
||||
switch (this.protocol) {
|
||||
case Protocols.VMESS:
|
||||
@@ -1178,6 +1189,20 @@ Inbound.VmessSettings.Vmess = class extends XrayCommonClass {
|
||||
|
||||
);
|
||||
}
|
||||
get _expiryTime() {
|
||||
if (this.expiryTime === 0) {
|
||||
return null;
|
||||
}
|
||||
return moment(this.expiryTime);
|
||||
}
|
||||
|
||||
set _expiryTime(t) {
|
||||
if (t == null) {
|
||||
this.expiryTime = 0;
|
||||
} else {
|
||||
this.expiryTime = t.valueOf();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Inbound.VLESSSettings = class extends Inbound.Settings {
|
||||
@@ -1215,6 +1240,21 @@ Inbound.VLESSSettings = class extends Inbound.Settings {
|
||||
fallbacks: Inbound.VLESSSettings.toJsonArray(this.fallbacks),
|
||||
};
|
||||
}
|
||||
get _expiryTime() {
|
||||
if (this.expiryTime === 0) {
|
||||
return null;
|
||||
}
|
||||
return moment(this.expiryTime);
|
||||
}
|
||||
|
||||
set _expiryTime(t) {
|
||||
if (t == null) {
|
||||
this.expiryTime = 0;
|
||||
} else {
|
||||
this.expiryTime = t.valueOf();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
Inbound.VLESSSettings.VLESS = class extends XrayCommonClass {
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<a-collapse activeKey="0" v-for="(vmess, index) in inbound.settings.vmesses"
|
||||
:key="`vmess-${index}`">
|
||||
<a-collapse-panel :header="vmess.email == '' ? 'Add User' : vmess.email">
|
||||
<a-tag v-if="isExpiry(index)" color="red" style="margin-bottom: 10px;display: block;text-align: center;">Account is Expired And Disabled</a-tag>
|
||||
|
||||
<a-form layout="inline">
|
||||
<a-form-item label="Email">
|
||||
@@ -68,7 +69,7 @@
|
||||
</a-tooltip>
|
||||
</span>
|
||||
<a-date-picker :show-time="{ format: 'HH:mm' }" format="YYYY-MM-DD HH:mm"
|
||||
v-model="vmess.expiryTime" style="width: 300px;"></a-date-picker>
|
||||
v-model="vmess._expiryTime" style="width: 300px;"></a-date-picker>
|
||||
</a-form-item>
|
||||
|
||||
<!--Add Svg Icon-->
|
||||
|
||||
@@ -112,6 +112,9 @@
|
||||
}
|
||||
event.target.value = ""
|
||||
},
|
||||
isExpiry(index) {
|
||||
return this.inbound.isExpiry(index)
|
||||
},
|
||||
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user