浏览代码

加入更多 Windows 版本的支持

James Iter 7 年之前
父节点
当前提交
afc64f2fca
共有 6 个文件被更改,包括 61 次插入5 次删除
  1. 二进制
      .DS_Store
  2. 1 1
      jimvc/api/about.py
  3. 10 2
      jimvc/themes/default/templates/os_templates_image_show.html
  4. 25 1
      misc/init.sql
  5. 24 0
      misc/v0.6_to_v0.7/update_for_windows.sql
  6. 1 1
      requirements.txt

二进制
.DS_Store


+ 1 - 1
jimvc/api/about.py

@@ -34,7 +34,7 @@ def r_get():
     ret['data'] = {
         'version': 0.7,
         'desc': """
-    JimV 是一套舒适的驾驭系统。通过它,您可以可以轻松自如地,让那匹彪悍烈马,把您带上长空云霄。
+    JimV 是一套舒适的驾驭系统。通过它,您可以轻松自如地,让那匹彪悍烈马,把您带上长空云霄。
     "舒适",是设计 JimV 的哲学理念。其中包含的意义有 "平滑、自在、敏捷、可控"。您所想、所要的,
 只需轻触鼠标,即可信手捏来。""",
         'copyright': '版权所有2018 JamesIter. 保留所有权利。'

+ 10 - 2
jimvc/themes/default/templates/os_templates_image_show.html

@@ -162,8 +162,16 @@
         });
 
         $('#update_logo_modal').on('show.bs.modal', function (me) {
-            $('#os_template_image_id').val($(me.relatedTarget).parent().parent().prev().prev().prev().prev().prev().text());
-            $('#update_logo_instance_desc').text($(me.relatedTarget).parent().parent().prev().prev().prev().text());
+            var os_template_image_id = $(me.relatedTarget).parent().parent().prev().prev().prev().prev().prev().text();
+            var update_logo_instance_desc = $(me.relatedTarget).parent().parent().prev().prev().prev().text();
+
+            if (os_template_image_id === "") {
+                os_template_image_id = $(me.relatedTarget).parent().parent().prev().prev().prev().prev().prev().prev().text();
+                update_logo_instance_desc = $(me.relatedTarget).parent().parent().prev().prev().prev().prev().text();
+            }
+
+            $('#os_template_image_id').val(os_template_image_id);
+            $('#update_logo_instance_desc').text(update_logo_instance_desc);
         });
 
         $('#add_os_template_image_form').formValidation({

+ 25 - 1
misc/init.sql

@@ -457,6 +457,7 @@ INSERT INTO os_template_initialize_operate_set (label, description, active) VALU
 INSERT INTO os_template_initialize_operate_set (label, description, active) VALUES ('Gentoo-OpenRC', '用作 Gentoo OpenRC 系列的系统初始化。', 1);
 INSERT INTO os_template_initialize_operate_set (label, description, active) VALUES ('CoreOS', '用作 CoreOS 系列的系统初始化。', 1);
 INSERT INTO os_template_initialize_operate_set (label, description, active) VALUES ('Windows', '用作 MS-Windows 系列的系统初始化。初始化操作依据 Windows 2012 来实现。', 1);
+INSERT INTO os_template_initialize_operate_set (label, description, active) VALUES ('WindowsMode2', '用作 MS-Windows 系列的系统初始化。初始化操作依据 WindowsXP 来实现。', 1);
 
 -- For CentOS-Systemd
 INSERT INTO os_template_initialize_operate (os_template_initialize_operate_set_id, kind, sequence, path, content, command) VALUES (1, 1, 0, '/etc/resolv.conf', 'nameserver {DNS1}
@@ -530,6 +531,18 @@ del C:\\Windows\\jimv_init.bat
 timeout 2 > NUL
 shutdown -r -t 0', '');
 
+-- For WindowsXP
+INSERT INTO os_template_initialize_operate (os_template_initialize_operate_set_id, kind, sequence, path, content, command) VALUES (6, 1, 0, '/WINDOWS/jimv_init.bat', 'netsh interface ip set address name="Ethernet" source=static {IP} {NETMASK} {GATEWAY} 1
+netsh interface ip set dns "Ethernet" static {DNS1} primary
+netsh interface ip add dns "Ethernet" {DNS2}
+wmic computersystem where name="%COMPUTERNAME%" call rename name="{HOSTNAME}"
+net user Administrator {PASSWORD}
+@ping 127.0.0.1 -n 3 > NUL
+sc delete JimVInit
+del C:\\WINDOWS\\jimv_init.bat
+shutdown -r -t 0
+@ping 127.0.0.1 -n 2 > NUL', '');
+
 
 INSERT INTO os_template_profile (label, description, os_type, os_distro, os_major, os_minor, os_arch, os_product_name, active, icon, os_template_initialize_operate_set_id)
 VALUES ('CentOS-7.4', 'CentOS 7.4。', 'linux', 'centos', 7, 4, 'x86_64', 'CentOS Linux release 7.4.1708 (Core)', 1, 'icon-os icon-os-centos', 1);
@@ -538,6 +551,17 @@ VALUES ('CentOS-6.8', 'CentOS 6.8。', 'linux', 'centos', 6, 8, 'x86_64', 'CentO
 INSERT INTO os_template_profile (label, description, os_type, os_distro, os_major, os_minor, os_arch, os_product_name, active, icon, os_template_initialize_operate_set_id)
 VALUES ('Gentoo-2.2', 'Gentoo 2.2。', 'linux', 'gentoo', 2, 2, 'x86_64', 'Gentoo Base System release 2.2', 1, 'icon-os icon-os-gentoo', 3);
 INSERT INTO os_template_profile (label, description, os_type, os_distro, os_major, os_minor, os_arch, os_product_name, active, icon, os_template_initialize_operate_set_id)
-VALUES ('CoreOS-1855.4.0', 'CoreOS 1855.4.0。', 'linux', 'coreos', 1855, 4, 'x86_64', 'CoreOS Linux release 1855.4.0', 1, 'icon-os icon-os-centos', 4);
+VALUES ('CoreOS-1855.4.0', 'CoreOS 1855.4.0。', 'linux', 'coreos', 1855, 4, 'x86_64', 'CoreOS Linux release 1855.4.0', 1, 'icon-os icon-os-coreos', 4);
+-- https://docs.microsoft.com/en-us/windows/desktop/sysinfo/operating-system-version
+INSERT INTO os_template_profile (label, description, os_type, os_distro, os_major, os_minor, os_arch, os_product_name, active, icon, os_template_initialize_operate_set_id)
+VALUES ('Windows-2016-Standard', 'Windows 2016 Standard。', 'windows', 'windows', 10, 0, 'x86_64', 'Windows Server 2016 Standard', 1, 'icon-os icon-os-windows', 5);
 INSERT INTO os_template_profile (label, description, os_type, os_distro, os_major, os_minor, os_arch, os_product_name, active, icon, os_template_initialize_operate_set_id)
 VALUES ('Windows-2012-R2-Standard', 'Windows 2012 R2 Standard。', 'windows', 'windows', 6, 3, 'x86_64', 'Windows Server 2012 R2 Standard', 1, 'icon-os icon-os-windows', 5);
+INSERT INTO os_template_profile (label, description, os_type, os_distro, os_major, os_minor, os_arch, os_product_name, active, icon, os_template_initialize_operate_set_id)
+VALUES ('Windows-2008-R2-Enterprise', 'Windows 2008 R2 Enterprise。', 'windows', 'windows', 6, 1, 'x86_64', 'Windows Server 2008 R2 Enterprise', 1, 'icon-os icon-os-windows', 5);
+INSERT INTO os_template_profile (label, description, os_type, os_distro, os_major, os_minor, os_arch, os_product_name, active, icon, os_template_initialize_operate_set_id)
+VALUES ('Windows7-Ultimate-SP1', 'Windows7 Ultimate SP1 x64。', 'windows', 'windows', 6, 1, 'x86_64', 'Windows7 Ultimate SP1 x64', 1, 'icon-os icon-os-windows', 5);
+INSERT INTO os_template_profile (label, description, os_type, os_distro, os_major, os_minor, os_arch, os_product_name, active, icon, os_template_initialize_operate_set_id)
+VALUES ('Windows-2003-R2-Enterprise-SP2', 'Windows 2003 R2 Enterprise SP2 x64。', 'windows', 'windows', 5, 2, 'x86_64', 'Windows 2003 R2 Enterprise SP2', 1, 'icon-os icon-os-windows', 6);
+INSERT INTO os_template_profile (label, description, os_type, os_distro, os_major, os_minor, os_arch, os_product_name, active, icon, os_template_initialize_operate_set_id)
+VALUES ('WindowsXP-SP3', 'WindowsXP SP1 x64。', 'windows', 'windows', 5, 1, 'x86', 'Windows XP SP3', 1, 'icon-os icon-os-windows', 6);

+ 24 - 0
misc/v0.6_to_v0.7/update_for_windows.sql

@@ -0,0 +1,24 @@
+INSERT INTO os_template_initialize_operate_set (label, description, active) VALUES ('WindowsMode2', '用作 MS-Windows 系列的系统初始化。初始化操作依据 WindowsXP 来实现。', 1);
+
+-- For WindowsXP
+INSERT INTO os_template_initialize_operate (os_template_initialize_operate_set_id, kind, sequence, path, content, command) VALUES (6, 1, 0, '/WINDOWS/jimv_init.bat', 'netsh interface ip set address name="Ethernet" source=static {IP} {NETMASK} {GATEWAY} 1
+netsh interface ip set dns "Ethernet" static {DNS1} primary
+netsh interface ip add dns "Ethernet" {DNS2}
+wmic computersystem where name="%COMPUTERNAME%" call rename name="{HOSTNAME}"
+net user Administrator {PASSWORD}
+@ping 127.0.0.1 -n 3 > NUL
+sc delete JimVInit
+del C:\\WINDOWS\\jimv_init.bat
+shutdown -r -t 0
+@ping 127.0.0.1 -n 2 > NUL', '');
+
+INSERT INTO os_template_profile (label, description, os_type, os_distro, os_major, os_minor, os_arch, os_product_name, active, icon, os_template_initialize_operate_set_id)
+VALUES ('Windows-2016-Standard', 'Windows 2016 Standard。', 'windows', 'windows', 10, 0, 'x86_64', 'Windows Server 2016 Standard', 1, 'icon-os icon-os-windows', 5);
+INSERT INTO os_template_profile (label, description, os_type, os_distro, os_major, os_minor, os_arch, os_product_name, active, icon, os_template_initialize_operate_set_id)
+VALUES ('Windows-2008-R2-Enterprise', 'Windows 2008 R2 Enterprise。', 'windows', 'windows', 6, 1, 'x86_64', 'Windows Server 2008 R2 Enterprise', 1, 'icon-os icon-os-windows', 5);
+INSERT INTO os_template_profile (label, description, os_type, os_distro, os_major, os_minor, os_arch, os_product_name, active, icon, os_template_initialize_operate_set_id)
+VALUES ('Windows7-Ultimate-SP1', 'Windows7 Ultimate SP1 x64。', 'windows', 'windows', 6, 1, 'x86_64', 'Windows7 Ultimate SP1 x64', 1, 'icon-os icon-os-windows', 5);
+INSERT INTO os_template_profile (label, description, os_type, os_distro, os_major, os_minor, os_arch, os_product_name, active, icon, os_template_initialize_operate_set_id)
+VALUES ('Windows-2003-R2-Enterprise-SP2', 'Windows 2003 R2 Enterprise SP2 x64。', 'windows', 'windows', 5, 2, 'x86_64', 'Windows 2003 R2 Enterprise SP2', 1, 'icon-os icon-os-windows', 6);
+INSERT INTO os_template_profile (label, description, os_type, os_distro, os_major, os_minor, os_arch, os_product_name, active, icon, os_template_initialize_operate_set_id)
+VALUES ('WindowsXP-SP3', 'WindowsXP SP1 x64。', 'windows', 'windows', 5, 1, 'x86', 'Windows XP SP3', 1, 'icon-os icon-os-windows', 6);

+ 1 - 1
requirements.txt

@@ -2,7 +2,7 @@ Flask==1.0.2
 mysql-connector-python-rf==2.2.2
 enum34==1.1.6
 jimit==0.63
-requests==2.19.1
+requests==2.20.0
 PyJWT==1.6.4
 Flask-Session==0.3.1
 IPy==0.83