Skip to content

Commit 914cddd

Browse files
authored
Merge pull request #156 from knoxfighter/Feature/Update-adminLTE
Feature/update admin lte
2 parents 46421f9 + 75784e5 commit 914cddd

26 files changed

+343
-408
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ All api actions are accessible with the /api route. The frontend is accessible
100100

101101
#### Requirements
102102
+ Go 1.11
103-
+ NodeJS
103+
+ NodeJS >10.13.0
104104

105105
#### Building Releases
106106
Creates a release zip for windows and linux: (this will install the dependencies listed in gopkgdeps)

app/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<link rel="stylesheet" type="text/css" href="./style.css">
1212
</head>
13-
<body class="hold-transition skin-blue sidebar-mini">
13+
<body class="hold-transition skin-blue sidebar-mini layout-fixed ">
1414
<div id="app"></div>
1515

1616
<!-- Main application -->

package.json

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,35 +24,35 @@
2424
},
2525
"homepage": "https://github.com/mroote/factorio-server-manager#readme",
2626
"devDependencies": {
27-
"@babel/core": "^7.4.5",
28-
"@babel/preset-env": "^7.4.5",
29-
"@babel/preset-react": "^7.0.0",
30-
"@fortawesome/fontawesome-free": "^5.8.2",
31-
"admin-lte": "^3.0.0-alpha.2",
27+
"@babel/core": "^7.8.3",
28+
"@babel/preset-env": "^7.8.3",
29+
"@babel/preset-react": "^7.8.3",
30+
"@fortawesome/fontawesome-free": "^5.12.0",
31+
"admin-lte": "^3.0.2",
3232
"babel-loader": "^8.0.6",
33-
"bootstrap": "^4.3.1",
34-
"bootstrap-fileinput": "^5.0.3",
33+
"bootstrap": "^4.4.1",
34+
"bootstrap-fileinput": "^5.0.8",
3535
"classnames": "^2.2.6",
36-
"css-loader": "^2.1.0",
37-
"file-loader": "^3.0.1",
36+
"css-loader": "^3.4.2",
37+
"file-loader": "^5.0.2",
3838
"jquery": "^3.4.1",
3939
"locks": "^0.2.2",
40-
"mini-css-extract-plugin": "^0.7.0",
41-
"node-sass": "^4.12.0",
42-
"optimize-css-assets-webpack-plugin": "^5.0.1",
40+
"mini-css-extract-plugin": "^0.9.0",
41+
"node-sass": "^4.13.1",
42+
"optimize-css-assets-webpack-plugin": "^5.0.3",
4343
"prop-types": "^15.7.2",
44-
"react": "^16.8.6",
45-
"react-dom": "^16.8.6",
44+
"react": "^16.12.0",
45+
"react-dom": "^16.12.0",
4646
"react-native-listener": "^1.1.0",
47-
"react-router": "^5.0.0",
48-
"react-router-dom": "^5.0.0",
49-
"resolve-url-loader": "^3.1.0",
50-
"sass-loader": "^7.1.0",
51-
"semver": "^6.1.1",
52-
"sweetalert2": "^8.11.6",
47+
"react-router": "^5.1.2",
48+
"react-router-dom": "^5.1.2",
49+
"resolve-url-loader": "^3.1.1",
50+
"sass-loader": "^8.0.2",
51+
"semver": "^6.3.0",
52+
"sweetalert2": "^9.7.1",
5353
"sweetalert2-react-content": "^1.1.0",
54-
"webpack": "^4.32.2",
55-
"webpack-cli": "^3.3.2",
56-
"webpack-fix-style-only-entries": "^0.2.0"
54+
"webpack": "^4.41.5",
55+
"webpack-cli": "^3.3.10",
56+
"webpack-fix-style-only-entries": "^0.4.0"
5757
}
5858
}

ui/App/components/Header.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Header extends React.Component {
3636
</Link>
3737
</li>
3838
<li className="nav-item">
39-
<a href="javascript:void(0)" onClick={this.onLogout} className="nav-link">
39+
<a href="#" onClick={this.onLogout} className="nav-link">
4040
<FontAwesomeIcon icon="lock" className="fa-fw"/>Logout
4141
</a>
4242
</li>

ui/App/components/Mods/ModLoadSave.jsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class ModLoadSave extends React.Component {
4747
if(checkboxes.length == 0) {
4848
ReactSwalNormal.fire({
4949
title: "No mods in this save!",
50-
type: "error"
50+
icon: "error"
5151
});
5252
return;
5353
}
@@ -78,7 +78,7 @@ class ModLoadSave extends React.Component {
7878
ReactSwalNormal.fire({
7979
title: "Mods to install",
8080
html: table,
81-
type: 'question',
81+
icon: 'question',
8282
showCancelButton: true,
8383
confirmButtonText: "Download Mods!",
8484
showLoaderOnConfirm: true,
@@ -89,37 +89,40 @@ class ModLoadSave extends React.Component {
8989
ReactSwalNormal.fire({
9090
title: jqXHR.responseJSON.data,
9191
html: true,
92-
type: "error",
92+
icon: "error",
9393
});
9494
}
9595
});
9696
}
9797

9898
loadModsSwalHandler() {
99-
$.ajax({
99+
// TODO remove jquery Ajax, use react one, return Promise from fetch
100+
return new Promise((resolve, reject) => $.ajax({
100101
url: "/api/mods/install/multiple",
101102
method: "POST",
102103
dataType: "JSON",
103104
data: $("#swalForm").serialize(),
104105
success: (data) => {
106+
resolve();
105107
ReactSwalNormal.fire({
106108
title: "All Mods installed successfully!",
107-
type: "success"
109+
icon: "success"
108110
});
109111

110112
this.props.modContentClass.setState({
111113
installedMods: data.data.mods
112114
});
113115
},
114116
error: (jqXHR) => {
117+
reject();
115118
let json_data = JSON.parse(jqXHR.responseJSON.data);
116119

117120
ReactSwalNormal.fire({
118121
title: json_data.detail,
119-
type: "error",
122+
icon: "error",
120123
});
121124
}
122-
})
125+
}));
123126
}
124127

125128
render() {
@@ -134,7 +137,7 @@ class ModLoadSave extends React.Component {
134137
}
135138
});
136139

137-
let classes = "box-body" + " " + this.props.className;
140+
let classes = "card-body" + " " + this.props.className;
138141
let ids = this.props.id;
139142

140143
return (

ui/App/components/Mods/ModManager.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class ModManager extends React.Component {
88
}
99

1010
render() {
11-
let classes = "box-body" + " " + this.props.className;
11+
let classes = "card-body" + " " + this.props.className;
1212
let ids = this.props.id;
1313

1414
return (

ui/App/components/Mods/ModOverview.jsx

Lines changed: 37 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class ModOverview extends React.Component {
4141

4242
ReactSwalNormal.fire({
4343
title: json_data.detail,
44-
type: "error"
44+
icon: "error"
4545
});
4646
}
4747
})
@@ -54,21 +54,16 @@ class ModOverview extends React.Component {
5454
render() {
5555
return(
5656
<div>
57-
<div className="box collapsed-box" id="add-mod-box">
58-
<div className="box-header"
59-
data-toggle="collapse"
60-
data-target="#modSearch"
61-
aria-expanded="false"
62-
aria-controls="modSearch"
63-
role="button"
64-
style={{cursor: "pointer"}}
65-
>
66-
<FontAwesomeIcon icon="plus"/>
67-
<h3 className="box-title">Add Mod</h3>
57+
<div className="card collapsed-card" id="add-mod-box">
58+
<div className="card-header">
59+
<button type="button" className="btn btn-tool btn-collapse" data-card-widget="collapse">
60+
<FontAwesomeIcon icon="plus"/>
61+
</button>
62+
<h3 className="card-title">Add Mod</h3>
6863
{this.props.loggedIn ?
69-
<div className="box-tools pull-right">
64+
<div className="card-tools">
7065
<NativeListener onClick={this.props.factorioLogoutHandler}>
71-
<button className="btn btn-box-tool btn-danger" style={{color: "#fff"}}>
66+
<button className="btn btn-tool btn-danger">
7267
Logout
7368
</button>
7469
</NativeListener>
@@ -79,69 +74,48 @@ class ModOverview extends React.Component {
7974
<ModSearch
8075
{...this.state}
8176
{...this.props}
82-
className="collapse"
83-
id="modSearch"
8477
submitSearchMod={this.handlerSearchMod}
8578
submitFactorioLogin={this.props.submitFactorioLogin}
8679
/>
8780
</div>
8881

89-
<div className="box collapsed-box">
90-
<div className="box-header"
91-
data-toggle="collapse"
92-
data-target="#modUpload"
93-
aria-expanded="false"
94-
aria-controls="modUpload"
95-
role="button"
96-
style={{cursor: "pointer"}}
97-
>
98-
<FontAwesomeIcon icon="plus"/>
99-
<h3 className="box-title">Upload Mod</h3>
82+
<div className="card collapsed-card">
83+
<div className="card-header">
84+
<button type="button" className="btn btn-tool btn-collapse" data-card-widget="collapse">
85+
<FontAwesomeIcon icon="plus"/>
86+
</button>
87+
<h3 className="card-title">Upload Mod</h3>
10088
</div>
10189

10290
<ModUpload
10391
{...this.props}
104-
className="collapse"
105-
id="modUpload"
10692
/>
10793
</div>
10894

109-
<div className="box collapsed-box">
110-
<div className="box-header"
111-
data-toggle="collapse"
112-
data-target="#modLoadSave"
113-
aria-expanded="false"
114-
aria-controls="modLoadSave"
115-
role="button"
116-
style={{cursor: "pointer"}}
117-
>
118-
<FontAwesomeIcon icon="plus"/>
119-
<h3 className="box-title">Load Mods From Save</h3>
95+
<div className="card collapsed-card">
96+
<div className="card-header">
97+
<button type="button" className="btn btn-tool btn-collapse" data-card-widget="collapse">
98+
<FontAwesomeIcon icon="plus"/>
99+
</button>
100+
<h3 className="card-title">Load Mods From Save</h3>
120101
</div>
121102

122103
<ModLoadSave
123104
{...this.props}
124-
className="collapse"
125-
id="modLoadSave"
126105
/>
127106
</div>
128107

129-
<div className="box" id="manage-mods">
130-
<div className="box-header"
131-
data-toggle="collapse"
132-
data-target="#modManager"
133-
aria-expanded="true"
134-
aria-controls="modManager"
135-
role="button"
136-
style={{cursor: "pointer"}}
137-
>
138-
<FontAwesomeIcon icon="minus"/>
139-
<h3 className="box-title">Manage Mods</h3>
140-
<div className="box-tools float-sm-right">
108+
<div className="card" id="manage-mods">
109+
<div className="card-header">
110+
<button type="button" className="btn btn-tool btn-collapse" data-card-widget="collapse">
111+
<FontAwesomeIcon icon="minus"/>
112+
</button>
113+
<h3 className="card-title">Manage Mods</h3>
114+
<div className="card-tools">
141115
{
142116
this.props.installedMods != null ?
143117
<NativeListener onClick={this.downloadAllHandler}>
144-
<a className="btn btn-box-tool btn-default" style={{marginRight: 20}} href={"/api/mods/download"} download>
118+
<a className="btn btn-tool btn-default" href={"/api/mods/download"} download>
145119
Download all Mods
146120
</a>
147121
</NativeListener>
@@ -150,7 +124,7 @@ class ModOverview extends React.Component {
150124
{
151125
this.props.updatesAvailable > 0 ?
152126
<NativeListener onClick={this.props.updateAllMods}>
153-
<button className="btn btn-box-tool btn-default" style={{marginRight: 20}}>
127+
<button className="btn btn-tool btn-default">
154128
Update all Mods
155129
</button>
156130
</NativeListener>
@@ -159,7 +133,7 @@ class ModOverview extends React.Component {
159133
{
160134
this.props.installedMods != null ?
161135
<NativeListener onClick={this.props.deleteAll}>
162-
<button className="btn btn-box-tool btn-danger" style={{color: "#fff"}}>
136+
<button className="btn btn-tool btn-danger">
163137
Delete ALL Mods
164138
</button>
165139
</NativeListener>
@@ -171,26 +145,19 @@ class ModOverview extends React.Component {
171145
<ModManager
172146
{...this.props}
173147
id="modManager"
174-
className="show"
175148
/>
176149
</div>
177150

178-
<div className="box collapsed-box">
179-
<div className="box-header"
180-
data-toggle="collapse"
181-
data-target="#modPacks"
182-
aria-expanded="false"
183-
aria-controls="modPacks"
184-
role="button"
185-
style={{cursor: "pointer"}}
186-
>
187-
<FontAwesomeIcon icon="plus"/>
188-
<h3 className="box-title">Manage Modpacks</h3>
151+
<div className="card collapsed-card">
152+
<div className="card-header">
153+
<button type="button" className="btn btn-tool btn-collapse" data-card-widget="collapse">
154+
<FontAwesomeIcon icon="plus"/>
155+
</button>
156+
<h3 className="card-title">Manage Modpacks</h3>
189157
</div>
190158

191159
<ModPacks
192160
{...this.props}
193-
className="collapse"
194161
id="modPacks"
195162
/>
196163
</div>

ui/App/components/Mods/ModUpload.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class ModUpload extends React.Component {
2020
}
2121

2222
render() {
23-
let classes = "box-body" + " " + this.props.className;
23+
let classes = "card-body" + " " + this.props.className;
2424
let ids = this.props.id;
2525

2626
return(

0 commit comments

Comments
 (0)