mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2026-04-21 04:06:17 +00:00
Compare commits
30 Commits
v4.3.3-qui
...
developmen
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
18c2568c22 | ||
|
|
d58e082336 | ||
|
|
523fee7b42 | ||
|
|
624206d5a7 | ||
|
|
fa9d9f24b5 | ||
|
|
c42bc47761 | ||
|
|
24e0f514d7 | ||
|
|
1744570086 | ||
|
|
9669782b0c | ||
|
|
03eddd2846 | ||
|
|
26b82745fc | ||
|
|
abc82369d9 | ||
|
|
f1764d3822 | ||
|
|
8fd15b9ca6 | ||
|
|
5f62e9ac69 | ||
|
|
8eb7e97d6e | ||
|
|
3b03099700 | ||
|
|
8d6eb4bb41 | ||
|
|
387adfee8c | ||
|
|
a33d6bfc9a | ||
|
|
5726627058 | ||
|
|
14b5885814 | ||
|
|
3d8cdcaf84 | ||
|
|
f1448b0e52 | ||
|
|
6e92b2b6a2 | ||
|
|
18ee8822d9 | ||
|
|
326628d258 | ||
|
|
566dda93f3 | ||
|
|
5c28e639ae | ||
|
|
3dfe740780 |
@@ -100,7 +100,7 @@ def createClientBlueprint(wireguardConfigurations: dict[WireguardConfiguration],
|
|||||||
date = datetime.datetime.now(tz=datetime.timezone.utc).strftime('%Y-%m-%d %H:%M:%S UTC')
|
date = datetime.datetime.now(tz=datetime.timezone.utc).strftime('%Y-%m-%d %H:%M:%S UTC')
|
||||||
|
|
||||||
emailSender = EmailSender(dashboardConfig)
|
emailSender = EmailSender(dashboardConfig)
|
||||||
if not emailSender.ready():
|
if not emailSender.is_ready():
|
||||||
return ResponseObject(False, "We can't send you an email due to your Administrator has not setup email service. Please contact your administrator.")
|
return ResponseObject(False, "We can't send you an email due to your Administrator has not setup email service. Please contact your administrator.")
|
||||||
|
|
||||||
data = request.get_json()
|
data = request.get_json()
|
||||||
@@ -244,4 +244,4 @@ def createClientBlueprint(wireguardConfigurations: dict[WireguardConfiguration],
|
|||||||
|
|
||||||
return ResponseObject(status, message)
|
return ResponseObject(status, message)
|
||||||
|
|
||||||
return client
|
return client
|
||||||
|
|||||||
@@ -51,7 +51,8 @@ class DashboardConfig:
|
|||||||
"peer_display_mode": "grid",
|
"peer_display_mode": "grid",
|
||||||
"remote_endpoint": GetRemoteEndpoint(),
|
"remote_endpoint": GetRemoteEndpoint(),
|
||||||
"peer_MTU": "1420",
|
"peer_MTU": "1420",
|
||||||
"peer_keep_alive": "21"
|
"peer_keep_alive": "21",
|
||||||
|
"peer_preshared_key_default": "false"
|
||||||
},
|
},
|
||||||
"Other": {
|
"Other": {
|
||||||
"welcome_session": "true"
|
"welcome_session": "true"
|
||||||
@@ -146,14 +147,17 @@ class DashboardConfig:
|
|||||||
if col_name not in existing_columns:
|
if col_name not in existing_columns:
|
||||||
type_str = col_type().compile(dialect=self.engine.dialect)
|
type_str = col_type().compile(dialect=self.engine.dialect)
|
||||||
current_app.logger.info(f"Adding missing column '{col_name}' to table '{table_name}'")
|
current_app.logger.info(f"Adding missing column '{col_name}' to table '{table_name}'")
|
||||||
conn.execute(db.text(f'ALTER TABLE "{table_name}" ADD COLUMN "{col_name}" {type_str}'))
|
preparer = self.engine.dialect.identifier_preparer
|
||||||
|
quoted_table = preparer.quote_identifier(table_name)
|
||||||
|
quoted_column = preparer.quote_identifier(col_name)
|
||||||
|
conn.execute(db.text(f"ALTER TABLE {quoted_table} ADD COLUMN {quoted_column} {type_str}"))
|
||||||
|
|
||||||
def getConnectionString(self, database) -> str or None:
|
def getConnectionString(self, database) -> str or None:
|
||||||
sqlitePath = os.path.join(DashboardConfig.ConfigurationPath, "db")
|
sqlitePath = os.path.join(DashboardConfig.ConfigurationPath, "db")
|
||||||
|
|
||||||
if not os.path.isdir(sqlitePath):
|
if not os.path.isdir(sqlitePath):
|
||||||
os.mkdir(sqlitePath)
|
os.mkdir(sqlitePath)
|
||||||
|
|
||||||
if self.GetConfig("Database", "type")[1] == "postgresql":
|
if self.GetConfig("Database", "type")[1] == "postgresql":
|
||||||
cn = f'postgresql+psycopg2://{self.GetConfig("Database", "username")[1]}:{self.GetConfig("Database", "password")[1]}@{self.GetConfig("Database", "host")[1]}/{database}'
|
cn = f'postgresql+psycopg2://{self.GetConfig("Database", "username")[1]}:{self.GetConfig("Database", "password")[1]}@{self.GetConfig("Database", "host")[1]}/{database}'
|
||||||
elif self.GetConfig("Database", "type")[1] == "mysql":
|
elif self.GetConfig("Database", "type")[1] == "mysql":
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ icmplib==3.0.4
|
|||||||
gunicorn==25.0.3
|
gunicorn==25.0.3
|
||||||
requests==2.32.5
|
requests==2.32.5
|
||||||
tcconfig==0.30.1
|
tcconfig==0.30.1
|
||||||
sqlalchemy==2.0.46
|
sqlalchemy==2.0.49
|
||||||
sqlalchemy_utils==0.42.1
|
sqlalchemy_utils==0.42.1
|
||||||
psycopg[binary]==3.3.3
|
psycopg[binary]==3.3.3
|
||||||
PyMySQL==1.1.2
|
PyMySQL==1.1.2
|
||||||
tzlocal==5.3.1
|
tzlocal==5.3.1
|
||||||
python-jose==3.5.0
|
python-jose==3.5.0
|
||||||
pydantic==2.12.5
|
pydantic==2.13.0
|
||||||
|
|||||||
1498
src/static/app/package-lock.json
generated
1498
src/static/app/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -20,28 +20,28 @@
|
|||||||
"animate.css": "^4.1.1",
|
"animate.css": "^4.1.1",
|
||||||
"bootstrap": "^5.3.2",
|
"bootstrap": "^5.3.2",
|
||||||
"bootstrap-icons": "^1.11.3",
|
"bootstrap-icons": "^1.11.3",
|
||||||
"cidr-tools": "^11.3.2",
|
"cidr-tools": "^11.3.3",
|
||||||
"css-color-converter": "^2.0.0",
|
"css-color-converter": "^2.0.0",
|
||||||
"dayjs": "^1.11.19",
|
"dayjs": "^1.11.19",
|
||||||
"electron-builder": "^26.7.0",
|
"electron-builder": "^26.7.0",
|
||||||
"fuse.js": "^7.0.0",
|
"fuse.js": "^7.3.0",
|
||||||
"i": "^0.3.7",
|
"i": "^0.3.7",
|
||||||
"is-cidr": "^6.0.3",
|
"is-cidr": "^6.0.3",
|
||||||
"npm": "^11.8.0",
|
"npm": "^11.8.0",
|
||||||
"ol": "^10.7.0",
|
"ol": "^10.8.0",
|
||||||
"pinia": "^3.0.4",
|
"pinia": "^3.0.4",
|
||||||
"pinia-plugin-persistedstate": "^4.7.1",
|
"pinia-plugin-persistedstate": "^4.7.1",
|
||||||
"qrcode": "^1.5.3",
|
"qrcode": "^1.5.3",
|
||||||
"qrcodejs": "^1.0.0",
|
"qrcodejs": "^1.0.0",
|
||||||
"simple-code-editor": "^2.0.9",
|
"simple-code-editor": "^2.0.9",
|
||||||
"uuid": "^13.0.0",
|
"uuid": "^13.0.0",
|
||||||
"vue": "^3.5.31",
|
"vue": "^3.5.32",
|
||||||
"vue-chartjs": "^5.3.3",
|
"vue-chartjs": "^5.3.3",
|
||||||
"vue-router": "^5.0.4"
|
"vue-router": "^5.0.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vitejs/plugin-vue": "^6.0.4",
|
"@vitejs/plugin-vue": "^6.0.4",
|
||||||
"vite": "^7.3.1"
|
"vite": "^8.0.8"
|
||||||
},
|
},
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"tar": "^7.5.6"
|
"tar": "^7.5.6"
|
||||||
|
|||||||
@@ -6,18 +6,27 @@ export default {
|
|||||||
components: {LocaleText},
|
components: {LocaleText},
|
||||||
props: {
|
props: {
|
||||||
data: Object,
|
data: Object,
|
||||||
saving: Boolean
|
saving: Boolean,
|
||||||
|
defaultEnabled: Boolean
|
||||||
},
|
},
|
||||||
data(){
|
data(){
|
||||||
return{
|
return{
|
||||||
enable: false
|
enable: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
const hasKey = !!(this.data && this.data.preshared_key && this.data.preshared_key.length > 0)
|
||||||
|
if (hasKey || this.defaultEnabled){
|
||||||
|
this.enable = true
|
||||||
|
}
|
||||||
|
},
|
||||||
watch:{
|
watch:{
|
||||||
enable(){
|
enable(){
|
||||||
if (this.enable){
|
if (this.enable) {
|
||||||
this.data.preshared_key = window.wireguard.generateKeypair().presharedKey
|
if (!this.data.preshared_key){
|
||||||
}else {
|
this.data.preshared_key = window.wireguard.generateKeypair().presharedKey
|
||||||
|
}
|
||||||
|
} else {
|
||||||
this.data.preshared_key = ""
|
this.data.preshared_key = ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -48,4 +57,4 @@ export default {
|
|||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ const peerData = ref({
|
|||||||
keepalive: parseInt(dashboardStore.Configuration.Peers.peer_keep_alive),
|
keepalive: parseInt(dashboardStore.Configuration.Peers.peer_keep_alive),
|
||||||
mtu: parseInt(dashboardStore.Configuration.Peers.peer_mtu),
|
mtu: parseInt(dashboardStore.Configuration.Peers.peer_mtu),
|
||||||
preshared_key: "",
|
preshared_key: "",
|
||||||
preshared_key_bulkAdd: false,
|
preshared_key_bulkAdd: Boolean(dashboardStore.Configuration.Peers.peer_preshared_key_default),
|
||||||
allowed_ips_validation: true,
|
allowed_ips_validation: true,
|
||||||
})
|
})
|
||||||
const availableIp = ref([])
|
const availableIp = ref([])
|
||||||
@@ -128,7 +128,7 @@ watch(() => {
|
|||||||
<EndpointAllowedIps :saving="saving" :data="peerData"></EndpointAllowedIps>
|
<EndpointAllowedIps :saving="saving" :data="peerData"></EndpointAllowedIps>
|
||||||
<div class="row gy-3">
|
<div class="row gy-3">
|
||||||
<div class="col-sm" v-if="!peerData.bulkAdd">
|
<div class="col-sm" v-if="!peerData.bulkAdd">
|
||||||
<PresharedKeyInput :saving="saving" :data="peerData" :bulk="peerData.bulkAdd"></PresharedKeyInput>
|
<PresharedKeyInput :saving="saving" :data="peerData" :bulk="peerData.bulkAdd" :defaultEnabled="Boolean(dashboardStore.Configuration.Peers.peer_preshared_key_default)"></PresharedKeyInput>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
@@ -177,4 +177,4 @@ watch(() => {
|
|||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export default {
|
|||||||
keepalive: parseInt(this.dashboardStore.Configuration.Peers.peer_keep_alive),
|
keepalive: parseInt(this.dashboardStore.Configuration.Peers.peer_keep_alive),
|
||||||
mtu: parseInt(this.dashboardStore.Configuration.Peers.peer_mtu),
|
mtu: parseInt(this.dashboardStore.Configuration.Peers.peer_mtu),
|
||||||
preshared_key: "",
|
preshared_key: "",
|
||||||
preshared_key_bulkAdd: false,
|
preshared_key_bulkAdd: Boolean(this.dashboardStore.Configuration.Peers.peer_preshared_key_default),
|
||||||
},
|
},
|
||||||
availableIp: undefined,
|
availableIp: undefined,
|
||||||
availableIpSearchString: "",
|
availableIpSearchString: "",
|
||||||
@@ -133,7 +133,7 @@ export default {
|
|||||||
<hr class="mb-0 mt-2">
|
<hr class="mb-0 mt-2">
|
||||||
<div class="row gy-3">
|
<div class="row gy-3">
|
||||||
<div class="col-sm" v-if="!this.data.bulkAdd">
|
<div class="col-sm" v-if="!this.data.bulkAdd">
|
||||||
<PresharedKeyInput :saving="saving" :data="data" :bulk="this.data.bulkAdd"></PresharedKeyInput>
|
<PresharedKeyInput :saving="saving" :data="data" :bulk="this.data.bulkAdd" :defaultEnabled="Boolean(this.dashboardStore.Configuration.Peers.peer_preshared_key_default)"></PresharedKeyInput>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
@@ -187,4 +187,4 @@ div{
|
|||||||
.card{
|
.card{
|
||||||
max-height: 100%;
|
max-height: 100%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ import PeersDefaultSettingsInput from "@/components/settingsComponent/peersDefau
|
|||||||
targetData="peer_mtu" title="MTU"></PeersDefaultSettingsInput>
|
targetData="peer_mtu" title="MTU"></PeersDefaultSettingsInput>
|
||||||
<PeersDefaultSettingsInput
|
<PeersDefaultSettingsInput
|
||||||
targetData="peer_keep_alive" title="Persistent Keepalive"></PeersDefaultSettingsInput>
|
targetData="peer_keep_alive" title="Persistent Keepalive"></PeersDefaultSettingsInput>
|
||||||
|
<PeersDefaultSettingsInput
|
||||||
|
targetData="peer_preshared_key_default" title="Pre-Shared Key Default"></PeersDefaultSettingsInput>
|
||||||
<PeersDefaultSettingsInput
|
<PeersDefaultSettingsInput
|
||||||
targetData="remote_endpoint" title="Peer Remote Endpoint"
|
targetData="remote_endpoint" title="Peer Remote Endpoint"
|
||||||
:warning="true" warningText="This will be changed globally, and will be apply to all peer's QR code and configuration file."
|
:warning="true" warningText="This will be changed globally, and will be apply to all peer's QR code and configuration file."
|
||||||
@@ -34,4 +36,4 @@ import PeersDefaultSettingsInput from "@/components/settingsComponent/peersDefau
|
|||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -31,6 +31,11 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
this.value = this.store.Configuration.Peers[this.targetData];
|
this.value = this.store.Configuration.Peers[this.targetData];
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
isBoolean(){
|
||||||
|
return typeof this.value === "boolean"
|
||||||
|
}
|
||||||
|
},
|
||||||
methods:{
|
methods:{
|
||||||
async useValidation(){
|
async useValidation(){
|
||||||
if(this.changed){
|
if(this.changed){
|
||||||
@@ -67,7 +72,14 @@ export default {
|
|||||||
<LocaleText :t="this.title"></LocaleText>
|
<LocaleText :t="this.title"></LocaleText>
|
||||||
</small></strong>
|
</small></strong>
|
||||||
</label>
|
</label>
|
||||||
<input type="text" class="form-control"
|
<div v-if="isBoolean" class="form-check form-switch">
|
||||||
|
<input class="form-check-input" type="checkbox" role="switch"
|
||||||
|
v-model="this.value"
|
||||||
|
:id="this.uuid"
|
||||||
|
@change="this.changed = true; useValidation()"
|
||||||
|
:disabled="this.updating">
|
||||||
|
</div>
|
||||||
|
<input v-else type="text" class="form-control"
|
||||||
:class="{'is-invalid': showInvalidFeedback, 'is-valid': isValid}"
|
:class="{'is-invalid': showInvalidFeedback, 'is-valid': isValid}"
|
||||||
:id="this.uuid"
|
:id="this.uuid"
|
||||||
v-model="this.value"
|
v-model="this.value"
|
||||||
@@ -88,4 +100,4 @@ export default {
|
|||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
2643
src/static/client/package-lock.json
generated
2643
src/static/client/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -13,16 +13,16 @@
|
|||||||
"bootstrap": "^5.3.6",
|
"bootstrap": "^5.3.6",
|
||||||
"bootstrap-icons": "^1.13.1",
|
"bootstrap-icons": "^1.13.1",
|
||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.13",
|
||||||
"oidc-client-ts": "^3.2.1",
|
"oidc-client-ts": "^3.5.0",
|
||||||
"pinia": "^3.0.2",
|
"pinia": "^3.0.2",
|
||||||
"qrcode": "^1.5.4",
|
"qrcode": "^1.5.4",
|
||||||
"uuid": "^11.1.0",
|
"uuid": "^13.0.0",
|
||||||
"vue": "^3.5.13",
|
"vue": "^3.5.32",
|
||||||
"vue-router": "^4.5.1"
|
"vue-router": "^4.5.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vitejs/plugin-vue": "^5.2.3",
|
"@vitejs/plugin-vue": "^5.2.3",
|
||||||
"vite": "^6.2.4",
|
"vite": "^8.0.8",
|
||||||
"vite-plugin-vue-devtools": "^7.7.2"
|
"vite-plugin-vue-devtools": "^8.1.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user