V2.3.1- bug fix

* Fix linux networking

* better general settings message

* bug fix general  settings networking not returning correct  status

* updated pom
This commit is contained in:
Ori agranat
2020-02-29 19:27:27 +02:00
committed by GitHub
parent d7d637379e
commit 321a90ac08
4 changed files with 21 additions and 9 deletions

View File

@@ -15,7 +15,7 @@
<v-btn style="margin-top:10px" small color="#4baf62" @click="sendGeneralSettings">Save General Settings</v-btn>
<div style="margin-top: 20px">
<span>Install or Update:</span>
<v-divider color="white"></v-divider>
<v-divider color="white"/>
</div>
<div v-if="!isLoading">
<v-row dense align="center">
@@ -23,14 +23,14 @@
<span>Choose a newer version: </span>
</v-col>
<v-col :cols="6">
<v-file-input accept=".jar" dark v-model="file"></v-file-input>
<v-file-input accept=".jar" dark v-model="file"/>
</v-col>
</v-row>
<v-btn small @click="installOrUpdate">{{fileUploadText}}</v-btn>
</div>
<div v-else style="text-align: center; margin-top: 20px">
<v-progress-circular color="white" :indeterminate="true" size="32"
width="4"></v-progress-circular>
width="4"/>
<br>
<span>Please wait this may take a while</span>
</div>
@@ -69,8 +69,19 @@
this.axios.post("http://" + this.$address + "/api/settings/general", this.settings).then(
function (response) {
if (response.status === 200) {
self.$store.state.saveBar = true;
self.snackbar = {
color: "success",
text: "Save successful, Please restart for changes to take action"
};
self.snack = true;
}
},
function (error) {
self.snackbar = {
color: "error",
text: error.response.data
};
self.snack = true;
}
)
},

View File

@@ -6,7 +6,7 @@
<groupId>org.chameleon-vision.main</groupId>
<artifactId>chameleon-vision</artifactId>
<version>2.3.1-RELEASE</version>
<version>2.3.1-BUGFIX</version>
<build>
<plugins>
<!--setup for java jdk 12-->

View File

@@ -71,9 +71,10 @@ public class LinuxNetworking extends SysNetworking {
lines.add("interface " + networkInterface.name);
InetAddress iNetMask = InetAddress.getByName(netmask);
int prefix = NetmaskToCIDR.convertNetmaskToCIDR(iNetMask);
lines.add("static ip_address " + ipAddress + "/" + prefix);
lines.add("static routers " + gateway);
lines.add("static ip_address=" + ipAddress + "/" + prefix);
lines.add("static routers=" + gateway);
FileUtils.writeLines(dhcpConf, lines);
return true;
} catch (IOException e) {
e.printStackTrace();
}

View File

@@ -57,8 +57,8 @@ public class RequestHandler {
// setting up network config after saving
boolean isStatic = ConfigManager.settings.connectionType.equals(NetworkIPMode.STATIC);
if (NetworkManager.setHostname(ConfigManager.settings.hostname) &&
NetworkManager.setNetwork(isStatic, ConfigManager.settings.ip, ConfigManager.settings.netmask, ConfigManager.settings.gateway)) {
boolean state = NetworkManager.setHostname(ConfigManager.settings.hostname) && NetworkManager.setNetwork(isStatic, ConfigManager.settings.ip, ConfigManager.settings.netmask, ConfigManager.settings.gateway);
if (state) {
ctx.status(200);
} else {
ctx.result("Something went wrong while setting network configuration");