mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-22 08:45:50 +00:00
0.0.1
This commit is contained in:
@@ -11,10 +11,10 @@
|
||||
<a-icon type="setting"></a-icon>
|
||||
<span>面板设置</span>
|
||||
</a-menu-item>
|
||||
<a-menu-item key="{{ .base_path }}xui/clients">
|
||||
<a-icon type="laptop"></a-icon>
|
||||
<span>客户端</span>
|
||||
</a-menu-item>
|
||||
<!--<a-menu-item key="{{ .base_path }}xui/clients">-->
|
||||
<!-- <a-icon type="laptop"></a-icon>-->
|
||||
<!-- <span>客户端</span>-->
|
||||
<!--</a-menu-item>-->
|
||||
<a-sub-menu>
|
||||
<template slot="title">
|
||||
<a-icon type="link"></a-icon>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<a-input type="number" :value="value" @input="$emit('input', $event.target.value)"></a-input>
|
||||
</template>
|
||||
<template v-else-if="type === 'textarea'">
|
||||
<a-textarea :value="value" @input="$emit('input', $event.target.value)" :auto-size="{ minRows: 6, maxRows: 6 }"></a-textarea>
|
||||
<a-textarea :value="value" @input="$emit('input', $event.target.value)" :auto-size="{ minRows: 10, maxRows: 10 }"></a-textarea>
|
||||
</template>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<a-layout-content>
|
||||
<a-spin :spinning="spinning" :delay="500" tip="loading">
|
||||
<transition name="list" appear>
|
||||
<a-tag v-if="true" color="red" style="margin-bottom: 10px">
|
||||
<a-tag v-if="false" color="red" style="margin-bottom: 10px">
|
||||
Please go to the panel settings as soon as possible to modify the username and password, otherwise there may be a risk of leaking account information
|
||||
</a-tag>
|
||||
</transition>
|
||||
@@ -32,11 +32,7 @@
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="24" :lg="12">
|
||||
total traffic:
|
||||
<a-popconfirm title="Are you sure you want to reset all traffic to 0? It\'s unrecoverable"
|
||||
@confirm="resetAllTraffic()"
|
||||
ok-text="confirm" cancel-text="cancel">
|
||||
<a-tag color="green">[[ sizeFormat(total.up + total.down) ]]</a-tag>
|
||||
</a-popconfirm>
|
||||
<a-tag color="green">[[ sizeFormat(total.up + total.down) ]]</a-tag>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="24" :lg="12">
|
||||
number of accounts:
|
||||
@@ -112,26 +108,21 @@
|
||||
align: 'center',
|
||||
width: 60,
|
||||
scopedSlots: { customRender: 'traffic' },
|
||||
}, {
|
||||
title: "settings",
|
||||
align: 'center',
|
||||
width: 60,
|
||||
scopedSlots: { customRender: 'settings' },
|
||||
}, {
|
||||
title: "streamSettings",
|
||||
align: 'center',
|
||||
width: 60,
|
||||
scopedSlots: { customRender: 'streamSettings' },
|
||||
// }, {
|
||||
// title: "settings",
|
||||
// align: 'center',
|
||||
// width: 60,
|
||||
// scopedSlots: { customRender: 'settings' },
|
||||
// }, {
|
||||
// title: "streamSettings",
|
||||
// align: 'center',
|
||||
// width: 60,
|
||||
// scopedSlots: { customRender: 'streamSettings' },
|
||||
}, {
|
||||
title: "enable",
|
||||
align: 'center',
|
||||
width: 60,
|
||||
scopedSlots: { customRender: 'enable' },
|
||||
}, {
|
||||
title: "expiryTime",
|
||||
align: 'center',
|
||||
width: 60,
|
||||
scopedSlots: { customRender: 'expiryTime' },
|
||||
}, {
|
||||
title: "action",
|
||||
align: 'center',
|
||||
@@ -213,7 +204,7 @@
|
||||
port: inbound.port,
|
||||
protocol: inbound.protocol,
|
||||
settings: inbound.settings.toString(),
|
||||
stream_settings: inbound.stream.toString(),
|
||||
streamSettings: inbound.stream.toString(),
|
||||
sniffing: inbound.canSniffing() ? inbound.sniffing.toString() : '{}',
|
||||
};
|
||||
await this.submit('/xui/inbound/add', data, inModal);
|
||||
@@ -227,7 +218,7 @@
|
||||
port: inbound.port,
|
||||
protocol: inbound.protocol,
|
||||
settings: inbound.settings.toString(),
|
||||
stream_settings: inbound.stream.toString(),
|
||||
streamSettings: inbound.stream.toString(),
|
||||
sniffing: inbound.canSniffing() ? inbound.sniffing.toString() : '{}',
|
||||
};
|
||||
await this.submit(`/xui/inbound/update/${dbInbound.id}`, data, inModal);
|
||||
@@ -249,30 +240,13 @@
|
||||
const link = dbInbound.genLink(address);
|
||||
qrModal.show('二维码', link);
|
||||
},
|
||||
resetTraffic(inbound) {
|
||||
this.submit(`/xui/reset_traffic/${inbound.id}`);
|
||||
},
|
||||
resetAllTraffic() {
|
||||
this.submit('/xui/reset_all_traffic');
|
||||
},
|
||||
switchEnable(dbInbound) {
|
||||
const data = {
|
||||
remark: dbInbound.remark,
|
||||
enable: dbInbound.enable,
|
||||
|
||||
listen: dbInbound.listen,
|
||||
port: dbInbound.port,
|
||||
protocol: dbInbound.protocol,
|
||||
settings: dbInbound.settings,
|
||||
stream_settings: dbInbound.stream,
|
||||
sniffing: dbInbound.sniffing,
|
||||
};
|
||||
this.submit(`/xui/inbound/update/${dbInbound.id}`, data);
|
||||
this.submit(`/xui/inbound/update/${dbInbound.id}`, dbInbound);
|
||||
},
|
||||
async submit(url, data, modal) {
|
||||
const msg = await HttpUtil.postWithModal(url, data, modal);
|
||||
if (msg.success) {
|
||||
this.getDBInbounds();
|
||||
await this.getDBInbounds();
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@@ -31,7 +31,10 @@
|
||||
<a-layout-content>
|
||||
<a-spin :spinning="spinning" :delay="500" tip="loading">
|
||||
<a-space direction="vertical">
|
||||
<a-button type="primary" :disabled="saveBtnDisable" @click="updateAllSetting">保存配置</a-button>
|
||||
<a-space direction="horizontal">
|
||||
<a-button type="primary" :disabled="saveBtnDisable" @click="updateAllSetting">保存配置</a-button>
|
||||
<a-button type="danger" :disabled="!saveBtnDisable" @click="restartPanel">重启面板</a-button>
|
||||
</a-space>
|
||||
<a-tabs default-active-key="1">
|
||||
<a-tab-pane key="1" tab="面板配置">
|
||||
<a-list item-layout="horizontal" style="background: white">
|
||||
@@ -45,16 +48,21 @@
|
||||
<a-tab-pane key="2" tab="用户设置">
|
||||
<a-form style="background: white; padding: 20px">
|
||||
<a-form-item label="原用户名">
|
||||
<a-input></a-input>
|
||||
<a-input v-model="user.oldUsername" style="max-width: 300px"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="原密码">
|
||||
<a-input></a-input>
|
||||
<a-input type="password" v-model="user.oldPassword"
|
||||
style="max-width: 300px"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="新用户名">
|
||||
<a-input></a-input>
|
||||
<a-input v-model="user.newUsername" style="max-width: 300px"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="新密码">
|
||||
<a-input></a-input>
|
||||
<a-input type="password" v-model="user.newPassword"
|
||||
style="max-width: 300px"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item>
|
||||
<a-button type="primary" @click="updateUser">修改</a-button>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-tab-pane>
|
||||
@@ -87,6 +95,7 @@
|
||||
oldAllSetting: new AllSetting(),
|
||||
allSetting: new AllSetting(),
|
||||
saveBtnDisable: true,
|
||||
user: {},
|
||||
},
|
||||
methods: {
|
||||
loading(spinning = true) {
|
||||
@@ -109,6 +118,33 @@
|
||||
if (msg.success) {
|
||||
await this.getAllSetting();
|
||||
}
|
||||
},
|
||||
async updateUser() {
|
||||
this.loading(true);
|
||||
const msg = await HttpUtil.post("/xui/setting/updateUser", this.user);
|
||||
this.loading(false);
|
||||
if (msg.success) {
|
||||
this.user = {};
|
||||
}
|
||||
},
|
||||
async restartPanel() {
|
||||
await new Promise(resolve => {
|
||||
this.$confirm({
|
||||
title: '重启面板',
|
||||
content: '确定要重启面板吗?点击确定将于 3 秒后重启,若重启后无法访问面板,请前往服务器查看面板日志信息',
|
||||
okText: '确定',
|
||||
cancelText: '取消',
|
||||
onOk: () => resolve(),
|
||||
});
|
||||
});
|
||||
this.loading(true);
|
||||
const msg = await HttpUtil.post("/xui/setting/restartPanel");
|
||||
this.loading(false);
|
||||
if (msg.success) {
|
||||
this.loading(true);
|
||||
await PromiseUtil.sleep(5000);
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
|
||||
Reference in New Issue
Block a user